0){$template = mysql_real_escape_string($_GET['template']);} else {$template=2;} $query = "SELECT body_id, header FROM ck_templates WHERE id = '$template'"; $result = mysql_query($query, $conn) or die(mysql_error()); mysql_select_db($database,$conn); if (mysql_real_escape_string($_GET['page'])>0){$page = mysql_real_escape_string($_GET['page']);$limit = (($page*8)-8);} else {$page=1;$limit= 0;} if(strlen(mysql_real_escape_string($_GET['category']))>0){$category = mysql_real_escape_string($_GET['category']);} else {$category=4;} $archive_query ="SELECT ck_agendas.id, ck_agendas.orchestra, ck_agendas.conductor, ck_agendas.cd, ck_agendas.cd1, ck_agendas.cd2, ck_agendas.cd3, ck_agendas.date, ck_agendas.time, ck_agendas.location, ck_agendas.city, ck_agendas.country, ck_presentations.cd_name, ck_presentations.id, ck_agendas.synopsis, ck_agendas.month, ck_agendas.day, ck_agendas.year, CONCAT( ck_agendas.YEAR, '-', ck_agendas.MONTH, '-', ck_agendas.DAY ), ck_agendas.ON_OFF FROM `ck_agendas` INNER JOIN ck_presentations ON ck_presentations.id = ck_agendas.cd WHERE ON_OFF=1 AND NOW()> CONCAT( ck_agendas.YEAR, '-', ck_agendas.MONTH, '-', ck_agendas.DAY ) "; $resultB = mysql_query($archive_query) or die(mysql_error()); if (mysql_real_escape_string($_GET['show'])=="archive"){ $post_query = "SELECT ck_agendas.id, ck_agendas.orchestra, ck_agendas.conductor, ck_agendas.cd, ck_agendas.cd1, ck_agendas.cd2, ck_agendas.cd3, ck_agendas.date, ck_agendas.time, ck_agendas.location, ck_agendas.city, ck_agendas.country, ck_presentations.cd_name, ck_presentations.id, ck_agendas.synopsis, ck_agendas.month, ck_agendas.day, ck_agendas.year, CONCAT( ck_agendas.YEAR, '-', ck_agendas.MONTH, '-', ck_agendas.DAY ) , title, ck_agendas.ON_OFF FROM `ck_agendas` INNER JOIN ck_presentations ON ck_presentations.id = ck_agendas.cd WHERE ck_agendas.ON_OFF=1 AND NOW( ) >= CONCAT( ck_agendas.YEAR, '-', ck_agendas.MONTH, '-', ck_agendas.DAY) ORDER BY ck_agendas.YEAR, ck_agendas.MONTH, ck_agendas.DAY limit $limit,8"; }else{ $post_query = "SELECT ck_agendas.id, ck_agendas.orchestra, ck_agendas.conductor, ck_agendas.cd, ck_agendas.cd1, ck_agendas.cd2, ck_agendas.cd3, ck_agendas.date, ck_agendas.time, ck_agendas.location, ck_agendas.city, ck_agendas.country, ck_presentations.cd_name, ck_presentations.id, ck_agendas.synopsis, ck_agendas.month, ck_agendas.day, ck_agendas.year, CONCAT( ck_agendas.YEAR, '-', ck_agendas.MONTH, '-', ck_agendas.DAY ), title, ck_agendas.ON_OFF FROM `ck_agendas` INNER JOIN ck_presentations ON ck_presentations.id = ck_agendas.cd WHERE ck_agendas.ON_OFF=1 AND CONCAT( ck_agendas.YEAR, '-', ck_agendas.MONTH, '-', ck_agendas.DAY) >= NOW( ) ORDER BY ck_agendas.YEAR, ck_agendas.MONTH, ck_agendas.DAY limit $limit,8"; $my_query = "SELECT ck_agendas.id, ck_agendas.orchestra, ck_agendas.conductor, ck_agendas.cd, ck_agendas.cd1, ck_agendas.cd2, ck_agendas.cd3, ck_agendas.date, ck_agendas.time, ck_agendas.location, ck_agendas.city, ck_agendas.country, ck_presentations.cd_name, ck_presentations.id, ck_agendas.synopsis, ck_agendas.month, ck_agendas.day, ck_agendas.year, CONCAT( ck_agendas.YEAR, '-', ck_agendas.MONTH, '-', ck_agendas.DAY+1 ), title, ck_agendas.ON_OFF FROM `ck_agendas` INNER JOIN ck_presentations ON ck_presentations.id = ck_agendas.cd WHERE ck_agendas.ON_OFF=1 AND CONCAT( ck_agendas.YEAR, '-', ck_agendas.MONTH, '-', ck_agendas.DAY ) >= NOW( ) ORDER BY CONCAT( ck_agendas.YEAR, '-', ck_agendas.MONTH, '-', ck_agendas.DAY ) ASC"; $resultD = mysql_query($my_query) or die(mysql_error()); } $resultA = mysql_query($post_query) or die(mysql_error()); if (mysql_real_escape_string(mysql_real_escape_string($_GET['show']))=="archive"){$num_rows = mysql_num_rows($resultB); } else { $num_rows = mysql_num_rows($resultD);} $a = $num_rows /8; $b = round($num_rows /8); if ($a > $b) {$pages = $b;}else{$pages = $b - 1;} //echo"total = $num_rows
pages = $pages
a = $a
b = $b"; function myMonth($month){ if($month==1) {echo "January";} if($month==2) {echo "February";} if($month==3) {echo "March";} if($month==4){ echo "April";} if($month==5){ echo "May";} if($month==6) {echo "June";} if($month==7) {echo "July";} if($month==8) {echo "August";} if($month==9) {echo "September";} if($month==10) {echo "October";} if($month==11) {echo "November";} if($month==12) {echo "December";} } ?> AGENDA ARCHIVE";}else{echo"

AGENDA: ".date("Y")."

";} //echo"
"; //if ($pages > 0 ) { echo""; if (mysql_real_escape_string($_GET['show'])=="archive"){echo"
  | current agenda
";} else{ echo"
  | agenda archive
"; } echo"
"; //} while (list($id, $orchestra, $conductor, $cd, $cd1, $cd2, $cd3, $date, $time, $location, $city, $country, $cd_name, $cd_id, $synopsis,$month,$day,$year,$tempDate,$title) = mysql_fetch_row($resultA)) { if ( (strlen(mysql_real_escape_string(mysql_real_escape_string($_GET['show'])))<1)){ echo"
"; echo"
$orchestra - Conductor: $conductor
"; echo"
$title$cd_name
"; $query="select ck_agendas.cd1,ck_presentations.cd_name from ck_agendas INNER JOIN ck_presentations ON ck_presentations.id = ck_agendas.cd1 where ck_agendas.id=$id"; $results = mysql_query($query) or die(mysql_error()); while(list($cd_id,$cd_name)=mysql_fetch_row($results)) { echo"
$title$cd_name
"; } $query="select ck_agendas.cd2,ck_presentations.cd_name from ck_agendas INNER JOIN ck_presentations ON ck_presentations.id = ck_agendas.cd2 where ck_agendas.id=$id"; $results = mysql_query($query) or die(mysql_error()); while(list($cd_id,$cd_name)=mysql_fetch_row($results)) { echo"
$title$cd_name
"; } $query="select ck_agendas.cd3,ck_presentations.cd_name from ck_agendas INNER JOIN ck_presentations ON ck_presentations.id = ck_agendas.cd3 where ck_agendas.id=$id"; $results = mysql_query($query) or die(mysql_error()); while(list($cd_id,$cd_name)=mysql_fetch_row($results)) { echo"
$title$cd_name
"; } echo"".myMonth($month)." $day, $year - $time $location, $city $country"; echo"
$synopsis
"; echo"
"; } elseif (strlen(mysql_real_escape_string($_GET['show']))>0){ echo"
"; echo"
$orchestra - Conductor: $conductor
"; echo"
$title$cd_name
"; $query="select ck_agendas.cd1,ck_presentations.cd_name from ck_agendas INNER JOIN ck_presentations ON ck_presentations.id = ck_agendas.cd1 where ck_agendas.id=$id"; $results = mysql_query($query) or die(mysql_error()); while(list($cd_id,$cd_name)=mysql_fetch_row($results)) { echo"
$title$cd_name
"; } $query="select ck_agendas.cd2,ck_presentations.cd_name from ck_agendas INNER JOIN ck_presentations ON ck_presentations.id = ck_agendas.cd2 where ck_agendas.id=$id"; $results = mysql_query($query) or die(mysql_error()); while(list($cd_id,$cd_name)=mysql_fetch_row($results)) { echo"
$title$cd_name
"; } $query="select ck_agendas.cd3,ck_presentations.cd_name from ck_agendas INNER JOIN ck_presentations ON ck_presentations.id = ck_agendas.cd3 where ck_agendas.id=$id"; $results = mysql_query($query) or die(mysql_error()); while(list($cd_id,$cd_name)=mysql_fetch_row($results)) { echo"
$title$cd_name
"; } echo"".myMonth($month)." $day, $year - $time $location, $city $country"; echo"
$synopsis
"; echo"
"; } } //include("includes/sidebar-home.php"); echo"
"; if (mysql_real_escape_string($_GET['show'])=="archive"){ if (($page + 1)<$pages+2){ echo"
next >
"; } else { echo"
< current agenda
"; } }else{ if (($page + 1)<$pages+2){ echo"
next >
"; } else {echo"
agenda archive >
";} } //include("captcha.php"); ?>

Send us additional Amstel Music Performance information: