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/allyindian_com/backend/application/controllers/Discount_report.php
<?php if ( ! defined('BASEPATH')) exit('No direct script is allowed');
require_once("Secure_Controller.php");
class Discount_report  extends Secure_Controller
{
 
	public function __construct(){
		parent::__construct('discount_report');
		$this->load->model('Discount_report_model');
	}
	public function index(){
		if(!$this->Appconfig->isAppvalid()){
			redirect('config');
		}
		$pack_data=$this->Discount_report_model->get_packages();
		
		foreach($pack_data as $row){
		    $package_name[$this->xss_clean($row['package_id'])] = $this->xss_clean($row['package_title']."-".$row['package_title2']);
		}
		$data['package_name']=$package_name; 
		$this->load->view('discount_report/manage',$data);
	}
	public function suggest_customer(){
		$term = $this->input->get('term');
		$suggestions = $this->xss_clean($this->Discount_report_model->get_customer_suggestions($term));
		echo json_encode($suggestions);
	}
	public function search(){
		$process               = $this->input->post('process');
		$package_name          = $this->input->post('package_name');
		$custid                = $this->input->post('custid');
		$package_details       =     $this->Discount_report_model->search($package_name,$custid);
		$tr_line = "";
		$cust_td = "";
		$cust_th = "";
		$count   = 0;
		foreach($package_details as $rslt){
			$count++;
			$custid           = $rslt['custid'];
			$orderid          = $rslt['orderid'];
			$tripcode         = $rslt['tripcode'];
			$passtripid       = $rslt['passtripid'];
			$custfname        = $rslt['custfname'];
			$custlname        = $rslt['custlname'];			
			$custmobile       = $rslt['custmobile'];
			$boarding_name    = $rslt['boarding_name'];
			$package_title    = $rslt['package_title'];
			$package_title2   = $rslt['package_title2'];
			$package_title3   = $rslt['package_title3'];
			$doj              = date('d-m-Y',strtotime($rslt['doj']));
			$custdob          = date('d-m-Y',strtotime($rslt['custdob']));
			$nopass           = $rslt['nopass'];
			$ticketamt        = $rslt['ticketamt'];
			$discountamt      = $rslt['discountamt'];
			$admn_discountamt = $rslt['admn_discountamt'];
			$cashpaid         = $rslt['cashpaid'];
			$cashdue          = $rslt['cashdue'];			
			$customer_name    = $custfname." ".$custlname;
			$package_name     = $package_title." ".$package_title2." ".$package_title3;
			if($process === "1"){
				$cust_th = "<th>Customer Name</th>						
					<th>Mobile</th>";
				$cust_td = "<td>$customer_name</td>							
						<td>$custmobile</td>";
			}	
			$tr_line .= "<tr class='cursor' onclick=get_passenger_info('$custid','$passtripid');>
						<td>$count</td>
						<td>$doj</td>
						<td>$tripcode</td>
						<td>$package_name</td>
						$cust_td						
						<td>$nopass</td>
						<td>$ticketamt</td>
						<td>$discountamt</td>
						<td>$admn_discountamt</td>
						<td>$cashpaid</td>
						<td>$cashdue</td>
						<td>$boarding_name</td>
					</tr>";				
		}
		echo "<table class='table table-bordered table-hover table-striped' id='analysis_tbl'>
			<thead>
				<tr>
					<th>Sl. No</th>
					<th>Journey Date</th>
					<th>Trip Code</th>
					<th>Package Name</th>
					$cust_th										
					<th>No. of Tickets</th>	
					<th>Total</th>
					<th>Package Discount</th>
					<th>Admin Discount</th>	
					<th>Paid</th>	
					<th>Balance</th>
					<th>Boarding</th>	
				</tr>
			</thead>
			<tbody>
			$tr_line
			</tbody>
		</table>";
	}
}
?>