//$employeeType = $_SESSION['employee_type']; $employeeType = 'cem'; $user_id = 6; $SR_id = intval($route['2']); if ($route[2] == 'picked' || $route[2] == 'match' || $route[2] == 'meeting' || $route[2] == 'demo' || $route[2] == 'done' || $route[2] == 'open' || $route[2] == '24hours') { $status = $route['2']; serviceRequestView($status, $user_id, $db_handle); } elseif (is_int($SR_id)) { if ($route['3'] == 'pick') { pickServiceRequest($SR_id, $user_id, $db_handle); } elseif ($route['3'] == 'add_note') { addNote($input, $SR_id, $user_id, $db_handle, $employeeType); } elseif ($route['3'] == 'change_status') { changeStatus($input, $SR_id, $user_id, $db_handle); } elseif ($route['3'] == 'add_meeting') { addMeeting($input, $SR_id, $user_id, $db_handle); } elseif ($route['3'] == 'add_worker') { $workerFName = $input->root->first_name; $workerAge = $input->root->age; $workerPhone = $input->root->phone; $sql = "SELECT id, first_name, last_name, phone FROM bluenethack_v0.workers WHERE age='{$workerAge}' AND phone = '{$workerPhone}' AND first_name = '{$workerFName}' ;"; $worker = mysqli_query($db_handle, $sql); $workerRow = mysqli_fetch_array($worker); if (mysqli_num_rows($workerRow) == 0) { //echo getcwd(); die(); include_once "/var/www/html/api_bluenet/apis/inc_workers/add_worker_function.php"; $new_worker_id = addNewWorker($input, $user_id, $db_handle); if ($route['4'] == '1') { $sql = "UPDATE bluenethack_v0.service_request SET match_id = '{$new_worker_id}', last_updated = CURRENT_TIMESTAMP WHERE id='{$SR_id}';"; $updateRequest = mysqli_query($db_handle, $sql); } elseif ($route['4'] == '2') {
break; case 'addMeeting': //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// $formData['Date_Day'] = db_clean_int($_POST['Date_Day']); $formData['Date_Month'] = db_clean_int($_POST['Date_Month']); $formData['Date_Year'] = db_clean_int($_POST['Date_Year']); $formData['meeting_type'] = db_clean_int($_POST['meeting_type']); $formData['semester'] = db_clean_int($_POST['semester']); $formData['description'] = db_clean_text($_POST['description']); //Verify form if (!secureform_test($verify_key, $verify_action)) { $smarty->assign("url", "./index.php?page=addMeeting&semester=" . $formData['semester']); $smarty->display('redirectError.tpl'); exit; } addMeeting($formData['Date_Day'], $formData['Date_Month'], $formData['Date_Year'], $formData['meeting_type'], $formData['semester'], $formData['description']); $smarty->assign("url", "./index.php?page=listMeetings&semester=" . $formData['semester']); $smarty->display('redirect.tpl'); break; case 'updateMeeting': //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// $formData['id'] = db_clean_int($_POST['id']); $formData['Date_Day'] = db_clean_int($_POST['Date_Day']); $formData['Date_Month'] = db_clean_int($_POST['Date_Month']); $formData['Date_Year'] = db_clean_int($_POST['Date_Year']); $formData['meeting_type'] = db_clean_int($_POST['meeting_type']); $formData['semester'] = db_clean_int($_POST['semester']); $formData['description'] = db_clean_text($_POST['description']); //Verify form if (!secureform_test_pk($verify_key, $verify_action, $formData['id'])) { $smarty->assign("url", "./index.php?page=updateMeeting&meeting=" . $formData['id']);
<?php global $errMsg; $description = $name = ""; $users = array(); $startDay = $startHour = $endHour = ""; $sectionLength = 0; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_POST["createMeeting"])) { $name = $_POST["meetingName"]; $description = $_POST["newDescription"]; $users = $_POST["newPersonId"]; $startDay = $_POST["startDate"]; $startHour = $_POST["startHour"]; $endHour = $_POST["endHour"]; $sectionLength = $_POST["sectionLength"]; addMeeting($name, $startDay, $startHour, $endHour, $sectionLength, $description); foreach ($users as $user) { addUserToMeeting($user, $name); } echo "<script> alertify.alert(\"New meeting was added.\")</script>"; } } ?> <div id="layout"> <a href="#menu" id="menuLink" class="menu-link"> <!-- Hamburger icon --> <span></span> </a> <?php generateMenu();