"Fossies" - the Fresh Open Source Software Archive

Member "mcLinksCounter/stats.php" (11 Apr 2002, 9320 Bytes) of package /linux/privat/old/mcLinksCounter1.2.zip:


The requested HTML page contains a <FORM> tag that is unusable on "Fossies" in "automatic" (rendered) mode so that page is shown as HTML source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "stats.php" see the Fossies "Dox" file reference documentation.

    1 <?
    2 // mcLinksCounter 1.2 - Marc Cagninacci - marc@phpforums.net - http://www.phpforums.net
    3 
    4 include "mclc.php";
    5 include "$langfile";
    6 $auth = explode(":",$HTTP_COOKIE_VARS["mcLinksCounter"]);
    7 if(empty($auth[0])){
    8 ?> <script language="JavaScript">
    9    document.location.replace("login.php?path=<? echo("stats.php"); ?>");
   10    </script>
   11 <?
   12 }
   13 ?>
   14 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
   15 <html>
   16 <head>
   17 <title>mcLinksCounter Stats</title>
   18 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   19 <META HTTP-EQUIV="Expires" CONTENT="Fri, Jan 01 1900 00:00:00 GMT">
   20 <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
   21 <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
   22 <style type="text/css">
   23 <!--
   24 a:actif {  font-family: Verdana; color: black; text-decoration: none}
   25 a:link {  font-family: Verdana; color: white; text-decoration: none}
   26 a:visited {  font-family: Verdana; color: white; text-decoration: none}
   27 a:hover {  font-family: Verdana; color: black; text-decoration: none}
   28 -&nbsp;
   29 </style>
   30 </head>
   31 <body bgcolor="#C0C0C0" text="black">
   32 <p align="right"><font face="verdana" size="5" color="black">mcLinksCounter 1.2</font></p><hr>
   33 <table width="95%" align="center" border="0">
   34 <tr><td valign="top">
   35 
   36 <?
   37 
   38  $connect= mysql_connect($host,$login,$pass);
   39  mysql_select_db($base, $connect);
   40  $query = "select sum(clic) from mclinkscounter";
   41  $res = mysql_query($query, $connect);
   42  $total = mysql_fetch_array($res);
   43  ?>
   44  <table border="0" cellspacing="1" cellpadding="2">
   45  <tr><td bgcolor="#333333" colspan="2"><font face="verdana" size="2" color="white"><? echo $lTotal; ?></font>
   46  </td>
   47  <td bgcolor="#333333" colspan="5"><font face="verdana" size="2" color="white"><? echo $total[0].' '.$lClics; ?></font>
   48  </td></tr>
   49  <?
   50  $query = "select cat, sum(clic) from mclinkscounter group by cat order by cat";
   51  $res = mysql_query($query, $connect);
   52  while ($categ = mysql_fetch_array($res))
   53  {
   54  $avcat=@ceil($categ[1]/$total[0]*100);
   55  echo '<tr><td bgcolor="#666666" colspan="2"><font face="verdana" size="2" color="white"><b>'.$categ[0].'</b></font></td>';
   56  echo '<td bgcolor="#666666" align="right"><font face="verdana" size="1" color="white">'.$categ[1].' '.$lClics.'</font></td>';
   57  echo '<td bgcolor="#333333" align="right"><font face="verdana" size="1" color="white">'.$avcat.' %</font></td>';
   58  echo '<td bgcolor="#666666" colspan="3"><font face="verdana" size="1" color="white">&nbsp;</font></td></tr>';
   59  $query = "select * from mclinkscounter where cat='$categ[0]' order by nom";
   60  $result = mysql_query($query, $connect);
   61   while ($lien = mysql_fetch_array($result))
   62   {
   63   $avlien=@ceil($lien[5]/$categ[1]*100);
   64   $avtot=@ceil($lien[5]/$total[0]*100);
   65   echo '<tr><td bgcolor="#999999"><font face="verdana" size="2" color="white"><a href="detail.php?det='.$lien[0].'&link='.$lien[1].'">'.$lien[1].'</a></font></td>';
   66   echo '<td bgcolor="#999999"><font face="verdana" size="1" color="white">'.$lien[3].'</font></td>';
   67   echo '<td bgcolor="#999999" align="right"><font face="verdana" size="2" color="white"><b>'.$lien[5].'</b></font></td>';
   68   echo '<td bgcolor="#666666" align="right"><font face="verdana" size="1" color="white">'.$avlien.' %</font></td>';
   69   echo '<td bgcolor="#333333" align="right"><font face="verdana" size="1" color="white">'.$avtot.' %</font></td>';
   70   echo '<td bgcolor="#999999"><font face="verdana" size="1" color="white"><a href="stats.php?modif='.$lien[0].'">'.$lModifier.'</a></font></td>';
   71   echo '<td bgcolor="#999999"><font face="verdana" size="1" color="white"><a href="stats.php?suppr='.$lien[0].'">'.$lSupprimer.'</a>';
   72                                                                                                          if ($suppr==$lien[0]) echo '&nbsp;<a href="stats.php?suppr='.$lien[0].'&ok=ok">'.$lConfSuppr.'</a>';
   73                                                                                                          echo '</font></td>';
   74 
   75   }
   76  }
   77 ?>
   78  </td></tr>
   79  </table>
   80 </td><td valign="top">
   81 <?
   82 if(!$modif && !$suppr)
   83 {
   84 ?>
   85  <form method="post" action="stats.php">
   86  <table border="0" cellspacing="1" cellpadding="5">
   87  <tr><td bgcolor="#333333" colspan="2"><font face="verdana" size="2" color="white"><? echo $lNouveau; ?></font>
   88  </td></tr>
   89  <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white"><? echo $lNom; ?></font>
   90  </td>
   91  <td bgcolor="#999999"><input type="text" name="nom"><font face="verdana" size="2" color="red"><b>&nbsp;*</b></font>
   92  </td></tr>
   93   <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white"><? echo $lCat; ?></font>
   94  </td>
   95  <td bgcolor="#999999"><input type="text" name="cat"><font face="verdana" size="2" color="red"><b>&nbsp;*</b></font>
   96  </td></tr>
   97   <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white"><? echo $lUrl; ?></font>
   98  </td>
   99  <td bgcolor="#999999"><input type="text" name="url"><font face="verdana" size="2" color="red"><b>&nbsp;*</b></font>
  100  </td></tr>
  101   <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white"><? echo $lTarget; ?></font>
  102  </td>
  103  <td bgcolor="#999999"><select name="target" >
  104           <option value=""></option>
  105           <option value="_self">_self</option>
  106           <option value="_top">_top</option>
  107           <option value="_blank">_blank</option>
  108           </select>
  109           <font face="verdana" size="1" color="white"><? echo $lCadre; ?>:</font>
  110           <input type="text" name="targetF">
  111  </td></tr>
  112   <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white"><? echo $lClics; ?></font>
  113  </td>
  114  <td bgcolor="#999999"><input type="text" name="clic" size="5">
  115  </td></tr>
  116  <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white">&nbsp;</font>
  117  </td>
  118  <td bgcolor="#999999"><input type="submit" name="submit" value="<? echo $lValider; ?>"><font face="verdana" size="1" color="red"><b>&nbsp;*</b> <? echo $lOblig; ?></font>
  119  </td></tr>
  120  </table>
  121  </form>
  122 <?
  123 if (isset($submit))
  124 {
  125 echo $cat;
  126 if ($targetF)  $target=$targetF;
  127 $query = "insert into mclinkscounter values('', '$nom', '$cat', '$url', '$target', '$clic')";
  128 mysql_query($query, $connect);
  129 ?>
  130    <script language="JavaScript">
  131    document.location.replace("stats.php");
  132    </script>
  133 <?
  134 
  135 }
  136 }
  137 if (isset($modif))
  138 {
  139 $query = "select * from mclinkscounter where id=$modif";
  140 $result = mysql_query($query, $connect);
  141 $lien = mysql_fetch_array($result);
  142 
  143 ?>
  144 <form method="post" action="stats.php">
  145  <table border="0" cellspacing="1" cellpadding="5">
  146  <tr><td bgcolor="#333333" colspan="2"><font face="verdana" size="2" color="white"><? echo $lModifLien; ?></font>
  147  </td></tr>
  148  <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white"><? echo $lNom; ?></font>
  149  </td>
  150  <td bgcolor="#999999"><input type="text" name="nom2" value="<? echo $lien[nom]; ?>"><font face="verdana" size="2" color="red"><b>&nbsp;*</b></font>
  151  </td></tr>
  152   <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white"><? echo $lCat; ?></font>
  153  </td>
  154  <td bgcolor="#999999"><input type="text" name="cat2" value="<? echo $lien[cat]; ?>"><font face="verdana" size="2" color="red"><b>&nbsp;*</b></font>
  155  </td></tr>
  156   <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white"><? echo $lUrl; ?></font>
  157  </td>
  158  <td bgcolor="#999999"><input type="text" name="url2" value="<? echo $lien[url]; ?>"><font face="verdana" size="2" color="red"><b>&nbsp;*</b></font>
  159  </td></tr>
  160   <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white"><? echo $lTarget; ?></font>
  161  </td>
  162  <td bgcolor="#999999"><select name="target2" >
  163           <option value=""></option>
  164           <option value="_self">_self</option>
  165           <option value="_top">_top</option>
  166           <option value="_blank">_blank</option>
  167           <option value="-------">------</option>
  168           <option value="<? echo $lien[target]; ?>" selected><? echo $lien[target]; ?></option>
  169           </select>
  170           <font face="verdana" size="1" color="white"><? echo $lCadre; ?>:</font>
  171           <input type="text" name="targetF2">
  172  </td></tr>
  173   <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white"><? echo $lClics; ?></font>
  174  </td>
  175  <td bgcolor="#999999"><input type="text" name="clic2" size="5" value="<? echo $lien[clic]; ?>">
  176  </td></tr>
  177  <tr><td bgcolor="#999999"><font face="verdana" size="1" color="white">&nbsp;</font>
  178  </td>
  179  <td bgcolor="#999999"><input type="submit" name="submitm" value="Valider"><font face="verdana" size="1" color="red"><b>&nbsp;*</b> <? echo $lOblig; ?></font>
  180                        <input type="hidden" name="id2" value=<? echo $lien[id]; ?>">
  181  </td></tr>
  182  </table>
  183  </form>
  184 <?
  185 }
  186 
  187 if (isset($submitm))
  188 {
  189 if ($targetF2)  $target2=$targetF2;
  190 $query = "update mclinkscounter set nom='$nom2', cat='$cat2', url='$url2', target='$target2', clic='$clic2' where id='$id2'";
  191 mysql_query($query, $connect);
  192 ?>
  193    <script language="JavaScript">
  194    document.location.replace("stats.php");
  195    </script>
  196 <?
  197 }
  198 
  199 if (isset($suppr)&&($ok=="ok"))
  200 {
  201 echo $lien[0];
  202 $query = "delete from mclinkscounter where id='$suppr'";
  203 mysql_query($query, $connect);
  204 ?>
  205    <script language="JavaScript">
  206    document.location.replace("stats.php");
  207    </script>
  208 <?
  209 }
  210 ?>
  211 
  212 </td></tr>
  213 </table>
  214 <p align="center"><a href="http://www.phpforums.net/index.php?dir=dld" target="_blank"><img src="mclc.gif" border="0" alt="Download mcLinksCounter"></a></p>
  215 </body>
  216 </html>