<?
session_start();
$username=$_SESSION['user'];
include("opendb.php");


$query="select level from bruser where username='$username' and brcode='$brcode'";
$rslt=mysqli_query($db,$query);
$row1=mysqli_fetch_row($rslt);

 $brnch1=mysqli_query($db,"select brname from branch  where brcode='$brcode' ");
 $res3=mysqli_fetch_row($brnch1);



?>
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    <title>Xpress</title>
    <script type="text/javascript" src="scripts/jquery-latest.js"></script>
	<link type="text/css" href="includes/style1.css" rel="stylesheet" />
     

    <script type="text/javascript">
      
    </script>
<style>


.tble td{

 -moz-box-shadow:inset 0px -3px 7px 0px #ffffff;
	-webkit-box-shadow:inset 0px -3px 7px 0px #ffffff;
	box-shadow:inset 0px -3px 7px 0px #ffffff;
	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf));
	background:-moz-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
	background:-webkit-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
	background:-o-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
	background:-ms-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
	background:linear-gradient(to bottom, #ededed 5%, #dfdfdf 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf',GradientType=0);
	background-color:#ededed;
	-moz-border-radius:3px;
	-webkit-border-radius:3px;
	border-radius:3px;
	border:1px solid #dcdcdc;
	//display:inline-block;
	cursor:pointer;
	color:#777777;
	font-family:arial;
	font-size:13px;
	padding:9px 23px;
	text-decoration:none;
	text-shadow:0px 1px 0px #ffffff;
	width:150px;
}


.pop-up2 {position:absolute; top:10%;right:12%; }
//.pop-up2:target {position:static; }

.popBox2 {
  background:white;

 
  width:12%;
  height:5%;



   z-index:1;

  border:1px solid #3a3a3a;


-moz-box-shadow:inset 0px -3px 7px 0px #ffffff;
	-webkit-box-shadow:inset 0px -3px 7px 0px #ffffff;
	box-shadow:inset 0px -3px 7px 0px #ffffff;
	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf));
	background:-moz-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
	background:-webkit-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
	background:-o-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
	background:-ms-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
	background:linear-gradient(to bottom, #ededed 5%, #dfdfdf 100%);

  	opacity:0;
 	-webkit-transition: opacity 0.5s ease-in-out;
 	-moz-transition: opacity 0.5s ease-in-out;
  	-o-transition: opacity 0.5s ease-in-out;
 	-ms-transition: opacity 0.5s ease-in-out;
       transition: opacity 0.5s ease-in-out; 
}
:target .popBox2 {position:fixed; opacity:1;}

.popBox2:hover {box-shadow:3px 3px 6px #5a5a5a;}



.lightbox {display:none; text-indent:0em; background:white; opacity:0.0; width:100%; height:100%; position:fixed; top:5px; left:0; bottom:0; right:0;}
:target .lightbox {display:block}


.popScroll2 {position:absolute; top:9%; left:3%; right:3%; bottom:9%;  padding-right:0.5em}
  




.pop-up2 :after{ 
position:absolute; top:10%;right:12%;
content:'';
display:#ededed;
position:absolute;
top:-20px; 
left:118px;
width:0;
height:0;
border-color: transparent transparent #ededed transparent;
border-style: solid;
border-width: 10px;
}


.myButton {
      
	color:white;
	font-family:arial;
	font-size:13px;
	
	
}


</style>
</head>
<body bgcolor="EEEECE">
<?

 if($switch_branch){

   if(strlen($branch_code)>0){

  	  unset($brcode);
	  session_register("brcode");
  	  $brcode=$branch_code;
         
    }

   else{

        print "<script>alert('Invalid Branch Selection');</script>";
   }

  print "<script>document.location='mach_menu.php';</script>";      
 }
else {
?>



<?php include('includes/top.php'); ?>
<br/>

<table width='100%'><tr><td align='left'><font style="font-family: 'Trebuchet MS',Verdana,Helvetica,sans-serif; font-size:15px;">  &nbsp;&nbsp;Master >> Machine</font></td>
<td align='right'  class="myButton">Branch: <? echo $res3[0];?><a href="#pop2" id="links"  style='color:white' ><i>  (Change)</i></a></td></tr></table>


<div id="pop2" class="pop-up2" >
  <div class="popBox2">
    <div class="popScroll2" id='popScroll2' style="background-color:#ededed;border:1px solid grey; ">
	<center>

    <form action='<?print $PHP_SELF ?>'> 
    <select name="branch_code" id="branch_code" style="width:80px;" >

	<option value=''>--SELECT--</option>
<?
	$xx=mysqli_query($db,"select * from bruser where level='$row1[0]' and brcode<>'$brcode' ");
	while($xx1=mysqli_fetch_array($xx))
	{

           
         $brnch=mysqli_query($db,"select brname from branch  where brcode='$xx1[0]' ");
         $res1=mysqli_fetch_row($brnch);

 	print "\n<option value='$xx1[0]'>$res1[0]</option>";

	}
?>
</select>
<input type=submit name='switch_branch' value='Go'/>
</form>
    </div>
 
  </div>


  <a href="#links" class="lightbox"></a>
</div>





<CENTER>
<BR>
<table border='0' class='tble' id='container' height='500' border='1' style='border-collapse:collapse;border:1 px solid grey; '>
<tr><? if($row1[0]!=6) { ?><td class="img"><a href="gateentry2.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Gate Entry</a></td><? } if($row1[0]==5) { ?> 
<td class="img"><a href="print_vehreceived1.php" style="text-decoration:none;" ><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Vehicle Received Report</a></td>
<td class="img"><a href="empdetails.php" style="text-decoration:none;" ><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Employee Details</a></td> 
<td class="img"><a href="print_workstat1.php" style="text-decoration:none;" ><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Vehicle Delivery List</a></td><? } if($row1[0]!=6) { ?> 
<td class="img"><a href="porder.php" style="text-decoration:none;" ><img src="images/supplier.png" width="80" height="80"  border='0'><br/>PurchaseOrder</a></td>

<? } if($row1[0]==6) { ?> 
<td class="img"><a href="print_vehreceived1.php" style="text-decoration:none;" ><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Vehicle Received Report</a></td>
<td class="img"><a href="empdetails.php" style="text-decoration:none;" ><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Employee Details</a></td> 
<td class="img"><a href="print_workstat1.php" style="text-decoration:none;" ><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Vehicle Delivery List</a></td>
<td class="img"><a href="mis_repo.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>MIS Report</a></td>
<td class="img"><a href="sale_repo.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Sales Register</a></td>
<!--<td class="img"><a href="invtilrepo.php" style="text-decoration:none;" ><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Invoice Till Report</a></td>
<td class="img"><a href="invrepo.php" style="text-decoration:none;" ><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Invoice Report</a></td> -->
<? } ?> 
</tr>


<tr><? if($row1[0]==6) { ?><td class="img"><a href="debtaging.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Debtors Ageing</a></td>
<td class="img"><a href="cr.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Creditors Ageing</a></td>
<td class="img"><a href="spares/stockrepodw.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Stock Report</a></td>
<td class="img"><a href="print_cbook1.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Cash Book</a></td>
<td class="img"><a href="print_bbook1.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Bank Book</a></td>
<? }?>
</tr>

<tr><? if($row1[0]==6) { ?>
<td class="img"><a href="sealedge.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Search Ledger</a></td>
<td class="img"><a href="daybookmnu.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Daily Statment with Cash balance</a></td>

<!--<td class="img"><a href="print_purchaserpt.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Purchase Report</a></td>
<td class="img"><a href="print_pur_reg1.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Purchase Register</a></td>-->

<td class="img"><a href="print_inv_reg1.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>Invoice Register</a></td>
<? 

if($username=='mdwwa' || $username=='ceo'|| $username=='reports')
{
?>
<td class="img"><a href="pandlmnu.php" style="text-decoration:none;"><img src="images/supplier.png" width="80" height="80"  border='0'><br/>P & L</a></td>

<? } }?>
</tr>




<tr>




<tr ><th align='center' colspan='4'><!--<input type='hidden' name='imagename'><input type='submit' name='save' value='Set as background image'>--></th></tr></form>
</table>

<br/><br/>



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

<?
}
?>
</body>



</html>
