Exemplo n.º 1
0
        break;
    case 'nonConflicts':
        $nonConflicts = "(" . arrayToCSV(checkNonConflicts()) . ")";
        $query = "SELECT reqNo,creator,room,eventTitle,eventStartDate,eventStartTime,reqType,appStatus FROM Requests where reqNo in " . $nonConflicts . "";
        getRequests("nonConflicts", $query);
        break;
    case 'Cancelled':
        $query = "SELECT reqNo,creator,room,eventTitle,eventStartDate,eventStartTime,reqType,appStatus FROM Requests where appStatus = 'Cancelled'";
        getRequests("Cancelled", $query);
        break;
    case 'Accepted':
        $query = "SELECT reqNo,creator,room,eventTitle,eventStartDate,eventStartTime,reqType,appStatus FROM Requests where appStatus = 'Accepted'";
        getRequests("Accepted", $query);
        break;
    case 'Conflicts':
        clashMux(checkConflicts());
        if (isset($_GET['st'])) {
            $mstart = $_GET['st'];
        } else {
            $mstart = 0;
        }
}
?>
</table>

<form method='POST' action='cancelReq.php' id='cancelForm'>
	<table>
		<tr>
			<td>Request Number</td>
			<td><input type='text' readonly name='reqNo'></td>
		</tr>	
Exemplo n.º 2
0
<?php

include "essential.php";
dbconnect();
//print_r($_POST);
//echo $_POST['forwardID'];
$a = "accept";
$b = "reject";
$c = "forward";
$d = "Specify a reason for rejection (optional) )";
$rID = getIDFromHash($_POST['reqID']);
$reqArray = getRequestByID(getIDFromHash($_POST['reqID']));
//print_r($reqArray);
$clashArrays = clashMux(checkConflicts());
foreach ($clashArrays as $clashArray) {
    if (in_array($rID, $clashArray)) {
        break;
    }
}
$_POST['reqID'] = getIDFromHash($_POST['reqID']);
//Get comma separated string of concerned persons, insert into db
$reqID = getIDFromHash($_POST['reqID']);
$cc = $_POST['cc'];
$ccPersons = CSVToArray($cc);
foreach ($ccPersons as $guy) {
    $query = "INSERT INTO ccPerson(reqNo, email) values(\"{$reqID}\", \"{$guy}\");";
    //echo $query;
    execute($query);
}
//clashArray now has all elements clashing with the current request, including the current request
//