Пример #1
0
        if (isset($_POST["job" . $jobs[$i]->id]) && $_POST["job" . $jobs[$i]->id] > "0") {
            saveEmployeeJob($empID, $jobs[$i]->id, $_POST["job" . $jobs[$i]->id]);
        }
    }
    //save employee availability
    for ($i = 0; $i < count($shifts); $i++) {
        for ($j = 1; $j <= 7; $j++) {
            if (isset($_POST["shift" . $shifts[$i]->name . "-" . $j])) {
                saveEmployeeAvailable($empID, $shifts[$i]->name, $j, "1");
            }
        }
    }
}
//edit employee
if ($_POST["procedure"] == "EDIT") {
    updateEmployee($_POST["emp_id"], $_POST["first"], $_POST["last"], $_POST["jobs"], $_POST["hours"], $_POST["address"], $_POST["phone1"] . $_POST["phone2"], $_POST["email"]);
    if ($_POST["loginID"] > "") {
        saveLogin($_POST["emp_id"], $_POST["loginID"], $_POST["loginPassword"]);
        $body = "Your account has been created / edited.<br>Username: "******"loginID"] . "<br>Password: "******"loginPassword"];
        //mail("*****@*****.**","Shift Scheduler Account Created", $body);
    }
    //save employee jobs
    deleteEmployeeJobs($_POST["emp_id"]);
    for ($i = 0; $i < count($jobs); $i++) {
        if (isset($_POST["job" . $jobs[$i]->id]) && $_POST["job" . $jobs[$i]->id] > "0") {
            saveEmployeeJob($_POST["emp_id"], $jobs[$i]->id, $_POST["job" . $jobs[$i]->id]);
        }
    }
    //save employee availability
    deleteEmployeeAvailability($_POST["emp_id"]);
    for ($i = 0; $i < count($shifts); $i++) {
Пример #2
0
        deleteJob();
        break;
    case "insertDepartment":
        addDepartment();
        break;
    case "updateDepartment":
        updateDepartment();
        break;
    case "deleteDepartment":
        deleteDepartment();
        break;
    case "insertEmployee":
        addEmployee();
        break;
    case "updateEmployee":
        updateEmployee();
        break;
    case "deleteEmployee":
        deleteEmployee();
        break;
    case "insertLocation":
        addLocation();
        break;
    case "updateLocation":
        updateLocation();
        break;
    case "deleteLocation":
        deleteLocation();
        break;
}
displayHeader();