本文整理汇总了PHP中Staff::getFirstName方法的典型用法代码示例。如果您正苦于以下问题:PHP Staff::getFirstName方法的具体用法?PHP Staff::getFirstName怎么用?PHP Staff::getFirstName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::getFirstName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
#****************************************************************************
#* Checking for post vars. Go back to form if none found.
#****************************************************************************
if (count($_POST) == 0) {
header("Location: ../admin/staff_new_form.php");
exit;
}
#****************************************************************************
#* Validate data
#****************************************************************************
$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();
示例2: update
/**
* bool update(Staff $staff)
*
* Update a staff member in the staff table.
*
* @param Staff $staff staff member to update
* @return boolean returns false, if error occurs
* @access public
*/
function update($staff)
{
if (!$staff instanceof Staff) {
$this->_error = "Argument is an inappropriate object.";
return false;
}
// If changing login check to see if it already exists.
/*if ($this->existLogin($staff->getLogin(), $staff->getIdMember()))
{
$this->_isError = true;
$this->_error = "Login is already in use.";
return false;
}*/
$sql = "UPDATE " . $this->_table . " SET " . "collegiate_number=?, " . "nif=?, " . "first_name=?, " . "surname1=?, " . "surname2=?, " . "address=?, " . "phone_contact=?, " . "login=? " . "WHERE id_member=?;";
$params = array(urlencode($staff->getCollegiateNumber()), urlencode($staff->getNIF()), urlencode($staff->getFirstName()), urlencode($staff->getSurname1()), urlencode($staff->getSurname2()), urlencode($staff->getAddress()), urlencode($staff->getPhone()), urlencode($staff->getLogin()), $staff->getIdMember());
return $this->exec($sql, $params);
}