示例#1
0
    $arr = loadJobArray();
    for ($i = 0; $i < count($arr); $i++) {
        for ($day = 1; $day <= 7; $day++) {
            saveShiftJob($id, $arr[$i], $_POST[$day . "-" . $arr[$i]], $day);
        }
    }
    $btn_text = "Update";
}
//edit shift
if (isset($_POST["procedure"]) && $_POST["procedure"] == "Edit") {
    $id = $_POST["id"];
    $btn_text = "Update";
}
//delete shift
if (isset($_POST["procedure"]) && $_POST["procedure"] == "Delete") {
    deleteShift($_POST["id"]);
}
//load panel
if ($id > 0) {
    loadShift($id, $shiftName, $arr);
}
$pageTitle = "Weekly Shifts";
$javascript = "manageShifts.js";
require "includes/adminHeader.php";
?>

<br>

<fieldset style="width:280px; margin-left:12px">
<legend>Weekly Proforma</legend>
	<table>
define("projectID", "10-31-14-10-16");
define("NameFirst", "John");
//A person, project, or shift from the
define("NameLast", "Smith");
//Table; First check to see if
//John Smith is already in the table - GIOVI
echo 'testing reportsAjax.php</br>';
error_log('testing reportsAjax.php</br>');
createPerson();
createShift();
createProject();
addPersontoShift();
addPersontoProject();
getReport();
deletePerson();
deleteShift();
deleteProject();
echo 'reportsAjax.php testing complete</br>';
error_log('testing reportsAjax.php</br>');
function createPerson()
{
    $m = new Person("John", "Smith", "10-12-87", "Male", "555 Main Street", "Flushing", "NY", "11111", "7188475582", "2072654046", "*****@*****.**", "volunteer", " ", "Schedule", "I like helping out", "55555", "03-14-14", "email");
    $result = add_person($m);
    echo 'result is ' . $result . '</br>';
    if ($result) {
        echo "person was added </br>";
    } else {
        echo "person already exists in db, not added</br>";
    }
}
function deletePerson()