本文整理汇总了PHP中Staff::validateData方法的典型用法代码示例。如果您正苦于以下问题:PHP Staff::validateData方法的具体用法?PHP Staff::validateData怎么用?PHP Staff::validateData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::validateData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
$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
#**************************************************************************
$staffQ = new StaffQuery();
$staffQ->connect();
示例2: Staff
$staff = new Staff();
$staff->setLastChangeUserid($_SESSION["userid"]);
$staff->setUserid($_POST["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->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"]));
$staff->setSuspended(isset($_POST["suspended_flg"]));
if (!$staff->validateData()) {
$pageErrors["last_name"] = $staff->getLastNameError();
$pageErrors["username"] = $staff->getUsernameError();
$_SESSION["postVars"] = $_POST;
$_SESSION["pageErrors"] = $pageErrors;
header("Location: ../admin/staff_edit_form.php");
exit;
}
#**************************************************************************
#* Update staff member
#**************************************************************************
$staffQ = new StaffQuery();
$staffQ->connect();
if ($staffQ->errorOccurred()) {
$staffQ->close();
displayErrorPage($staffQ);