<!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 nlcategories WHERE id='{$_REQUEST['catid']}'",$dbh);
			$myrow=mysql_fetch_array($result); 
			$catid=$myrow['id'];
			$cat=$myrow['title'];
			
?>
      <?php echo $cat ?></div></td>
  </tr>
  <tr>
    <td><?php require_once 'navibar.php'; ?>
      <?php  $nav = new navibar; ?>
      <?php
$sql = "SELECT * FROM nlmembers WHERE category_id='{$_REQUEST['catid']}' ORDER BY id desc";
$result = $nav->execute($sql, $db);
$rows = mysql_num_rows($result);
for ($y = 0; $y < $rows; $y++) {
 $count=0;
  while ($myrow=mysql_fetch_array($result)) {
 $count++;
		    $id=$myrow['id'];
			$category_id=$myrow['category_id'];
			$name=$myrow['name'];
			$email=$myrow['email'];
			$address=$myrow['address'];
			$city=$myrow['city'];
			$tel=$myrow['tel'];
			$comments=$myrow['comments'];
	
 ?></td>
  </tr>
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="1" cellpadding="4">
        <tr valign="top" bgcolor="#F2F2F2"> 
          <td bgcolor="#F2F2F2"> <b> 
            <?php echo $name ?>
            </b> 
            <hr>
            <table width="100%" border="0" cellspacing="0" cellpadding="2">
              
              <tr> 
                <td valign="top" width="80">Διεύθυνση</td>
                <td valign="top"> 
                  <?php echo $address ?>
                  <br>
                  <?php echo $city ?>
                  </td>
                </tr>
              <tr> 
                <td valign="top">Τel.</td>
                <td valign="top"> 
                  <?php echo $tel ?>
                  </td>
                </tr>
              <tr>
                <td valign="top">E-mail</td>
                <td valign="top"><a href="mailto:<?php echo $email ?>?subject=<?php echo $firma?> Newsletter" class="links"> <?php echo $email ?> </a></td>
                </tr>
              </table>
            </td>
          <td width="250"> 
            <b>ΣΧΟΛΙΑ </b><br>
            <?php echo $comments   ?>
            </td>
          <td width="70" align="center"><div style="margin-top:3px"><a href="edit-nlmember.php?id=<?php echo $id?>" class="link">ΑΛΛΑΓΗ</a></div></td>
          <td width="70" align="center"><?php
if  (isset($_POST['submit'])) {
$sql10="DELETE FROM nlmembers WHERE id='{$_REQUEST['id']}'";
	$result10=mysql_query($sql10);	
?>
            <meta http-equiv="refresh" content="0;URL=all-nlmembers.php?catid=<?php echo $category_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="catid" value="<?php echo $category_id ?>">
<input type="submit" name="submit" value="ΔΙΑΓΡΑΦΗ" class="link">
              </form></td>
          </tr>
        </table>
      <hr></td>
  </tr>
  <tr>
    <td>
      <?php } ?>
      <?php } ?></td>
  </tr>
  <tr>
    <td align="center"><a href="mailto:<?php echo $sitemail1 ?>?Bcc=<?php 
			$sql20 = "SELECT * FROM nlmembers WHERE id>='$id' ORDER BY id LIMIT 20";
			$result20 = mysql_query($sql20);
			while ($myrow=mysql_fetch_array($result20)) {
			$id=$myrow['id'];
		   $email=$myrow['email'];?><?php echo $email ?>,<?php }?>&subject=<?php echo $firma1 ?>" class="links">&gt;&gt; 
      mail to all</a></td>
  </tr>
  <tr>
    <td align="center"><?php
$links = $nav->getlinks("all", "on");
for ($y = 0; $y < count($links); $y++) {
  echo $links[$y] . "&nbsp;&nbsp;";
}
?></td>
  </tr>
  </table>
</div>

<div align="right">               
 <?php
if  (isset($_POST['submit'])) {
$sql10="DELETE FROM nlmembers WHERE name IS NULL OR comments LIKE ('%http%')";
	$result10=mysql_query($sql10);	
?>
 <meta http-equiv="refresh" content="0;URL=all-nlcategories.php">   
 <?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="submit" name="submit" value="Διαγραφή spam" class="link"></form>
           </div>
</td>
  </tr>
</table>
<?php include 'menudown.php';?>
</body>
</html>
