{ if (preg_match("/^([0-9]{4})-([0-9]{2})-([0-9]{2})\$/", $eventdate, $parts)) { if (checkdate($parts[2], $parts[3], $parts[1])) { return true; } else { return false; } } else { return false; } } function checkTimeFormat($eventtime) { return preg_match('/(^([0-9]|[0-1][0-9]|[2][0-3]):([0-5][0-9])(\\s{0,1})([AM|PM|am|pm]{2,2})$)|(^([0-9]|[1][0-9]|[2][0-3])(\\s{0,1})([AM|PM|am|pm]{2,2})$)/xms', $eventtime, $match) ? sprintf('%02d:%d%s', $match[1], $match[2], strtoupper($match[3])) : false; } $meeting_id = ID_Incremenet(); $Date = $_POST['Date']; $Time = $_POST['Time']; $Venue = $_POST['Venue']; $Agenda = $_POST['Agenda']; $status = "OK"; if (checkDateFormat($Date) == False || $Date == NULL) { echo '<meta HTTP-EQUIV="REFRESH" content="3; url=Create-Meeting.php">'; echo "<center><font face='Verdana' size='3' color=red>\n Please enter the meeting date in the correct format!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit; $status = "NOTOK"; } if (checkTimeFormat($Time) == False || $Time == NULL) { echo '<meta HTTP-EQUIV="REFRESH" content="3; url=Create-Meeting.php">'; echo "<center><font face='Verdana' size='3' color=red>\n Please enter the meeting time in the correct format!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit;
$con = mysql_connect("{$host}", "{$username}", "{$password}") or die("Cannot connect"); mysql_select_db("{$db_name}") or die("Cannot select DB"); if (!isset($_SESSION['session'])) { echo '<meta HTTP-EQUIV="REFRESH" content="3; url=Main.php">'; echo "<center><font face='Verdana' size='3' color=red>\n Sorry, Please login first!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; die; } $userid = $_SESSION['myusername']; function ID_Incremenet() { $Result = mysql_query("SELECT MAX(SAPS_ID) FROM SAPS"); $Row = mysql_fetch_row($Result); $id = $Row[0] + 1; return $id; } $SAPS_Point_id = ID_Incremenet(); $Student_Name = $_POST['Student_Name']; $Student_ID = $_POST['Student_ID']; $Points = $_POST['Points']; $status = "OK"; $result = mysql_query("SELECT * FROM User WHERE User_ID = '{$Student_ID}'"); $row = mysql_fetch_array($result); $Full_Name = $row['User_First_Name'] . " " . $row['User_Last_Name']; $user_type = $row['User_Type']; $society_id = $row['User_Society_ID']; if ($Student_Name != $Full_Name || $Student_Name == NULL) { echo '<meta HTTP-EQUIV="REFRESH" content="3; url=Add-SAPS-Point.php">'; echo "<center><font face='Verdana' size='3' color=red>\n The Student Name you've entered is not found in the database!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit; $status = "NOTOK"; }
// Connect to server and select databse. $con = mysql_connect("{$host}", "{$username}", "{$password}") or die("Cannot connect"); mysql_select_db("{$db_name}") or die("Cannot select DB"); if (!isset($_SESSION['session'])) { echo '<meta HTTP-EQUIV="REFRESH" content="3; url=Main.php">'; echo "<center><font face='Verdana' size='3' color=red>\n Sorry, Please login first!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; die; } function ID_Incremenet() { $Result = mysql_query("SELECT MAX(Society_ID) FROM Society"); $Row = mysql_fetch_row($Result); $id = $Row[0] + 1; return $id; } $society_id = ID_Incremenet(); $Name = $_POST['Name']; $Category = $_POST['Category']; $Address = $_POST['Address']; $status = "OK"; if ($Name == NULL) { echo '<meta HTTP-EQUIV="REFRESH" content="3; url=Add-Society.php">'; echo "<center><font face='Verdana' size='3' color=red>\n Please enter the society name!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit; $status = "NOTOK"; } if ($Category == NULL) { echo '<meta HTTP-EQUIV="REFRESH" content="3; url=Add-Society.php">'; echo "<center><font face='Verdana' size='3' color=red>\n Please enter the category of the society!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit; $status = "NOTOK";
{ if (preg_match("/^([0-9]{4})-([0-9]{2})-([0-9]{2})\$/", $date, $parts)) { if (checkdate($parts[2], $parts[3], $parts[1])) { return true; } else { return false; } } else { return false; } } function checkTimeFormat($time) { return preg_match('/(^([0-9]|[0-1][0-9]|[2][0-3]):([0-5][0-9])(\\s{0,1})([AM|PM|am|pm]{2,2})$)|(^([0-9]|[1][0-9]|[2][0-3])(\\s{0,1})([AM|PM|am|pm]{2,2})$)/xms', $time, $match) ? sprintf('%02d:%d%s', $match[1], $match[2], strtoupper($match[3])) : false; } $event_id = ID_Incremenet(); $Name = $_POST['Name']; $Start_Date = $_POST['Start_Date']; $End_Date = $_POST['End_Date']; $Start_Time = $_POST['Start_Time']; $End_Time = $_POST['End_Time']; $Venue = $_POST['Venue']; $Category = $_POST['Category']; $Budget_Required = $_POST['Budget_Required']; $status = "OK"; if ($Name == NULL) { echo '<meta HTTP-EQUIV="REFRESH" content="3; url=Add-Event.php">'; echo "<center><font face='Verdana' size='3' color=red>\n Please enter the event name!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit; $status = "NOTOK"; }