<!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
$roomid = mysql_real_escape_string(stripslashes($_REQUEST['roomid']));
$infoid = mysql_real_escape_string(stripslashes($_REQUEST['infoid']));
?>
<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 if ($roomid=='') { 
$roomid=0;
	}?>
    <?php if ($infoid=='') { 
$infoid=0;
	}?>
             
 
        <?php
			$sql = "SELECT * FROM photos WHERE room_id='$roomid' AND info_id='$infoid'";
			$result = mysql_query($sql);
			$nu_row = mysql_num_rows($result);
?>

<?php echo $nu_row ?> 
        
        </div></td>
  </tr>
  <tr>
    <td><?php
			$sql = "SELECT * FROM photos WHERE room_id='$roomid' AND info_id='$infoid' ORDER BY priority";
			$result = mysql_query($sql);
         	while ($myrow=mysql_fetch_array($result)) {
			$id=$myrow['id'];
			$room_id=$myrow['room_id'];
			$info_id=$myrow['info_id'];
			$name=$myrow['name'];
			$priority=$myrow['priority'];
?>
      
  <div style="float: left; width: 170px; height: 120px; border: 1px solid #d8dbdf; padding:5px; margin:6px; text-align:center">
  <div style="padding:5px"><b><?php echo $priority ?></b></div>
   <a href="../photos/<?php echo $id ?>.jpg" class="plinks" rel="thumbnail"><img src="../photos/thumbs/<?php echo $id?>.jpg" alt="<?php echo $name?>" title="<?php echo $name?>" width="70" height="60" border="0"></a> 
    
  <div style="margin-top:10px">
  <div style="float:left; margin-top:3px"><a href="edit-photo.php?id=<?php echo $id?>" class="link">ΑΛΛΑΓΗ</a></div>
    <div style="float:right">
      <?php
if  (isset($_POST['submit'])) {
$sql10="DELETE FROM photos WHERE id='{$_REQUEST['id']}'";
	$result10=mysql_query($sql10);	
?>
      <meta http-equiv="refresh" content="0;URL=all-photos.php?roomid=<?php echo $room_id ?>&infoid=<?php echo $info_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="infoid" value="<?php echo $info_id ?>">
        <input type="submit" name="submit" value="ΔΙΑΓΡΑΦΗ" class="link">
        </form>
    </div>
  </div>
    
  </div>
      
      
  <?php } ?>
      
  </td>
  </tr>
  </table>
</div>
<div align="right">
  <?php if ($roomid!='0') { ?>
  <a href="all-rooms.php" class="links">μεταφορά στην Λίστα</a>
  <?php } ?>
  <?php if ($infoid!='0') { ?>
  <a href="all-infocategories.php" class="links">μεταφορά στην Λίστα</a>
  <?php } ?>
</div>
</td>
  </tr>
</table>
<?php include 'menudown.php';?>
</body>
</html>
