本文整理汇总了PHP中Staff::getIdMember方法的典型用法代码示例。如果您正苦于以下问题:PHP Staff::getIdMember方法的具体用法?PHP Staff::getIdMember怎么用?PHP Staff::getIdMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::getIdMember方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intval
require_once "../model/Query/Staff.php";
/**
* Validate data
*/
$errorLocation = "../admin/staff_edit_form.php?id_member=" . intval($_POST["id_member"]);
// controlling var
$staff = new Staff();
$staff->setIdMember($_POST["id_member"]);
require_once "../admin/staff_validate_post.php";
/**
* Destroy form values and errors
*/
Form::unsetSession();
/**
* Update staff member
*/
$staffQ = new Query_Staff();
if ($staffQ->existLogin($staff->getLogin(), $staff->getIdMember())) {
FlashMsg::add(sprintf(_("Login, %s, already exists. The changes have no effect."), $staff->getLogin()), OPEN_MSG_WARNING);
} else {
$staffQ->update($staff);
$info = $staff->getFirstName() . " " . $staff->getSurname1() . " " . $staff->getSurname2();
FlashMsg::add(sprintf(_("Staff member, %s, has been updated."), $info));
}
$staffQ->close();
unset($staffQ);
unset($staff);
/**
* Redirect to $returnLocation to avoid reload problem
*/
header("Location: " . $returnLocation);
示例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);
}