phpDocumentor VFront
Stats
[ class tree: VFront ] [ index: VFront ] [ all elements ]

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /**
  3. * Da questo file è possibile leggere e creare nuove statistiche.
  4. * Le statistiche sul DB sono eseguite per mezzo di query registrate in database nella tabella stats
  5. @desc File di menu per le statistiche sul database
  6. @package VFront
  7. @subpackage Stats
  8. @author Mario Marcello Verona <marcelloverona@gmail.com>
  9. @copyright 2007 Mario Marcello Verona
  10. @version 0.90
  11. @license http://www.gnu.org/licenses/gpl.html GNU Public License
  12. */
  13.  
  14.  
  15. require("../inc/conn.php");
  16. require("../inc/layouts.php");
  17. require("../inc/func.comuni.php");
  18. require("../inc/func.frontend.php");
  19.  
  20.  
  21. $files=array("sty/admin.css");
  22.  
  23. echo openLayout1("Statistiche Database",$files);
  24.  
  25.  echo "<div id=\"briciole\"><a href=\"../admin/index.php\">home amministrazione</a> &raquo; statistiche database</div>\n";
  26.  
  27.  echo "<br /><img src=\"../img/statistiche.gif\" alt=\"statistiche\" class=\"img-float\" />\n";
  28.  
  29.  echo "<h1>Statistiche Database</h1>\n";
  30.   
  31.  
  32.      // SEZIONE FEEDBACK
  33.      
  34.      if(isset($_GET['feed'])){
  35.         switch($_GET['feed']){
  36.             
  37.             case 'okdel'$feed_str="<p class=\"feed-mod-ok\">Statistica eliminata correttamente</p>\n";
  38.             break;
  39.             
  40.             case 'kodel'$feed_str="<p class=\"feed-mod-ko\">Errore nella eliminazione della statistica!</p>\n";
  41.             break;
  42.             
  43.             case 'konew'$feed_str="<p class=\"feed-mod-ko\">Errore nella creazione della statistica!</p>\n";
  44.             break;
  45.             
  46.             case 'komod'$feed_str="<p class=\"feed-mod-ko\">Errore nella modifica della statistica!</p>\n";
  47.             break;
  48.             
  49.             case 'okmod'$feed_str="<p class=\"feed-mod-ok\">Statistica modificata correttamente</p>\n";
  50.             break;
  51.             
  52.         }
  53.         
  54.      }
  55.      
  56.      else $feed_str='';
  57.  
  58.  
  59.      echo $feed_str;
  60.  
  61.      echo "<p><a href=\"stat.personal.php?new\">Crea una nuova statistica</a></p>\n";
  62.  
  63.     echo "<ul>
  64.         <li><a href=\"stat.count_table.php\">Dati popolamento tabelle</a></li>
  65.     </ul>";
  66.     
  67.     
  68.     
  69.     
  70.     // PRENDI LE STAT PERSONALIZZATE
  71.     
  72.     $sql "SELECT s.id_stat, s.nome_stat , s.autore, s.data_stat, ".concat_sintax("u.nome, ' ', u.cognome"'nomecognome')."
  73.             FROM {$db1['frontend']}.stat s, {$db1['frontend']}.utente u
  74.             WHERE s.autore=u.id_utente
  75.             AND (auth_stat=1
  76.                 OR (auth_stat=2 AND u.gid=".intval($_SESSION['gid']).")
  77.                 OR (auth_stat=3 AND u.id_utente=".intval($_SESSION['user']['uid']).")
  78.                 )
  79.             ORDER BY data_stat DESC";
  80.     
  81.     $q=vmsql_query($sql,$link);
  82.     
  83.     $stat_pers=array();
  84.     
  85.     while($RS=vmsql_fetch_assoc($q)){
  86.         
  87.         // se è proprietario o amministratore può modificare o cancellare la statistica
  88.         $aggiunta_mod_del (($_SESSION['user']['uid']==$RS['autore']|| $_SESSION['user']['livello']==3
  89.                             " - <a href=\"stat.personal.php?modifica=".$RS['id_stat']."\">modifica</a> - <a href=\"stat.personal.php?elimina=".$RS['id_stat']."\" class=\"rosso\">elimina</a>" "";
  90.         
  91.         $stat_pers[]="<li><a href=\"stat.personal.php?id_s=".$RS['id_stat']."\">".$RS['nome_stat']."</a> (".$RS['nomecognome'].", ".dataITA($RS['data_stat'])."$aggiunta_mod_del</li>\n";
  92.     }
  93.     
  94.  
  95.     if(count($stat_pers)>0){
  96.         
  97.         echo "<ul style=\"margin-left:40px;\">\n".implode("",$stat_pers)."</ul>\n";
  98.         
  99.     }
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106. echo closeLayout1();
  107.  
  108.  
  109. ?>

Documentation generated on Sat, 22 Sep 2007 11:50:51 +0200 by phpDocumentor 1.4.0a2