[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/tests/ -> popup_alert.php (source)

   1  <?php
   2  
   3  
   4     /**
   5     
   6     * Ouvre un popup d'alert (message se trouvant sur wawadeb)
   7     * @Version $Id: popup_alert.php 6166 2011-02-26 13:33:55Z keyser $ 
   8     * @Projet LCS / SambaEdu 
   9     * @auteurs Philippe Chadefaux  MrT
  10     * @Licence Distribue selon les termes de la licence GPL
  11     * @note
  12     * Modifications proposées par Sébastien Tack (MrT)
  13     * Optimisation du lancement des scripts bash par la technologie asynchrone Ajax.
  14   
  15     
  16     */
  17  
  18     /**
  19  
  20     * @Repertoire: /tests/
  21     * file: popup_alert.php
  22     */
  23  
  24  
  25  
  26  require_once ('entete_ajax.inc.php');
  27    //######################### MISES A JOUR ######################################## ##/
  28  
  29          
  30      // Ajout popup d'alerte
  31      include ("fonc_outils.inc.php");
  32      
  33      entree_table_param_exist(url_popup_alert,"http://wwdeb.crdp.ac-caen.fr/mediase3/index.php/Alerte_popup.html",4,"Url du popup alerte");
  34      entree_table_param_exist(tag_popup_alert,0,4,"Tag du popup alerte");
  35      // On relit la table
  36      require ("config.inc.php");
  37      system("cd /tmp; wget -q --tries=1 --timeout=2 $url_popup_alert");
  38         if (file_exists("/tmp/Alerte_popup.html")) {
  39              $lines = file("/tmp/Alerte_popup.html");
  40              foreach ($lines as $line_num => $line) {
  41              $line=trim($line);
  42              if(preg_match("/([0-9]{2})\/([0-9]{2})\/([0-9]{4})/","$line",$matche)) {
  43                  // test la persence du tag precedent
  44                  $tag_alerte=$matche[1].$matche[2].$matche[3];
  45                  if ($tag_alerte==$tag_popup_alert) {
  46                      $ok_alert="0";
  47                  } else {    
  48                                  $ok_alert="1";
  49                  }    
  50                      }
  51              }
  52      }                                                
  53      @unlink("/tmp/Alerte_popup.html");       
  54  
  55      $rep = "$ok_alert"; 
  56      
  57      if ($ok_alert=="1") {
  58          setparam("tag_popup_alert",$tag_alerte);
  59          $rep = "window.open('$url_popup_alert','PopUp','width=500,height=350,location=no,status=no,toolbars=no,scrollbars=no,left=100,top=80');";
  60      }
  61      
  62      die($rep);
  63      
  64  ?>


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1