예제 #1
0
 * @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();
$service_id = CValue::getOrSession("service_id");
$chambre_id = CValue::getOrSession("chambre_id");
$lit_id = CValue::getOrSession("lit_id");
$group = CGroups::loadCurrent();
// Chargement de la chambre à ajouter/editer
$chambre = new CChambre();
$chambre->service_id = $service_id;
$chambre->load($chambre_id);
$chambre->loadRefsNotes();
$chambre->loadRefService();
foreach ($chambre->loadRefsLits(true) as $_lit) {
    $_lit->loadRefsNotes();
}
// Récupération des chambres/services
$where = array();
$where["group_id"] = "= '{$group->_id}'";
$order = "nom";
$service = new CService();
$services = $service->loadListWithPerms(PERM_READ, $where, $order);
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("services", $services);
$smarty->assign("chambre", $chambre);
$smarty->assign("tag_chambre", CChambre::getTagChambre($group->_id));
$smarty->assign("tag_lit", C**t::getTagLit($group->_id));
$smarty->display("inc_vw_chambre.tpl");
예제 #2
0
        $chambre_id = $lit->chambre_id;
    }
    $sejours_chambre[$chambre_id][] = $sejour;
}
for ($num = 0; $num <= 1; $num++) {
    /** @var CChambre[] $chambres */
    if ($num == 0) {
        $chambres = $chambres_uhcd;
        $nom = "uhcd";
    } else {
        $chambres = $chambres_urgences;
        $nom = "urgence";
    }
    foreach ($chambres as $chambre) {
        $chambre->loadRefService();
        $chambre->loadRefsLits();
        if (!count($chambre->_ref_lits)) {
            unset($chambres[$chambre->_id]);
            continue;
        }
        $chambre->loadRefEmplacement();
        $grille[$nom][$chambre->_ref_emplacement->plan_y][$chambre->_ref_emplacement->plan_x] = $chambre;
        $emplacement = $chambre->_ref_emplacement;
        if ($emplacement->hauteur - 1) {
            for ($a = 0; $a <= $emplacement->hauteur - 1; $a++) {
                if ($emplacement->largeur - 1) {
                    for ($b = 0; $b <= $emplacement->largeur - 1; $b++) {
                        if ($b != 0) {
                            unset($grille[$nom][$emplacement->plan_y + $a][$emplacement->plan_x + $b]);
                        } elseif ($a != 0) {
                            unset($grille[$nom][$emplacement->plan_y + $a][$emplacement->plan_x + $b]);
예제 #3
0
 * @category Hospi
 * @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();
$group = CGroups::loadCurrent();
$chambre_id = CValue::getOrSession("chambre_id");
$lit_id = CValue::getOrSession("lit_id");
// Récupération de la chambre à ajouter/editer
$chambre = new CChambre();
$chambre->load($chambre_id);
$chambre->loadRefsNotes();
$chambre->loadRefService();
/** @var CChambre[] $chambres */
$chambres = $chambre->loadRefsLits(true);
foreach ($chambres as $_chambre) {
    $_chambre->loadRefsNotes();
}
if (!$chambre->_id) {
    CValue::setSession("lit_id", 0);
}
// Chargement du lit à ajouter/editer
$lit = new C**t();
$lit->load($lit_id);
$lit->loadRefChambre();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("_lit", $lit);
$smarty->assign("tag_lit", C**t::getTagLit($group->_id));
$smarty->assign("chambre", $chambre);