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


PHP Teacher::getDep方法代码示例

本文整理汇总了PHP中Teacher::getDep方法的典型用法代码示例。如果您正苦于以下问题:PHP Teacher::getDep方法的具体用法?PHP Teacher::getDep怎么用?PHP Teacher::getDep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Teacher的用法示例。


在下文中一共展示了Teacher::getDep方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Department

				</tr>
				<tr>	
			        <th>Department</th>
			        <td>
						<select name="department">
							<option value="" selected>Department</option>
							<?php 
    $dep = new Department();
    $departments = $dep->getAllDepartment();
    while ($department = $departments->fetch_object()) {
        ?>
							<option value="<?php 
        echo $department->dept_id;
        ?>
" <?php 
        echo $t->getDep() == $department->dept_id ? 'selected' : '';
        ?>
><?php 
        echo $department->name;
        ?>
</option>
							<?php 
    }
    ?>
						</select>
					</td>
				</tr>
				<tr>	
			        <th>Email</th>
			        <td><input type="text" placeholder="Email" class="" value="<?php 
    echo $t->getEmail();
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:edit_teacher.php

示例2: reject

 public function reject($tid, $cid, $did, $reject_msg)
 {
     if (!loggedIn()) {
         return 0;
     }
     $this->_connect();
     $this->_teacher_id = $this->_db->real_escape_string($tid);
     $tid = $this->_db->real_escape_string($tid);
     $this->_course_code = $this->_db->real_escape_string($cid);
     $this->_course_dep = $this->_db->real_escape_string($did);
     if ($this->approved($cid, $did)) {
         if ($this->_status_level == '-1') {
             die('This result is already rejected.');
         }
         if ($this->_status_level < 5) {
             $approved_by = explode(',', $this->_approved_by);
             $t = new Teacher();
             $t->getInfo(Session::get('teacher_id'));
             $reject_msg = 'By ' . $t->getName() . '. ' . $reject_msg;
             $this->_reject_msg = $this->_db->real_escape_string($reject_msg);
             if (Session::get('privilege') === 'teacher') {
                 $i = 0;
                 while (isset($approved_by[$i])) {
                     if ($approved_by[$i] == $tid) {
                         return 2;
                         break;
                     } else {
                         $i++;
                     }
                 }
             } else {
                 if (Session::get('privilege') === 'dupc' || Session::get('privilege') === 'dppc') {
                     $i = 1;
                     if ($this->_status_level >= 3) {
                         die("You cannot reject because all DUPC or DPPC members have approved!");
                     }
                     if ($t->getDep() != $this->_course_dep) {
                         die("Sorry! You cannot reject this result!");
                     }
                     while (isset($approved_by[$i])) {
                         if ($approved_by[$i] == $tid) {
                             return 2;
                             break;
                         } else {
                             $i++;
                         }
                     }
                 } else {
                     if (Session::get('privilege') === 'hod' && $this->_status_level == 3) {
                         if ($t->getDep() != $this->_course_dep) {
                             die("Sorry! You cannot reject this result!");
                         }
                     } else {
                         if (Session::get('privilege') === 'hod' && $this->_status_level < 3) {
                             die("You cannot approve/reject this result being HOD because DUPC or DPPC members have not approved/rejected this result yet.");
                         } else {
                             if (Session::get('privilege') === 'hod' && $this->_status_level > 3) {
                                 die("You have already approved this result being HOD. So you cannot reject.");
                             } else {
                                 if (Session::get('privilege') === 'dean' && $this->_status_level < 4) {
                                     die("You cannot approve/reject this result being DEAN because HOD or DUPC or DPPC members have not approved/rejected this result yet.");
                                 }
                             }
                         }
                     }
                 }
             }
             $approved_by = '';
             $status_level = '-1';
             $query = "UPDATE approval SET reject_msg='" . $this->_reject_msg . "',status_level='" . $status_level . "', approved_by='" . $approved_by . "' WHERE teacher_id='" . $this->_teacher_id . "' AND course_code='" . $this->_course_code . "' AND course_dep='" . $this->_course_dep . "' AND timestamp>='" . Session::get('semester_timestamp') . "'";
         } else {
             die("Cannot Reject!");
         }
     } else {
         die("Reject Error");
     }
     $result = $this->_db->query($query);
     if ($this->_db->affected_rows) {
         if ($this->_db->error == '') {
             return 1;
         } else {
             die($this->_db->error);
         }
     } else {
         return 2;
     }
 }
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:87,代码来源:Approval.php


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