本文整理汇总了PHP中Batches::getTotalNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP Batches::getTotalNumber方法的具体用法?PHP Batches::getTotalNumber怎么用?PHP Batches::getTotalNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Batches
的用法示例。
在下文中一共展示了Batches::getTotalNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view_batches
public function view_batches($paged_vaccine = null, $offset = 0)
{
$default_offset = 0;
$data['title'] = "Stock Management::All Batches";
$data['content_view'] = "view_batches_view";
$vaccines = Vaccines::getAll_Minified();
$vaccine_plans = array();
$items_per_page = 20;
foreach ($vaccines as $vaccine)
{
//skip the vaccine that is currently being browsed through
if ($vaccine -> id == $paged_vaccine)
{
continue;
}
$total_number = Batches::getTotalNumber($vaccine -> id);
if ($total_number > $items_per_page)
{
$config['base_url'] = base_url() . "batch_management/view_batches/" . $vaccine -> id;
$config['total_rows'] = $total_number;
$config['per_page'] = $items_per_page;
$config['uri_segment'] = 5;
$config['num_links'] = 5;
$this -> pagination -> initialize($config);
$data['pagination'][$vaccine -> id] = $this -> pagination -> create_links();
}
$vaccine_plans[$vaccine -> id] = Provisional_Plan::getCurrentPlan($vaccine -> id);
$batch_years[$vaccine -> id] = Batches::getDistinctYears($vaccine -> id);
$batches[$vaccine -> id] = Batches::getVaccineBatches($vaccine -> id, $default_offset, $items_per_page);
}
if ($paged_vaccine != null)
{
$data['paged_vaccine'] = $paged_vaccine;
$total_number = Batches::getTotalNumber($paged_vaccine);
if ($total_number > $items_per_page)
{
$config['base_url'] = base_url() . "batch_management/view_batches/" . $paged_vaccine;
$config['total_rows'] = $total_number;
$config['per_page'] = $items_per_page;
$config['uri_segment'] = 4;
$config['num_links'] = 5;
$this -> pagination -> initialize($config);
$data['pagination'][$paged_vaccine] = $this -> pagination -> create_links();
}
$vaccine_plans[$paged_vaccine] = Provisional_Plan::getCurrentPlan($paged_vaccine);
$batch_years[$paged_vaccine] = Batches::getDistinctYears($paged_vaccine);
$batches[$paged_vaccine] = Batches::getVaccineBatches($paged_vaccine, $offset, $items_per_page);
}
$data['vaccine_plans'] = $vaccine_plans;
$data['batch_years'] = $batch_years;
$data['batches'] = $batches;
$this -> base_params($data);
}