<html>
<head>
<title>Web management</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<link rel="stylesheet" href="../styles.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="10">
      <?php 
			include 'connect.php';
if ($submit) {
	$sql="UPDATE colorcombi SET color1='$color1', color2='$color2', color3='$color3', color4='$color4', color5='$color5' WHERE id='$id'";
	$result = mysql_query($sql);	
?>
<table width="700" border="1" cellspacing="0" cellpadding="0" align="center" class="webadmintext" bordercolor="#999999">
  <tr> 
    <td bgcolor="#666666" bordercolor="#666666"> 
      <div align="center" class="white">Ο ΣΥΝΔΥΑΣΜΟΣ ΧΡΩΜΑΤΩΝ ΑΛΛΑΞΕ</div>
    </td>
  </tr>
  <tr> 
    <td bordercolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr> 
    <td bordercolor="#FFFFFF">&nbsp; </td>
  </tr>
  <tr> 
    <td bordercolor="#FFFFFF">&nbsp; </td>
  </tr>
</table>
<meta http-equiv="refresh" content="0;URL=colorcombi.php?id=<?php echo $id ?>">
<?php
} else {	
			$result = mysql_query("SELECT * FROM colorcombi WHERE id=$id",$dbh);
			$myrow=mysql_fetch_array($result); 
			$id=$myrow['id'];
			$color1=$myrow['color1'];
			$color2=$myrow['color2'];
			$color3=$myrow['color3'];
			$color4=$myrow['color4'];
			$color5=$myrow['color5'];
?>

<form name="forma" method="post" action="<?php echo $PHP_SELF ?>" enctype="multipart/form-data">
  <table width="700" border="1" cellspacing="0" cellpadding="0" align="center" class="webadmintext" bordercolor="#999999">
    <tr> 
      <td bgcolor="#666666" bordercolor="#666666"> 
        <div align="center" class="white">ΑΛΛΑΓΗ ΧΡΩΜΑΤΩΝ</div>
      </td>
    </tr>
    <tr> 
      <td bordercolor="#FFFFFF">&nbsp; </td>
    </tr>
    <tr> 
      <td bordercolor="#FFFFFF"> 
        <table width="100%" border="0" cellspacing="1" cellpadding="2" class="webadmintext" bgcolor="#F2F2F2">
          <tr> 
            <td width="100">Χρώμα 1 
              <input type="hidden" name="id" value="<?php echo $id ?>">
            </td>
            <td width="200">background</td>
            <td> 
              <select name="color1" class="forms">
                <?php 
			include 'connect.php';
			$sql1 = "SELECT * FROM colors ORDER BY colour";
			$result1 = mysql_query($sql1);
			while ($myrow=mysql_fetch_array($result1)) {
				$colour1=$myrow['colour'];
				$pantone1=$myrow['pantone'];
?>
                <?php
	if ($pantone1 == $color1 ) {
?>
                <option value="<?php echo $pantone1 ?>" selected> 
                <?php echo $colour1 ?>
                <?php } else { ?>
                <option value="<?php echo $pantone1 ?>"> 
                <?php echo $colour1 ?>
                </option>
                <?php 
				}
				}
?>
              </select>
            </td>
          </tr>
          <tr> 
            <td>Χρώμα 2</td>
            <td>φόρμες</td>
            <td> 
              <select name="color2" class="forms">
                <?php 
			include 'connect.php';
			$sql2 = "SELECT * FROM colors ORDER BY colour";
			$result2 = mysql_query($sql2);
			while ($myrow=mysql_fetch_array($result2)) {
				$colour2=$myrow['colour'];
				$pantone2=$myrow['pantone'];
?>
                <?php
	if ($pantone2 == $color2 ) {
?>
                <option value="<?php echo $pantone2 ?>" selected> 
                <?php echo $colour2 ?>
                <?php } else { ?>
                <option value="<?php echo $pantone2 ?>"> 
                <?php echo $colour2 ?>
                </option>
                <?php 
				}
				}
?>
              </select>
            </td>
          </tr>
          <tr> 
            <td>Χρώμα 3</td>
            <td>χρώμα 1</td>
            <td> 
              <select name="color3" class="forms">
                <?php 
			include 'connect.php';
			$sql3 = "SELECT * FROM colors ORDER BY colour";
			$result3 = mysql_query($sql3);
			while ($myrow=mysql_fetch_array($result3)) {
				$colour3=$myrow['colour'];
				$pantone3=$myrow['pantone'];
?>
                <?php
	if ($pantone3 == $color3 ) {
?>
                <option value="<?php echo $pantone3 ?>" selected> 
                <?php echo $colour3 ?>
                <?php } else { ?>
                <option value="<?php echo $pantone3 ?>"> 
                <?php echo $colour3 ?>
                </option>
                <?php 
				}
				}
?>
              </select>
            </td>
          </tr>
          <tr> 
            <td>Χρώμα 4</td>
            <td>χρώμα 2</td>
            <td> 
              <select name="color4" class="forms">
                <?php 
			include 'connect.php';
			$sql4 = "SELECT * FROM colors ORDER BY colour";
			$result4 = mysql_query($sql4);
			while ($myrow=mysql_fetch_array($result4)) {
				$colour4=$myrow['colour'];
				$pantone4=$myrow['pantone'];
?>
                <?php
	if ($pantone4 == $color4 ) {
?>
                <option value="<?php echo $pantone4 ?>" selected> 
                <?php echo $colour4 ?>
                <?php } else { ?>
                <option value="<?php echo $pantone4 ?>"> 
                <?php echo $colour4 ?>
                </option>
                <?php 
				}
				}
?>
              </select>
            </td>
          </tr>
          <tr> 
            <td>Χρώμα 5</td>
            <td>γραμμές</td>
            <td> 
              <select name="color5" class="forms">
                <?php 
			include 'connect.php';
			$sql5 = "SELECT * FROM colors ORDER BY colour";
			$result5 = mysql_query($sql5);
			while ($myrow=mysql_fetch_array($result5)) {
				$colour5=$myrow['colour'];
				$pantone5=$myrow['pantone'];
?>
                <?php
	if ($pantone5 == $color5 ) {
?>
                <option value="<?php echo $pantone5 ?>" selected> 
                <?php echo $colour5 ?>
                <?php } else { ?>
                <option value="<?php echo $pantone5 ?>"> 
                <?php echo $colour5 ?>
                </option>
                <?php 
				}
				}
?>
              </select>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td bgcolor="#FFFFFF" bordercolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr bgcolor="#666666"> 
      <td bgcolor="#666666" bordercolor="#666666"> 
        <table width="300" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr> 
            <td> 
              <div align="center"> 
                <input type="submit" name="submit" value="Καταχώρηση" class="button">
              </div>
            </td>
            <td> 
              <div align="center"> 
                <input type="reset" name="Submit2" value="Επαναφορά" class="button">
              </div>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>
<?php } ?>
<table width="700" border="0" cellspacing="0" cellpadding="4" align="center">
  <tr>
    <td>
      <div align="center"> <a href="javascript:history.go(-1);"><img src="back.gif" alt="πίσω" border="0"></a> 
        &nbsp; <a href="#top"><img src="top.gif" border="0" alt="πάνω"></a> 
      </div>
    </td>
  </tr>
</table>
</body>
</html>
