Beispiel #1
0
 public static function regionsArr()
 {
     $arr = array();
     foreach (Region::all() as $region) {
         $arr[$region->id] = $region->region;
     }
     return $arr;
 }
Beispiel #2
0
 public static function regionsFacilitiesInit()
 {
     $arr = array();
     $res = Region::rightjoin('districts AS d', 'd.id', '=', 'f.districtID')->rightjoin('regions AS r', 'r.id', '=', 'd.regionID')->select('regionID', 'region', 'f.id AS facility_id')->from('facilities AS f')->get();
     foreach ($res as $row) {
         $arr[$row->regionID][$row->facility_id] = 0;
     }
     return $arr;
 }
 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"));
 }
Beispiel #4
0
 private static function regionMonthsInit()
 {
     $regions = Location\Region::regionsArr();
     $months = \MyHTML::initMonths();
     $ret = [];
     foreach ($regions as $regID => $reg) {
         $ret[$regID] = $months;
     }
     return $ret;
 }