<?php
require("../connection.php");
include("../user.php");
$user_id=$_SESSION['user'];
$username=$_SESSION['user_name'];
?>

<!DOCTYPE html>
<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 class="skin-blue fixed sidebar-mini">
	 <?php require('../sidemenu.php');?>
<!-- /#left-panel -->
<!-- Right Panel -->
<div id="right-panel" class="right-panel">
<!-- Header-->
<?php require('../header.php');?>
<div class="content">
<!-- Animated -->
	  <div class="content-wrapper1">
	
		<!-- Main content -->
		
			<!-- Default box -->
		 <div class="col-12 col-md-12">
            <div class="col-md-3" style="padding-right:5px;    float: right;">
			 
			 <?php
				$item_row=mysqli_query($con,"SELECT im.id,em.employee_name,im.emp_code,im.issue_date,lm.location FROM non_consumable_issue im left join location_master lm on lm.id=im.location left join employee_master em on em.emp_no=im.emp_name order by im.id desc");			
				$s1=1;
			 ?>
				<div class="box box-primary">
					<div class="box-header with-border">
						<div class="" style="width:100%;float:left;" >
							<div class="input-group" style="width:100%;float:left;">
								<input type="hidden" name="filter" id="fil" value=""/>
								<input type="hidden" name="sort" id="st" value=""  />
								<input id="search1" class="form-control" type="text" placeholder="Enter Search Name..." value="" onChange="rs1()" name="filter[search]" style="width:100%;"/>
								<span class="input-group-btn"  >
								<button class="btn btn-flat" id="search-btn" name="search" onClick="rs1_non()"  type="submit" style="background-color:#0000ff;"><i class="fa fa-search" style="color: #fff;"></i></button>
								</span>
							</div>
						</div>
					</div><!-- /.box-header -->
					<div class="box-body" id="box-body" style="font-family:'Times New Roman', Times, serif">
						<ul class="nav nav-pills" style="float:left;max-height:450px;overflow-y:scroll; width:100%; " >
						<?php 
							while($item_res=mysqli_fetch_array($item_row))
							{
							?>
							<li style="border-top:1px solid #ddd; cursor:pointer;width:97%;"  class="active1" onClick="clic(this.id);" id="<?php echo $s1;?>" > 
							<input type="hidden" name="invoice" id="invoice<?php echo $s1;?>" value="<?php echo $item_res['id'];?>"  />
							<?php $s1++;?>
							<div id="attrib-advanced" class="tab-pane active">
								<div style="position:relative; color:blue; float:left; line-height: 80px;">
									<b><img alt=" img" class="user-image" src="/asset_temp/images/user.png" height="70" width="80"></b>
								</div><br>
					 			<div style="text-transform: uppercase;font-size: 16px;padding-top: 1px;color: #000;line-height: 18px; font-weight:bold;float:right; position:relative;" >
									<span style="font-weight:bold;font-size:13px;">
									<?php 
										echo $item_res['id'];
									?>
								</div><br>
								<div class="emp_name">
									<div style="text-transform: uppercase;line-height: 18px; font-weight:bold;float:right; position:relative;" >&nbsp;||
										<span style="font-weight:normal;font-size:12px; color:#0000ff;">
										<?php echo $item_res['employee_name']; echo " ";
										echo $item_res['location'];?> </span>
									</div>
								</div><br>		
								<div class="date">
									<div style="text-transform: uppercase;line-height: 18px; font-weight:bold;float:right; position:relative;" >&nbsp;||
										<span style="font-weight:normal;font-size:12px; color:#0000ff;">
										<?php echo $item_res['issue_date'];?> </span>
									</div>
								</div>								
							</div>
							</li>
							<?php
							}
							?>      
							</ul>
					</div><!-- /.box-body -->
              </div><!-- /.box -->
           </div>
		
        <div class="col-md-8" style="" style="font-family:'Times New Roman', Times, serif">
		
		<div class="ravi">
			 <div class="box box-primary box-primary7">
			 <div id="getemp">
                <div class="box-header with-border">
                  <h3 class="box-title" style="font-family:Times New Roman;font-weight:bold;">Non Consumable Issue</h3>
	  					<div id="xx">
						<button class="btn btn-primary" onclick="non_consumable_issue()">
						<span class="pencil1"><i class="fa fa-plus"></i></span>New</button>
						<input type="button" onclick="printDiv('rav')" value="Print" class="btn btn-primary"/>
						<input type="submit" name="myButtonControlID" id="myButtonControlID" class="btn btn-primary" value="EXCEL">
						</div>
						
                </div><!-- /.box-header -->
				<?php  
		$cus=mysqli_query($con,"select  *,t.employee_name as f_name,lm.location as loc from non_consumable_issue n  join employee_master t join location_master lm on lm.id=n.location  ORDER BY n.id  DESC limit 1");
	/* echo "SELECT top 1 tab1.issue_id,tab1.item_code,tab1.location,tab1.date,tab2.thosiba_emp_name,tab2.thosiba_emp_code,tab2.thosiba_emp_department,tab2.head_name,tab2.head_mobile,tab2.head_mail
FROM  [asset].[dbo].[new_item_issue1] tab1 left JOIN [toshiba_clms].[dbo].[thosiba_employee_master]  tab2   
    ON tab1.employee_code = tab2.thosiba_emp_code  ORDER BY tab1.issue_id  DESC"; */
		while($item1=mysqli_fetch_array($cus))
		{
			$emm=$item1['f_name'];
			$crea=$item1['created_by'];
			$da=$item1['issue_date'];
			$da1=date("d-m-Y",strtotime($da));
			
		if ($item1['f_name'])
			{
				$na=$item1['f_name'];
				$na1=$item1['emp_code'];
				$na2=$item1['emp_dept'];
				
			}
		
		?>
				<div id="rav" style="margin:5px;">
				<div style="width:100%;float:left;">
				<div style="margin:5px 0px 5px 10px;float:left;">
					<img alt=" img" class="user-image" src="/asset_temp/images/sun.png" style="height: 88px;width: 130px;">
				</div>
				<div style="margin:0px;float:right;">
					<table class="table table-hover table-bordered" style="font-weight:bold;margin-bottom:0px;">
					<tr><th> Date:	</th><td><?php echo $da1;?></td></tr>
					
					<tr><th> Office Location:</th><td>Chennai</td></tr>
					</table>
				</div>
				</div>
					
                <div id="rs">
				<table class="table table-hover table-bordered" style="font-family:'Times New Roman', Times, serif">
						<thead>
						<tr id="dark">
							<td id="dark" style="text-align:center;" colspan="5">NON-CONSUMABLE ISSUE LIST</td>
						</tr>
						<tr>
							<th>ISSUE ID</th>
							<th>Employee Location</th>
							<th>Employee Code</th>
							<th>Employee Name</th>
							<th>Employee Department</th>
						</tr>
						</thead>
						<tbody>
						<tr>
						<td style="text-align:left;"><?php echo $item1['id']; ?></td>
					    <td style="text-align:left;"><?php echo $item1['loc']; ?> </td>
					    <td style="text-align:left;"><?php echo $item1['emp_code']; ?></td>
					    <td style="text-align:left;"><?php echo $item1['f_name']; ?></td>
						<td style="text-align:left;"><?php echo $item1['emp_dept']; ?></td>

						</tr>
					    </tbody>
				</table>
				
			<?php 
		}
		?>
	
			
			<div style="text-align:left;float: left;width: 33%;margin-left: 20px;">Signature of the Issuer<br> <?php echo $crea;?></div>
			<div style="text-align:right;margin-right:20px;">Signature of the Receiver <br> <?php echo $emm;?></div>
			
			</div>
			
    </div>
			   </div>
			   </div>
				</div> <!-- col 8 close-->
				</div>
			</div>
          </div>
			
		
	</div>
	</div>
	</div>

	
	

</body>
</html>
<?php require("../mainjavascript.js");?>
