[insert_php]
define(‘DONOTCACHEPAGE’, true);
function get_scoreboard_sql($year, $month) {
$sql = “SELECT name, SUM(points) as score, GROUP_CONCAT(points, ‘ ‘, IFNULL(shortdescription, ‘miscellaneous activity’) ORDER BY eventdate SEPARATOR ‘, ‘) as details” .
” FROM aylus_HonorPoints” .
” WHERE year(eventdate) = ” . $year . ” and month(eventdate) = ” . $month . ” and approved = 1″ .
” GROUP BY name” .
” ORDER BY SUM(points) DESC”;
return $sql;
}
$start = date(“Y-m-01”);
$stop = ‘2015-09-01’;
// Create connection
$conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
// Check connection
if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}
$is_current = true;
while ($start >= $stop)
{
$result = $conn->query(get_scoreboard_sql(date(‘Y’, strtotime($start)), date(‘m’, strtotime($start))));
if (!$is_current)
echo ‘
‘;
echo ‘
‘;
if ($is_current)
echo ‘
Current counting period: ‘ . date(‘F Y’, strtotime($start)) . ‘
‘;
else
echo ‘
Archive: ‘ . date(‘F Y’, strtotime($start)) . ‘
‘;
echo ‘
echo ‘
Name | Score | Details |
---|---|---|
‘ . $row[“name”] . ‘ | ‘ . $row[“score”] . ‘ | ‘ . $row[“details”] . ‘ |
‘;
echo ‘
‘;
$start = date(‘Y-m-01’, strtotime($start . ‘ – 1 MONTH’));
$is_current = false;
}
$conn->close();
[/insert_php]
Archive: July-August, 2015
Name | Score | Details |
---|---|---|
Eric Wu | 22 | 6 AMC videos, 1 music video, 1 website, 1 volunteering at Zoo, 1 robot activities, 1 Tianjin Blast donation activity, 1 T-shirt design, 1 flag design, 1 recruit members, 1 HonorPoints form, 1 ScoreBoard table, 2 video conversion/upload (60+ videos), 5 branch activities [end of aug] |
Christie Yu | 16 | 3 first meeting, 2 logo designs, 1 T-shirt design, 3 book donation, 1 honor pt form, 1 service form, 1 AYLF form, 1 edit all posts, 1 redesign single color Icon for AYLF, 2-coord honor pts [end of aug] |
Lauren Yang | 14 | 2 coordinate music, 2 music videos, 1 website, 1 T-shirt design, 2 branch activities, 1 flag design, 1 recruit members, 3 meet mayor, 1 music event extra [end of aug] |
Gan Liu | 10 | 3 robot seminars, 1 robot activities, 1 Tianjin Blast donation activity, 5 branch activities [end of aug] |
William John | 10 | 3 first meeting, 1 music video, 1 web site, 1 icon design, 3 Initiate “Clean the World Up” activities, 1 T-shirt design [end of aug] |
Jason Wu | 9 | 1 robot activities, 1 Tianjin Blast donation activity, 1 music video, 1 T-shirt design, 5 branch activities [end of aug] |
Karen Yang | 5 | 3 art, 2 branch activities [end of aug] |
Shangtao Wu | 6 | 3 initiate t-shirt & flag, 1 T-shirt design, 1 flag design, 1 branch activity [end of aug] |
Hill Yin | 6 | 6 AMC videos [end of aug] |
Meena He | 4 | 4 music videos [end of aug] |
Julia He | 4 | 2 science videos, 2 music videos [end of aug] |
David Lin | 8 | 1 T-shirt design, 1 robot activities, 1 Tianjin Blast donation activity, 5 branch activities [end of aug] |
Aric Zhuang | 3 | 3 first meeting [end of aug] |
Cindy Wang | 3 | 3 music videos [end of aug] |
Emily Wang | 6 | 2 coordinate art, 1 T-shirt design, 3 medium report [end of aug] |
Sophie Wen | 5 | 1 website, 1 T-shirt design, 1 music video, 2 coord t-shirt [end of aug] |
George Cao | 2 | 2 engineering videos [end of aug] |
Tiffany Chang | 2 | 2 music videos [end of aug] |
Jarrad Li | 2 | 2 music videos [end of aug] |
Kevin Xu | 2 | 2 music videos [end of aug] |
Claire Wen | 2 | 2 music videos [end of aug] |
April Cheng | 2 | 2 music videos [end of aug] |
Elaine Cheng | 2 | 2 music videos [end of aug] |
Linda Fan | 2 | 2 music videos [end of aug] |
Ethan Shen | 2 | 2 music videos [end of aug] |
Amy Zhong | 2 | 2 music videos [end of aug] |
Stephanie Than | 1 | 1 origami video [end of aug] |
Jackie Du | 1 | 1 music video [end of aug] |
Jesse Fei | 1 | 1 music video [end of aug] |
Cissy Xiao | 1 | 1 music video [end of aug] |
Elizabeth John | 2 | 1 music video, 1 T-shirt design [end of aug] |
Ethan Zhou | 1 | 1 music video [end of aug] |
Lauren Wang | 1 | 1 music video [end of aug] |
Daiyao Zhang | 1 | 1 music video [end of aug] |
Richard Xie | 1 | 1 music video[end of aug] |
Taoli Zhen | 1 | 1 music video[end of aug] |
Grant Zhou | 1 | 1 music video[end of aug] |
Bryant Li | 1 | 1 music video[end of aug] |
Lori Zhou | 1 | 1 music video[end of aug] |
Michelle Zhang | 1 | 1 music video[end of aug] |
Eric Peng | 1 | 1 music video[end of aug] |
Daniel Meng | 1 | 1 music video[end of aug] |
Nicole Chen | 1 | 1 music video[end of aug] |
Ian James Lin | 1 | 1 music video[end of aug] |
Zizhou Wang | 1 | 1 music video[end of aug] |
Jerry Xu | 1 | 1 music video[end of aug] |
Timothy So | 1 | 1 music video[end of aug] |
Jonathan Chang | 1 | 1 music video[end of aug] |
Robert Guan | 1 | 1 music video[end of aug] |
Jun Hin Loi | 1 | 1 music video[end of aug] |
Yongxin Shi | 1 | 1 music video[end of aug] |
Henric Zhang | 1 | 1 music video[end of aug] |
Emily Wang | 1 | 1 music video[end of aug] |
Jennifer Zhu | 1 | 1 music video[end of aug] |
Serena Liu | 1 | 1 music video[end of aug] |
Andrew Zheng | 1 | 1 music video[end of aug] |
Andrew Liu | 1 | 1 music video[end of aug] |
Neal Pang | 1 | 1 branch activity[end of aug] |
Shivani Guha | 1 | 1 branch activity[end of aug] |
Pilar Ibarra | 1 | 1 music video[end of aug] |
Jay Mehta | 1 | 1 music video[end of aug] |
Kevin Joseph | 1 | 1 music video[end of aug] |
Jane Zhao | 1 | 1 music video[end of aug] |
Shining Sun | 1 | 1 music video[end of aug] |
Albert Hsiao | 1 | 1 flag design[end of aug] |