$anesthesistes = $mediuser->loadAnesthesistes(PERM_READ); $consult = new CConsultation(); // Liste des admissions par jour //foreach ($ds->loadHashList($sql) as $day => $num1) { // $days[$day]["num1"] = $num1; //} // Récupération du nombre de consultations par jour $ljoin = array(); $ljoin["plageconsult"] = "consultation.plageconsult_id = plageconsult.plageconsult_id"; $where = array(); $where["consultation.patient_id"] = "IS NOT NULL"; $where["consultation.annule"] = "= '0'"; $where["plageconsult.chir_id"] = CSQLDataSource::prepareIn(array_keys($anesthesistes)); $where["plageconsult.date"] = "BETWEEN '{$month_min}' AND '{$nextmonth}'"; $order = "plageconsult.date"; $groupby = "plageconsult.date"; $fields = array("plageconsult.date"); $listMonth = $consult->countMultipleList($where, $order, $groupby, $ljoin, $fields); foreach ($listMonth as $_day) { $days[$_day["date"]]["total"] = $_day["total"]; } // Création du template $smarty = new CSmartyDP(); $smarty->assign("hier", $hier); $smarty->assign("demain", $demain); $smarty->assign("date", $date); $smarty->assign("lastmonth", $lastmonth); $smarty->assign("nextmonth", $nextmonth); $smarty->assign("bank_holidays", $bank_holidays); $smarty->assign("days", $days); $smarty->display('inc_vw_all_preadmissions.tpl');