本文整理匯總了PHP中Incident_Model::get_incident_reports方法的典型用法代碼示例。如果您正苦於以下問題:PHP Incident_Model::get_incident_reports方法的具體用法?PHP Incident_Model::get_incident_reports怎麽用?PHP Incident_Model::get_incident_reports使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Incident_Model
的用法示例。
在下文中一共展示了Incident_Model::get_incident_reports方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
//.........這裏部分代碼省略.........
}
else
{
$form_error = TRUE;
}
}
$order = 0;
$order_string = "desc";
if( isset($_GET['order']) )
{
$order = intval($_GET['order']);
if ( $order == 0 )
{
$order_string = "desc";
} elseif ( $order == 1 ) {
$order_string = "asc";
} else {
$order = 0;
$order_string = "desc";
}
}
// Pagination
$pagination = new Pagination(array(
'query_string' => 'page',
'items_per_page' => (int) Kohana::config('settings.items_per_page_admin'),
'total_items' => ORM::factory('incident')
->join('location', 'incident.location_id', 'location.id','INNER')
->where($filter)
->count_all()
));
$incidents = Incident_Model::get_incident_reports($filter,$order_string,$pagination->sql_offset);
$location_ids = array();
foreach ($incidents as $incident)
{
$location_ids[] = $incident->location_id;
}
foreach ($incidents as $incident)
{
$incident_ids[] = $incident->id;
}
//add_param_get
$filter = " incident_id IN (".implode(',',$incident_ids).")";
$incident_persons = Incident_Model::get_incident_persons($filter);
$incident_messages = Incident_Model::get_incident_messages($filter);
$incident_incident_langs = Incident_Model::get_incident_incident_langs($filter);
$incident_incident_categories = Incident_Model::get_incident_incident_categories($filter);
//check if location_ids is not empty
if( count($location_ids ) > 0 )
{
$locations_result = ORM::factory('location')->in('id',implode(',',$location_ids))->find_all();
$locations = array();
foreach ($locations_result as $loc)
{
$locations[$loc->id] = $loc->location_name;
}
}
else
{
$locations = array();
}
$this->template->content->locations = $locations;