Example #1
0
 if ($_POST['eventActive'] == 'on') {
     $eventActive = 1;
 } else {
     $eventActive = 0;
 }
 if (strlen(trim($photoName)) < 1) {
     $photoNameErrorText = "Bad name value";
     $photoNameErrorStyle = "background-color:#F99;";
     $error = true;
 }
 if (strlen(trim($photoDescription)) < 1) {
     $photoDescriptionErrorText = "Bad description value";
     $photoDescriptionErrorStyle = "background-color:#F99;";
     $error = true;
 }
 if (!GlobalActions::check_date($photoDate)) {
     $photoDateErrorText = "Bad date value";
     $photoDateErrorStyle = "background-color:#F99;";
     $error = true;
 }
 if (!is_numeric($userIDD)) {
     $userIDErrorText = "Invalid UserID";
     $userIDErrorStyle = "background-color:#F99;";
     $error = true;
 }
 if (!is_numeric($eventID)) {
     $eventIDErrorText = "Invalid Event ID";
     $eventIDErrorStyle = "background-color:#F99;";
     $error = true;
 }
 if (!is_numeric($classID)) {
Example #2
0
 if (!ereg($pattern, $eventTime)) {
     $error = true;
     $eventTimeErrorText = "Invalid 24 hour time (hh:mm)";
     $eventTimeErrorStyle = "background-color:#F99;";
 }
 if (strlen(trim($eventDescription)) < 1) {
     $eventDescriptionErrorText = "Bad name value";
     $eventDescriptionErrorStyle = "background-color:#F99;";
     $error = true;
 }
 if (strlen($eventColour) != 3 && strlen($eventColour) != 6) {
     $eventColourErrorText = "Must be 3 or 6 letters";
     $eventColourErrorStyle = "background-color:#F99;";
     $error = true;
 }
 if (!GlobalActions::check_date($eventDate)) {
     $eventDateErrorText = "Bad date value(yyyy-mm-dd)";
     $eventDateErrorStyle = "background-color:#F99;";
     $error = true;
 }
 if (!$error) {
     $result = DBAccess::createEvent($eType, $eventName, $eventDescription, $eventDate, $eventTime, $eventColour, $eventActive);
     $value = $result[0]['Error'];
     if ($value > 0) {
         header("Location: ./manageEvent.php");
     } else {
         $feedBack = "An error occured" . $value;
     }
 } else {
     $feedBack = "Invalid input detected ";
 }
Example #3
0
 function beforeRender()
 {
     parent::beforeRender();
 }