File manager - Edit - /home/autoph/public_html/api/aha/load_meetingAttendees.php
Back
<?php include '../../../cfg/connhr.php'; $mykey = $_GET['keyID']; if($mykey =="6e59e008b5348b452b615a3033729daae383ATT"){ $userID = $_GET['userID']; $meetingID = $_GET['meetingID']; $CstartDate = date('Y-m-d'); //$dateTime = DateTime::createFromFormat('h:i A', $timeSlot); //$dateTimeX = DateTime::createFromFormat('H:i:s', $row['time_slot']); //$amTimepm = $dateTimeX->format('h:i A'); // SQL query $sql = "SELECT t1.*, t2.employee_id, t2.asa_user_id, t2.firstname,t2.lastname,t2.email,t2.mobile, t2.position FROM asa_meeting_attendees t1 LEFT JOIN employees AS t2 ON t1.asa_user_id = t2.asa_user_id WHERE t1.meeting_id ='$meetingID' ORDER BY t2.lastname ASC"; $result = $connhr->query($sql); if ($result->num_rows > 0) { // Array to hold the results $rows = array(); $count=0; $cssBG == "cssWhite"; while($row = $result->fetch_assoc()) { $count=$count + 1; if($cssBG == "cssWhite"){ $cssBG ="cssBlue"; }else{ $cssBG ="cssWhite"; } if($row['asa_user_id']===$userID && $row['status'] !=1){ $viewAccept ="visible"; $greenText='redCSS'; }else{ $viewAccept =""; $greenText='grayCSS'; } $timestamp = strtotime($row['start_datetime']); $sDate = date('Y-m-d', $timestamp); $sTime = date('h:i A', $timestamp); $endDatetime = strtotime($row['end_datetime']); $eDate = date('Y-m-d', $endDatetime); $eTime = date('h:i A', $endDatetime); $rows[] = ([$row,"noCount"=>"$count","viewAccept" =>"$viewAccept","textCSS" =>"$greenText"]); } } header('Content-Type: application/json'); echo json_encode([$rows,"count"=>"$count"]); } //###################################### //###UPDATE MEETING ATTENDEES //##################################### if($mykey =="U6e59e008b5348b452b615a3033729daae383UPDATE"){ $meetingID = $_GET['meetingID']; $recordID = $_GET['recordID']; $status=""; $sql = "UPDATE `asa_meeting_attendees` SET `status`='1',`date_confirmed`='$myTimeStamp' WHERE `id`='$recordID'"; if ($connhr->query($sql) === TRUE) { $status = "Meeting accepted"; }else{ $status= "Error: Try Again!"; } header('Content-Type: application/json'); echo json_encode(["status" => "$status"]); } $connhr->close(); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings