Example #1
0
    if ($typeRepas->group_id != $group->_id) {
        $typeRepas = new CTypeRepas();
        $typerepas_id = null;
        CValue::setSession("typerepas_id", null);
    }
    $listHours = array();
    for ($i = 0; $i <= 23; $i++) {
        $key = $i <= 9 ? "0" . $i : $i;
        $listHours[$key] = $key;
    }
    $smarty->assign("listHours", $listHours);
    $smarty->assign("typeRepas", $typeRepas);
} elseif ($typeVue == 1) {
    // Chargement du plat demandé
    $plat = new CPlat();
    $plat->load($plat_id);
    if ($plat->group_id != $group->_id) {
        $plat = new CPlat();
        $plat_id = null;
        CValue::setSession("plat_id", null);
    } else {
        $plat->loadRefsFwd();
    }
    // Liste des plats
    $listPlats = new CPlat();
    $where = array("group_id" => $ds->prepare("= %", $group->_id));
    $order = "nom, type";
    $listPlats = $listPlats->loadList($where, $order);
    $smarty->assign("listPlats", $listPlats);
    $smarty->assign("plat", $plat);
} else {
Example #2
0
        $menu["total"] = 1;
        foreach ($typesPlats as $typePlat) {
            $menu["detail"][$typePlat] = 0;
        }
    } else {
        $menu["total"]++;
    }
    foreach ($typesPlats as $typePlat) {
        $plat_id =& $repas->{$typePlat};
        if ($plat_id) {
            $plat_remplacement =& $listRemplacement[$typePlat][$plat_id];
            if (isset($plat_remplacement)) {
                $plat_remplacement["nb"]++;
            } else {
                $plats2 = new CPlat();
                $plats2->load($plat_id);
                $plat_remplacement = array("obj" => $plats2, "nb" => 1);
            }
        } else {
            $menu["detail"][$typePlat]++;
        }
    }
}
// Liste des types de repas
$listTypeRepas = new CTypeRepas();
$order = "debut, fin, nom";
$listTypeRepas = $listTypeRepas->loadList(null, $order);
// Liste des services
$services = new CService();
$where = array();
$where["group_id"] = "= '{$group->_id}'";