<?php

/**
 * $Id$
 *
 * @category System
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
$log = new CLongRequestLog();
$log->_date_min = CValue::get("_date_min", CMbDt::date("-1 MONTH") . ' 00:00:00');
$log->_date_max = CValue::get("_date_max");
$log->user_id = CValue::get("user_id");
$log->duration = CValue::get("duration");
$duration_operand = CValue::get("duration_operand");
$user = new CUser();
$user->template = "0";
$order = "user_last_name, user_first_name";
$user_list = $user->loadMatchingList($order);
$smarty = new CSmartyDP();
$smarty->assign("user_list", $user_list);
$smarty->assign("log", $log);
$smarty->assign("duration_operand", $duration_operand);
$smarty->display("vw_purge_long_request_logs.tpl");
    }
    if (!isset($transmissions[$sort_key])) {
        $transmissions[$sort_key] = array("data" => array(), "action" => array(), "result" => array());
    }
    if (!isset($transmissions[$sort_key][0])) {
        $transmissions[$sort_key][0] = $_trans;
    }
    $transmissions[$sort_key][$_trans->type][] = $_trans;
}
krsort($transmissions);
$sejour->_ref_transmissions = $transmissions;
$sejour->loadRefsConsultAnesth();
$sejour->_ref_consult_anesth->loadRefConsultation();
if ($prescription_active) {
    $prescription_sejour = $sejour->loadRefPrescriptionSejour();
    $prescription_sejour->loadJourOp(CMbDt::date());
    // Chargement des lignes de prescriptions
    $prescription_sejour->loadRefsLinesMedComments();
    foreach ($prescription_sejour->_ref_lines_med_comments["med"] as $_line_med) {
        /**@var CPrescriptionLineMedicament $_line_med*/
        $_line_med->updateAlerteAntibio();
    }
    $prescription_sejour->loadRefsLinesElementsComments();
    // Chargement des prescription_line_mixes
    $prescription_sejour->loadRefsPrescriptionLineMixes();
    foreach ($prescription_sejour->_ref_prescription_line_mixes as $curr_prescription_line_mix) {
        $curr_prescription_line_mix->loadRefsLines();
        $curr_prescription_line_mix->updateAlerteAntibio();
        $curr_prescription_line_mix->_compact_view = array();
        foreach ($curr_prescription_line_mix->_ref_lines as $_line) {
            if (!$_line->solvant) {