include 'config.php';
include 'connect_db.php';
include 'default.inc';
echo "
\n";
echo " |
";
echo "
";
// NS
$ns[0]['name']='Home';
$ns[0]['url']=$server_path.'/index.php';
$ns[1]['name']='DB Seminars';
$ns[1]['url']=$server_path.'/seminars.php';
ns($ns,$server_path);
// Schedule in form of calendar
title_line("Schedule","schedule",$server_path,"left");
//================================================== START OF CALENDAR ============================================
//This gets today's date
if ($date=='')
$date =time () ;
//This puts the day, month, and year in seperate variables
$day = date('d', $date) ;
if ($month=='')
$month = date('n') ;
if ($year=='')
$year = date('Y') ;
// Select events
$query = "select a.seminar_type, a.color, a.b_year, a.b_month, a.b_day, a.seminar_id seminar_id, b.people_id people_id, c.name name, a.title title from `db_seminar` a, `db_seminar_asoc_people` b, `people` c where a.b_year=".$year." and a.b_month=".$month." and a.seminar_id=b.seminar_id and b.people_id=c.people_id order by a.b_year desc, a.b_month desc, a.b_day desc ";
$color_flag=0;
$result = mysql_query($query,$db_link)
or die("Query failed : Failed to select the seminar list from database");
while ($line=mysql_fetch_array($result, MYSQL_ASSOC)){
$event[$line["b_year"]][$line["b_month"]][$line["b_day"]].="";
if ($line['seminar_type']=='Students')
$event[$line["b_year"]][$line["b_month"]][$line["b_day"]].="DB Seminar ";
else if ($line['seminar_type']=='Probation Talk')
$event[$line["b_year"]][$line["b_month"]][$line["b_day"]].="Probation Talk ";
else
$event[$line["b_year"]][$line["b_month"]][$line["b_day"]].="".$line['seminar_type']." ";
$event[$line["b_year"]][$line["b_month"]][$line["b_day"]].=$line["name"]."
|
";
// $db_seminars[count($db_seminars)]=$line;
}
mysql_free_result($result);
// Select Conference
$query = "select * from `conferences` ";
$color_flag=0;
$result = mysql_query($query,$db_link)
or die("Query failed : Failed to select the conference list from database");
while ($line=mysql_fetch_array($result, MYSQL_ASSOC)){
$event[$line["a_year"]][$line["a_month"]][$line["a_day"]].="".$line['name_short']." Abstract deadline ";
if ($line['url']!='')
$event[$line["a_year"]][$line["a_month"]][$line["a_day"]].="";
$event[$line["a_year"]][$line["a_month"]][$line["a_day"]].=" |
";
$event[$line["f_year"]][$line["f_month"]][$line["f_day"]].="".$line['name_short']." Paper submission deadline ";
if ($line['url']!='')
$event[$line["f_year"]][$line["f_month"]][$line["f_day"]].="";
$event[$line["f_year"]][$line["f_month"]][$line["f_day"]].=" |
";
// $db_seminars[count($db_seminars)]=$line;
}
mysql_free_result($result);
//Here we generate the first day of the month
$first_day = mktime(0,0,0,$month, 1, $year) ;
//This gets us the month name
$title = date('F', $first_day) ;
//Here we find out what day of the week the first day of the month falls on
$day_of_week = date('D', $first_day) ;
//Once we know what day of the week it falls on, we know how many blank days occure before it. If the first day of the week is a Sunday then it would be zero
switch($day_of_week){
case "Sun": $blank = 0; break;
case "Mon": $blank = 1; break;
case "Tue": $blank = 2; break;
case "Wed": $blank = 3; break;
case "Thu": $blank = 4; break;
case "Fri": $blank = 5; break;
case "Sat": $blank = 6; break;
}
//We then determine how many days are in the current month
$days_in_month = cal_days_in_month(0, $month, $year) ;
//Here we start building the table heads
echo "";
echo "";
echo "";
echo "";
//Left button
if ($month>1)
echo " ";
else
echo " ";
echo " | ".$title." | ";
//Right button
if ($month<12)
echo " ";
else
echo " ";
echo " | | ";
echo " ";
echo "".$year."";
echo " ";
echo " | ";
echo " |
";
echo "Sunday | Monday | Tuesday | Wednesday | Thrusday | Friday | Saturday |
";
//This counts the days in the week, up to 7
$day_count = 1;
echo "";
//first we take care of those blank days
while ( $blank > 0 )
{
echo " | ";
$blank = $blank-1;
$day_count++;
}
//sets the first day of the month to 1
$day_num = 1;
//count up the days, untill we've done all of them in the month
while ( $day_num <= $days_in_month )
{
echo "";
// ========================================================Do things here ==========================================
if ($year==date("Y") && $month==date("n") && $day_num==date("j"))
echo "";
echo "";
echo "$day_num | ";
if ($event[$year][$month][$day_num]!='')
echo $event[$year][$month][$day_num];
echo " ";
if ($year==date("Y") && $month==date("n") && $day_num==date("j"))
echo " | ";
echo " | ";
$day_num++;
$day_count++;
//Make sure we start a new row every week
if ($day_count > 7)
{
echo "
";
$day_count = 1;
}
}
//Finaly we finish out the table with some blank details if needed
while ( $day_count >1 && $day_count <=7 )
{
echo " | ";
$day_count++;
}
echo "
";
//================================================== END OF CALENDAR ============================================
echo "\n";include 'connect_db.php';
$color_flag=0;
for ($i=0; $i";
$color_flag=0;
}else if ($color_flag==0){
echo "";
$color_flag=1;
}
echo "".($i+1)." | ";
echo "".$_TUTORIAL[$i]['topic']." | ";
echo "".$_TUTORIAL[$i]['date']." | ";
echo "".$_TUTORIAL[$i]['venue']." | ";
if ($_TUTORIAL[$i]['material']!='')
echo "Download | ";
else
echo "/ | ";
echo "".$_TUTORIAL[$i]['remarks']." | ";
}
echo "
";
// List of DB Seminars
title_line("List of Past DB Seminars","list of db seminars",$server_path,"left");
echo "\n";include 'connect_db.php';
echo "Date | Title | Speaker | Download | Details |
";
$color_flag=0;
$query = "select a.private,a.file, c.name_short, a.color, a.b_year, a.b_month, a.b_day, a.seminar_id seminar_id, b.people_id people_id, c.name name, a.title title from `db_seminar` a, `db_seminar_asoc_people` b, `people` c where !((a.b_year=".date('Y')." and a.b_month>=".(date('n')+1).") or (a.b_year=".date('Y')." and a.b_month=".date('n')." and a.b_day>=".date('d').") or a.b_year>=".(date('Y')+1).") and a.seminar_id=b.seminar_id and b.people_id=c.people_id order by a.b_year desc, a.b_month desc, a.b_day desc ";
$color_flag=0;
$result = mysql_query($query,$db_link)
or die("Query failed : Failed to select the seminar list from database");
while ($line=mysql_fetch_array($result, MYSQL_ASSOC)){
if ($color_flag==1){
echo "";
$color_flag=0;
}else if ($color_flag==0){
echo "
";
$color_flag=1;
}
echo "".$line['b_day']."-".$line['b_month']."-".$line['b_year']." ".$line['time']." | ";
echo "".$line['title']." | ";
echo "".$line['name'];
if ($line['name_short']!='')
echo " (".$line['name_short'].")";
echo " | ";
echo "";
if ($line['private']=='N'){ //Public
if ($line['file']!='')
echo "";
else
echo "TBA";
}else
echo "TBA";
echo " | ";
echo " | ";
echo "
";
}
mysql_free_result($result);
echo "
";
echo "\n";
echo " Please click here for a complete list of past DB Seminars. |
";
echo "
";
include 'default_close.inc';
?>