<?php 
require("../connection.php");
include("../user.php");
$user_id=$_SESSION['user'];
$username=$_SESSION['user_name'];
$branch_id=$_SESSION['branch_id'];
$ho_access=$_SESSION['ha'];
?>
<html>
<head>
  <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?php echo TITLE;?></title>
    <meta name="description" content="Ela Admin - HTML5 Admin Template">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="apple-touch-icon" href="../images/bluebase.png">
    <link rel="shortcut icon" href="../images/bluebase.png">

    <link rel="stylesheet" href="../css/normalize.min.css">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/themify-icons.css">
    <link rel="stylesheet" href="../css/pe-icon-7-stroke.min.css">
    <link rel="stylesheet" href="../css/flag-icon.min.css">
    <link rel="stylesheet" href="../assets/css/cs-skin-elastic.css">
    <link rel="stylesheet" href="../assets/css/style.css">
    <link href="../css/chartist.min.css" rel="stylesheet">
    <link href="../css/jqvmap.min.css" rel="stylesheet">

    <link href="../css/weather-icons.css" rel="stylesheet" />
    <link href="../css/fullcalendar.min.css" rel="stylesheet" />

<script src="../js/jquery-1.12.4.min.js"></script>
<script src="../js/jquery-3.3.1.js"></script>
<script src="../js/jquery.dataTables.min.js"></script>


    <script src="../js/popper.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/jquery.matchHeight.min.js"></script>
    <script src="../assets/js/main.js"></script>
    <script src="../js/jquery-3.3.1.min.js"></script>
   <style>
    #weatherWidget .currentDesc 
	{
        color: #ffffff!important;
    }
        .traffic-chart {
            min-height: 335px;
        }
        #flotPie1  {
            height: 150px;
        }
        #flotPie1 td {
            padding:3px;
        }
        #flotPie1 table {
            top: 20px!important;
            right: -10px!important;
        }
        .chart-container {
            display: table;
            min-width: 270px ;
            text-align: left;
            padding-top: 10px;
            padding-bottom: 10px;
        }
        #flotLine5  {
             height: 105px;
        }

        #flotBarChart {
            height: 150px;
        }
        #cellPaiChart{
            height: 160px;
        }
th{
	text-transform:uppercase;
}
td{
	text-transform:uppercase;
}
    </style>

<link rel="stylesheet" href="<?php echo URL; ?>datatable/css/jquery.dataTables.min.css">
<script src="<?php echo URL; ?>datatable/js/jquery.datatables.min.js"></script>
<!-- button --><link rel="stylesheet" type="text/css" href="<?php echo URL; ?>button/css/buttons.css" /><!-- button -->

<script>
$(document).ready(function() {
		$('#example').DataTable();
		} );
</script>
</head>
<body>
 <?php require('../sidemenu.php');?>
    <!-- /#left-panel -->
    <!-- Right Panel -->
    <div id="right-panel" class="right-panel">
        <!-- Header-->
        <?php require('../header.php');?>
 <div class="col-lg-8">
	<div class="card">
		<div class="card-header">
		<strong>INVENTORY CREATION</strong>
					
		</div>
	<div class="card-body card-block">
<form  method="post" enctype="multipart/form-data" class="form-horizontal" action="inventory_submit.php">
	<?php 
	if($ho_access=="yes")
	{
	?>  
<div class="row form-group">
		<div class="col col-md-3"><label for="text-input" class=" form-control-label">Branch</label><span style="color:red;">*</span></div>
		<div class="col-12 col-md-9">
		<select id="branch" name="branch" placeholder="select Branch" class="form-control"autocomplete="off"  onchange="get_pono(this.value)" required>
		<option  selected disabled>Select Branch</option>
		 <?php
					  $brn=mysqli_query($con,"SELECT * FROM branch_master where  status='0' order by id asc");
					while($brc=mysqli_fetch_array($brn))
					{
					?>
						  <option value="<?php echo $brc['id']; ?>"><?php echo strtoupper($brc['branch_name']); ?></option>
						    <?php
					}
					?>
		</select></div>
		</div>
		<div class="row form-group" id="po_num_select">
		
		<div class="col col-md-3"><label class=" form-control-label">PO Number</label></div>
		<div class="col-12 col-md-9"><select name="po_number" class="form-control" >
		<option selected disabled>Select PO</option>
		
		</select>
		</div>
		</div>
		<div class="row form-group">
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">PO date</label></div>
		<div class="col-12 col-md-9"><input type="text" name="po_date" id="po_date" class="form-control" placeholder="PO Date" readonly / ></div>
		</div>
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">Invoice No</label></div>
		<div class="col-12 col-md-9"><input type="text" name="invoice_no" id="invoice_no" class="form-control" placeholder="Invoice Number" readonly / ></div>
		</div>
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">Invoice date</label></div>
		<div class="col-12 col-md-9"><input type="text" name="invoice_date" placeholder="Invoice Date" id="invoice_date" class="form-control" readonly / ></div>
		</div>
		</div>
		<div class="row form-group">
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">Warranty</label></div>
		<div class="col-12 col-md-9"><input type="text" name="warranty" id="warranty" class="form-control"  placeholder="Warranty" readonly / ></div>
		</div>
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">Expired Date</label></div>
		<div class="col-12 col-md-9"><input type="text" name="exp_date" placeholder="Expired Date" id="exp_date" class="form-control"  readonly / ></div>
		</div>
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">Vendor</label></div>
		<div class="col-12 col-md-9"><input type="text" name="vendor" id="vendor" class="form-control"  placeholder="Vendor Name" readonly / ></div>
		</div>
		</div>
		<div class="row form-group">
		<div class="col col-md-3"><label class=" form-control-label">Remarks</label></div>
		<div class="col-12 col-md-9">
		<textarea name="remark" id="remark" class="form-control" placeholder="Remarks" readonly ></textarea>
		</div>
		</div>
		
		<div id="table_view">
		
		</div>
		
		
		<?php
	}
else 
{
	?>
	<div class="row form-group">
		<?php 
		$po=mysqli_query($con,"select * from inward_master where status=0 and branch='$branch_id'");
		//echo "select * from inward_master where status=0 and branch='$branch_id'";
		?>
		<div class="col col-md-3"><label class=" form-control-label">PO Number</label></div>
		<div class="col-12 col-md-9">
		<select name="po_number" class="form-control" onchange="get_podate(this.value)">
		<option selected disabled>Select PO</option>
		<?php 
		while($po_num=mysqli_fetch_array($po))
		{
		?>
		<option value="<?php echo $po_num['po_no'];?>"><?php echo $po_num['po_no'];?></option>
		<?php 
		}
		?>
		</select>
		</div>
		</div>
		<div class="row form-group">
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">PO date</label></div>
		<div class="col-12 col-md-9"><input type="text" name="po_date" id="po_date" class="form-control" placeholder="PO Date" readonly / ></div>
		</div>
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">Invoice No</label></div>
		<div class="col-12 col-md-9"><input type="text" name="invoice_no" id="invoice_no" class="form-control" placeholder="Invoice Number" readonly / ></div>
		</div>
		<div class="col col-md-4">
	<div class="col col-md-3"><label class=" form-control-label">Invoice date</label></div>
		<div class="col-12 col-md-9"><input type="text" name="invoice_date" placeholder="Invoice Date" id="invoice_date" class="form-control" readonly / ></div>
		</div>
		</div>
		<div class="row form-group">
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">Warranty</label></div>
		<div class="col-12 col-md-9"><input type="text" name="warranty" id="warranty" class="form-control"  placeholder="Warranty" readonly / ></div>
		</div>
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">Expired Date</label></div>
		<div class="col-12 col-md-9"><input type="text" name="exp_date" placeholder="Expired Date" id="exp_date" class="form-control"  readonly / ></div></div>
		<div class="col col-md-4">
		<div class="col col-md-3"><label class=" form-control-label">Vendor</label></div>
		<div class="col-12 col-md-9"><input type="text" name="vendor" id="vendor" class="form-control"  placeholder="Vendor Name" readonly / ></div>
		</div>
		</div>
		<div class="row form-group">
		<div class="col col-md-3"><label class=" form-control-label">Remarks</label></div>
		<div class="col-12 col-md-9">
		<textarea name="remark" id="remark" class="form-control" placeholder="Remarks" readonly ></textarea>
		</div>
		</div>
		<div id="table_view">
		
		</div>
		
			
	<?php
}
	?>	
		
		<button type="submit" name="submit" class="btn btn-success" ><i class="fa fa-dot-circle-o"></i> Submit</button>
</form>
</div>
	
	</div>
	</div>
	<div class="clearfix"></div>
	</div>
	</body>
	</html>
	
	
<?php require("../mainjavascript.js");

			require ("checkbox.js");
?>
