|
|
@@ -0,0 +1,64 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+class printPaper
|
|
|
+{
|
|
|
+ public static function switch(string $_page, int $_id){
|
|
|
+ switch ($_page) {
|
|
|
+ case 'qrcode-event':
|
|
|
+ self::qrcodeEmargement($_id);
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ echo NULL;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private static function searchElementPage(string $_element){
|
|
|
+ return "{{" . $_element . "}}";
|
|
|
+ }
|
|
|
+
|
|
|
+ private static function show(string $_page, array $_search, array $_replace){
|
|
|
+ $template = DIR_PRINT . "cms." . $_page . ".html";
|
|
|
+ if(file_exists($template)){
|
|
|
+ $pageEmpty = file_get_contents($template);
|
|
|
+ $pageCompleted = $pageEmpty;
|
|
|
+ echo str_replace($_search, $_replace, $pageCompleted);
|
|
|
+ } else {
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private static function qrcodeEmargement(int $_idEvent){
|
|
|
+ $event = event::getFiche($_idEvent);
|
|
|
+
|
|
|
+ if($event["actif"] == 0){
|
|
|
+ $alert = '<div class="alert alert-danger" role="alert">Cet évènement est désactivé et non visible des salariés.</div>';
|
|
|
+ } else {
|
|
|
+ $alert = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ $explication = "Pour vous émarger il vous faut scanner ce QRCode ou vous rendre sur <span style='font-weight : bold;'>https://" . DOMAIN_EVENTS . "</span> dans le navigateur de votre mobile.<br />";
|
|
|
+ $explication .= "Une fois sur l'app mobile, il vous faut renseigner votre <span style='font-weight : bold;'>matricule Capgemini</span> (composé de chiffres et présent sur la fiche paie) ou votre <span style='font-weight : bold;'>identifiant Capgemini</span> (qui est généralement la première lettre de votre prénom et votre nom) et votre <span style='font-weight : bold;'>date de naissance</span> (celle renseignée sur le site).<br />";
|
|
|
+ $explication .= "";
|
|
|
+
|
|
|
+ $search = array(
|
|
|
+ self::searchElementPage("TITRE"),
|
|
|
+ self::searchElementPage("PERIODE"),
|
|
|
+ self::searchElementPage("QRCODE"),
|
|
|
+ self::searchElementPage("EXPLICATION"),
|
|
|
+ self::searchElementPage("ALERTE")
|
|
|
+ );
|
|
|
+
|
|
|
+ $replace = array(
|
|
|
+ $event["titre"], // TITRE
|
|
|
+ "DU " . core::convertDate($event["startDate"]) . " AU " . core::convertDate($event["endDate"]), // PERIODE
|
|
|
+ event::getQRCode($event["id"], "400"), // QRCODE
|
|
|
+ $explication, // EXPLICATION
|
|
|
+ $alert // ALERTE
|
|
|
+ );
|
|
|
+
|
|
|
+ self::show("qrcode-event", $search, $replace);
|
|
|
+ }
|
|
|
+}
|