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

Source for file stat.count_table.php

Documentation is available at stat.count_table.php

  1. <?php
  2. /**
  3. @desc Statistica di default sul popolamento delle tabelle del database
  4. @package VFront
  5. @subpackage Stats
  6. @author Mario Marcello Verona <marcelloverona@gmail.com>
  7. @copyright 2007 Mario Marcello Verona
  8. @version 0.90
  9. @license http://www.gnu.org/licenses/gpl.html GNU Public License
  10. */
  11.  
  12.  
  13. require_once("../inc/conn.php");
  14. require_once("../inc/layouts.php");
  15. require_once("../inc/func.stat.php");
  16. require_once("./stat.graph.php");
  17.  
  18. // PRENDI TUTTE LE TABELLE e le viste
  19.  
  20. $sql_tab="SELECT t1.table_namet1.table_type 
  21.      FROM {$db1['frontend']}.registro_tab t1
  22.      WHERE t1.gid=0 
  23.      ORDER BY t1.table_typet1.table_name";
  24.  
  25. $q_tab vmsql_query($sql_tab,$link);
  26.  
  27.  
  28. # PARAMETRI 
  29. $i=0;
  30. $v=0;
  31. $scala=0;
  32. $scala_vista=0;
  33. $nome_file_img='tab_count';
  34. $nome_file_viste_img='view_count';
  35. $tabella=array();
  36. $vista=array();
  37.  
  38. while($RS=vmsql_fetch_assoc($q_tab)){
  39.     
  40.     if($RS['table_type']=='BASE TABLE'){
  41.  
  42.         $tabella[$i]=$RS['table_name'];
  43.         
  44.         $q_count=vmsql_query("SELECT count(*) FROM ".$RS['table_name'],$link);
  45.         
  46.         list($count_tabella[$i])=vmsql_fetch_row($q_count);
  47.         
  48.         $scala ($count_tabella[$i]>$scala$count_tabella[$i]:$scala;
  49.         
  50.         $i++;
  51.     }
  52.     else{
  53.         
  54.         $vista[$v]=$RS['table_name'];
  55.         
  56.         $q_count_v=vmsql_query("SELECT count(*) FROM ".$RS['table_name'],$link);
  57.         
  58.         list($count_vista[$v])=vmsql_fetch_row($q_count_v);
  59.         
  60.         $scala_vista ($count_vista[$v]>$scala$count_vista[$v]:$scala_vista;
  61.         
  62.         $v++;
  63.     }
  64.     
  65.     
  66.     
  67. }
  68.  
  69. // OUT
  70.  
  71. $OUT="";
  72.  
  73.  
  74.  
  75. // GRAFICO E TABELLA PER LE TABELLE
  76.  
  77. if(count($tabella)>0){
  78.     
  79.     
  80.         $scala $scala*1.1;
  81.         $stima_altezza_t round(count($tabella)*22.5,0);
  82.         $altezza_grafico_t (($stima_altezza_t)<280280:$stima_altezza_t;
  83.         
  84.         $grafico barre($count_tabella,$tabella,$scala,'Popolamento tabelle',$nome_file_img,540,$altezza_grafico_t,array('red','orange'),165,'%d','ivory');
  85.         
  86.         
  87.         
  88.         // SCRIVE UNA TABELLA:
  89.         
  90.         $OUT.="<table summary=\"cont\" class=\"tab-cont\">\n<tr>";
  91.         
  92.         if($grafico){
  93.             
  94.             $OUT.= "<td><img src=\"".FRONT_DOCROOT."/tmp/$nome_file_img.png\" alt=\"test\"   class=\"img-stat\" /></td>\n";
  95.         }
  96.         
  97.         
  98.         $OUT.= "<td>".stat_tabella($tabella,$count_tabella"</td>";
  99.         
  100.         $OUT.="</tr></table>\n";
  101.  
  102.  
  103. }
  104.  
  105.  
  106.  
  107.  
  108.  
  109. // GRAFICO E TABELLA PER LE VISTE
  110.  
  111. if(count($vista)>0){
  112.  
  113.         $scala_v $scala*1.1;
  114.         $stima_altezza_v round(count($vista)*22.5,0);
  115.         $altezza_grafico_v (($stima_altezza_v)<220220:$stima_altezza_v;
  116.         
  117.         $grafico2 barre($count_vista,$vista,$scala_v,'Popolamento viste',$nome_file_viste_img,540,$altezza_grafico_v,array('green','yellowgreen'),165,'%d','ivory');
  118.         
  119.         
  120.         
  121.         
  122.         $OUT.="<table summary=\"cont\"  class=\"tab-cont\">\n<tr>";
  123.         
  124.         
  125.         
  126.         if($grafico2){
  127.             
  128.             $OUT.=  "<td><img src=\"".FRONT_DOCROOT."/tmp/$nome_file_viste_img.png\" alt=\"dati popolamento\" class=\"img-stat\" /></td>\n";
  129.         }
  130.         
  131.         
  132.         $OUT.= "<td>".stat_tabella($vista,$count_vista"</td>";
  133.         
  134.         $OUT.="</tr></table>\n";
  135.  
  136. }
  137.  
  138.  
  139. $files=array("sty/stat.css");
  140.  
  141. echo openLayout1("Dati popolamento tabelle",$files);
  142.  
  143. echo "<div id=\"briciole\"><a href=\"../admin/index.php\">home amministrazione</a> &raquo; <a href=\"index.php\">statistiche</a> &raquo; popolamento tabelle </div>\n";
  144. echo "<h1>Dati popolamento tabelle</h1>\n";
  145.  
  146. echo $OUT;
  147.  
  148.  
  149. echo closeLayout1();
  150.  
  151.  
  152.  
  153. ?>

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