justinh Posted November 2, 2008 Share Posted November 2, 2008 <?php include("connect.php"); function GetReservation($processid){ $result = mysql_query("SELECT * FROM reservations WHERE id = $processid"); $num = mysql_num_rows($result); return $num; } function NavigateCalender($month, $year){ $cur = strtotime($year . '-' . $month . '-01'); if (isset($_GET['direction'])){ switch($_GET['direction']){ case "1": list($year,$month) = explode('-',date('Y-m',strtotime('-1 month',$cur))); break; case "2": list($year,$month) = explode('-',date('Y-m',strtotime('+1 month',$cur))); break; } } return(array($month,$year)); } $date = time(); $day = date('d',$date); $month = (isset($_GET['month']))?$_GET['month']:date('m',$date); $year = (isset($_GET['year']))?$_GET['year']:date('Y',$date); list($month,$year) = NavigateCalender($month,$year); $firstday = mktime(0,0,0, $month, 1, $year); $title = date('F', $firstday); $dayofweek = date('D', $firstday); switch($dayofweek){ 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; } switch($month){ case "01": $MonthDisplay = "January"; break; case "02": $MonthDisplay = "Febuary"; break; case "03": $MonthDisplay = "March"; break; case "04": $MonthDisplay = "April"; break; case "05": $MonthDisplay = "May"; break; case "06": $MonthDisplay = "June"; break; case "07": $MonthDisplay = "July"; break; case "08": $MonthDisplay = "August"; break; case "09": $MonthDisplay = "September"; break; case "10": $MonthDisplay = "October"; break; case "11": $MonthDisplay = "November"; break; case "12": $MonthDisplay = "December"; break; } $daysinmonth = date('t',strtotime($year . '-' . $month . '-01')); echo "<body bgcolor=black><p align=\"center\"><img src=\"logo.jpeg\"><br><table border=1 width=294>"; echo '<tr><th colspan=7><font color=white><a href="?direction=1&month=' . $month . '&year=' . $year . '">< </a>' . $MonthDisplay . ' - '. $year . '<a href="?direction=2&month=' . $month . '&year=' . $year . '"> ></a></th></tr>'; echo"<tr><td width=42><font color=white>S</td><td width=42><font color=white>M</td><td width=42><font color=white>T</td><td width=42><font color=white>W</td><td width=42><font color=white>T</td><td width=42><font color=white>F</td> <td width=42><font color=white>S</td></tr>"; $daycount = 1; echo "<tr>"; while ($blank > 0){ echo "<td></td>"; $blank = $blank-1; $daycount++; } $daynum = 1; while($daynum <= $daysinmonth){ $processid = $month.$daynum.$year; GetReservation($processid); if ($num >= 1){ if ($daynum == $day && $month == date('m',$date)){ echo "<td<font color=blue> $daynum </font></td>"; $daynum++; $daycount++; } else { echo "<td><td<font color=blue> <a href=\"process.php?id=$processid\">$daynum</a> </td>"; $daynum++; $daycount++; if($daycount > 7){ echo "</tr><tr>"; $daycount = 1; } } }else { if ($daynum == $day && $month == date('m',$date)){ echo "<td><font color=red><a href=\"process.php?id=$processid\"> $daynum</a> </font></td>"; $daynum++; $daycount++; } else { echo "<td><td>font color=red> <a href=\"process.php?id=$processid\">$daynum</a> </td>"; $daynum++; $daycount++; if($daycount > 7){ echo "</tr><tr>"; $daycount = 1; } } } while($daycount >= 1 && $daycount < 7){ echo "<td></td>"; $daycount++; } echo "</tr></table>"; ?> is returning this error: Parse error: syntax error, unexpected $end in /homepages/29/d119570661/htdocs/wmptest.com/HuntReserver/calender.php on line 182 there isn't even a line 182 in the code... O_o Link to comment https://forums.phpfreaks.com/topic/131056-wierd-error/ Share on other sites More sharing options...
ratcateme Posted November 2, 2008 Share Posted November 2, 2008 i think you are missing the closing } from this while while($daynum <= $daysinmonth){ Scott. Link to comment https://forums.phpfreaks.com/topic/131056-wierd-error/#findComment-680424 Share on other sites More sharing options...
Jeremysr Posted November 2, 2008 Share Posted November 2, 2008 You're probably missing a closing brace somewhere. You need to indent your code better to catch this kind of error. Link to comment https://forums.phpfreaks.com/topic/131056-wierd-error/#findComment-680425 Share on other sites More sharing options...
justinh Posted November 2, 2008 Author Share Posted November 2, 2008 Fixed it. Thanks guys. I'll work on indenting my code Jeremy Link to comment https://forums.phpfreaks.com/topic/131056-wierd-error/#findComment-680428 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.