header("Location: " . $_SERVER['SCRIPT_NAME']); } //inserts attendance record $query = "\n\t\tINSERT INTO attendance (\n\t\t\temail,\n\t\t\tdate\n\t\t) VALUES (\n\t\t\t'{$email}',\n\t\t\t'{$date}'\n\t\t);"; try { $stmt = $db->prepare($query); $stmt->execute(); $_SESSION['checkedIn'] = $date; header("Location: " . $_SERVER['SCRIPT_NAME']); } catch (PDOException $ex) { die("Failed to run query: " . $ex->getMessage()); header("Location: " . $_SERVER['SCRIPT_NAME']); } } } checkIn(); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="description" content="UCC Robotics"> <title><?php echo $row_info['first_name']; ?> 's Homepage | UCC Robotics</title> <link rel="icon" href="css/favicon.ico" /> <?php include_once "functions/stylesheet.php"; ?>
<?php if (isset($_POST["form_submit"]) && $_POST["form_submit"] == "true" && $_POST["form_submit"] != "") { $userid = trim($_POST['userid']); $data['attd_in_time'] = trim($_POST['attd_in_time']); $data['attd_date'] = trim($_POST['attd_date']); $data['attd_comment'] = trim($_POST['attd_comment']); if (checkInCheck($userid, $data, $db)) { // check whether checked in or not $rfc = "<script>alert('You already checked in for today, thank you.')</script>"; } else { if (checkIn($userid, $data, $db)) { // checking in $rfc = "<script>alert('Successfully checked in, thank you.')</script>"; } else { $rfc = "<script>alert('Sorry for inconvenience, try again.')</script>"; } } } if (isset($_POST["form_submit_out"]) && $_POST["form_submit_out"] == "true" && $_POST["form_submit_out"] != "") { $userid = trim($_POST['userid']); $data['attd_out_time'] = trim($_POST['attd_out_time']); $data['attd_date'] = trim($_POST['attd_date']); $data['attd_comment'] = trim($_POST['attd_comment']); if (!checkOutCheckIn($userid, $data, $db)) { // check today check in data is exist or not $rfc = "<script>alert('Please, check in first, thank you.')</script>"; } else { if (checkOutCheckedIn($userid, $data, $db)) { // check today checked in data is already exist or not $rfc = "<script>alert('You already checked out for today, thank you.')</script>";
_log("*** Invalid user: {$callerID} on {$channel} / {$network} ***"); hangup(); } else { _log("*** Validated user {$callerID} ***"); // Handle incoming telephone calls. if ($channel == 'VOICE') { say("."); $result = ask("Check in, check out or knock knock?", array("choices" => "check in(in, 1), check out(out, 2), knock knock(knock, 3)", "attempts" => "3", "timeout" => "10.0")); $message = $result->value; } else { $message = strtolower($currentCall->initialText); } switch ($message) { // User is checking in. case 'check in': if (checkIn($callerID, $channel, $network)) { say('You have been checked in to Cloud knock.'); } else { say('Could not check you in. Do you need to check out?'); } break; // User is checking out. // User is checking out. case 'check out': if (checkOut($callerID)) { say('You have been checked out of Cloud knock.'); } else { say('Could not check you out. Do you need to check in?'); } break; // Somebody's knocking on the door, somebody's rining the bell...
createAccount($params); break; case 'signUp': signUp($params); break; case 'signUpAndMetaInfo': signUpAndMetaInfo($params); break; case 'metaInfo': metaInfo($params); break; case 'createDataFile': createDataInFile($params); break; case 'checkIn': checkIn($params); break; case 'setLocationData': setLocationData($params); break; case 'updateLocationData': updateLocationData($params); break; case 'getLocationDataDir': getLocationDataDir($params); break; case 'getLocationDataFile': getLocationDataFile($params); break; case 'pushLocationData': pushData($params);