session_start(); if (!session_is_registered("LLC")) { // if session check fails, invoke error handler header("Location: /error.php?e=1"); exit(); } else { $user = $_SESSION['UNAME']; include("../includes/dbconfig.php"); $connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!"); $query = "SELECT FirstName, LastName, Extension from userlist WHERE username = '$user'"; mysql_select_db($db_name); $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); if (mysql_num_rows($result) == 1) { $row = mysql_fetch_row($result); $fullname = $row[0].' '.$row[1]; $ext = $row[2]; } // user/pass combination is wrong else { return 0; } } $thisyear = date("Y"); $lastyear = $thisyear - 1; $nextyear = $thisyear + 1; $thismonth = date("m"); $thismonth = $thismonth + 0; for ($i=1;$i<=12;$i++) { $m1[$i]=''; $m2[$i]=''; } $m1[$thismonth]=" selected"; $today = date("d"); $today = $today + 0; for ($i=1;$i<=31;$i++) { $d1[$i]=''; $d2[$i]=''; } $d1[$today]=" selected"; if (date("Y",time()+7*24*3600) == $thisyear) { $y2[0] = " selected"; $y2[1] = ""; } else { $y2[0] = " selected"; $y2[1] = ""; } $cmonth = date("m",time()+7*24*3600)+0; $cday = date("d",time()+7*24*3600)+0; $m2[$cmonth]=" selected"; $d2[$cday]=" selected"; $location = isset($_GET['lo']) ? $_GET['lo'] : "LLC264"; $station = isset($_GET['st']) ? $_GET['st'] : ""; ?>