コード例 #1
0
function doEdit()
{
    $instid = $_GET['id'];
    if (isset($_POST['savefaculty'])) {
        if ($_POST['name'] == "" or $_POST['address'] == "" or $_POST['email'] == "") {
            message("All field is required!", "error");
            check_message();
        } else {
            $inst = new Instructor();
            $name = $_POST['name'];
            $address = $_POST['address'];
            $Gender = $_POST['Gender'];
            $civilstats = $_POST['civilstats'];
            $specialization = $_POST['specialization'];
            $email = $_POST['email'];
            $empStats = $_POST['empStats'];
            $inst->INST_FULLNAME = $name;
            $inst->INST_ADDRESS = $address;
            $inst->INST_SEX = $Gender;
            $inst->INST_STATUS = $civilstats;
            $inst->SPECIALIZATION = $specialization;
            $inst->INST_EMAIL = $email;
            $inst->EMPLOYMENT_STATUS = $empStats;
            $inst->update($instid);
            message($name . "has been updated successfully!", "success");
            redirect('index.php');
        }
    }
}