Ejemplo n.º 1
0
 /**
  * [queryDataAction query data by use ajax get data follow flag]
  * @param  [integer] $dataid [data id]
  * @param  [integer] $cond_id [condtion id]
  * @param  [string] $flag   [to specific data is own agency or all agency]
  * @param  [integer] $agencyid [agenc id]
  * @return [array]         [collection of data]
  */
 public function queryDataAction($dataid, $cond_id, $flag, $agencyid = "")
 {
     $data_name = Data::find($dataid)->data_name;
     $qData = new QueryData();
     $rsData = $qData->queryDataNHC($this->policy_id, $dataid, $cond_id, $flag, $agencyid);
     if ($rsData) {
         if ($dataid == 11) {
             list($tb_name, $field, $datefield, $tele_id) = explode("-", $rsData['info_querydata']->table_name);
         } else {
             list($tb_name, $field, $datefield) = explode("-", $rsData['info_querydata']->table_name);
         }
         if ($dataid == 6) {
             $teleid = 'dam_id';
         } else {
             $teleid = 'tele_station_id';
         }
     } else {
         $rsData['data'] = null;
         $data_name = null;
         $datefield = null;
         $field = null;
         $teleid = null;
     }
     // var_dump($rsData);exit;
     // return View::make('querydata.ajax_test')
     // 			->with('paginator',$rsData['data']);
     return View::make('querydata.ajax_data')->with('paginator', $rsData['data'])->with('data_name', $data_name)->with('field_date', $datefield)->with('field_value', $field)->with('teleid', $teleid);
 }