<?php  

  session_start();
    error_reporting(0);
		include("../db.php");
		include("../all_query.php");
		
		
		
		 if(isset($_SESSION['loan_crm_username']) && isset($_SESSION['loan_crm_password']))
		{
			
			
			$table_fieldsQ= mysqli_query($conn,"select *from `table_fields` where `table_name` = 'leads' ");
		   $table_fieldsData = mysqli_fetch_assoc($table_fieldsQ);
		
		
		
		    $account_id = $_REQUEST['account_id'];
			
			
			$leadQ = mysqli_query($conn,"select *from `leads` where account_id = '$account_id' ");
			$row = mysqli_fetch_assoc($leadQ);		 
			
			$lead_data = $row['lead_data'];
			 $leadDataArray = json_decode(stripslashes($lead_data),TRUE); 
			
			
			
			?>
			
			
			<table class="table" >
			
		                    <?php 
                          $datac = explode(',',$table_fieldsData['column_names']);
                                 
								 
								 

                        // print_r($data);
                        foreach($datac as $field)
                        {    
                        if($field!='status' && $field!='id'  && $field!='date_time'    )
                        {
                        ?>
						<tr>
                     <th ><?php echo ucfirst(str_replace('_',' ',$field)); ?></th>
					 <td><?php echo $leadDataArray[$field]; ?></td>
					 </tr>
                     <?php }   } ?>
			
			
			</table>
			
			
			<?php
			
			
			
			
			
			
			
			
		}






		
?>