<?php
  include "../include/dbcon.php";
  include "../include/CADMIN.php";
  include "../include/CPRODUCT.php";
  include "../include/CORDER.php";
?>
<?php
  if( !empty($_SESSION["SESID"]) ){
?>
<html>
<head>
<style>

	.mainpage{
	  background: url("../img/bg01.png");
		background-repeat: no-repeat;
		background-size:100% 100%;
	}
	
	.btn{
	  border:none;
	  cursor:pointer;
	   
	}
	
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body bgcolor="#FFFFFF">

<table width="100%" height="100%" border="0" class="mainpage">
<tr><td>

<table width="100%" height="100%" border="0">
  <tr>
    <!-- side menu -->
    <td valign="top" width="170px">
	
	<table border="0">
	  <tr>
	    <td>
		<a href="main.php?pg=pdt"><img src="img/ico_food.png" class="btn"></a>
		</td>
	  </tr>
	  <tr>
	    <td>
		<a href="main.php?pg=stk"><img src="img/ico_stock2.png" class="btn"></a>
		</td>
	  </tr>
	  <tr>
	    <td>
		<a href="main.php?pg=rpt"><img src="img/ico_report.png" class="btn"></a>
		</td>
	  </tr>
	  <tr>
	    <td>
		<a href="main.php?pg=pw"><img src="img/ico_password.png" class="btn"></a>
		</td>
	  </tr>
	  <tr>
	    <td>
		<a href="logout.php"><img src="img/ico_logout.png" class="btn"></a>
		</td>
	  </tr>
	</table>
	
	</td>
	
	<!-- content -->
	<td align="center">
	<?php
	  if( empty($_GET["pg"]) ){
	    $pg = "dft";
	  }else{
	    $pg = $_GET["pg"];
	  }
	?>
	<?php
	  switch($pg){
	    case "pw":
		  include "pg_password.php";
		  break;
	    case "pwe":
		  include "pg_password_ed.php";
		  break;
	    case "pdt":
		  include "pg_product.php";
		  break;
	    case "pdte":
		  include "pg_product_ed.php";
		  break;
	    case "pdtd":
		  include "pg_product_del_c.php";
		  break;
	    case "pdts":
		  include "pg_productsort.php";
		  break;
	    case "stk":
		  include "pg_stock.php";
		  break;
		case "rpt":
		  if(isset($_GET["ty"])){
		    $pty = $_GET["ty"];
			switch($pty){
			  case "dy":
			    include "rpt_dailys.php";
			    break;
			}
		  }else{
		    include "pg_report.php";
		  }
		  
		  break;
	  }
	?>
	</td>
	
  </tr>
  
</table>


</td>
</tr>
</table>

</body>
</html>

<?php
  }else{
	$_SESSION["errmsg"] = "#ERROR:<br>PLEASE LOGIN";
	header("location: index.php");
  }
?>