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


PHP Batches::getDistinctYears方法代码示例

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


在下文中一共展示了Batches::getDistinctYears方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
	}
开发者ID:EuniceManyasi,项目名称:DVI,代码行数:60,代码来源:batch_management.php

示例2: view_batches

 public function view_batches()
 {
     $data['title'] = "Stock Management::All Batches";
     $data['content_view'] = "view_batches_view";
     $vaccines = Vaccines::getAll_Minified();
     $vaccine_plans = array();
     foreach ($vaccines as $vaccine) {
         $vaccine_plans[$vaccine->id] = Provisional_Plan::getCurrentPlan($vaccine->id);
         $batch_years[$vaccine->id] = Batches::getDistinctYears($vaccine->id);
     }
     $data['vaccine_plans'] = $vaccine_plans;
     $data['batch_years'] = $batch_years;
     $this->base_params($data);
 }
开发者ID:EuniceManyasi,项目名称:DVI,代码行数:14,代码来源:batch_management.php


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