當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Report::all方法代碼示例

本文整理匯總了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';
 }
開發者ID:soumyakolloon,項目名稱:report,代碼行數:32,代碼來源:reports_controller.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);
 }
開發者ID:vishnu-b,項目名稱:traffic_minimal,代碼行數:21,代碼來源:ReportController.php

示例3: array

<?php

require_once 'lib/init.php';
$reports = Report::all("updated_at DESC");
view("index", array("reports" => $reports));
開發者ID:hzy,項目名稱:Report-Generator,代碼行數:5,代碼來源:index.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $reports = $this->report->all();
     return View::make('reports.index', compact('reports'));
 }
開發者ID:Atiragram,項目名稱:poit-labs,代碼行數:10,代碼來源:ReportsController.php


注:本文中的Report::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。