<html>
<head>
<title>Web management</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<link rel="stylesheet" href="../styles.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="10"> 
<table width="600" border="1" cellspacing="0" cellpadding="0" align="center" class="webadmintext" bordercolor="#999999" bgcolor="#FFFFFF">
  <tr> 
    <td bgcolor="#666666" bordercolor="#666666"> 
      <div align="center" class="white">GUESTBOOK - ΜΕΛΗ</div>
    </td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF" bordercolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="1" cellpadding="2" class="webadmintext" bgcolor="#FFFFFF">
        <tr valign="top"> 
          <td width="200">ΣΤΟΙΧΕΙΑ</td>
          <td>ΚΕΙΜΕΝΟ</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td bordercolor="#FFFFFF" bgcolor="#FFFFFF"> 
      <?php 
			include 'connect.php';
	 	$result1 = mysql_query("SELECT * FROM siteinfo",$dbh);
			$myrow=mysql_fetch_array($result1); 
			$firma=$myrow['firma'];
			$sitemail=$myrow['sitemail'];
?>
      <?php 
			include 'connect.php';
						$sql = "SELECT * FROM guestbook WHERE id<'$start1' ORDER BY id desc LIMIT 0,20";
			$result = mysql_query($sql);
						$count=$start1;
			while ($myrow=mysql_fetch_array($result)) {
			$count++;
			$id=$myrow['id'];
			$name=$myrow['name'];
			$greek=$myrow['greek'];
			$city=$myrow['city'];
			$country=$myrow['country'];
			$mail=$myrow['mail'];
			$description=$myrow['description'];
			$publish=$myrow['publish'];
			$date=$myrow['date'];
?>
      <table width="100%" border="0" cellspacing="1" cellpadding="2" class="webadmintext" bgcolor="#FFFFFF">
        <tr valign="top" bgcolor="#F2F2F2"> 
          <td width="200"> <b> 
            <?php echo $name  ?>
            </b> <br>

            <a href="mailto:<?php echo $mail ?>?subject=Message from <?php echo $firma ?> guestbook" class="webadminlinks"> 
            <?php echo $mail ?>
            </a><br>
            <?php echo $city  ?>
            - 
            <?php echo $country  ?>
            <br>
            Δημοσίευση: 
            <?php if ($publish!='no') { ?>
            <b>ΝΑΙ</b> 
            <?php } else { ?>
            <font color="#CC0000"><b>ΟΧΙ</b></font> 
            <?php } ?>
          </td>
          <td> <b> 
            <?php $s_year = substr("$date", 0, 4);   ?>
            <?php $s_month = substr("$date", 5, 2);   ?>
            <?php $s_day = substr("$date", 8, 2);   ?>
            <?php  echo $s_day ?>
            .
            <?php  echo $s_month ?>
            .
            <?php  echo $s_year ?>
            </b> <br>
            <?php echo $description  ?>
          </td>
          <td width="60"> 
            <div align="center"><a href="edit-guest.php?id=<?php echo $id?>" class="webadminlinks">ΑΛΛΑΓΗ</a></div>
          </td>
          <td width="60"> 
            <div align="center"><a href="delete-guest.php?id=<?php echo $id?>" class="webadminlinks">ΔΙΑΓΡΑΦΗ</a></div>
          </td>
        </tr>
      </table>
      <?php			
	}
?>
    </td>
  </tr>
  <tr>
    <td bordercolor="#FFFFFF" bgcolor="#FFFFFF"><a href="mailto:<?php echo $sitemail ?>?Bcc=<?php 
			include 'connect.php';
			$sql = "SELECT * FROM guestbook WHERE id<'$start1' ORDER BY id desc LIMIT 0,20";
			$result = mysql_query($sql);
						$count=$start1;
			while ($myrow=mysql_fetch_array($result)) {
			$count++;
			$id=$myrow['id'];
		    $mail=$myrow['mail'];?><?php echo $mail ?>,<?php }?>&subject=<?php echo $firma ?>" class="webadminlinks">&gt;&gt; 
      mail to all</a></td>
  </tr>
  <tr>
    <td bordercolor="#FFFFFF" bgcolor="#FFFFFF">
      <div align="center"> 
        <?php $start1=$id ?>
        <?php
$start=($start+ 20) ?>
        <?php if ( $start >=$num_rows )    {?>
        <a href="javascript:history.go(-1);" class="webadminlinks">&lt;&lt; προηγούμενα</a> 
        <?php }else{ ?>
        <a href="javascript:history.go(-1);" class="webadminlinks">&lt;&lt; προηγούμενα</a> 
        &nbsp; <a href="all-guestsnext.php?num_rows=<?php echo $num_rows ?>&start=<?php echo $start ?>&start1=<?php echo $start1 ?>" class="webadminlinks">επόμενα 
        &gt;&gt; </a> 
        <?php } ?>
      </div>
    </td>
  </tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="4" align="center">
  <tr>
    <td>
      <div align="center"> <a href="javascript:history.go(-1);"><img src="back.gif" alt="πίσω" border="0"></a> 
        &nbsp; <a href="#top"><img src="top.gif" border="0" alt="πάνω"></a> 
      </div>
    </td>
  </tr>
</table>
</body>
</html>
