<?php
session_start();
error_reporting(0);
$user_name=$_SESSION['user_name'];
if(empty($user_name))
 {
 header("location:index.php");
 }

include_once("database_connection.php"); 
?>
<html>
<body style='bgcolor="#E6E6FA" border="10px;solid black;" width=100%; height=100%'>
<head>
  <title>Case:Management</title>
   
  <style>
  #searchbutton  {
	background-color:#228B22;
	color:#FFF;
	padding:5px;
	border-radius:8px;
	font-weight:bold;
}
#searchbutton:hover  {
	background-color:#228B22;
	color:#FFF;
	padding:5px;
	border-radius:8px;
}
.button {
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}


.button {background-color: #0080ff;}
</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>
<style type="text/css">
    .bs-example{
    	margin: 20px;
    } 
	.center {
 text-align: center
}
</style>
 <script language="JavaScript" type="text/javascript">  
   function checkdelete(){
		var r=confirm("Are you sure to delete?");
		if (r==true){
			return true;
		}
		else{
			return false;
		}
	}
	</script>
	<script type="text/javascript">
checked=false;
function checkedAll (view_allocationclient) {
	var aa= document.getElementById('view_allocationclient');
	 if (checked == false)
          {
           checked = true
          }
        else
          {
          checked = false
          }
	for (var i =0; i < aa.elements.length; i++) 
	{
	 aa.elements[i].checked = checked;
	}
      }
</script>
  </head>
<body>
<div class="background">
<form method ="post" name="view_allocationclient" id="view_allocationclient" action="">
<?php
	
	if(isset($_POST['txtsubmit']) && $_POST['txtsubmit']=='REFRESH')
 {  
	
	$_SESSION['loantype']='';
	
 }


if(isset($_POST['txtsubmit']) && $_POST['txtsubmit']=='SEARCH')
 {
  	$loantype=$_POST['loantype'];
	$_SESSION['loantype']=$_POST['loantype'];	
 }
include("header.php");
	if(($_SESSION['uniqe_id']=='S'))
	{
	include("menu/menu_superadmin.php");
	}
	elseif(($_SESSION['uniqe_id']=='A'))
	{
	include("menu/menu_admin.php");
	}
	elseif(($_SESSION['uniqe_id']=='D'))
	{
	include("menu/menu_deo.php");
	}
	else
	{
	header("location:index.php");
	}
	$export='<a href="export_clientallocation.php"><font color="white">Export</font></a>'
	?>
	<table style="width:98%" align="center"  class="salary-data"  cellpadding="5" cellspacing="0" rules="all">
	<tr height="35" bgcolor="#008CBA" >

	<td align="center" ><font color="white"><b>Vendor Name</b></font>
	<select name="vendorname" id ="vendorname"  required >
	<option value="">Select</option>
	
	<?php
	$sqlocl="select user_name,name from user_tblvendor where unique_id='V' and status='A' order by user_name asc";
	$resultocl=mysqli_query($conn,$sqlocl);
	while($dataocl=mysqli_fetch_array($resultocl))
	{
	?>
	<option value="<?php echo $dataocl['user_name'];?>"><?php echo $dataocl['name'];?></option>
	<?php
	}
	?>	
	<option ></option>
	</select>	
	</td>
	<td align="center"><input type="submit" name="txtsubmit"  value="SEARCH" id="searchbutton" > 
	&nbsp;<input type="submit" name="txtsubmit"  value="REFRESH" id="searchbutton" >
	&nbsp;<input type="submit" name="txtsubmit"  value="GO" id="searchbutton" ></td>
	</table>
	<table style="width:98%" align="center" border="1" class="salary-data"  cellpadding="5" cellspacing="0" rules="all">
	<tr height="25" >
	<td align="center" ><font color="#488AC7"><b>Create Date</b></font></td>    
	<td align="center" ><font color="#488AC7"><b>Agency Code</b></font></td>	
<td align="center" ><font color="#488AC7"><b>Reference Number</b></font></td>
<td align="center" ><font color="#488AC7"><b>App Number</b></font></td>
		<td align="center" ><font color="#488AC7"><b>Docs Type</b></font></td>
	<td align="center" ><font color="#488AC7"><b>Applicant Type</b></font></td>
	<td align="center" ><font color="#488AC7"><b>Name</b></font></td>
	<td align="center" ><font color="#488AC7"><b>Docs Details</b></font></td>	
    <td align="center" ><font color="#488AC7"><b>Docs Status</b></font></td>	

	</tr>       
	<?php
	
    $sql2="select * from sbidocs_tbl where  status='4'   order by id asc  " ;
	$result2=mysqli_query($conn,$sql2);
	
	$i=1;
	while($data2=mysqli_fetch_array($result2))
	{
	$agencycode=$data2['promo_code'];
	if($data2['loan_type']=="BANK STATEMENT")
	{
	 $ac="ACCOUNT NO - " ;  
	 $address= $data2['bank_name'].' -'.$ac.' '.$data2['account_no'];
	}
	else
	{
	 $p="PAN NO - ";
	 $y="YEAR - ";
	 $address=$p. $data2['pan_no'].' '.$y.' '.$data2['assesment_year1'].' '.$data2['assesment_year2'].' '.$data2['assesment_year3'];
	}
	?>
	<tr>
	<td align="center" ><?php echo $data2['date'].' '.$data2['upload_time'];?></td>    
	<td align="center"><?php echo $agencycode;?></td>	
	<td align="center"><?php echo $data2['case_id'];?></td>
	<td align="center"><?php echo $data2['app_no'];?></td>
	<td align="center"><?php echo $data2['loan_type'];?></td>
	<td align="center"><?php echo $data2['appco_applicant'];?></td>
	<td align="center"><?php echo $data2['name'];?></td>
	<td align="center" ><?php echo $address;?></td>
	<td  align="center"><?php echo $status;?></td>	

	</tr>
	<?php
	$i++;
	} ?>		
  </table>	
	
			</form>
			</body>
			</html>

