<?php include ("app_needed/config.php");
require_once("app_classes/module_sizes.inc"); 
if(!$_SESSION[unique])
header("Location: ".APP_WEBSITE."/login.html");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?= language("CHARSET") ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?= language('PAGE_admin_categories_title') ?> - <?= $config->get_value('platform_title') ?></title>
<link rel="shortcut icon" type="image/png" href="<?= $config->get_value('platform_favicon') ?>"/>
<link href="app_needed/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="app_needed/style.tipsy.css" type="text/css" />
</head>

<body>
<div id="wrapper">
	<?php include("module.header.php"); ?>
	<?php include ("module.menu.php"); ?>
	<div class="content">
		<div class="info">
        <div class="left">
		<h1>Ads Sizes List</h1>
        </div>
        <div class="clear"></div>
		</div>
        <div class="box">
              <form  name="my-form" action="app_needed/ajax.functions.php" method="POST"  enctype="multipart/form-data">
              <input type="hidden" name="create_size" value="1" />
       	  <div class="inside">
          <div class="title">
       		<h2>Add a new size</h2>
            </div>
                
            <table width="100%" border="0">
                  <tr>
                    <td width="18%">Width</td>
                    <td width="82%"><input type="text" name="width"/></td>
                  </tr>
                  <tr>
                    <td>Height</td>
                    <td id="response2"><input type="text" name="height"/></td>
                  </tr>
                  <tr>
                    <td><input type="submit" value="<?= language('BUTTON_submit') ?>"  /></td>
                    <td id="response">&nbsp;</td>
                  </tr>
            </table>
       	  </div>
          </form>
   		 </div>
        <div class="list_head">
            <ul>
              <div class="clear"></div>
            </ul>
           <div class="box inside">
             <table width="100%" border="0">
               <tr>
                 <td width="24%"><?= language('TABLE_id')?></td>
                 <td width="67%">Size</td>
                 <td width="9%">Delete </td>
               </tr>
             </table>
           </div>
      	</div>
        <?php
      $sql = "SELECT * FROM `app_sizes` ";
		$result = mysql_query ($sql);
		$count = 0;
		while ($categories = mysql_fetch_array($result))
		{
		 
		 $size = new class_sizes($categories[unique]);
		?>
        <div class="box list" id="<?= $size->get_unique() ?>">
          <table width="100%" border="0">
            <tr>
              <td width="24%"><strong>#<?= $size->get_unique() ?></strong></td>
              <td width="67%"><?= $size ->get_size()?></td>
              <td width="9%"><a href="javascript:delete_size('<?= $size->get_unique() ?>')"><img src="app_images/icon-delete.png" width="24" class="tip" title="<?= language('ICON_size_delete') ?>"  /></a></td>
            </tr>
          </table>
        </div>
        <?php } ?>
    </div>
</div>
<div id='confirm'>
<div class="left">
	<div class='title'><span><?= language('CONFIRM') ?></span></div>
	<div class='message'></div>
</div>
<div class="right">
	<div class='buttons'>
				<span class='no simplemodal-close'><?= language('NO') ?></span><span class='yes'><?= language('YES') ?></span>
               
	</div>
</div>
<div class="clear"></div>
	</div>
		<!-- preload the images -->
	<div style='display:none'>
		<img src='img/confirm/header.gif' alt='' />
		<img src='img/confirm/button.gif' alt='' />
	</div>

<script type="text/javascript" src="app_needed/jquery-1.9.0.min.js"></script>
<script type='text/javascript' src='app_needed/jquery.accordionmenu.js'></script>
<script type='text/javascript' src='app_needed/jquery.checkbox.js'></script>
<script type='text/javascript' src='app_needed/jquery.tipsy.js'></script>
<script type='text/javascript' src='app_needed/function.ajax.js'></script>
<script type='text/javascript' src='app_needed/simply-toast.min.js'></script>
<script type='text/javascript' src='app_needed/jquery.simplemodal.js'></script>
<script type='text/javascript' src='app_needed/functions.js'></script>
</body>
</html>
<?php mysql_close($conn); ?>