if (isset($_GET['commended'])) {
    $commended = $_GET['commended'];
}
if (isset($_POST['commend'])) {
    $employee = $_POST['employee'];
    $date = $_POST['date'];
    $reason = $_POST['reason'];
    $public = $_POST['public'];
    try {
        $insertQuery = $db->prepare("INSERT INTO reportCommendable (employee, date, reason, area, submitter, public, guid) VALUES (:employee,:day,:reason,:area,:netId,:public,:guid)");
        $insertQuery->execute(array(':employee' => $_POST['employee'], ':day' => $_POST['date'], ':reason' => $_POST['reason'], ':area' => $area, ':netId' => $netID, ':public' => $_POST['public'], ':guid' => newGuid()));
    } catch (PDOException $e) {
        exit("error in query");
    }
    //Create $persons object to be passed in to the notify function.
    $persons = getReceivers($_POST['employee'], $areaGuid, "ffb6ffe7-c522-11e5-bdda-0242ac110003");
    //Call notify function using the object $persons created above as the third argument.
    notify("ffb6ffe7-c522-11e5-bdda-0242ac110003", "Congratulations! You have received a commendable performance report! See your report on the Wall of Fame or Commendable Log Page.", $persons);
    echo "<script>alert('Commendable Performance Submitted');window.close();</script>";
}
?>

<html>

	<script type="text/javascript">
		window.onload=function()
			{
				$("#employee").val(<?php 
echo "\"{$commended}\"";
?>
);
                $updateMonitorQuery = $db->prepare("UPDATE silentMonitorCalls SET criteriaAvg = :average WHERE smid = :index AND callNum = :call");
                $updateMonitorQuery->execute(array(':average' => $criteriaAvg, ':index' => $index, ':call' => $callNum));
            } catch (PDOException $e) {
                exit("error in query");
            }
        }
    }
    if ($env == 0) {
        echo "netID of submitter: " . $netID;
        echo "<br/>netID of caller: " . $_POST['employee'];
        echo "<br/>date of Submittal: " . var_dump($_POST['startDate']);
        echo "<br/>";
        echo "Select box data <br/>";
        var_dump($_POST['select']);
        echo "<br/>Comment Box Data<br/>";
        var_dump($_POST['comments']);
        echo "<br/>Rating Box Data<br/>";
        var_dump($_POST['rating']);
    }
    if ($complete == 1) {
        //Create $persons object to be passed in to the notify function
        $persons = getReceivers($curnetID, $areaGuid, "a9dd371f-1a43-45d1-a316-378623e01a4c");
        //Call notify function using the object $person created above as the third argument.
        notify("a9dd371f-1a43-45d1-a316-378623e01a4c", "A silent monitor has been submitted for you. Please see your report on the Silent Monitor Log page.", $persons);
    }
}
?>

<a href='./index.php'>Return to Silent Monitor Application</a>
<?php 
require '../includes/includeAtEnd.php';
Example #3
0
 $description = $_POST["description"];
 print "Storing The title<br>";
 $images = storeImages();
 print "image stored<br>";
 $xml = new SimpleXMLElement('<data/>');
 $xml->addChild('title', $title);
 $xml->addChild('description', $description);
 $image = $xml->addChild('images');
 for ($i = 0; $i < count($images); $i++) {
     $link = $image->addChild('link');
     $link->addChild('image', PROJECT_URL . $images[$i][0]);
     $link->addChild('thum', PROJECT_URL . $images[$i][1]);
 }
 include_once './db_functions.php';
 $con = new DB_Functions();
 $registatoin_ids = getReceivers($con);
 if (count($registatoin_ids) == 0) {
     print "No users <br>";
     //header( 'Location:' . PROJECT_URL . 'index.php?message=No%20Users%20Found');
     return;
 }
 if (count($registatoin_ids) > 1000) {
     $count = count($registatoin_ids);
     $index = 0;
     while ($count > 1000) {
         $regs = array();
         for ($i = $index; $i < $index + 1000; $i++) {
             $regs[] = $registatoin_ids[$i];
         }
         $index += 1000;
         $count -= 1000;
        }
        // Notify the person whose hours were taken
        $persons = getReceivers($curTrade['postedBy'], $areaGuid, "d13b5f2c-cc5c-11e5-bdda-0242ac110003");
        $tradeMessage = "Your trade request for " . date("D, M jS, Y", strtotime($curTrade['startDate'])) . " from " . date("g:ia", strtotime($curTrade['startTime'])) . " to " . date("g:ia", strtotime($curTrade['endTime'])) . " has been taken. Please see your updated schedule";
        //Call notify function using the object $persons created above as the third argument.
        notify("d13b5f2c-cc5c-11e5-bdda-0242ac110003", $tradeMessage, $persons);
        // Notify the person who took the hours
        try {
            $giverStmt = $db->prepare("SELECT employee FROM scheduleTradeBids WHERE tradeID=:id");
            $giverStmt->execute(array(":id" => $curID));
        } catch (PDOException $e) {
            exit("error in query");
        }
        if ($giver = $giverStmt->fetch()) {
            //Notify and getReceivers functions called a second time for the receiver of the trade.
            $persons = getReceivers($giver->employee, $areaGuid, "b81177ff-cc5c-11e5-bdda-0242ac110003");
            $tradeMessage = "Your trade request bid for " . date("D, M jS, Y", strtotime($curTrade['startDate'])) . " from " . date("g:ia", strtotime($curTrade['startTime'])) . " to " . date("g:ia", strtotime($curTrade['endTime'])) . " has been accepted. Please see your updated schedule";
            //Call notify function using the object $persons created above as the third argument.
            notify("b81177ff-cc5c-11e5-bdda-0242ac110003", $tradeMessage, $persons);
        }
    }
    echo "1";
}
//This function should take in an employee, tradeId, and startHour and return a shift to be added
//To the employee's schedule.
//$data = the trade entry from `scheduleTrades`
//TODO make some sort of logic for determining the start and end dates of the new shifts based on the dates for the shift that's being traded away
function createShiftsFromBids($data)
{
    global $hourSize;
    $time = date('H:i:s', strtotime($data['startTime']));
require '../includes/includeMeSimple.php';
if (isset($_GET['violator'])) {
    $violator = $_GET['violator'];
} else {
    $violator = "";
}
if (isset($_POST['security'])) {
    try {
        $insertQuery = $db->prepare("INSERT INTO reportSecurityViolation (employee, date, violation, reason,submitter,guid) VALUES (:employee,:day,:violation,:reason,:netId,:guid)");
        $insertQuery->execute(array(':employee' => $_POST['employee'], ':day' => $_POST['date'], ':violation' => $_POST['violation'], ':reason' => $_POST['reason'], ':netId' => $netID, ':guid' => newGuid()));
    } catch (PDOException $e) {
        exit($e);
    }
    //Create $persons object to be passed into the notify function.
    $persons = getReceivers($violator, $areaGuid, "ffb6ffe7-c522-11e5-bdda-0242ac110003");
    //Call notify function using the object $persons created above as the third argument.
    notify("ffb6ffe7-c522-11e5-bdda-0242ac110003", "A security violation log has ben submitted for you. Please see your report on the Security Violation Log page.", $persons);
    echo "<script>alert('Security Violation Submitted');window.close();</script>";
}
?>
	<script type="text/javascript">
		window.onload=function()
			{
				$("#date").datepicker({dateFormate:"yy-mm-dd"});
				$("#employee").val(<?php 
echo "\"{$violator}\"";
?>
);
			}
	</script>