<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Web management</title>
<link rel="stylesheet" href="styles.css" type="text/css">
<?php include 'codes.php';?>
</head>
<body>

    <?php
$accommodation = mysql_real_escape_string(stripslashes($_REQUEST['accommodation']));
$info = mysql_real_escape_string(stripslashes($_REQUEST['info']));
$loyalty = mysql_real_escape_string(stripslashes($_REQUEST['loyalty']));
$newsletter = mysql_real_escape_string(stripslashes($_REQUEST['newsletter']));	  
$guestbook = mysql_real_escape_string(stripslashes($_REQUEST['guestbook']));	 

if  (isset($_POST['submit'])) {
	$sql="UPDATE menu SET accommodation='$accommodation', info='$info', loyalty='$loyalty', newsletter='$newsletter', guestbook='$guestbook' WHERE id='1'";
	$result = mysql_query($sql);	
?>
<meta http-equiv="refresh" content="0;URL=menu.php">
<?php
} else {	
			$result = mysql_query("SELECT * FROM menu WHERE id='1'",$dbh);
			$myrow=mysql_fetch_array($result); 
			$accommodation=$myrow['accommodation'];
			$info=$myrow['info'];
			$loyalty=$myrow['loyalty'];
			$newsletter=$myrow['newsletter'];
			$guestbook=$myrow['guestbook'];
?>

<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>
    
    <form name="forma" method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" enctype="multipart/form-data">

<div><img src="img/frame-edit.png" width="180" height="37" alt=""></div>
<div class="frame">
 <table width="100%" border="0" cellspacing="0" cellpadding="4">
          <tr>
            <td align="center"><img src="img/ic3.png" alt=""><span class="titles">Menu</span></td>
          </tr>
          <tr class="lines">
            <td></td>
          </tr>
          <tr>
            <td>
              <table width="100%" border="0" cellspacing="1" cellpadding="4">
                <tr valign="top" bgcolor="#F2F2F2">
                  <td>Ξενοδοχείο</td>
                  <td>Κείμενα info</td>
                  <td>Guestbook</td>
                  <td>Newsletter</td>
                  <td>Loyalty</td>
                  </tr>
                <tr>
                  <td>
                    
                    <?php if ($accommodation==0) { ?>
                    <input type="hidden" name="accommodation" value="0" /> <input type="checkbox" name="accommodation" value="1" />  
                    <?php }else{?>
                    <input type="hidden" name="accommodation" value="0" /> <input name="accommodation" type="checkbox" value="1" checked />  
                    <?php } ?>
                  </td>
                  <td>
                    <?php if ($info==0) { ?>
                    <input type="hidden" name="info" value="0" /> <input type="checkbox" name="info" value="1" />  
                    <?php }else{?>
                    <input type="hidden" name="info" value="0" /> <input name="info" type="checkbox" value="1" checked />  
                    <?php } ?>
                  </td>
                  <td>
                    <?php if ($guestbook==0) { ?>
                    <input type="hidden" name="guestbook" value="0" /> <input type="checkbox" name="guestbook" value="1" />  
                    <?php }else{?>
                    <input type="hidden" name="guestbook" value="0" /> <input name="guestbook" type="checkbox" value="1" checked />  
                    <?php } ?>
                  </td>
                  <td>
                    <?php if ($newsletter==0) { ?>
                    <input type="hidden" name="newsletter" value="0" /> <input type="checkbox" name="newsletter" value="1" />  
                    <?php }else{?>
                    <input type="hidden" name="newsletter" value="0" /> <input name="newsletter" type="checkbox" value="1" checked />  
                    <?php } ?>
                  </td>
                  <td><?php if ($loyalty==0) { ?>
                    <input type="hidden" name="loyalty" value="0" />
                    <input type="checkbox" name="loyalty" value="1" />
                    <?php }else{?>
                    <input type="hidden" name="loyalty" value="0" />
                    <input name="loyalty" type="checkbox" value="1" checked />
                    <?php } ?></td>
                  </tr>
              </table></td>
          </tr>
          </table>

  <div align="center" style="padding:5px">
   <input type="submit" name="submit" value="Καταχώρηση" class="button">
        <input type="reset" name="reset" value="Επαναφορά" class="button">
  </div>
</div>
</form></td>
  </tr>
</table><?php include 'menudown.php';?>
<?php } ?>
</body>
</html>
