<?php
session_start();

$title = 'Uprav príspevok';

include('funkcie.php');
include('funkcie_select.php');
include('funkcie_insert.php');
include('funkcie_update.php');
include('funkcie_delete.php');

hlavicka($title);
overenie();
navig_profil(1);

if (isset($_POST['prispevok_uprav'])) {uprav_prispevok(); header("Location: ./tema.php?f=".$_GET['f']."&t=".$_GET['t'].""); exit();}

if ($link = spoj_s_db()) {
        $sql = "SELECT * FROM forum_prispevky WHERE id_fora='".$_GET['f']."' AND 
                                                    id_temy='".$_GET['t']."' AND
                                                    id_prispevku='".$_GET['p']."'";
        $result = mysql_query($sql, $link);
        while ($row = mysql_fetch_assoc($result)) {

?>

<form action="prispevok_uprav.php?f=<?php echo $_GET['f'].'&t='.$_GET['t'].'&p='.$_GET['p']; ?>" method="post" name="prispevok_form">
  <table>
    <tr>
      <td class="formularove_pismo">Text prispevku: </td>
      <td><textarea rows="8" cols="80" name="sprava_uprav" value="" class="" ><?php echo $row['sprava_orig']; ?></textarea></td>
    </tr>
    <tr>
      <td></td>
      <td><input type="submit" name="prispevok_uprav" value="Odoslať" class="" /></td>
    </tr>
  </table>
</form>

<?php 
}}
include('paticka.php'); 
?>