'; $eday=$HTTP_POST_VARS["eday"]; $emonth=$HTTP_POST_VARS["emonth"]; $year=$HTTP_POST_VARS["year"]; $bday=$HTTP_POST_VARS["bday"]; $bmonth=$HTTP_POST_VARS["bmonth"]; //Väliaikainen bugikorjaus kesäajan vuoksi. Toimii lokakuun - joulukuu //-välillä. if ($bmonth == "Oct" && $bday <= 31 && ($eday > 29 || $emonth != "Oct")) { $eday =29; $emonth = "Oct"; echo "Your query has been cut. There is a bug with daylight saving time and you must not include 31.10.2004 to your query. Make another query without the day 31.10."; } $btime=$bday." ".$bmonth." ".$year." 00:01:00"; $etime=$eday." ".$emonth." ".$year." 00:01:00"; /*Making dynamic query*/ $dynamic_query="select workNumber,access_key,assistant,reserved from works where (workNumber=-1"; $number=0; /*The file contains authentication information*/ require "/home/www/data/labReservation.conf"; $work_link=mysql_connect($host,$user,$passwd) or die ("COULDN't Connect"); $query="SELECT workNumber FROM workTopics"; $result=mysql_db_query("labReservation",$query,$work_link) or die (mysql_error()); //echo mysql_error(); while($row=mysql_fetch_array($result)){ $number=$row[0]; if($HTTP_POST_VARS["Valinta".$number]==yes){ /*A portion is concatenated to the query if selected*/ $dynamic_query=$dynamic_query." or workNumber=$number"; } } $unix_btime=strtotime($btime); $unix_etime=strtotime($etime); //mysql_select_db("labReservation",$work_link) or die ("Couldn't select!"); $time=$unix_btime+8*3600; //echo "$time
"; //echo "$unix_btime
"; $number=makeTimeRow($unix_btime,$unix_etime); for($i=8;$i<21;$i++) makeRow($i,$unix_btime,$number,$HTTP_POST_VARS["admin_key"],$dynamic_query,$HTTP_SERVER_VARS["REQUEST_URI"],$HTTP_HOST,$work_link); echo ""; while($time<$etime) makeColumn($time); $result=mysql_query($query); /*while($row=mysql_fetch_array($result)) echo "$row[1]$row[0]";*/ mysql_close($work_link); ?>