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


PHP Department::find_by_id方法代码示例

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


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

示例1: delete

 public function delete($id)
 {
     $article = Department::find_by_id($id);
     if ($article->delete()) {
         return true;
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:7,代码来源:departments_model.php

示例2: Carbon

<?php

require_once "inc/initialize.php";
require_once "inc/vendor/autoload.php";
use Carbon\Carbon;
// Instance of Carbon Class with the current time
$date_now = new Carbon('now');
if (!$session->is_logged_in()) {
    header("location: index.php");
}
$user = User::find_by_id($session->id);
if (isset($user->programme_id)) {
    $prog = Programme::find_by_id($user->programme_id);
}
if (isset($prog->department_id)) {
    $dept = Department::find_by_id($prog->department_id);
}
if (isset($dept->faculty_id)) {
    $fac = Faculty::find_by_id($dept->faculty_id);
}
?>
<!DOCTYPE HTML>
    <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>University of Jos, Nigeria - Transcript System</title>
        <?php 
require_once LIB_PATH . DS . 'javascript.php';
require_once LIB_PATH . DS . 'css.php';
?>
        <style type="text/css">
开发者ID:Ghaji,项目名称:transcripts,代码行数:31,代码来源:profile.php

示例3: findDepartment

 public function findDepartment($id)
 {
     $empDept = Department::find_by_id($id);
     if ($empDept) {
         return $empDept;
         //print_r($empRole);
     } else {
         return false;
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:10,代码来源:employees_model.php

示例4: UpdateEmpRole

 /**
  * this section is required 
  * to update employee role
  */
 public function UpdateEmpRole()
 {
     $rEmployee = Employee::find_by_id($_POST['empid']);
     $rEmployee->emp_post = $_POST['emppost'];
     $rEmployee->emp_dept = $_POST['empdept'];
     $empDept = Department::find_by_id($_POST['empdept']);
     $Tlog = new Transaction();
     $Tlog->com_id = $empDept->dept_code;
     $Tlog->trans_type = "HR DEPARTMENT";
     $Tlog->trans_description = "Employee assigned to " . $empDept->dept_name . " Department";
     $Tlog->datecreated = date("Y-m-d H:i:s");
     $Tlog->user_id = $_SESSION['emp_ident'];
     $empRole = Roles::find_by_id($_POST['emppost']);
     $Tlog2 = new Transaction();
     $Tlog2->com_id = $empRole->main_id;
     $Tlog2->trans_type = "HR DEPARTMENT";
     $Tlog2->trans_description = "Employee assigned " . $empRole->role_name . " Role";
     $Tlog2->datecreated = date("Y-m-d H:i:s");
     $Tlog2->user_id = $_SESSION['emp_ident'];
     if ($rEmployee->update()) {
         $Tlog2->create();
         $Tlog->create();
         return true;
     } else {
         return false;
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:31,代码来源:employees_model.php


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