本文整理汇总了PHP中Staff::setSname方法的典型用法代码示例。如果您正苦于以下问题:PHP Staff::setSname方法的具体用法?PHP Staff::setSname怎么用?PHP Staff::setSname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::setSname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$pagescript = array();
$pagestyle = array();
$sqltext = "SELECT * from staff WHERE staffid=?";
// print "<br/>$sqltext";
$q = $db->select($sqltext, array($staffid), 'i');
$r = $q[0];
$addsid = $r->addsid;
$errors = array();
if (isset($_GET['go']) && $_GET['go'] == "y") {
// Add to Address table
$addsid = db_updateAddress($_POST, $addsid);
// Update DB
$staffUpdate = new Staff();
$staffUpdate->setStaffid($staffid);
$staffUpdate->setFname($_POST['fname']);
$staffUpdate->setSname($_POST['sname']);
$staffUpdate->setJobtitle($_POST['jobtitle']);
$staffUpdate->updateDB();
header("Location: /");
exit;
}
$pagetitle = "Edit Staff Member";
$pagescript = array();
$pagestyle = array();
if ($seclevel > 3 && $r->staffid != $staffid) {
header("Location: /staff/?Oooopppsss=1");
exit;
}
include "tmpl/header.php";
?>
示例2: array
$done = 0;
$fields = array("sname", "fname", 'jobtitle');
foreach ($fields as $field) {
if (!isset($_POST[$field])) {
$_POST[$field] = '';
}
}
if (isset($_GET['go']) && $_GET['go'] == "y") {
$logContent = "";
$pw = generatePassword();
// Add to Address table
$addsid = db_addAddress($_POST);
# Insert into DB
$staffNew = new Staff();
$staffNew->setFname($_POST['fname']);
$staffNew->setSname($_POST['sname']);
$staffNew->setAddsid($addsid);
$staffNew->setJobtitle($_POST['jobtitle']);
$stfid = $staffNew->insertIntoDB();
$usr = generateStafflogon($_POST['fname'], $_POST['sname']);
$staffPwd = mkPwd($pw);
# Insert Pwd into DB
$pwdNew = new Pwd();
$pwdNew->setUsr($usr);
$pwdNew->setStaffid($stfid);
$pwdNew->setPw($staffPwd);
$pwdNew->insertIntoDB();
file_put_contents('/etc/athenace/pwd', "Staff\t{$stfid}\t{$usr}\t{$pw}\n", FILE_APPEND);
$logresult = logEvent(15, $logContent);
$done = 1;
}