<?php
session_start();
error_reporting(0);
$role=$_SESSION['role'];
$user_name=$_SESSION['user_name'];
	if($_SESSION['user_name']==""){ 
		header('Location: index.php');
	}
	include("database_connection.php");
	$date=date('d-M-Y'); 

?>
<!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>
<title>Field:Pending NCR</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php //title();?>
<link type="text/css" rel="stylesheet" href="Library/css/style-menu.css"   />
<link type="text/css" rel="stylesheet" href="Library/css/style-content.css"   />
<script type="text/javascript" src="Library/js/jquery-1.3.1.min.js" > </script> 
<script type="text/javascript">

    function PrintElem(elem)
    {
        Popup($(elem).html());
    }

    function Popup(data) 
    {
        var mywindow = window.open('', 'Billing Application Dashboard', 'height=650,width=750');
        mywindow.document.write('<html><head><title>Billing Application Dashboard</title>');
        /*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
        mywindow.document.write('</head><body >');
        mywindow.document.write(data);
        mywindow.document.write('</body></html>');

        mywindow.print();
        mywindow.close();

        return true;
    }

</script>


<style>
.borderHeader{
	border:1px;
	border-style:solid;
	height:73px;
	background-color:white;
}
.centerimage{
	margin-top:20px;
}
.pagename
{
	text-align:center;
	margin-top:-60px;
	color:#8B0000;
}

.airtellogo
{
   margin-top:-60px;

}	
.center {
 text-align: center
}
td { 
	
	height:15px;
}
</style>
<link type="text/css" href="menu/menu_admin.css" rel="stylesheet" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script language="JavaScript" src="newdate/calendar_us.js"></script>
  <link rel="stylesheet" href="newdate/calendar.css">


</head>
<body>
	<div class="borderHeader">

	<div align=left><img src="images/kmspl.PNG" /></div><div class="pagename"><h2>FIELD PENDING NCR  <?php echo $date;?></h2></div>
</div>
	<?php 
	if(($_SESSION['uniqe_id']=='S'))
	{
	include("menu/menu_superadmin.php");
	}
	elseif(($_SESSION['uniqe_id']=='A'))
	{
	include("menu/menu_admin.php");
	}
	else
	{
	header('Location: index.php');
	}
	?>
	<form method="post" action=" " name="view_fereporttoday" id="view_fereporttoday">
	<?php
	if(isset($_POST['txtsubmit']) && $_POST['txtsubmit']=='REFRESH')
	{
	$_POST['dump_date']='';
	$_POST['dump_date1']='';
	$_POST['zone']='';
	}
	if(isset($_POST['txtsubmit']) && $_POST['txtsubmit']=='SEARCH')
 	{  
	$dump_date=$_POST['dump_date'];
	$dump_date1=$_POST['dump_date1'];
	$zone=$_POST['zone'];
	}

	date_default_timezone_set('Asia/Calcutta');
	?>
	
	<table style="width:100%"   align="center"> 
	<tr>
	<td align="center" style="width:95%;">
	<table  border="1" bgcolor="white" style="width:95%;" class="table table-striped" > 
	<thead>
	<tr height="25">
				<th class="center" ><font size="2"><b>SR NO</b></font></th>				
				<th class="center"><font size="2"><b>CLIENT NAME</b></font></th>				
				<th class="center"><font size="2"><b>DATE</b></font></th>
				<th class="center"><font size="2"><b>TYPE</b></font></th>
				<th class="center"><font size="2"><b>APPLICATION NO</b></font></th>
				<th class="center"><font size="2"><b>CASE ID</b></font></th>
				<th class="center"><font size="2"><b>CUSTOMER NAME</b></font></th>
				<th class="center"><font size="2"><b>ADRRESS</b></th>
				<th class="center"><font size="2"><b>ZONE</b></font></th>
				<th class="center"><font size="2"><b>FE NAME</b></font></th>
				<th class="center"><font size="2"><b>ALLOCATED BY</b></font></th>
				</tr>
		 </thead>
		 <tbody>
		<?php
		$queryr="SELECT allocation_tbl.id,allocation_tbl.bank_name,allocation_tbl.dump_date,allocation_tbl.type,
allocation_tbl.app_no,allocation_tbl.case_id,allocation_tbl.name,
allocation_tbl.address1,allocation_tbl.zone,allocation_tbl.user_code,allocation_tbl.initiated_by FROM `allocation_tbl`,`user_tbl` WHERE   allocation_tbl.status='4'  and allocation_tbl.user_code !='2000001918' and allocation_tbl.user_code=user_tbl.user_code  and user_tbl.zone in ('EAST','CENTRAL','GHAZIABAD','NOIDA','NORTH','SOUTH','WEST','FARIDABAD','GURGAON')   order by allocation_tbl.id asc";
	$resultr = MYSQLI_QUERY($conn,$queryr);
		
	 $i=1;
	while($data=mysqli_fetch_array($resultr)) {
	$user_code=$data['user_code'];
	$sqlfe="select first_name,last_name,mobile,zone,location from user_tbl where user_code='$user_code' ";
	$resultuser=mysqli_query($conn,$sqlfe);
	$datauser=mysqli_fetch_array($resultuser);
	$fename=strtoupper($datauser['first_name'].' '.$datauser['last_name']);
	if($data['bank_name']=="SBI AUTO LOAN")
	{
	$bankname="SBI";
	}
	else
	{
	$bankname=$data['bank_name'];
	}
	?>
	<tr>	
	<td  align="center"><font size="2"><b><?php echo $i ; ?></b></font> </td>
	<td  align="center"><font size="2"><b><?php echo $bankname ; ?></b></font> </td>
	<td  align="center"><font size="2"><b><?php echo $data['dump_date'] ; ?></b> </font></td>
	<td  align="center"><font size="2"><b><?php echo $data['type'] ; ?></b></font> </td>
	<td  align="center"><font size="2"><b><?php echo $data['app_no'] ; ?></b></font> </td>
	<td  align="center"><font size="2"><b><?php echo $data['case_id'] ; ?></b></font> </td>	
	<td  align="center"><font size="2"><b><?php echo $data['name'] ; ?></b></font> </td>
	<td  align="center"><font size="2"><b><?php echo $data['address1'] ; ?></b> </font></td>
	<td  align="center"><font size="2"><b><?php echo $data['zone'] ; ?></b> </font></td>
	<td  align="center"><font size="2"><b><?php echo $fename ; ?></b> </font></td>			
	<td  align="center"><font size="2"><b><?php echo $data['initiated_by'] ; ?></b></font> </td>
	
	</tr>
	<?php $i++; } ?>
</tbody>
 </table>
</td>
</tr>
</table>

</div>
</body>
</html>			
