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


PHP Teacher::getApproved方法代码示例

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


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

示例1: Log

 $edit = $teach->edit_teacher_info(Input::get('name'), Input::get('t_id'), Input::get('email'), Input::get('privilege'), Input::get('department'), Input::get('mobile'), Input::get('approved'), Input::get('blocked'));
 if ($edit == 4) {
     echo '<div class="alert alert-warning alert-dismissible" role="alert">';
     echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
     echo 'Maximum no. of possible ' . Input::get('privilege') . ' exists.';
     echo '</div>';
 } else {
     if ($edit == 3) {
         echo '<div class="alert alert-warning alert-dismissible" role="alert">';
         echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
         echo 'Sorry, you don\'t have privilege to edit teacher\'s information.';
         echo '</div>';
     } else {
         if ($edit == 1) {
             $log = new Log();
             if ($teach->getApproved() == 0 && Input::get('approved') == 1) {
                 $log->actionLog('Approved Teacher');
             }
             if ($teach->getApproved() == 1 && Input::get('approved') == 0) {
                 $log->actionLog('Disapproved Teacher');
             }
             if ($teach->getBlocked() == 1 && Input::get('blocked') == 0) {
                 $log->actionLog('Unblocked Teacher');
             }
             if ($teach->getBlocked() == 0 && Input::get('blocked') == 1) {
                 $log->actionLog('Blocked Teacher');
             }
             $log->actionLog('Edited Teacher');
             echo '<div class="alert alert-success alert-dismissible" role="alert">';
             echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
             echo 'Teacher\'s information edited successfully.';
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:edit_teacher.php

示例2: appointCourse

 public function appointCourse($teacher_id = '', $course_code = '', $course_sem = '', $course_dep = '')
 {
     if (loggedIn() && (privilege() === 'teacher' || privilege() === 'dppc' || privilege() === 'dupc' || privilege() == NULL)) {
         return 0;
     }
     if (loggedIn()) {
         $this->_connect();
         $course_code = $this->_db->real_escape_string(escape($course_code));
         $course_sem = $this->_db->real_escape_string(escape($course_sem));
         $course_dep = $this->_db->real_escape_string(escape($course_dep));
         $teacher_id = $this->_db->real_escape_string(escape($teacher_id));
         if ($this->appointError($teacher_id, $course_code, $course_dep)) {
             return 2;
         } else {
             $t = new Teacher();
             $t->getInfo($teacher_id);
             if (!$t->getApproved()) {
                 unset($t);
                 return 3;
             }
             $query = "INSERT INTO courses_appointed (teacher_id,course_code,course_sem,course_dep) VALUES ('" . $teacher_id . "','" . $course_code . "','" . $course_sem . "','" . $course_dep . "')";
             $result = $this->_db->query($query);
             if ($this->_db->affected_rows) {
                 if ($this->_db->error == '') {
                     return 1;
                 } else {
                     die($this->_db->error);
                 }
             } else {
                 return 0;
             }
         }
     } else {
         if (!loggedIn()) {
             return 0;
         }
     }
 }
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:38,代码来源:Course.php

示例3:

    ?>
" name="email"/></td>
			    </tr>
				<tr>    
			        <th>Mobile</th>
			        <td><input type="text" placeholder="Mobile" class="" value="<?php 
    echo $t->getMobile();
    ?>
" name="mobile"/></td>
			    </tr>
				<tr>    
			        <th>Approved</th>
			        <td>
						<select name="approved" class="">
							<option value="0" <?php 
    echo $t->getApproved() == '0' ? 'selected' : '';
    ?>
>Not Approved</option>
							<option value="1" <?php 
    echo $t->getApproved() == '1' ? 'selected' : '';
    ?>
>Approved</option>
						</select>
					</td>
				</tr>
				<tr>
			        <th>Blocked</th>
			        <td>
						<select name="blocked" class="">
							<option value="0" <?php 
    echo $t->getBlocked() == '0' ? 'selected' : '';
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:edit_teacher.php


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