<?php

include('includes/hlava.php');
title('Klub priateľov fotografie', '');

if ($link) {
  if ($db_selected) {
  
include('includes/vedla.php');
odkaz('');
include('includes/menu.php');
menu('','');
?>           
        
        <div class="obsah">
                    
<?php

   if ($_SESSION['aid'] == 1){
     $zobraz = true;
   }
   else {
     $zobraz = false;
   }
   
if ($zobraz) {

    //////  cislo temy   //////

    $a = 7;

    //////  cislo temy   //////
    
    
    if ($_GET['theme']<>''){
            	
		$sql = "UPDATE kpf_tema_photos SET tema = '" . $a . "' WHERE `kategoria` = '" . $_GET['theme'] . "';";
            $result = mysql_query($sql, $link);
        		if ($result) {
              echo '<p><b>"'.$_GET['theme']. '"</b> sa zmenila na temu <b>cislo '.$a.'</b>.<br /><br />';
              echo '<a href="zmena.php">Spat</a>';            
            }
            else {
              echo "Janko, to nevadi. Niekte naslala chyba.";
            }
    }
    else{
      $sql = "SELECT DISTINCT kategoria
              FROM kpf_tema_photos
              WHERE tema=0;";
      $result = mysql_query($sql, $link);
      if ($result) {
        echo '<h2>Menis <em>temu</em> cislo <em>'. $a . '</em></h2>';
        echo '<ul class="zmen"> ';
        while ($row = mysql_fetch_assoc($result)) {
          echo '<li><a href="?theme='.$row['kategoria'].'">'.$row['kategoria'] . '</a></li>';       
        }
        echo '</ul>';
      }
    }
        
}
else{
  echo '<p>Co ty chces menit?</p>';
}		

        		}   
	   mysql_close($link);   
 
	}
 
include('includes/pata.php');
?>    
