<!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
			$sql = "SELECT * FROM infocategories";
			$result = mysql_query($sql);
			$nu_row = mysql_num_rows($result);
?>
        <?php echo $nu_row  ?> </div></td>
  </tr>
  <tr>
    <td><?php
			$sql1 = "SELECT * FROM infocategories WHERE level=1 AND lang_id=1 ORDER BY priority";
			$result1 = mysql_query($sql1);
        	while ($myrow=mysql_fetch_array($result1)) {
			$id=$myrow['id'];
			$insert_id=$myrow['insert_id'];
			$title=$myrow['title'];
			$publish=$myrow['publish'];
			$priority=$myrow['priority'];
?></td>
  </tr>
  <tr>
    <td>
    <table width="100%" border="0" cellspacing="1" cellpadding="4">
        <tr valign="top">
          <td width="30" bgcolor="#F2F2F2"><?php echo $priority ?></td> 
          <td width="200" bgcolor="#F2F2F2">
		  <?php
			$sql3 = "SELECT * FROM info WHERE category_id='$insert_id' AND lang_id=1";
			$result3= mysql_query($sql3);
			$nu_row3 = mysql_num_rows($result3);
?>
            <?php 
	if  ( ( $nu_row3==0)) {
	?>
            <?php echo $title ?>
            <?php } else {?>
            <a href="all-info.php?catid=<?php echo $insert_id?>" class="links"> <?php echo $title ?></a> <b> [<?php echo $nu_row3  ?>] </b>
          <?php } ?>
          <?php if ($publish=='no') { ?>
            <div style="color:#666666; font-weight:bold; padding-top:5px;">&raquo; ΔΗΜΟΣΙΕΥΣΗ <font color="#d64111">ΟΧΙ</font></div><?php } ?>
            </td>
          <td><?php 
			$sql2 = "SELECT * FROM infocategories WHERE level=2 AND lang_id=1 AND parent='$insert_id' ORDER BY priority";
			$result2 = mysql_query($sql2);
			$nu_row2 = mysql_num_rows($result2);
	        while ($myrow=mysql_fetch_array($result2)) {
			$id2=$myrow['id'];
			$insert_id2=$myrow['insert_id'];
			$title2=$myrow['title'];
			$publish=$myrow['publish'];
			$priority2=$myrow['priority'];
?>
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr valign="top">
                <td width="30" bgcolor="#F2F2F2"><?php echo $priority2 ?></td>
                <td bgcolor="#F2F2F2"> 
                  <?php
			$sql4 = "SELECT * FROM info WHERE category_id='$insert_id2' AND lang_id=1";
			$result4= mysql_query($sql4);
			$nu_row4 = mysql_num_rows($result4);
?>
                  <?php 
	if  ( ( $nu_row4==0)) {
	?>
                  <?php echo $title2 ?>
                  <?php } else {?>
                  <a href="all-info.php?catid=<?php echo $insert_id2?>" class="links"> <?php echo $title2 ?></a> <b> [<?php echo $nu_row4  ?>] </b>
                  <?php } ?>
                  <?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" bgcolor="#F2F2F2"> 
                  <div align="center"><a href="edit-infocategory.php?id=<?php echo $insert_id2?>" class="link">ΑΛΛΑΓΗ</a></div>
                </td>
                <td width="70" bgcolor="#F2F2F2"><div align="center"><a href="delete-infocategory.php?id=<?php echo $insert_id2?>" class="link">ΔΙΑΓΡΑΦΗ</a></div></td>
                </tr>
              </table><?php } ?>
          </td>
          <td width="70"><div align="center"><a href="edit-infocategory.php?id=<?php echo $insert_id?>" class="link">ΑΛΛΑΓΗ</a></div></td>
          </tr>
      </table>
    <hr></td>
  </tr>
  <tr>
    <td><?php } ?></td>
  </tr>
</table>
</div>
</td>
  </tr>
</table>

<?php include 'menudown.php';?>
</body>
</html>
