当前位置: 首页>>代码示例>>PHP>>正文


PHP Teacher::setByArray方法代码示例

本文整理汇总了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/"/>';
     }
 }
开发者ID:srinivasans,项目名称:educloud,代码行数:42,代码来源:teacherController.php


注:本文中的Teacher::setByArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。