diff --git a/20150816025505139706841.txt b/20150816025505139706841.txt new file mode 100644 index 0000000..14daed7 --- /dev/null +++ b/20150816025505139706841.txt @@ -0,0 +1 @@ +0612423997:salut diff --git a/controllers/internalIncs.php b/controllers/internalIncs.php index aa47c6f..ea1ecdf 100755 --- a/controllers/internalIncs.php +++ b/controllers/internalIncs.php @@ -51,4 +51,12 @@ { $this->render('internalIncs/footer'); } + + /** + * Cette fonction retourne une page js avec des constantes php sous forme js + */ + public function phptojs() + { + $this->render('internalIncs/phptojs'); + } } diff --git a/controllers/receiveds.php b/controllers/receiveds.php index 8a0b68b..517ba50 100755 --- a/controllers/receiveds.php +++ b/controllers/receiveds.php @@ -47,4 +47,28 @@ 'nbResults' => count($receiveds), )); } + + /** + * Cette fonction retourne tous les SMS reçus aujourd'hui pour la popup + * @return json : Un tableau des sms + */ + public function popup () + { + global $db; + $now = new DateTime(); + $receiveds = $db->getReceivedsSince($now->format('Y-m-d')); + + $nbReceiveds = count($receiveds); + + if (!isset($_SESSION['popup_nb_receiveds']) || ($_SESSION['popup_nb_receiveds'] > $nbReceiveds)) + { + $_SESSION['popup_nb_receiveds'] = $nbReceiveds; + } + + $newlyReceiveds = array_slice($receiveds, $_SESSION['popup_nb_receiveds']); + + echo json_encode($newlyReceiveds); + $_SESSION['popup_nb_receiveds'] = $nbReceiveds; + return true; + } } diff --git a/css/style.css b/css/style.css index dea9794..d8314a7 100755 --- a/css/style.css +++ b/css/style.css @@ -9,12 +9,19 @@ } /** POPUPS ALERT **/ -.popup-alert +.popup-alerts-container { position: fixed; left: 0; top: 0; - z-index: 9999; + z-index: 9998; + width: 100%; +} + +.popup-alert +{ + width: 50%; + position: relative; } /** FOOTER **/ diff --git a/js/custom.js b/js/custom.js index 45e9ebf..f404c51 100755 --- a/js/custom.js +++ b/js/custom.js @@ -17,5 +17,24 @@ function showMessage(message, type) } var alerthtml = '