<!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 seasons";
			$result = mysql_query($sql);
			$nu_row = mysql_num_rows($result);
?>
        <?php echo $nu_row  ?> </div></td>
  </tr>
  <tr>
    <td><?php
			$sql = "SELECT * FROM seasons WHERE lang_id=1 ORDER BY id";
			$result = mysql_query($sql);
        	while ($myrow=mysql_fetch_array($result)) {
			$id=$myrow['id'];
			$insert_id=$myrow['insert_id'];
			$name=$myrow['name'];
			$date1=$myrow['date1'];
			$date2=$myrow['date2'];
?>
    </td>
  </tr>
  <tr>
    <td>
    <table width="100%" border="0" cellspacing="1" cellpadding="4">
        <tr valign="top" bgcolor="#F2F2F2"> 
          <td width="50"> 
            <?php echo $id ?>
          </td>
          <td> 
            <b><?php echo $name ?></b> &nbsp;
            <?php echo $date1 ?> & <?php echo $date2 ?>
             </td>
          <td width="70" align="center">
          <div style="margin-top:3px"><a href="edit-season.php?id=<?php echo $insert_id?>" class="link">ΑΛΛΑΓΗ</a></div>
          </td>
          <td width="70" align="center"> 
          
                <?php
if  (isset($_POST['submit'])) {
$sql10="DELETE FROM seasons WHERE insert_id='{$_REQUEST['insertid']}'";
	$result10=mysql_query($sql10);	
	
	$sql11="DELETE FROM prices WHERE season_id='{$_REQUEST['id']}'";
	$result11=mysql_query($sql11);
?>
 <meta http-equiv="refresh" content="0;URL=all-seasons.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="hidden" name="insertid" value="<?php echo $insert_id ?>">
<input type="submit" name="submit" value="ΔΙΑΓΡΑΦΗ" class="link"></form>
            
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><?php } ?></td>
  </tr>
</table>
</div>
</td>
  </tr>
</table>
<?php include 'menudown.php';?>
</body>
</html>
