<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
</head>


<body bgcolor="#FFFFFF" text="#000000">
<?php 
			$dbh=mysql_connect("localhost","olympicv","olym8y");
			mysql_select_db("olympicv_olympic",$dbh);
	
if ($submit) {
	$sql="UPDATE GUESTBOOK  SET name='$name', surname='$surname', comments='$comments' , email='$email' , publish='$publish' , date='$date'   WHERE id='$id'";
	$result = mysql_query($sql);	
?><br>
<table width="560" border="1" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#CC0000" align="center" class="ttext">
  <tr> 
    <td bgcolor="#CCCCCC" bordercolor="#CCCCCC">
      <div align="center" class="">Η ΑΛΛΑΓΗ ΣΤΟ GUESTBOOK <b></b>ΕΓΙΝΕ</div>
    </td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF" bordercolor="#FFFFFF">
      <p>&nbsp;
      <table width="511" border="0" cellspacing="0" cellpadding="5" align="center" class="ttext">
        <tr> 
                      
          <td width="53" align="center" valign="top">
          
          </td>
                      
          <td align="left" width="246"> 
            <?php echo $TITLE ?>
          </td>
                      
          </tr>
                  </table>
                  
      <p>&nbsp;</p>
    </td>
  </tr>
</table>

<?php
} else {	
			$result = mysql_query("SELECT * FROM GUESTBOOK  WHERE id=$id",$dbh);
			$myrow=mysql_fetch_array($result); 
		
			$name=$myrow['name'];
			$surname=$myrow['surname'];
			$email=$myrow['email'];
			$publish=$myrow['publish'];
			$date=$myrow['date'];
			$comments=$myrow['comments'];
?>

<form name="newproductform1" method="post" action="<?php echo $PHP_SELF ?>" enctype="multipart/form-data">
  <table width="560" border="0" cellspacing="0" cellpadding="0" align="center" class="ttext">
    <tr> 
      <td width="192">name 
        <input type="hidden" name="id" value="<?php echo $id?>">
      </td>
      <td width="368"> 
        <input type="text" name="name"  maxlength="254" value="<?php echo $name ?>">
      </td>
    </tr>
    <tr> 
      <td width="192">surname (english)</td>
      <td width="368"> 
        <input type="text" name="surname"  maxlength="254" value="<?php echo $surname ?>">
      </td>
    </tr>
    <tr> 
      <td width="192">email</td>
      <td width="368"> 
        <input type="text" name="email"  maxlength="254" value="<?php echo $email ?>">
      </td>
    </tr>
    <tr> 
      <td width="192">comments</td>
      <td width="368"> 
        <textarea name="comments" cols="44" rows="6"><?php echo $comments ?></textarea>
      </td>
    </tr>
    <tr> 
      <td width="192">date</td>
      <td width="368"> 
        <input type="text" name="date"  maxlength="254" value="<?php echo $date ?>">
      </td>
    </tr>
    <tr> 
      <td width="192">Δημοσίευση</td>
      <td width="368"> 
        <?php if ($publish!=no) { ?>
        <select name="publish">
          <option value="yes" selected>yes</option>
          <option value="no">no</option>
        </select>
        <?php }else{?>
        <select name="publish">
          <option value="yes">yes</option>
          <option value="no" selected>no</option>
        </select>
        <?php } ?>
      </td>
    </tr>
    <tr> 
      <td width="192"> 
        <input type="submit" name="submit" value="Submit">
      </td>
      <td width="368">&nbsp;</td>
    </tr>
  </table>

</form>
<?php } ?>

</body>
</html>
