<?php
session_start();
error_reporting(0);
$user_name=$_SESSION['user_name'];
if(empty($user_name))
 {
 header("location:index.php");
 }
$idd=$_GET['id'];
$id=base64_decode($idd);
include_once("database_connection.php"); 
$sqlu="select *  from sbialloc_tbl where id='$id' " ;
$resultu=mysqli_query($conn,$sqlu);
$data=mysqli_fetch_array($resultu);
$idu=$datau['id'];

	
?>

	<table style="width:1000px;" align="center">
<tr >
<td bgcolor="#488AC7" style="width:1000px;height:35px;" ><font color="white" font size="4px;"><b>View Case</b>  &nbsp;&nbsp;</font></td>
</tr>
</table>

		<table  style="width:1000px;"  cellspacing="5" align="center" >
		<?php
		$case_id= $data['case_id'];
		$sql22="select id,status,app_no,final_status from sbidocs_tbl where case_id='$case_id' ";
		$result22=mysqli_query($conn,$sql22);
		$data22=mysqli_fetch_array($result22);
		if($data22['status']=="4")
		{
		$status="In Process"  ;  
		}
		elseif($data22['status']=="0")
		{
		$status="Complete"  ;  
		$substatus=$data22['final_status'];
		}
		else
		{
		  $status=" "  ;   
		  $substatus="";
		}
		?>
		<tr>
		<td><b>Internal Code :</b></td>
		<td><input type="text" name="app_no"  value="<?php echo $data22['app_no'];?>" class="field"  style="width:350px; height:35px;" readonly /></td>
		<td><b>Reference Number :</b></td>
		<td><input type="text" name="case_id"  value="<?php echo $data['case_id'];?>" class="field"  style="width:325px; height:35px;" readonly /></td>			
		</tr>
		<tr>
		<td><b>Docs Type :</b> </td>
		<td><input type="text" name="app_no"  value="<?php echo $data['loan_type'];?>" class="field"  style="width:350px; height:35px;" readonly /></td>
		<td><b>Type of Applicant :</b></td>
		<td><input type="text" name="case_id"  value="<?php echo $data['appco_applicant'];?>" class="field"  style="width:325px; height:35px;" readonly /></td>			
		</tr>
		<tr>
		<td><b>Applicant Name :</b></td>
		<td><input type="text" name="name" value="<?php echo $data['name'];?>" class="field"  style="width:350px; height:35px;" readonly /></td>			
		<td><b> Type :</b><span><font color="red">*</font></span> </td>
		<td><input type="text" name="type"   value="<?php echo $data['type'];?>" class="field"  style="width:325px; height:35px;" readonly /></td>			
		</tr>
		<?php
		if($data['loan_type']=="BANK STATEMENT")
		{
		?>    
	
		<tr>
		<td><b>Bank Name :</b> </td>
		<td><textarea name="address1" cols="55" rows="2" class="field"  style="width:350px; "  readonly><?php echo $data['bank_name'];?></textarea></td>			
		<td><b>Account No :</b> </td>
		<td><input type="text" name="pin" value="<?php echo $data['account_no'];?>" class="field"  style="width:325px; height:35px;"  readonly/></td>			
		</tr>
		<tr>
		<td><b>Branch:</b> </td>
		<td><input type="text" name="branch" value="<?php echo $data['branch'];?>" class="field"  style="width:350px; height:35px;"  readonly/></td>			
		<td><b>CreatedDate :</b> </td>
		<td><input type="text" name="pin" value="<?php echo $data['entry_date'].' '.$data['entry_time'];?>" class="field"  style="width:325px; height:35px;"  readonly/></td>			
		</tr>
		<?php
		}
		else
		{
		?>
		<tr>
		<td><b>Pan No :</b> </td>
		<td><textarea name="address1" cols="55" rows="2" class="field"  style="width:350px; "  readonly><?php echo $data['pan_no'];?></textarea></td>			
		<td><b>Assesment Year 1 :</b> </td>
		<td><input type="text" name="pin" value="<?php echo $data['assesment_year1'];?>" class="field"  style="width:325px; height:35px;"  readonly/></td>			
		</tr>
		<tr>
		<td><b>Assesment Year 2:</b> </td>
		<td><input type="text" name="branch" value="<?php echo $data['assesment_year2'];?>" class="field"  style="width:350px; height:35px;"  readonly/></td>			
		<td><b>Assesment Year 3 :</b> </td>
		<td><input type="text" name="pin" value="<?php echo $data['entry_date'].' '.$data['assesment_year3'];?>" class="field"  style="width:325px; height:35px;"  readonly/></td>			
		</tr>
		<tr>
		    <td><b>CreatedDate :</b> </td>
		<td><input type="text" name="pin" value="<?php echo $data['entry_date'].' '.$data['entry_time'];?>" class="field"  style="width:325px; height:35px;"  readonly/></td>			
		</tr>
		<?php
		}
		?>
		<tr>
		<td><b>Status :</b> </td>
		
		<td><input type="text" name="address1" value="<?php echo $status;?>" class="field"  style="width:350px; height:35px;"  readonly/></td>			
		<td><b>Sub Status :</b> </td>
		<td><input type="text" name="pin" value="<?php echo $substatus;?>" class="field"  style="width:325px; height:35px;"  readonly/></td>			
		</tr>
		</table>
		
			
			</form>
			</body>
			</html>

