Leadership TeacherViewing Schedule for:
$sql_list = db_exec_sql("SELECT name, year, program, id from groups where id = $programid","webdb");
$count = mysql_num_rows($sql_list);
if($count){
while($list = mysql_fetch_object($sql_list)){
echo "
" . $list->name . " " . $list->year . ", " . $list->program . "";
}
}
?>
////////////////////////////////////////////////////
// [S] Agenda
////////////////////////////////////////////////////
// Bring in agenda items for current user login:
$agendas = db_exec_sql( "
SELECT schedules.*, sponsors1.company AS sponsor1, sponsors1.website AS url1, sponsors2.company AS sponsor2, sponsors2.website AS url2, sponsors3.company AS sponsor3, sponsors3.website as url3, sponsors4.company AS sponsor4, sponsors4.website as url4, sponsors5.company AS sponsor5, sponsors5.website as url5, sponsors6.company AS sponsor6, sponsors6.website as url6, sponsors7.company AS sponsor7, sponsors7.website as url7, sponsors8.company AS sponsor8, sponsors8.website as url8
FROM schedules
LEFT JOIN sponsors AS sponsors1 ON sponsors1.id = schedules.sponsor1
LEFT JOIN sponsors AS sponsors2 ON sponsors2.id = schedules.sponsor2
LEFT JOIN sponsors AS sponsors3 ON sponsors3.id = schedules.sponsor3
LEFT JOIN sponsors AS sponsors4 ON sponsors4.id = schedules.sponsor4
LEFT JOIN sponsors AS sponsors5 ON sponsors5.id = schedules.sponsor5
LEFT JOIN sponsors AS sponsors6 ON sponsors6.id = schedules.sponsor6
LEFT JOIN sponsors AS sponsors7 ON sponsors7.id = schedules.sponsor7
LEFT JOIN sponsors AS sponsors8 ON sponsors8.id = schedules.sponsor8
WHERE schedules.program = '$programid'
AND schedules.approval = '1'
","webdb");
// Process, if there are any
if(mysql_num_rows($agendas) > 0){
while($agenda = mysql_fetch_object($agendas)){
// Loop-a-rooni!
for($x = 1; $x <= 8; $x++){
#if($agenda->{"topic".$x}){
// Process Date:
if( ($agenda->{"datetime".$x."_start"} != "0000-00-00 00:00:00") && ($agenda->{"datetime".$x."_end"} != "0000-00-00 00:00:00") ){
// Break 'em up
$start = explode(" ",$agenda->{"datetime".$x."_start"});
$end = explode(" ",$agenda->{"datetime".$x."_end"});
// If Start/End Dates Are same (single date)
if($start[0] == $end[0]){
$date = dateformat($start[0], "F jS Y"); // Start date
if( ($start[1] == $end[1]) && (substr($start[1],-2) != "01") ){$time = " ".timeformat($start[1],0);} // If Start/End time are the same, show start time.
if(substr($start[1],-2) == "01"){$time = "";} // If No Start time, assume full-day event.
if($start[1] != $end[1]){$time = " ".timeformat($start[1],0)." - ".timeformat($end[1],0);} // If different, show range
if( (substr($start[1],-2) != "01") && (substr($end[1],-2) == "01") ){$time = " ".timeformat($start[1],0);} // If Start Time, no end time, show start time.
$datedisplay = "$date$time";
}
// If Start/End Dates Are Different (date range)
if($start[0] != $end[0]){
$startstr = dateformat($start[0], "F jS Y"); // Start Date
$endstr = dateformat($end[0], "F jS Y"); // End Date
if(substr($start[1],-2) != "01"){$starttime = " ".timeformat($start[1],0);} // If valid start time, add to string
if(substr($end[1],-2) != "01"){$endtime = " ".timeformat($end[1],0);} // If valid end time, add to string
if( ($starttime) && ($endtime) ){$dash = " - ";}
$datedisplay = "$startstr - $endstr $starttime$dash$endtime";
}
}
$content .= 'Session '.$x.': '.$datedisplay.' ';
if ($agenda->{"topic".$x}) {
$content .= $agenda->{"topic".$x}.' @ ';
}
if ($agenda->{"url".$x}) { $content .= ''.$agenda->{"sponsor".$x}.''; } else { $content .= $agenda->{"sponsor".$x}; }
$content .= '
';
}
unset($datedisplay, $start, $end);
#}
}
echo $content;
}
// Otherwise, shoot the error
else {
echo 'No current schedules found for this program. ';
}
////////////////////////////////////////////////////
// [E] Agenda
////////////////////////////////////////////////////
$sql_sponsors = db_exec_sql(" SELECT sponsors.company, sponsors.website
from sponsors
left join rel_sponsor_program on sponsors.id = rel_sponsor_program.sponsor_id
where rel_sponsor_program.program_id = $programid and sponsors.show_on_affiliate = 1
order by company","webdb");
$count = mysql_num_rows($sql_sponsors);
if($count){
echo "