home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / internet / flashland / sutaz / sutaz.php < prev   
PHP Script  |  2001-08-20  |  4KB  |  115 lines

  1. <?php
  2.     
  3.     if (date('j') > SUTAZ_DEN) $rrrrmm = date('Ym', mktime(0, 0, 0, date('m')+1, 1, date('Y')));
  4.     else $rrrrmm = date('Ym');
  5.  
  6.     //echo("user=$flashlanduser<BR>login=$flashlandlogin<BR>mail=$flashlandmail<BR><BR>hlasoval=$hlasoval<BR>degree=".$user['degree']."<BR>cas=$rrrrmm<BR>akoon=$cok<BR>");
  7.  
  8. $hlasoval = 0;
  9. ?>
  10.  
  11. <BR>
  12. <div align="center">
  13. <table border="0" width="480" cellspacing="0" cellpadding="0">
  14.   <tr>
  15.     <td width="20%"><img border="0" src="sutaz/pohar.jpg" width="50" height="55"></td>
  16.     <td width="60%"><p align="center" class="ttn">S·¥a₧ o najlepÜiu FLASHovinu.</p></td>
  17.     <td width="20%"><p align="right"><img border="0" src="sutaz/pohar.jpg" width="50" height="55"></td>
  18.   </tr>
  19. </table>
  20. <form action="./index.php" METHOD="POST">
  21.  
  22. <table border="1" width="480" bgcolor="#BFDFFF" cellpadding="3" cellspacing="0">
  23.     <TR>
  24.         <TD bgcolor="#3366CC"><p><font color="#FFFFFF">
  25.         Hlasovanie o najlepÜiu FLASHovinu - <?echo substr($rrrrmm, 4, 2).'/'.substr($rrrrmm, 0, 4) ?></font></p>
  26.         </td>
  27.     </tr>
  28.     
  29.     <tr>
  30.         <td>
  31.         <table class="tt" cellpadding="4" width="100%">
  32.             <tr><td colspan="<?echo $hlasoval ? 2 : 3 ?>">
  33.                 <BR>Pre tento mesiac boli nominovanΘ nasleduj·ce strßnky. Hlasova¥ sa dß a₧ po zaregistrovanφ.<BR><BR>
  34.                 </td>
  35.             </tr>
  36.             <?php
  37.  
  38.             $DBLink->query("select sum(hlasov) as pochla from sutaz where obdobie=$rrrrmm;");
  39.             list($pochla)=$DBLink->next_record();
  40.  
  41.             if ($hlasoval=="1") 
  42.             { $DBLink->query("select * from sutaz where obdobie=$rrrrmm order by hlasov desc;");}
  43.             else { $DBLink->query("select * from sutaz where obdobie=$rrrrmm order by url desc;");}
  44.             while ($row = $DBLink->next_record()) {
  45.                 if ($pochla != 0) $perc = sprintf('%.2f', $row['hlasov']/$pochla*100);
  46.                 else $perc = 0;
  47.                 if (substr($row['url'], 0, 7) != 'http://') $row['url'] = 'http://'.$row['url'];
  48.                 
  49.                 echo('<tr><td width="100%">
  50.                 <table border="0" width="100%" cellspacing="0" cellpadding="4">
  51.                   <tr>
  52.                 
  53.                 <td width="100%" colspan="3"><B>'.$row['nazov'].'</B></td>
  54.                   </tr>
  55.                   <tr>
  56.                 <td width="120"><a href="'.$row['url'].'" WIDTH="120" target="_blank"><IMG SRC="sutaz/scr/'.$rrrrmm.'/'.$row['scrshot'].'" WIDTH=120 HEIGHT=80 BORDER=0></a></td>
  57.                 <td width="70%"><p align="justify"><small>'.$row['popis'].'</small></p></td>');
  58.                 
  59.                 if ($hlasoval=="0"){
  60.                     echo('<td width="100"><SELECT NAME="s['.$row['id'].']">');
  61.                     for ($i=0; $i<4; $i++) {
  62.                         $bod = $i*($user['degree']+1);
  63.                         echo("<OPTION value=\"$bod\">$bod</OPTION>");
  64.                     }
  65.                     echo('</SELECT> b.</td></tr>');
  66.                 }
  67.                 
  68.                 echo('<tr>
  69.                 <td width="100%" colspan="3">URL: <a href="'.$row['url'].'" target="_blank">'.$row['url'].'</a> ');
  70.                 if ($row['mail']!='') echo('Autor: <A HREF=mailto:'.$row['mail'].'>'.ucfirst($row['autor']).'</A><BR>');
  71.                 else echo('Autor: <b>'.ucfirst($row['autor']).'</b>');
  72.                 echo('</td></tr>');
  73.                   
  74.                   if ($hlasoval=="1") { 
  75.                 echo('<tr><td width="100%" colspan="3">
  76.                     <table border="0" cellspacing="0" cellpadding="0">
  77.                       <tr>
  78.                     <td width="190">'); 
  79.                     echo('<I>Hlasov: '.$row['hlasov']." ($perc%)</I>\n");
  80.                     echo('</td><td width="250"  height="8" bordercolor="#000000" style="border-style: solid; border-width: 1">
  81.                     <img src="sutaz/nic.gif" border="0" height="14" width="'.$perc.'%" >');
  82.                     echo('</td>
  83.                       </tr>
  84.                     </table>
  85.                 </td>
  86.                 </tr>'); };
  87.                 echo('</table></tr></td>');
  88.                 
  89.                 
  90.             }
  91.             ?>
  92.             </td></tr>
  93.         </table>
  94.         </td>
  95.     </tr>
  96.  
  97.     <tr><td align="center">
  98.         <?php 
  99.         if ($hlasoval=="0") {
  100.             echo('<input type="submit" value="Hlasuj!" name="hlasuj"><BR>');
  101.             echo('<INPUT TYPE="hidden" name="rrrrmm" value="'.$rrrrmm.'">');
  102.         }
  103.         else echo('Hlasova¥ je mo₧ne iba on-line.');
  104.         ?>
  105.         </td>
  106.     </tr>
  107. </table>
  108. </div>
  109. </form>
  110.  
  111. <center>
  112.     <a class="lel" href="index.php?intro=sutaz/prehlad.php">V²sledky predchßdzaj·cich mesiacov.</a>
  113.     <BR><BR>
  114.     <a href="index.php">spΣ¥</a>
  115. </center>