<?php
session_start();
error_reporting(0);
$unique_id=$_SESSION['unique_id'];
$user_name=$_SESSION['user_name'];
$url=$_SERVER['REQUEST_URI'];
$_SESSION['url']=$url; 
	if($_SESSION['user_name']==""){ 
		header('Location: index.php');
	}
	$id=$_GET['id'];
	include("database_connection.php");
	$sql="select * from `sbidocs_tbl` where `sbiref_id` = '$id'";
	$result=mysqli_query($conn,$sql);
	$datab=mysqli_fetch_array($result);	
	date_default_timezone_set('Asia/Calcutta'); 
	?>
	
	<html>
<body style='bgcolor="#E6E6FA" border="10px;solid black;" width=100%; height=100%'>
<head>
  <title>ITR</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: #008CBA;}

</style>
<link type="text/css" href="menu/menu_admin.css" rel="stylesheet" />
  </head>
<body>
<div class="background">
<form method ="post" action=""/>
<table style="width:1025px;" align="center">
<tr >
<td bgcolor="#008CBA" style="width:1000px;height:35px;" align="center" ><font color="white" font size="6px;"><b>SBI <?php echo$datab['loan_type'];?> REPORT</b>  &nbsp;&nbsp;</font></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="1" width="900" align="center">	
		<td>
		<fieldset style="width:1000px; margin-top:2px;">
		<table  style="width:1000px;" cellspacing="5" align="center">
		 
	<tr>
		<td><b>App No</b> </td>
		<td><input type="text" name="app_no" class="field"  style="width:350px; height:35px;text-transform: uppercase;" value="<?php echo $datab['app_no'];?>" /></td>			
		
		<td><b>Client Reference No</b> </td>
		<td><input type="text" name="case_id" class="field"  style="width:350px; height:35px;text-transform: uppercase;" value="<?php echo $datab['case_id'];?>"  /></td>			
		</tr>
		<input type="hidden" name="sbiref_id" class="field"  value="<?php echo $datab['sbiref_id'];?>" />
		<tr>
		<td><b>Docs Type</b></td>
	<td><select name="loan_type" class="field"  style="width:350px; height:35px;" required >
			<option value="<?php echo $datab['loan_type'];?>"><?php echo $datab['loan_type'];?></option>
		</select></td>	
	
		<td><b>Type of Applicant</b> </td>
		<td><input type="text" name="case_id" class="field"  style="width:350px; height:35px;text-transform: " value="<?php echo $datab['appco_applicant'];?>"  /> 	</td>			
		</tr>
		<tr>
		<td><b>Applicant Name</b></td>
		<td><input type="text" name="name" class="field"  style="width:350px; height:35px;text-transform: uppercase;" value="<?php echo $datab['name'];?>"  /></td>
		<td><b>Pan No</b> </td>
    	<?php
		$panno=$datab['pan_no'];
		$p1=substr($panno, 0, 5);
		$p2=substr($panno, 5, 4);
		$p3=substr($panno, 9, 9);
		?>
		<td><input type="text" name="pan_no1" class="field"  style="width:100px; height:35px;" value="<?php echo strtoupper($p1);?>"  required/>  &nbsp;
		<input type="text" name="pan_no1" class="field"  style="width:80px; height:35px;" value="<?php echo $p2;?>"  required/>&nbsp;
		<input type="text" name="pan_no1" class="field"  style="width:50px; height:35px;" value="<?php echo strtoupper($p3);?>"  required/>
		</td>			
		</tr>		
		<input type="hidden" name="pan_no"  value="<?php echo $datab['pan_no'];?>"  />
		<tr>
		<td><b>Assesment Year 1</b> </td>
		<td><input type="text" name="assesment_year1" class="field"  style="width:350px; height:35px;"value="<?php echo $datab['assesment_year1'];?>" /></td>	
		<td><b>Assesment Year 2</b> </td>
		<td><input type="text" name="assesment_year2" class="field"  style="width:350px; height:35px;"value="<?php echo $datab['assesment_year2'];?>" /></td>			
		</tr>
		<?php 
		if(strlen($datab['assesment_year3'])>0)
		{
		?>
		<tr>
		<td><b>Assesment Year 3</b> </td>
		<td><input type="text" name="assesment_year3" class="field"  style="width:350px; height:35px;"value="<?php echo $datab['assesment_year3'];?>" /></td>
		<tr>
		 <?php
		}
		else
		{
		}
		 	if(strlen($datab['visit_date'])>1)
			{
			$visit_date=$datab['visit_date'];
			}
			else
			{
			$visit_date=date('m-d-Y');
			}
		    if(strlen($datab['visit_time'])>1)
			{
			$visit_time=$datab['visit_time'];
			}
			else
			{
			$visit_time=date('h:i A');
			}
		 ?>
		<td><b>Visit Date </b><span><font color="red">*</font></span> </td>
		<td><input type="text" name="visit_date" class="field"  style="width:150px; height:35px;" value="<?php echo $visit_date;?>" />
		&nbsp;<b>Visit Time &nbsp;</b><input type="text" name="visit_time" class="field"  style="width:100px; height:35px;" value="<?php echo $visit_time;?>" /> </td>			
		</tr>
		</table>
		<table  style="width:1000px;" cellspacing="5" align="center">
		<tr>
		<td><b>Docs Remarks </b><span><font color="red">*</font></span> </td>
		<td><textarea name="remarks" class="field"  style="width:750px; " rows="4" cols="150" required ><?php echo $datab['remarks'];?></textarea> </td>			
		</tr>
		<tr>
		<td><b>Docs Status</b><span><font color="red">*</font></span> </td>
	<td><select name="final_status" class="field"  style="width:350px; height:35px;" required >
			<option value="<?php echo $datab['final_status'];?>"><?php echo $datab['final_status'];?></option>
				<option value="Positive">Positive</option>
				<option value="Negative">Negative</option>
				<option value="Refer">Refer</option>
		</select></td>	
		</tr>
		
		</table>
		
		