Пример #1
0
$staff = new Staff();
$staff->setLastChangeUserid($_SESSION["userid"]);
$staff->setLastName($_POST["last_name"]);
$_POST["last_name"] = $staff->getLastName();
$staff->setFirstName($_POST["first_name"]);
$_POST["first_name"] = $staff->getFirstName();
$staff->setUsername($_POST["username"]);
$_POST["username"] = $staff->getUsername();
$staff->setPwd($_POST["pwd"]);
$_POST["pwd"] = $staff->getPwd();
$staff->setPwd2($_POST["pwd2"]);
$_POST["pwd2"] = $staff->getPwd2();
$staff->setCircAuth(isset($_POST["circ_flg"]));
$staff->setCircMbrAuth(isset($_POST["circ_mbr_flg"]));
$staff->setCatalogAuth(isset($_POST["catalog_flg"]));
$staff->setAdminAuth(isset($_POST["admin_flg"]));
$staff->setReportsAuth(isset($_POST["reports_flg"]));
$validData = $staff->validateData();
$validPwd = $staff->validatePwd();
if (!($validData && $validPwd)) {
    $pageErrors["last_name"] = $staff->getLastNameError();
    $pageErrors["username"] = $staff->getUsernameError();
    $pageErrors["pwd"] = $staff->getPwdError();
    $_SESSION["postVars"] = $_POST;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/staff_new_form.php");
    exit;
}
#**************************************************************************
#*  Insert new staff member
#**************************************************************************
Пример #2
0
 function fetchStaff()
 {
     $array = $this->_conn->fetchRow();
     if ($array == false) {
         return false;
     }
     $staff = new Staff();
     $staff->setUserid($array["userid"]);
     $staff->setLastName($array["last_name"]);
     $staff->setFirstName($array["first_name"]);
     $staff->setUsername($array["username"]);
     if ($array["circ_flg"] == "Y") {
         $staff->setCircAuth(true);
     } else {
         $staff->setCircAuth(false);
     }
     if ($array["circ_mbr_flg"] == "Y") {
         $staff->setCircMbrAuth(TRUE);
     } else {
         $staff->setCircMbrAuth(FALSE);
     }
     if ($array["catalog_flg"] == "Y") {
         $staff->setCatalogAuth(true);
     } else {
         $staff->setCatalogAuth(false);
     }
     if ($array["admin_flg"] == "Y") {
         $staff->setAdminAuth(true);
     } else {
         $staff->setAdminAuth(false);
     }
     if ($array["reports_flg"] == "Y") {
         $staff->setReportsAuth(TRUE);
     } else {
         $staff->setReportsAuth(FALSE);
     }
     if ($array["suspended_flg"] == "Y") {
         $staff->setSuspended(true);
     } else {
         $staff->setSuspended(false);
     }
     return $staff;
 }
Пример #3
0
 function _mkObj($array)
 {
     $staff = new Staff();
     $staff->setUserid($array["userid"]);
     $staff->setLastName($array["last_name"]);
     $staff->setFirstName($array["first_name"]);
     $staff->setUsername($array["username"]);
     $staff->setEmail($array["email"]);
     $staff->setContactNumber($array["contact_number"]);
     if ($array["circ_flg"] == "Y") {
         $staff->setCircAuth(true);
     } else {
         $staff->setCircAuth(false);
     }
     if ($array["circ_mbr_flg"] == "Y") {
         $staff->setCircMbrAuth(TRUE);
     } else {
         $staff->setCircMbrAuth(FALSE);
     }
     if ($array["catalog_flg"] == "Y") {
         $staff->setCatalogAuth(true);
     } else {
         $staff->setCatalogAuth(false);
     }
     if ($array["admin_flg"] == "Y") {
         $staff->setAdminAuth(true);
     } else {
         $staff->setAdminAuth(false);
     }
     if ($array["reports_flg"] == "Y") {
         $staff->setReportsAuth(TRUE);
     } else {
         $staff->setReportsAuth(FALSE);
     }
     if ($array["suspended_flg"] == "Y") {
         $staff->setSuspended(true);
     } else {
         $staff->setSuspended(false);
     }
     return $staff;
 }