Source for file admin.statistics.html.php

Documentation is available at admin.statistics.html.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Statistics
  5. @copyright  Refer to copyright.php
  6. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  7. @author Mambo Foundation Inc see README.php
  8. */
  9.  
  10. /** ensure this file is being included by a parent file */
  11. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  12.  
  13. class HTML_statistics {
  14.     function show&$browsers&$platforms$tldomains$bstats$pstats$dstats$sorts$option {
  15.         global $mosConfig_live_site;
  16.  
  17.         $tab mosGetParam$_REQUEST'tab''tab1' );
  18.         $width 400;    // width of 100%
  19.         $tabs new mosTabs(1);
  20.         ?>
  21.         <style type="text/css">
  22.         .bar_1{ background-color: #8D1B1B; border: 2px ridge #B22222; }
  23.         .bar_2{ background-color: #6740E1; border: 2px ridge #4169E1; }
  24.         .bar_3{ background-color: #8D8D8D; border: 2px ridge #D2D2D2; }
  25.         .bar_4{ background-color: #CC8500; border: 2px ridge #FFA500; }
  26.         .bar_5{ background-color: #5B781E; border: 2px ridge #6B8E23; }
  27.         </style>
  28.         <table class="adminheading">
  29.         <tr>
  30.             <th class="browser"><?php echo T_('Browser, OS, Domain Statistics')?></th>
  31.         </tr>
  32.         </table>
  33.         <form action="index2.php" method="post" name="adminForm">
  34.         <?php
  35.         $tabs->startPane("statsPane");
  36.         $tabs->startTab(T_("Browsers"),"browsers-page");
  37.         ?>
  38.         <table class="adminlist">
  39.         <tr>
  40.             <th align="left">&nbsp;<?php echo T_('Browser')?> <?php echo $sorts['b_agent'];?></th>
  41.             <th>&nbsp;</th>
  42.             <th width="100" align="left">% <?php echo $sorts['b_hits'];?></th>
  43.             <th width="100" align="left">#</th>
  44.         </tr>
  45.         <?php
  46.         $c 1;
  47.         if (is_array($browsers&& count($browsers0{
  48.             $k 0;
  49.             foreach ($browsers as $b{
  50.                 $f $bstats->totalhits $b->hits $bstats->totalhits 0;
  51.                 $w $width $f;
  52.             ?>
  53.             <tr class="row<?php echo $k;?>">
  54.                 <td width="200" align="left">
  55.                     &nbsp;<?php echo $b->agent?>&nbsp;
  56.                 </td>
  57.                 <td align="left" width="<?php echo $width+10;?>">
  58.                     <div align="left">&nbsp;<img src="<?php echo $mosConfig_live_site?>/components/com_poll/images/blank.png" class="bar_<?php echo $c?>" height="6" width="<?php echo $w?>"></div>
  59.                 </td>
  60.                 <td align="left">
  61.                     <?php printf"%.2f%%"$f 100 );?>
  62.                 </td>
  63.                 <td align="left">
  64.                     <?php echo $b->hits;?>
  65.                 </td>
  66.             </tr>
  67.             <?php
  68.             $c $c 1;
  69.             $k $k;
  70.             }
  71.         }
  72.         ?>
  73.         <tr>
  74.             <th colspan="4">&nbsp;</th>
  75.         </tr>
  76.         </table>
  77.         <?php
  78.         $tabs->endTab();
  79.         $tabs->startTab(T_("OS Stats"),"os-page");
  80.         ?>
  81.         <table class="adminlist">
  82.         <tr>
  83.             <th align="left">&nbsp;<?php echo T_('Operating System')?> <?php echo $sorts['o_agent'];?></th>
  84.             <th>&nbsp;</th>
  85.             <th width="100" align="left">% <?php echo $sorts['o_hits'];?></th>
  86.             <th width="100" align="left">#</th>
  87.         </tr>
  88.         <?php
  89.         $c 1;
  90.         if (is_array($platforms&& count($platforms0{
  91.             $k 0;
  92.             foreach ($platforms as $p{
  93.                 $f $pstats->totalhits $p->hits $pstats->totalhits 0;
  94.                 $w $width $f;
  95.                 ?>
  96.                 <tr class="row<?php echo $k;?>">
  97.                     <td width="200" align="left">
  98.                     &nbsp;<?php echo $p->agent?>&nbsp;
  99.                     </td>
  100.                     <td align="left" width="<?php echo $width+10;?>">
  101.                     <div align="left">&nbsp;<img src="<?php echo $mosConfig_live_site?>/components/com_poll/images/blank.png" class="bar_<?php echo $c?>" height="6" width="<?php echo $w?>"></div>
  102.                     </td>
  103.                     <td align="left">
  104.                     <?php printf"%.2f%%"$f 100 );?>
  105.                     </td>
  106.                     <td align="left">
  107.                     <?php echo $p->hits;?>
  108.                     </td>
  109.                 </tr>
  110.                 <?php
  111.                 $c $c 1;
  112.                 $k $k;
  113.             }
  114.         }
  115.         ?>
  116.         <tr>
  117.             <th colspan="4">&nbsp;</th>
  118.         </tr>
  119.         </table>
  120.         <?php
  121.         $tabs->endTab();
  122.         $tabs->startTab(T_("Domain Stats"),"domain-page");
  123.         ?>
  124.         <table class="adminlist">
  125.         <tr>
  126.             <th align="left">&nbsp;<?php echo T_('Domain')?> <?php echo $sorts['d_agent'];?></th>
  127.             <th>&nbsp;</th>
  128.             <th width="100" align="left">% <?php echo $sorts['d_hits'];?></th>
  129.             <th width="100" align="left">#</th>
  130.         </tr>
  131.         <?php
  132.         $c 1;
  133.         if (is_array($tldomains&& count($tldomains0{
  134.             $k 0;
  135.             foreach ($tldomains as $b{
  136.                 $f $dstats->totalhits $b->hits $dstats->totalhits 0;
  137.                 $w $width $f;
  138.                 ?>
  139.                 <tr class="row<?php echo $k;?>">
  140.                     <td width="200" align="left">
  141.                         &nbsp;<?php echo $b->agent?>&nbsp;
  142.                     </td>
  143.                     <td align="left" width="<?php echo $width+10;?>">
  144.                         <div align="left">&nbsp;<img src="<?php echo $mosConfig_live_site?>/components/com_poll/images/blank.png" class="bar_<?php echo $c?>" height="6" width="<?php echo $w?>"></div>
  145.                     </td>
  146.                     <td align="left">
  147.                         <?php printf"%.2f%%"$f 100 );?>
  148.                     </td>
  149.                     <td align="left">
  150.                         <?php echo $b->hits;?>
  151.                     </td>
  152.                 </tr>
  153.                 <?php
  154.                 $c $c 1;
  155.                 $k $k;
  156.             }
  157.         }
  158.         ?>
  159.         <tr>
  160.             <th colspan="4">&nbsp;</th>
  161.         </tr>
  162.         </table>
  163.         <?php
  164.         $tabs->endTab();
  165.         $tabs->endPane();
  166.         ?>
  167.         <input type="hidden" name="option" value="<?php echo $option;?>" />
  168.         <input type="hidden" name="tab" value="<?php echo $tab;?>" />
  169.         </form>
  170.         <?php
  171.     }
  172.  
  173.     function pageImpressions&$rows$pageNav$option$task {
  174.         ?>
  175.         <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminheading">
  176.         <tr>
  177.             <th width="100%" class="impressions"><?php echo T_('Page Impression Statistics')?></th>
  178.         </tr>
  179.         </table>
  180.  
  181.         <form action="index2.php" method="post" name="adminForm">
  182.         <table class="adminlist">
  183.         <tr>
  184.             <th style="text-align:right">#</th>
  185.             <th class="title"><?php echo T_('Title')?></th>
  186.             <th align="center" nowrap="nowrap"><?php echo T_('Page Impressions')?></th>
  187.         </tr>
  188.         <?php
  189.         $i $pageNav->limitstart;
  190.         $k 0;
  191.         if (is_array($rows)) {
  192.             foreach ($rows as $row{
  193.                 ?>
  194.                 <tr class="row<?php echo $k;?>">
  195.                     <td align="right">
  196.                         <?php echo ++$i?>
  197.                     </td>
  198.                     <td align="right">
  199.                         &nbsp;<?php echo $row->title." (".MosFormatdate($row->created"Y-m-d H:i:s").")"?>&nbsp;
  200.                     </td>
  201.                     <td align="center">
  202.                         <?php echo $row->hits?>
  203.                     </td>
  204.                 </tr>
  205.                 <?php
  206.                 $k $k;
  207.             }
  208.         }
  209.         ?>
  210.         </table>
  211.         <?php echo $pageNav->getListFooter()?>
  212.           <input type="hidden" name="option" value="<?php echo $option;?>" />
  213.           <input type="hidden" name="task" value="<?php echo $task;?>" />
  214.         </form>
  215.         <?php
  216.     }
  217.  
  218.     function showSearches&$rows$pageNav$option$task {
  219.         global $mainframe;
  220.         ?>
  221.         <form action="index2.php" method="post" name="adminForm">
  222.         <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminheading">
  223.             <tr>
  224.                 <th width="100%" class="searchtext">
  225.                 <?php echo T_('Search Engine Text :')?>
  226.                 <span class="componentheading"><?php echo T_('logging is :')?>
  227.                 <?php echo $mainframe->getCfg'enable_log_searches' '<b><font color="green">'.T_('Enabled').'</font></b>' '<b><font color="red">'.T_('Disabled').'</font></b>' ?>
  228.                 </span>
  229.                 </th>
  230.             </tr>
  231.         </table>
  232.  
  233.         <table class="adminlist">
  234.         <tr>
  235.             <th style="text-align:right">#</th>
  236.             <th class="title"><?php echo T_('Search Text')?></th>
  237.             <th nowrap="nowrap"><?php echo T_('Times Requested')?></th>
  238.             <th nowrap="nowrap"><?php echo T_('Results Returned')?></th>
  239.         </tr>
  240.         <?php
  241.         $k 0;
  242.         for ($i=0$n count($rows)$i $n$i++{
  243.             $row =$rows[$i];
  244.             ?>
  245.             <tr class="row<?php echo $k;?>">
  246.                 <td align="right">
  247.                 <?php echo $i+1+$pageNav->limitstart?>
  248.                 </td>
  249.                 <td align="right"><?php echo $row->search_term;?></td>
  250.                 <td align="center"><?php echo $row->hits?></td>
  251.                 <td align="center"><?php echo $row->returns?></td>
  252.             </tr>
  253.             <?php
  254.             $k $k;
  255.         }
  256.         ?>
  257.     </table>
  258.     <?php echo $pageNav->getListFooter()?>
  259.       <input type="hidden" name="option" value="<?php echo $option;?>" />
  260.       <input type="hidden" name="task" value="<?php echo $task;?>" />
  261.     </form>
  262.     <?php
  263.     }
  264. }
  265. ?>

Documentation generated on Mon, 05 May 2008 16:16:15 +0400 by phpDocumentor 1.4.0