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; }
require_once "../classes/StaffQuery.php"; require_once "../functions/errorFuncs.php"; require_once "../classes/Localize.php"; $loc = new Localize(OBIB_LOCALE, $tab); #**************************************************************************** #* Checking for post vars. Go back to form if none found. #**************************************************************************** if (count($_POST) == 0) { header("Location: ../admin/staff_list.php"); exit; } #**************************************************************************** #* Validate data #**************************************************************************** $staff = new Staff(); $staff->setUserid($_POST["userid"]); $staff->setPwd($_POST["pwd"]); $_POST["pwd"] = $staff->getPwd(); $staff->setPwd2($_POST["pwd2"]); $_POST["pwd2"] = $staff->getPwd2(); if (!$staff->validatePwd()) { $pageErrors["pwd"] = $staff->getPwdError(); $_SESSION["postVars"] = $_POST; $_SESSION["pageErrors"] = $pageErrors; header("Location: ../admin/staff_pwd_reset_form.php"); exit; } #************************************************************************** #* Update staff member #************************************************************************** $staffQ = new StaffQuery();
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; }