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


PHP Division::count方法代码示例

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


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

示例1: filters

 public function filters($offset = 0)
 {
     $string = '%' . $this->input->post('division') . '%';
     $condiciones = '';
     $valores = array();
     if ($string != '%%') {
         $condiciones .= " division LIKE ?";
         $valores['division'] = $string;
     }
     $conditions = array_merge(array($condiciones), $valores);
     $config['base_url'] = site_url('divisiones/index');
     $config['total_rows'] = Division::count(array('conditions' => $conditions));
     $config['per_page'] = '10';
     $config['num_links'] = '10';
     $config['first_link'] = '← primero';
     $config['last_link'] = 'último →';
     $this->load->library('pagination', $config);
     $divisiones = Division::all(array('conditions' => $conditions, 'limit' => $config['per_page'], 'offset' => $offset));
     $this->table->set_heading('Orden', 'División', 'Acciones');
     foreach ($divisiones as $division) {
         $this->table->add_row($division->id, $division->division, anchor('divisiones/editar/' . $division->id, img('static/img/icon/pencil.png'), 'class="tipwe" title="Editar"') . ' ' . anchor('divisiones/eliminar/' . $division->id, img('static/img/icon/trash.png'), 'class="tipwe eliminar" title="Eliminar"'));
     }
     echo $this->table->generate();
     echo '<div class="pagination">';
     echo $this->pagination->create_links();
     echo '</div>';
 }
开发者ID:ricardocasares,项目名称:Cobros,代码行数:27,代码来源:divisiones.php

示例2: divisions

 function divisions($office_id = '')
 {
     $o = new Office_m();
     $o->get_by_office_id($office_id);
     $data['page_name'] = '<b>Divisions of "' . $o->office_name . '"</b>';
     $data['msg'] = '';
     $this->load->library('pagination');
     $divisions = new Division();
     $config['base_url'] = base_url() . 'training_manage/course';
     $config['total_rows'] = $divisions->count();
     $config['per_page'] = '15';
     $config['full_tag_open'] = '<p>';
     $config['full_tag_close'] = '</p>';
     $this->pagination->initialize($config);
     // How many related records we want to limit ourselves to
     $limit = $config['per_page'];
     // Set the offset for our paging
     $offset = $this->uri->segment(4);
     $divisions->where('office_id', $office_id);
     $divisions->order_by('name');
     $data['rows'] = $divisions->get($limit, $offset);
     $data['office_id'] = $office_id;
     $data['page'] = $this->uri->segment(3);
     $data['main_content'] = 'divisions';
     return View::make('includes/template', $data);
 }
开发者ID:billyriantono,项目名称:ihrmis,代码行数:26,代码来源:office_manage.php


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