コード例 #1
0
ファイル: District.php プロジェクト: CHAIUganda/eiddashboard
 public static function districtsArr()
 {
     $arr = array();
     foreach (District::all() as $d) {
         $arr[$d->id] = $d->district;
     }
     return $arr;
 }
コード例 #2
0
ファイル: District.php プロジェクト: CHAIUganda/vl_dashboard
 public static function distsNregs()
 {
     $res = District::all();
     $ret = [];
     foreach ($res as $rw) {
         $ret[$rw->id] = $rw->regionID;
     }
     return $ret;
 }
コード例 #3
0
ファイル: Facility.php プロジェクト: CHAIUganda/eiddashboard
 public static function facilitiesByDistrictsArr2()
 {
     $arr = array();
     $districts = Location\District::districtsArr();
     foreach (Facility::select('id', 'facility', 'districtID')->get() as $f) {
         $d_name = array_key_exists($f->districtID, $districts) ? $districts[$f->districtID] : '';
         $v = json_encode(['facility_id' => $f->id, 'facility_name' => $f->facility, 'district' => $d_name], JSON_FORCE_OBJECT);
         $arr[$d_name][$v] = $f->facility;
     }
     ksort($arr);
     return $arr;
 }
コード例 #4
0
 public function show($time = "")
 {
     if (empty($time)) {
         $time = date("Y");
     }
     $regions = Region::regionsArr();
     $districts = District::districtsArr();
     $facility_levels = FacilityLevel::facilityLevelsArr();
     $count_positives = Sample::countPositives($time);
     $av_positivity = Sample::avPositivity($time);
     $count_positives_arr = Sample::countPositives2($time);
     $av_positivity_arr = Sample::avPositivity2($time);
     return view('db/show', compact("time", "regions", "districts", "facility_levels", "count_positives", "av_positivity", "count_positives_arr", "av_positivity_arr"));
 }
コード例 #5
0
ファイル: Sample.php プロジェクト: CHAIUganda/vl_dashboard
 private static function districtMonthsInit()
 {
     $districts = Location\District::districtsArr();
     $months = \MyHTML::initMonths();
     $ret = [];
     foreach ($districts as $dID => $d) {
         $ret[$dID] = $months;
     }
     return $ret;
 }