本文整理汇总了PHP中Teacher::setByArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Teacher::setByArray方法的具体用法?PHP Teacher::setByArray怎么用?PHP Teacher::setByArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Teacher
的用法示例。
在下文中一共展示了Teacher::setByArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateconfirm
protected function validateconfirm()
{
$required = array("teacher_id" => "Teacher Id", "admission_date" => "Admission Date", "name" => "Name", "subject_id" => "Subject", "date_of_birth" => "Date of Birth", "gender" => "Gender", "mobile" => "Mobile");
global $user;
global $objPDO;
$student = new Student($objPDO, $user->getuserId());
if ($user->checkAdmin() == true || $student->checkTeacher() == true) {
if (isset($_POST)) {
foreach ($required as $key => $value) {
if (!isset($_POST[$key]) || $_POST[$key] == '' || $_POST[$key] == 'select') {
echo $value . ' is Required<br/>';
return;
}
}
if (!is_numeric($_POST['mobile'])) {
echo "Mobile number must be Numeric";
} else {
if (isset($_POST['permanent_pincode']) && $_POST['permanent_pincode'] != '' && !is_numeric($_POST['permanent_pincode']) || isset($_POST['correspondence_pincode']) && $_POST['correspondence_pincode'] != '' && !is_numeric($_POST['correspondence_pincode'])) {
echo "Pincode must be Numeric";
} else {
echo 'Saving...';
require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/teacher_class.php';
$teacherProfile = new Teacher($objPDO);
if ($user->checkAdmin() == true) {
$teacher_id = $_GET['uid'];
} else {
$teacher_id = $student->getID();
}
if ($_POST['blood_group'] == 'select') {
unset($_POST['blood_group']);
}
$teacherProfile->loadByUserId($teacher_id);
$teacherProfile->setByArray($_POST);
$teacherProfile->save();
echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/teacher/view/' . $teacher_id . '"/>';
}
}
}
} else {
echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/teacher/view/"/>';
}
}