本文整理匯總了PHP中Report::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Report::all方法的具體用法?PHP Report::all怎麽用?PHP Report::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Report
的用法示例。
在下文中一共展示了Report::all方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
/**
** Function to plot graphs
***/
public function index()
{
if (isset($_POST) && !empty($_POST['datepickerfrom']) && !empty($_POST['datepickerto'])) {
$datefrom = $_POST['datepickerfrom'];
$dateto = $_POST['datepickerto'];
}
$projectsArray = Project::all();
/**Get all projects from databa se */
$result_array = Report::all();
if (!empty($result_array)) {
foreach ($result_array as $key => $res) {
$project[$key]['name'] = $res['name'];
$projects[$key]['id'] = $res['id'];
}
} else {
echo '<p class="error_msg">No data available in this range</p> <p>Please click <a href="?controller=pages&action=reportdata">Report</a> to select another range</p>';
exit;
}
$date_range = $this->getDatesFromRange($datefrom, $dateto);
$xaxis_data = json_encode($date_range);
for ($rs = 0; $rs < count($project); $rs++) {
foreach ($date_range as $dt) {
$bugs[$rs] = Report::find($projects[$rs]['id'], $dt);
$project[$rs]['data'][] = intval($bugs[$rs][$projects[$rs]['id']]['bugs']);
}
}
$result_array = json_encode($project);
require_once 'views/reports/index.php';
}
示例2: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
/*$reports = [];
$trafficjams = TrafficJam::where('clear_by', '>=', date('Y-m-d H:i:s', time()))->get();
foreach ($trafficjams as $value) {
array_push($reports, $value->report);
}*/
$reports = [];
$report = Report::all();
foreach ($report as $key) {
if ($key->clear_by >= date('Y-m-d H:i:s', time()) || $key->type == 'Accident' || $key->type == 'Road Block') {
array_push($reports, $key);
}
}
return Response::json(array('report' => $reports), 200);
}
示例3: array
<?php
require_once 'lib/init.php';
$reports = Report::all("updated_at DESC");
view("index", array("reports" => $reports));
示例4: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$reports = $this->report->all();
return View::make('reports.index', compact('reports'));
}