<?php  

  session_start();
   error_reporting(0);
		include("../db.php");
		include("../all_query.php");
		

 if(isset($_SESSION['loan_crm_username']) && isset($_SESSION['loan_crm_password']))
{
	
	$attempt_status = $_REQUEST['attempt_status'];
	$disposition = $_REQUEST['disposition'];
	
	$view_type = $_REQUEST['view_type'];
	
	 
	  if($view_type == 'disposition')
	  {
	
	?>
	 <select onchange="getDispositionSelect('sub_disposition'); getDateAmountSection(); "  name="disposition" id="disposition"    class="select2 form-select" data-allow-clear="true"  required   >
			  <option value="">Select Desposition</option>
			 <?php $catQ= mysqli_query($conn,"select *from `disposition` where attempt_status_id in (select id from  attempt_status where name = '$attempt_status'  )   ");
			  while($catData=mysqli_fetch_assoc($catQ))
		       {  ?>
				 <option  value="<?php echo $catData['name']; ?>"><?php echo $catData['name']; ?> - <?php echo $catData['disposition_title']; ?></option>
				 <?php
			   }
            	 ?>
			  </select>
			  
	
	<?php
	  }
	  
	   if($view_type == 'sub_disposition')
	  {
	
	?>
 
	 <select  name="sub_disposition" id="sub_disposition"    class="select2 form-select" data-allow-clear="true"  required   >
			  <option value="">Select Desposition</option>
			 <?php $catQ= mysqli_query($conn,"select *from `sub_disposition` where disposition_id in (select id from  disposition where name = '$disposition'  )   ");
			  while($catData=mysqli_fetch_assoc($catQ))
		       {  ?>
				 <option  value="<?php echo $catData['name']; ?>"><?php echo $catData['name']; ?></option>
				 <?php
			   }
            	 ?>
			  </select>
			  
	
	<?php
	  }
	  
	  
	  
	
}

?>