MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/crm_cafsindia_com/application/views/mis/form_login.php
<?php 
	foreach ($cust_info as $key => $value){
		$cust_name     = $value['cust_name'];
		$cust_mobile   = $value['cust_mobile'];
		$dob           = date('d-m-Y',strtotime($value['dob']));
		$cust_email    = $value['cust_email'];
		$cust_address  = $value['cust_address'];       
	}	
	foreach ($family_info as $key => $value){
        $fam_name      = $value['fam_name'];
        $fam_relation  = $value['fam_relation'];
        $fam_dob       = date('d-m-Y',strtotime($value['fam_dob']));
        $fam_profile   = $value['fam_profile'];
        $fam_sex       = $value['fam_sex'];   
		$fam_age       = date_diff(date_create($fam_dob), date_create('today'))->y;
		$family_line  .= "<tr>
					<td>$fam_name</td>
					<td>$fam_dob</td>
					<td>$fam_age</td>
					<td>$fam_relation</td>
					<td>$fam_sex</td>
					<td>$fam_profile</td>
				  </tr>";
    }

	$life = "";
	$health = "";
	$term = "";
	foreach ($login_history as $key => $value){
		$created_by    = $value['owner'];
		$rm_name       = $value['rm_name'];
		$re_name       = $value['re_name'];
		$category      = $value['product_category'];
		//life
		$login_date        = date('d-m-Y',strtotime($value['login_date']));
		$life_assured      = $value['life_assured'];
		$category          = $value['product_category'];
		$product_name      = $value['product_name'];
		$policy_term       = $value['policy_term'];
		$paying_term       = $value['paying_term'];
		$net_premium       = $value['overall_net_premium'];
		$sum_assured       = $value['sum_assured'];
		$company           = $value['companyname'];
		$policy_no         = $value['policy_no'];
		$issuance_status   = $value['issuance_status'];
		$nominee           = $value['nominee'];
		$issued_date       = date('d-m-Y',strtotime($value['issued_date']));

		if($login_date === "01-01-1970"){
			$login_date = "";
		}
		if($issued_date === "01-01-1970"){
			$issued_date = "";
		}
		if($life_assured){
			$assured_qry = $this->db->query("SELECT fam_name from ospos_family where ospos_family.family_id = '$life_assured'");
			$assured = $assured_qry->row();
			$life_assured = $assured->fam_name;
		}
		if($nominee){
			$nominee_qry = $this->db->query("SELECT fam_name from ospos_family where ospos_family.family_id = '$nominee'");
			$nominee = $nominee_qry->row();
			$nominee = $nominee->fam_name;
		}
		if($rm_name){
			$rm_qry = $this->db->query("SELECT first_name from ospos_people where ospos_people.person_id = '$rm_name'");

		}else{
			$rm_qry = $this->db->query("SELECT first_name from ospos_people where ospos_people.person_id = '$created_by'"); 
		}
		if($category === "3"){
			$rm_qry = $this->db->query("SELECT first_name from ospos_people where ospos_people.person_id = '$re_name'");
		}
		$rm = $rm_qry->row();
		$name = $rm->first_name;


		if($category === "2"){
			$life  .= "<tr>
							<td>$life_assured</td>
							<td>$company</td>
							<td>$product_name</td>
							<td>$policy_no</td>
							<td>$sum_assured</td>
							<td>$net_premium</td>
							<td>$policy_term</td>
							<td>$paying_term</td>
							<td>$login_date</td>
							<td>$issuance_status</td>
							<td>$issued_date</td>
							<td>$nominee</td>
						</tr>";

		}else
		if($category === "3"){
			$health  .= "<tr>
							<td>$life_assured</td>
							<td>$company</td>
							<td>$product_name</td>
							<td>$policy_no</td>
							<td>$sum_assured</td>
							<td>$net_premium</td>
							<td>$login_date</td>
							<td>$issuance_status</td>
							<td>$issued_date</td>
						</tr>";

		}else
		if($category === "5"){
			$term  .= "<tr>
							<td>$life_assured</td>
							<td>$company</td>
							<td>$product_name</td>
							<td>$policy_no</td>
							<td>$sum_assured</td>
							<td>$net_premium</td>
							<td>$policy_term</td>
							<td>$paying_term</td>
							<td>$login_date</td>
							<td>$issuance_status</td>
							<td>$issued_date</td>
							<td>$nominee</td>
						</tr>";

		}
		
	}
	if($life === ""){
		$life = "<tr style='text-align:center;'><td colspan='12'>No Data to Display</td></tr>";
	}else
	if($health === ""){
		$health = "<tr style='text-align:center;'><td colspan='9'>No Data to Display</td></tr>";
	}else
	if($term === ""){
		$term = "<tr style='text-align:center;'><td colspan='12'>No Data to Display</td></tr>";
	}
?>
<!--<h5 style='color:#0071b3;font-weight:bold;'>Customer Details</h5>-->
<table class='table table-bordered col-style'>
	<tr>
		<td style="vertical-align: middle;">
			<?php
				$url = site_url();
				$url = str_replace("index.php","",$url)."/images/cafs_logo.jpg";
			?>
			<img src='<?php echo $url;?>' alt="CAFS LOGO" style="margin-left:22%;width: 100px; height: 90px;"/>
		</td>
		<td style="padding:0px;">
			<table class='table table-bordered col-style' style="margin:0px;">
				<tr>
					<td style="font-weight:bold;">Client</td>
					<td><?php echo $cust_name; ?></td>
				</tr>
				<tr>
					<td style="font-weight:bold;">DOB</td>
					<td><?php echo $dob; ?></td>
				</tr>
				<tr>
					<td style="font-weight:bold;">Mobile No</td>
					<td><?php echo $cust_mobile; ?></td>
				</tr>
				<tr>
					<td style="font-weight:bold;">Email ID</td>
					<td><?php echo $cust_email; ?></td>
				</tr>					
				<tr>
					<td style="font-weight:bold;">Address</td>
					<td><?php echo $cust_address; ?></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<h5 style='color:#0071b3;font-weight:bold;'>Family Details</h5>
<table id='detail_list' class='table table-bordered col-style'>
	<thead>
		<tr>
			<th>Name</th>
			<th>DOB</th>
			<th>Age</th>
			<th>Relationship</th>
			<th>Gender</th>
			<th>Profile</th>
		</tr>
	</thead>
	<tbody><?php echo $family_line; ?> </tbody>               
</table>
<h5 style='color:#0071b3;font-weight:bold;'>Life Insurance</h5>
<table id='detail_list' class='table table-bordered col-style'>
	<thead>
		<tr>
			<th>Life Assured</th>
			<th>Company</th>
			<th>Product</th>
			<th>Policy No</th>
			<th>S.Assured</th>
			<th>N.Premium</th>
			<th>Term</th>
			<th>PPT</th>			
			<th>Login</th>
			<th>Policy Status</th>
			<th>Issued</th>
			<th>Nominee</th>
		</tr>
	</thead>
	<tbody><?php echo $life; ?> </tbody>               
</table>
<h5 style='color:#0071b3;font-weight:bold;'>Health Insurance</h5>
<table id='detail_list' class='table table-bordered col-style'>
	<thead>
		<tr>
			<th>Insured</th>
			<th>Company</th>
			<th>Product</th>
			<th>Policy No</th>
			<th>S.Assured</th>
			<th>N.Premium</th>
			<th>Login Date</th>
			<th>Policy Status</th>
			<th>Issued</th>
		</tr>
	</thead>
	<tbody><?php echo $health; ?> </tbody>               
</table>
<h5 style='color:#0071b3;font-weight:bold;'>Term Plan</h5>
<table id='detail_list' class='table table-bordered col-style'>
	<thead>
		<tr>
			<th>Life Assured</th>
			<th>Company</th>
			<th>Product</th>
			<th>Policy No</th>
			<th>S.Assured</th>
			<th>N.Premium</th>			
			<th>Term</th>
			<th>PPT</th>
			<th>Login</th>
			<th>Policy Status</th>
			<th>Issued</th>
			<th>Nominee</th>
		</tr>
	</thead>
	<tbody><?php echo $term; ?> </tbody>               
</table>