* @version $Revision$ * @author Romain OLLIVIER */ CCanDo::checkRead(); $ds = CSQLDataSource::get("std"); // Période $today = CMbDT::date(); $debut = CValue::getOrSession("debut", $today); $debut = CMbDT::date("last sunday", $debut); $fin = CMbDT::date("next sunday", $debut); $debut = CMbDT::date("+1 day", $debut); $prec = CMbDT::date("-1 week", $debut); $suiv = CMbDT::date("+1 week", $debut); // Sélection des plages $plages = array(); $curr_plage = new CPlageressource(); for ($i = 0; $i < 7; $i++) { $date = CMbDT::date("+{$i} day", $debut); $where["date"] = "= '{$date}'"; $plagesPerDay = $curr_plage->loadList($where); foreach ($plagesPerDay as $key => $value) { $plagesPerDay[$key]->loadRefs(); } $plages[$date] = $plagesPerDay; } // Liste des heures for ($i = 8; $i <= 20; $i++) { $listHours[$i] = $i; } // Etat du compte $prat = CMediusers::get();
*/ CCanDo::checkEdit(); // Liste des prats $listPrat = new CMediusers(); $listPrat = $listPrat->loadPraticiens(PERM_EDIT); // Période $today = CMbDT::date(); $debut = CValue::getOrSession("debut", $today); $debut = CMbDT::date("last sunday", $debut); $fin = CMbDT::date("next sunday", $debut); $debut = CMbDT::date("+1 day", $debut); $prec = CMbDT::date("-1 week", $debut); $suiv = CMbDT::date("+1 week", $debut); // Plage selectionnée $plage_id = CValue::getOrSession("plage_id", null); $plage = new CPlageressource(); $plage->date = $debut; $plage->load($plage_id); $plage->loadRefsNotes(); // Sélection des plages $plages = array(); for ($i = 0; $i < 7; $i++) { $date = CMbDT::date("+{$i} day", $debut); $where["date"] = "= '{$date}'"; $plagesPerDay = $plage->loadList($where); foreach ($plagesPerDay as $_plage) { $_plage->loadRefs(); } $plages[$date] = $plagesPerDay; } // Liste des heures
<?php /* $Id$ */ /** * @package Mediboard * @subpackage dPcabinet * @version $Revision$ * @author Romain Ollivier */ // Object binding $obj = new CPlageressource(); $obj->bind($_POST); $del = CValue::post('del', 0); $repeat = CValue::post('_repeat', 1); $double = CValue::post('_double', 0); $body_msg = null; $header = array(); $msgNo = null; if ($del) { $obj->load(); $deleted = 0; $not_deleted = 0; $not_found = 0; while ($repeat-- > 0) { $msg = NULL; if ($obj->plageressource_id) { if (!($msg = $obj->canDeleteEx())) { if ($msg = $obj->delete()) { $not_deleted++; } else { $msg = "plage supprimée";