示例#1
0
    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 {
    // Chargement du menu demandé
    $menu = new CMenu();
    $menu->load($menu_id);
    if ($menu->group_id != $group->_id) {
        $menu = new CMenu();
        $menu_id = null;