本文整理汇总了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>';
}
示例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);
}