Exemple #1
0
 public static function jenisKasus($start = null, $end = null)
 {
     $anak = ReportDAO::getAnakBetween($start, $end);
     $out = ReportDAO::getJenisKasusDefault();
     foreach ($anak as $an) {
         // jenis kasus yang berelasi dengan  anak
         foreach ($an->jenis_kasus as $jk) {
             //cek gender anak yang mengalami kasus
             if ($an->gender == "Laki-Laki") {
                 //cek jika jenis kasus merupakan standar dari LPA, bukan lainnya
                 if ($jk->other == "F") {
                     $out[$jk->jenis]["P"] = $out[$jk->jenis]["P"] + 1;
                 } else {
                     $out["Other"]["P"] = $out["Other"]["P"] + 1;
                 }
             } else {
                 if ($jk->other == "F") {
                     $out[$jk->jenis]["W"] = $out[$jk->jenis]["W"] + 1;
                 } else {
                     $out["Other"]["W"] = $out["Other"]["W"] + 1;
                 }
             }
         }
     }
     $out['Total'] = 0;
     return $out;
 }