exit; $status = "NOTOK"; } if (checkDateFormat($End_Date) == False || $End_Date == 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 end 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($Start_Time) == False || $Start_Time == 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 start time in the correct format!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit; $status = "NOTOK"; } if (checkTimeFormat($End_Time) == False || $End_Time == 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 end time in the correct format!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit; $status = "NOTOK"; } if ($Venue == 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 venue!!!\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-Event.php">'; echo "<center><font face='Verdana' size='3' color=red>\n Please enter the category of the event!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit;
{ 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; $status = "NOTOK"; } if ($Venue == 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 venue!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit; $status = "NOTOK"; } if ($Agenda == 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 agenda in point form!!!\n <br> <br> <br>\n Wait!!! You will be redirected in 3 seconds ...</font></center>"; exit;
if (count($argv) < 5) { echo "Erreur:\tArguments manquants\n" . "Usage:\tAjoutSimpleCalendrier.php client nom début fin\n" . "\tclient\t\tIdentifiant client voir ListeIdentifiantCapteur.php\n" . "\tnom\t\tNom du calendrier\n" . "\tdébut\tHoraire de départ au format HHMM\n" . "\tfin\tHoraire de fin au format HHMM\n"; exit(1); } include_once "BluePHP/BluePortail/BluePortailLang.inc"; $bpl = new BluePortailLang(array()); $clientId = $argv[1]; $nom = $argv[2]; $debut = $argv[3]; $fin = $argv[4]; $clientIdInfo = $bpl->getClientData(array("clientId" => $clientId)); if (!count($clientIdInfo)) { throw new Exception("Client {$clientId} non trouvé"); } $bpl->setClientId($clientId); if (!checkTimeFormat($debut)) { throw new Exception("Le format de l'horaire de début est incorrect"); } if (!checkTimeFormat($fin)) { throw new Exception("Le format de l'horaire de fin est incorrect"); } if (strtotime($debut) >= strtotime($fin)) { throw new Exception("L'heure de début doit être inférieure à l'heure de fin"); } include_once "BluePHP/BTopLocalServer/Calendar.inc"; $cal = new Calendar(); $calData = $cal->createCalendar(array("name" => $nom)); $cal->newEntry(array("cal" => $calData["id"], "pri" => 0, "testts" => "%H%M", "ts" => "2007-01-01 " . substr($debut, 0, 2) . ":" . substr($debut, 2, 2) . ":00", "testte" => "%H%M", "te" => "2007-01-01 " . substr($fin, 0, 2) . ":" . substr($fin, 2, 2) . ":00", "isOpen" => 1)); } catch (Exception $e) { echo "Exception reçue : " . $e->getMessage() . "\n"; }