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


PHP Employee::find_by_sql方法代码示例

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


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

示例1: getList

 /**
  * the getList method is used to 
  * pupolate the listing table 
  */
 public function getList($id = "", $pg)
 {
     $purl = array();
     if (isset($_GET['url'])) {
         $purl = $_GET['url'];
         $purl = rtrim($purl);
         $purl = explode('/', $_GET['url']);
     } else {
         $purl = null;
     }
     if (!isset($purl['2'])) {
         $pn = 1;
     } else {
         $pn = $purl['2'];
     }
     global $database;
     $resultEmployee = $database->db_query("SELECT * FROM employee");
     $pagin = new Pagination();
     //create the pagination object;
     $pagin->nr = $database->dbNumRows($resultEmployee);
     $pagin->itemsPerPage = 20;
     $customers = Employee::find_by_sql("SELECT * FROM employee " . $pagin->pgLimit($pn));
     $index_array = array("myemployee" => $customers, "mypagin" => $pagin->render($pg));
     return $index_array;
     return $index_array;
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:30,代码来源:employees_model.php

示例2: getData

 public function getData()
 {
     global $database;
     $depts = Department::find_all();
     $role = Roles::find_all();
     $country = Country::find_all();
     $vendors = Vendor::find_all();
     $zone = Zone::find_by_sql("SELECT * FROM zone");
     $techEmp = Employee::find_by_sql("SELECT * FROM employee WHERE emp_dept='5'");
     $startups = array("departs" => $depts, "country" => $country, "zone" => $zone, "vendors" => $vendors, "role" => $role, "techemp" => $techEmp);
     return $startups;
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:12,代码来源:clientproduct_model.php

示例3: getList

 /**
  * the getList method is used to 
  * pupolate the listing table 
  */
 public function getList($id = "", $pg)
 {
     $purl = array();
     if (isset($_GET['url'])) {
         $purl = $_GET['url'];
         $purl = rtrim($purl);
         $purl = explode('/', $_GET['url']);
     } else {
         $purl = null;
     }
     if (!isset($purl['2'])) {
         $pn = 1;
     } else {
         $pn = $purl['2'];
     }
     $empname = "";
     $empdept = "";
     $emppost = "";
     /**
      * of all the filter fields if only one field is set
      */
     $filterResult = "";
     if (isset($_POST['empname']) && !empty($_POST['empname'])) {
         $empname .= " AND emp_fname = '" . $_POST['empname'] . "' OR emp_lname = '" . $_POST['empname'] . "' ";
     }
     if (isset($_POST['empdept']) && !empty($_POST['empdept'])) {
         $empdept .= " AND emp_dept='" . $_POST['empdept'] . "' ";
     }
     if (isset($_POST['emppost']) && !empty($_POST['emppost'])) {
         $emppost .= " AND emp_post='" . $_POST['emppost'] . "' ";
     }
     $filterResult .= " WHERE id !='' " . $empname . $empdept . $emppost;
     global $database;
     $resultEmployee = $database->db_query("SELECT * FROM employee");
     $pagin = new Pagination();
     //create the pagination object;
     $pagin->nr = $database->dbNumRows($resultEmployee);
     $pagin->itemsPerPage = 50;
     $customers = Employee::find_by_sql("SELECT * FROM employee " . $filterResult . " ORDER BY id DESC ");
     $index_array = array("myemployee" => $customers, "mypagin" => $pagin->render($pg));
     return $index_array;
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:46,代码来源:employees_model.php

示例4: getData

 /**
  * load initail data for support ticket form needed during 
  * creating and editing support ticket
  * data 
  */
 public function getData()
 {
     global $database;
     $depts = Department::find_all();
     $role = Roles::find_all();
     $country = Country::find_all();
     $vendors = Vendor::find_all();
     $myproducts = Cproduct::find_all();
     /**
      * issues may arise that when database
      * is cleared emp_dept may not be 5
      */
     $techEmployee = Employee::find_by_sql("SELECT * FROM employee WHERE emp_dept = 5");
     $zone = Zone::find_by_sql("SELECT * FROM zone");
     $startups = array("departs" => $depts, "country" => $country, "zone" => $zone, "vendors" => $vendors, "role" => $role, "myproducts" => $myproducts, "techstaff" => $techEmployee);
     return $startups;
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:22,代码来源:support_model.php

示例5: getData

 /**
  * load initail data for support ticket form needed during 
  * creating and editing support ticket
  * data 
  */
 public function getData()
 {
     global $database;
     $depts = Department::find_all();
     $role = Roles::find_all();
     $country = Country::find_all();
     $vendors = Vendor::find_all();
     $myproducts = Cproduct::find_all();
     $lastSignoff = array_shift($database->fetch_assoc($database->db_query("SELECT MAX(id) as lastID, prod_id FROM sign_off_form ")));
     $lastWorkSheet = array_shift($database->fetch_assoc($database->db_query("SELECT MAX(id) as lastID, prod_id FROM work_sheet_form ")));
     /**
      * issues may arise that when database
      * is cleared emp_dept may not be 5
      */
     $clients = Client::find_all();
     // print_r($clients);
     $techEmployee = Employee::find_by_sql("SELECT * FROM employee WHERE emp_dept = 5");
     $zone = Zone::find_by_sql("SELECT * FROM zone");
     $startups = array("clients" => $clients, "departs" => $depts, "country" => $country, "zone" => $zone, "vendors" => $vendors, "role" => $role, "myproducts" => $myproducts, "techstaff" => $techEmployee, "lastsf" => $lastSignoff, "lastws" => $lastWorkSheet);
     return $startups;
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:26,代码来源:support_model.php

示例6: Pagination

$per_page = JOBS_PER_SEARCH;
$total_count = Employee::count_all_deactive();
$smarty->assign('total_count', $total_count);
$smarty->assign('page', $page);
$pagination = new Pagination($page, $per_page, $total_count);
$smarty->assign('previous_page', $pagination->previous_page());
$smarty->assign('has_previous_page', $pagination->has_previous_page());
$smarty->assign('total_pages', $pagination->total_pages());
$smarty->assign('has_next_page', $pagination->has_next_page());
$smarty->assign('next_page', $pagination->next_page());
$offset = $pagination->offset();
$sql = " SELECT * FROM " . TBL_EMPLOYEE;
$sql .= " WHERE is_active ='N' ";
$sql .= " LIMIT {$per_page} ";
$sql .= " OFFSET {$offset} ";
$lists = Employee::find_by_sql($sql);
$manage_lists = array();
if ($lists && is_array($lists)) {
    $i = 1;
    foreach ($lists as $list) {
        $manage_lists[$i]['id'] = $list->id;
        $manage_lists[$i]['employee_id'] = $list->id;
        $manage_lists[$i]['username'] = $list->username;
        $manage_lists[$i]['email_address'] = $list->email_address;
        $manage_lists[$i]['date_register'] = strftime(DATE_FORMAT, strtotime($list->date_register));
        $manage_lists[$i]['last_login'] = strftime(DATE_FORMAT, strtotime($list->last_login));
        $manage_lists[$i]['is_active'] = $list->is_active;
        $manage_lists[$i]['job_status'] = $list->employee_status;
        $i++;
    }
    $smarty->assign('manage_lists', $manage_lists);
开发者ID:nim94sha,项目名称:Online-Job-Portal,代码行数:31,代码来源:manage_employee_deactive.php


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