本文整理汇总了PHP中Schedule::setDateStart方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::setDateStart方法的具体用法?PHP Schedule::setDateStart怎么用?PHP Schedule::setDateStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule::setDateStart方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DateTime
if (!isset($_GET['start']) or !isset($dateStart)) {
$dateStart = new DateTime(date("Y-m-d H:i:s"));
}
} else {
Tools::redirect("home");
}
} else {
Tools::redirect("home");
}
//PRISE D'UN RENDEZ-VOUS
if (isset($_POST['date-rdv']) and isset($_POST['time-rdv']) and isset($_POST['tk']) and $_POST['tk'] == $_SESSION['token2'] and $_SESSION['user']->getIdMember() != $_GET['doctor']) {
if (Tools::checkDate($_POST['date-rdv']) and Tools::checkTime($_POST['time-rdv']) and isset($_POST['valid-rdv'])) {
$sc = new Schedule();
$sc->setIdDoctor($doctor->getIdMember());
$sc->setIdMember($_SESSION['user']->getIdMember());
$sc->setDateStart(strtotime($_POST['date-rdv'] . " " . $_POST['time-rdv'] . ":00"));
$sc->setDateStop($sc->getDateStart() + $doctor->getRdvDuration() * 60);
if ($doctor->getRdvConfirm() == 0) {
$sc->setValidate(1);
}
if (isset($_POST['note'])) {
$sc->setNote(Tools::secure($_POST['note']));
}
$dayStartHour = strtotime($_POST['date-rdv'] . " " . $doctor->getStartHour('h') . ":" . $doctor->getStartHour('m') . ":00");
$result = SchedulesManager::instance()->getLastBlockedBlockHour($doctor->getIdMember(), $dayStartHour, $sc->getDateStart());
$calage = abs($sc->getDateStart() - $result);
$calage = $calage % ($doctor->getRdvDuration() * 60);
if ($calage != 0) {
$errors['rdv'] = new Error("Vous ne pouvez pas prendre un rendez-vous en dehors des heures fixées par le calendrier.");
} else {
$result = SchedulesManager::instance()->add($sc);
示例2: Error
//Ajout de i semaine (i x 7 jours x 24 heures x 3600 secondes) à la date de début
$block->setDateStart($datedebut + 24 * 3600 * 7 * $i);
//Ajout de i semaine (i x 7 jours x 24 heures x 3600 secondes) à la date de fin
$block->setDateStop($datefin + 24 * 3600 * 7 * $i);
$block->setNote($_POST['infos']);
$block->setRecursion('7');
$block->setIdDoctor($_SESSION['user']->getIdMember());
$errors['blocage-horaires'] = SchedulesManager::instance()->addBlock($block);
}
}
} else {
$errors['blocage-horaires'] = new Error("Veuillez indiquer le nombre de semaines pour la récursivité");
}
} else {
$block = new Schedule();
$block->setDateStart(strtotime($_POST['ddebut'] . " " . $_POST['hdebut'] . ":0"));
$block->setDateStop(strtotime($_POST['dfin'] . " " . $_POST['hfin'] . ":0"));
$block->setNote($_POST['infos']);
$block->setRecursion('0');
$block->setIdDoctor($_SESSION['user']->getIdMember());
$errors['blocage-horaires'] = SchedulesManager::instance()->addBlock($block);
}
} else {
$errors['blocage-horaires'] = new Error("Veuillez remplir tous les champs correctement");
}
} else {
$errors['blocage-horaires'] = new Error("Veuillez remplir tous les champs correctement");
}
}
//Suppresion d'un blocage
if (isset($_GET['del']) and isset($_GET['id'])) {
示例3: Schedule
}
}
}
if ($found) {
$previous = $sched;
break;
}
}
//si pas de créneau on récupere le précédent dans la journée (bloquage ou schedule)
if (!$found) {
$previous = SchedulesManager::instance()->getPreviousSchedule($doctor, $dayStartHour, $dateStart);
if (get_class($previous) != "Schedule") {
// pas trouvé de départ bloqué. On prend l'heure de démarrage de la journée
$previous = new Schedule();
$temp = intval(date('i', $dayStartHour));
$previous->setDateStart($dayStartHour - $temp * 60);
$previous->setDateStop($dayStartHour);
}
//$rdv[] = $previous;
}
$result = "";
$hourWidth = 800 / $nbrBlocks;
//pixel - border * 2
$baseCalcul = $hourWidth / ($duration * 60);
/** Au choix ici, on peut choisir de conserver l'organisation générale des créneaux ou s'adapter par rapport au dernier pris **/
//$dateStart = $dayStartHour + floor(($dateStart - $dayStartHour) / ($doctor->getRdvDuration() * 60)) * ($doctor->getRdvDuration() * 60);
$dateStart = $previous->getDateStop() + floor(($dateStart - $previous->getDateStop()) / ($doctor->getRdvDuration() * 60)) * ($doctor->getRdvDuration() * 60);
for ($i = 0; $i < $nbrBlocks; $i++) {
if ($dateStart + $i * $duration * 60 + $duration * 60 <= $dayStartHour or $dateStart + $i * $duration * 60 + $duration * 60 > $dayEndHour) {
continue;
}