<!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>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>
    
<div><img src="img/frame-list.png" width="180" height="37" alt=""></div>
<div class="frame">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><div class="titles">
      <?php
            $result = mysql_query("SELECT * FROM rooms WHERE insert_id='{$_REQUEST['roomid']}' AND lang_id=1",$dbh);
			$myrow=mysql_fetch_array($result); 
			$room=$myrow['name'];
?>
      <?php echo $room ?></div></td>
  </tr>
  <tr>
    <td><?php
			$sql = "SELECT * FROM specscategories WHERE lang_id=1 ORDER BY priority";
			$result = mysql_query($sql);
        	while ($myrow=mysql_fetch_array($result)) {
			$catid=$myrow['insert_id'];
			$category=$myrow['title'];
?></td>
  </tr>
  <tr>
    <td>
    <table width="100%" border="0" cellspacing="1" cellpadding="4">
        <tr valign="top"> 
          <td width="200" bgcolor="#F2F2F2"> 
            <?php echo $category   ?>
          </td>
          <td> 
            <?php
			$sql2 = "SELECT * FROM specs WHERE room_id='{$_REQUEST['roomid']}' AND category_id='$catid' AND lang_id=1 ORDER BY priority";
			$result2 = mysql_query($sql2);
	while ($myrow=mysql_fetch_array($result2)) {
			$id=$myrow['id'];
			$room_id=$myrow['room_id'];
			$insert_id=$myrow['insert_id'];
			$name=$myrow['name'];
			$publish=$myrow['publish'];
?>
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr valign="top"> 
                <td bgcolor="#F2F2F2"> 
                  <b><?php echo $name ?></b>
                  <?php if ($publish=='no') { ?>
            <div style="color:#666666; font-weight:bold; padding-top:5px;">&raquo; ΔΗΜΟΣΙΕΥΣΗ <font color="#d64111">ΟΧΙ</font></div><?php } ?>
                   </td>
                <td width="70" align="center" bgcolor="#F2F2F2"><div style="margin-top:3px"><a href="edit-spec.php?id=<?php echo $insert_id?>" class="link">ΑΛΛΑΓΗ</a></div></td>
                <td width="70" align="center" bgcolor="#F2F2F2"><?php
if  (isset($_POST['submit'])) {
$sql10="DELETE FROM specs WHERE insert_id='{$_REQUEST['insertid']}'";
	$result10=mysql_query($sql10);	
?>
                  <meta http-equiv="refresh" content="0;URL=all-specs.php?roomid=<?php echo $room_id ?>">
                  <?php } ?>
                  <form name="forma" method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" enctype="multipart/form-data" style="margin:0; padding:0">
                    <input type="hidden" name="id" value="<?php echo $id ?>">
                    <input type="hidden" name="roomid" value="<?php echo $room_id ?>">
                    <input type="hidden" name="insertid" value="<?php echo $insert_id ?>">
                    <input type="submit" name="submit" value="ΔΙΑΓΡΑΦΗ" class="link">
                  </form></td>
              </tr>
            </table><?php } ?>
          </td>
        </tr>
      </table>
    <hr></td>
  </tr>
  <tr>
    <td><?php } ?></td>
  </tr>
  </table>
</div>
<div align="right"><a href="all-rooms.php" class="links">μεταφορά στην Λίστα</a></div></td>
  </tr>
</table>
<?php include 'menudown.php';?>
</body>
</html>
