<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 LINKS SET LINK='$LINK', DESCRIPTIONUK='$DESCRIPTIONUK', DESCRIPTION='$DESCRIPTION', PUBLISH='$PUBLISH'   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="">Η ΑΛΛΑΓΗ ΣΤΑ<b> links </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 $LINK ?>
          </td>
                      
          </tr>
                  </table>
                  
      <p>&nbsp;</p>
    </td>
  </tr>
</table>

<?php
} else {	
			$result = mysql_query("SELECT * FROM LINKS  WHERE ID=$ID",$dbh);
			$myrow=mysql_fetch_array($result); 
			$DESCRIPTION=$myrow['DESCRIPTION'];
			$DESCRIPTIONUK=$myrow['DESCRIPTIONUK'];
			$LINK=$myrow['LINK'];
			$PUBLISH=$myrow['PUBLISH'];
		
?>
<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 colspan="2"><a href="uploadlink.php?ID=<?PHP ECHO $ID ?>">UPLOAD IMAGE</a><br>
        <br>
        <?php
	 $filename15="../linksimages/".$ID.".jpg";
	 
if (file_exists($filename15)) {
?>
        <img src="../linksimages/<?php echo $ID ?>.jpg"> 
        <?PHP } ?>
      </td>
    </tr>
    <tr> 
      <td width="192">LINK 
        <input type="hidden" name="ID" value="<?php echo $ID?>">
      </td>
      <td width="368"> 
        <input type="text" name="LINK"  maxlength="254" value="<?php echo $LINK ?>">
      </td>
    </tr>
    <tr> 
      <td width="192">Κείμενο english</td>
      <td width="368"> 
        <textarea name="DESCRIPTIONUK" cols="55" rows="5"><?php echo $DESCRIPTIONUK ?></textarea>
      </td>
    </tr>
    <tr> 
      <td width="192">Κείμενο</td>
      <td width="368"> 
        <textarea name="DESCRIPTION" cols="55" rows="5"><?php echo $DESCRIPTION ?></textarea>
      </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>
