本文整理汇总了PHP中calendar::getPeriodName方法的典型用法代码示例。如果您正苦于以下问题:PHP calendar::getPeriodName方法的具体用法?PHP calendar::getPeriodName怎么用?PHP calendar::getPeriodName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calendar
的用法示例。
在下文中一共展示了calendar::getPeriodName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: launch
public function launch(Request $request, Response $response)
{
$response->addVar('NomPeriode', calendar::getPeriodName(time()));
$response->addVar('TypeSemaineCourante', calendar::getTypeCurrentWeek());
$response->addVar('SemaineCourante', calendar::getCurrentWeek());
$this->render("./lib/template/indexSuccess.php");
$this->printOut();
}
示例2: launch
public function launch(Request $request, Response $response)
{
$message = null;
$new_name = null;
$delete_confirmation = null;
if ($_SESSION['statut'] == "administrateur") {
if ($request->getParam('operation')) {
check_token(false);
if ($request->getParam('operation') == "delete") {
if ($request->getParam('confirm_delete')) {
if ($request->getParam('id_calendrier')) {
$calendrier = new Calendrier();
$calendrier->id = $request->getParam('id_calendrier');
if (!$calendrier->delete()) {
$message = "Impossible de supprimer le calendrier";
}
}
} else {
if ($request->getParam('id_calendrier')) {
$delete_confirmation = "<form action=\"index.php?action=calendriermanager\" method=\"post\">" . add_token_field(false) . "\r\n\t\t\t\t\t\t\t\t\t\t\t<input name=\"operation\" type=\"hidden\" value=\"delete\">\r\n\t\t\t\t\t\t\t\t\t\t\t<input name=\"id_calendrier\" type=\"hidden\" value=\"" . $request->getParam('id_calendrier') . "\">\r\n\t\t\t\t\t\t\t\t\t\t\t<p>La suppression d'un calendrier entraîne la suppression de toutes les périodes calendaires qui en dépendent !</p>\r\n\t\t\t\t\t\t\t\t\t\t\t<input name=\"confirm_delete\" type=\"submit\" style=\"width:200px;\" value=\"Confirmer la suppression\">\r\n\t\t\t\t\t\t\t\t\t\t</form>";
}
}
} else {
if ($request->getParam('operation') == "new") {
if ($request->getParam('nom_calendrier')) {
$calendrier = new Calendrier();
$calendrier->nom = $request->getParam('nom_calendrier');
if (!$calendrier->save()) {
$message = "Impossible de créer le calendrier";
}
}
} else {
if ($request->getParam('operation') == "modify_name") {
if ($request->getParam('new_name')) {
$calendrier = new Calendrier();
$calendrier->nom = $request->getParam('new_name');
$calendrier->id = $request->getParam('id_calendrier');
if (!$calendrier->update()) {
$message = "Impossible de modifier le nom du calendrier";
}
} else {
if ($request->getParam('id_calendrier')) {
$new_name = "<form action=\"index.php?action=calendriermanager\" method=\"post\">" . add_token_field(false) . "\r\n\t\t\t\t\t\t\t\t\t\t\t<input name=\"operation\" type=\"hidden\" value=\"modify_name\">\r\n\t\t\t\t\t\t\t\t\t\t\t<input name=\"id_calendrier\" type=\"hidden\" value=\"" . $request->getParam('id_calendrier') . "\">\r\n\t\t\t\t\t\t\t\t\t\t\t<input name=\"new_name\" type=\"text\" style=\"width:200px;\" value=\"" . Calendrier::getNom($request->getParam('id_calendrier')) . "\">\r\n\t\t\t\t\t\t\t\t\t\t\t<input name=\"bouton_valider_new_name\" type=\"submit\" style=\"width:200px;\" value=\"Modifier le nom du calendrier\">\r\n\t\t\t\t\t\t\t\t\t\t</form>";
}
}
} else {
if ($request->getParam('operation') == "edit_classes") {
if ($request->getParam('id_calendrier')) {
$id_calendrier = $request->getParam('id_calendrier');
$jointure = new jointure_calendar_classes();
$periodes = new PeriodeCalendaire();
$classe = new Classe();
$jointure->id_calendar = $id_calendrier;
$jointure->delete_classes();
if ($request->getParam('classes_' . $id_calendrier)) {
$liste_classes = null;
foreach ($request->getParam('classes_' . $id_calendrier) as $id_classe) {
$classe->id = $id_classe;
$liste_classes .= $classe->getShortName() . ";";
$jointure->id_classe = $id_classe;
if (!$jointure->save_classe()) {
$message .= "Une classe est déjà affectée dans un autre calendrier<br/>";
}
}
// ================ Compatibilité pour les autres modules GEPi
$periodes->id_calendar = $id_calendrier;
$periodes->classes_concernees = $liste_classes;
$periodes->update_classes();
}
}
}
}
}
}
}
calendar::updateTables();
}
$response->addVar('delete_confirmation', $delete_confirmation);
$response->addVar('new_name', $new_name);
$response->addVar('message', $message);
$response->addVar('NomPeriode', calendar::getPeriodName(time()));
$response->addVar('TypeSemaineCourante', calendar::getTypeCurrentWeek());
$response->addVar('SemaineCourante', calendar::getCurrentWeek());
$response->addVar('calendrier', calendar::GenerateCalendarList());
$this->render("./lib/template/calendriermanagerSuccess.php");
$this->printOut();
}
示例3: launch
//.........这里部分代码省略.........
$type_edt = "classe";
} else {
if ($request->getParam('id_salle')) {
$id = $request->getParam('id_salle');
$type_edt = "salle";
}
}
}
if ($request->getParam('message') != "") {
$_SESSION["message"] = "";
}
// =================== Gérer la bascule entre emplois du temps périodes et emplois du temps semaines.
if ($request->getParam('bascule_edt')) {
$_SESSION['bascule_edt'] = $bascule_edt;
}
if (!isset($_SESSION['bascule_edt'])) {
$_SESSION['bascule_edt'] = 'periode';
}
if ($_SESSION['bascule_edt'] == 'periode') {
if (PeriodesExistent()) {
if ($period_id != NULL) {
$_SESSION['period_id'] = $period_id;
}
if (!isset($_SESSION['period_id'])) {
$_SESSION['period_id'] = ReturnIdPeriod(date("U"));
}
if (!PeriodExistsInDB($_SESSION['period_id'])) {
$_SESSION['period_id'] = ReturnFirstIdPeriod();
}
$DisplayPeriodBar = true;
$DisplayWeekBar = false;
} else {
$DisplayWeekBar = false;
$DisplayPeriodBar = false;
$_SESSION['period_id'] = 0;
}
} else {
$DisplayPeriodBar = false;
$DisplayWeekBar = true;
if ($week_selected != NULL) {
$_SESSION['week_selected'] = $week_selected;
}
if (!isset($_SESSION['week_selected'])) {
$_SESSION['week_selected'] = date("W");
}
}
// =================== Forcer l'affichage d'un edt si l'utilisateur est un prof
if (!$id) {
if ($_SESSION['statut'] == "professeur" and $type_edt == "prof") {
$id = $_SESSION['login'];
$_GET["login_edt"] = $id;
$_GET["type_edt_2"] = "prof";
$type_edt_2 = "prof";
$visioedt = "prof1";
}
}
// =================== Construire les emplois du temps
if ($id) {
if ($type_edt == "prof") {
$tab_data = ConstruireEDTProf($id, $_SESSION['period_id']);
$entetes = ConstruireEnteteEDT();
$creneaux = ConstruireCreneauxEDT();
FixColumnPositions($tab_data, $entetes);
// en cours de devel
$DisplayEDT = true;
} else {
if ($type_edt == "classe") {
$tab_data = ConstruireEDTClasse($id, $_SESSION['period_id']);
$entetes = ConstruireEnteteEDT();
$creneaux = ConstruireCreneauxEDT();
$DisplayEDT = true;
} else {
if ($type_edt == "salle") {
$tab_data = ConstruireEDTSalle($id, $_SESSION['period_id']);
$entetes = ConstruireEnteteEDT();
$creneaux = ConstruireCreneauxEDT();
//FixColumnPositions($tab_data, $entetes); // en cours de devel
$DisplayEDT = true;
} else {
if ($type_edt == "eleve") {
$tab_data = ConstruireEDTEleve($id, $_SESSION['period_id']);
$entetes = ConstruireEnteteEDT();
$creneaux = ConstruireCreneauxEDT();
$DisplayEDT = true;
} else {
$DisplayEDT = false;
}
}
}
}
} else {
$DisplayEDT = false;
}
$response->addVar('message', $message);
$response->addVar('NomPeriode', calendar::getPeriodName(time()));
$response->addVar('TypeSemaineCourante', calendar::getTypeCurrentWeek());
$response->addVar('SemaineCourante', calendar::getCurrentWeek());
$this->render("./lib/template/edtSuccess.php");
$this->printOut();
}