当前位置: 首页>>代码示例>>PHP>>正文


PHP Calendar::instance方法代码示例

本文整理汇总了PHP中Calendar::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::instance方法的具体用法?PHP Calendar::instance怎么用?PHP Calendar::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Calendar的用法示例。


在下文中一共展示了Calendar::instance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: instance

 /** 
  * @brief	Retourne l'instance de la classe et permet d'instancier un Calendar si c'est le premier appel.
  * @return	Calendar		Retourne l'instance de la classe
  */
 public static function instance()
 {
     if (self::$instance == null) {
         self::$instance = new Calendar();
     }
     return self::$instance;
 }
开发者ID:AymericFrey,项目名称:ProjetBooking,代码行数:11,代码来源:Calendar.class.php

示例2: defined

<?php

defined("_nova_district_token_") or die('');
//affichage partie gauche
$days = "";
$nbr = 14;
$startDay = $day - 5 * 24 * 3600;
//3 jours avant le start
for ($i = 0; $i < $nbr; $i++) {
    $w = Calendar::instance()->getDays()[intval(date('w', $startDay + $i * 24 * 3600))];
    $jour = date('d', $startDay + $i * 24 * 3600);
    $mois = Calendar::instance()->getMonths()[date('n', $startDay + $i * 24 * 3600) - 1];
    $addClass = "";
    if ($startDay + $i * 24 * 3600 == $day) {
        $addClass = " daily-day-selected";
    }
    if ($i + 1 == $nbr) {
        $addClass .= " daily-day-last";
    }
    $days .= "<div class='daily-day" . $addClass . "'><a href='index.php?p=gestion&chosen-date=" . date('Y-m-d', $startDay + $i * 24 * 3600) . "'>" . $w . " " . $jour . " " . $mois . "</a></div>";
}
?>
<script type='text/javascript'>
$(document).ready(function() {
	$(".daily-schedule-delete").click(function(){
		var url = $(this).attr("href");
		App.Dialog.add(
			"Etes-vous sûr de vouloir supprimer ce rendez-vous ?", 
			"<br />Vous supprimerez définitivement ce rendez-vous, le client en sera informé.", 
			new Array('oui', 'annuler'),
			function (result){ if(result) document.location.href = url; }
开发者ID:AymericFrey,项目名称:ProjetBooking,代码行数:31,代码来源:gestion-daily.php

示例3: Error

        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);
            if (Tools::getClass($result) == "Error") {
                $errors["rdv"] = $result;
            } else {
                $errors['rdv'] = new Error("Le rendez-vous a bien été pris auprès de votre médecin", "info");
            }
        }
    } else {
        $errors['rdv'] = new Error("Les informations entrées ne sont pas valides");
    }
}
//AJOUT DU MEDECIN AUX FAVORIS !
if (isset($_POST['add-to-favorite'])) {
    $errors['add-to-favorite'] = UsersManager::instance()->addDoctorToFavorites($_SESSION['user']->getIdMember(), $doctor->getIdMember());
}
if (isset($_POST['remove-to-favorite'])) {
    $errors['add-to-favorite'] = UsersManager::instance()->removeDoctorFromFavorites($_SESSION['user']->getIdMember(), $doctor->getIdMember());
}
$favoriteButtonAction = "add";
$titleButtonAction = "Ajout aux favoris";
if (UsersManager::instance()->checkFavoritesDoc($_SESSION['user']->getIdMember(), $doctor->getIdMember())) {
    $favoriteButtonAction = "remove";
    $titleButtonAction = "Retirer des favoris";
}
//RECUPERATION DU CALENDRIER
$calendrier = Calendar::instance()->getDoctorCalendar($dateStart, $doctor);
//On inclut la vue
include dirname(__FILE__) . '/../views/booking.php';
开发者ID:AymericFrey,项目名称:ProjetBooking,代码行数:31,代码来源:booking.php

示例4: header

if (!isset($_SESSION['user']) or $_SESSION['user']->getIdMember() <= 0 && Tools::getParentClass($_SESSION['user']) != "Doctor") {
    header("Location: ../index.php");
}
require_once dirname(__FILE__) . '/../../libs/html2pdf/html2pdf.class.php';
if (isset($_GET['date']) and Tools::checkDate($_GET['date'])) {
    $temp = explode('-', $_GET['date']);
    if (isset($temp[0]) and isset($temp[1]) and isset($temp[2])) {
        $day = mktime(0, 0, 0, intval($temp[1]), intval($temp[2]), intval($temp[0]));
    }
}
//controle d'acces 2
if (!isset($day)) {
    header("Location: ../index.php");
}
$dailyScheduleList = SchedulesManager::instance()->getScheduleList($_SESSION['user']->getIdMember(), $day, $day + 24 * 3600);
$content = "\n\t\t<table style='width: 100%;'>\n\t\t\t<tr>\n\t\t\t\t<td style='width: 65%'></td>\n\t\t\t\t<td style='text-align: center; background-color: #2a7edd; color: white; padding: 6px; border-radius: 5px'>\n\t\t\t\t\tBOOKING\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td style='width: 65%'></td>\n\t\t\t\t<td style='text-align: right; padding: 6px; color: #2c2c2c; '>\n\t\t\t\t\tEmploi du temps du " . Calendar::instance()->getDays()[date('w', $day)] . " " . date("d-m-Y", $day) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td style='width: 65%'></td>\n\t\t\t\t<td style='text-align: right; padding-right: 6px; color: grey; font-size: 80%'>\n\t\t\t\t\tgénéré le " . Calendar::instance()->getDays()[date('w', time())] . " " . date("d-m-Y", time()) . " à " . date("H\\h:i", time()) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<br /><br /><br />\n\t\t<br /><br /><br />\n\t";
if (count($dailyScheduleList) > 0) {
    foreach ($dailyScheduleList as $schedule) {
        $sexe = "homme";
        if (isset($schedule['sexe'])) {
            $sexe = $schedule['sexe'];
        }
        $infos = "Aucune note particulière sur ce rendez-vous";
        if ($schedule['note'] != "") {
            $infos = $schedule['note'];
        }
        $content .= "\n\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='width: 10%; padding: 4px; color: #e36b00'>" . date("H:i", $schedule['date_start']) . "</td>\n\t\t\t\t\t<td rowspan='3'><img src='../img/" . $sexe . "_icon.jpg' style='height: 75px; margin-right: 20px'/></td>\n\t\t\t\t\t<td style='padding: 4px;font-size: 110%'><span style='text-transform: uppercase; font-size: 110%'>" . $schedule['nom'] . "</span> \n\t\t\t\t\t" . ucfirst($schedule['prénom']) . " (age)</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='width: 10%; padding: 4px; color: #d59054'>" . ($schedule['date_stop'] - $schedule['date_start']) / 60 . "mn</td>\n\t\t\t\t\t<td style='padding: 4px; color: grey'>\n\t\t\t\t\t\t" . $schedule['téléphone'] . "<br />\n\t\t\t\t\t\t" . $schedule['ville'] . " (" . $schedule['code postal'] . ")\n\t\t\t\t\t\t<br />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='width: 10%; padding: 4px;'></td>\n\t\t\t\t\t<td style='padding: 4px; color: grey'>\n\t\t\t\t\t\t" . $infos . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<hr style='height: 1px; border: none; background: lightgrey' />";
    }
} else {
    $content .= "<table style='width:100%'>\n\t\t<tr><td style='text-align: center; width: 100%'>Aucun rendez-vous prévu ce jour</td></tr>\n\t</table>";
}
开发者ID:AymericFrey,项目名称:ProjetBooking,代码行数:31,代码来源:pdf.php


注:本文中的Calendar::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。