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