403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/adeetie_hellogtx/application/modules/home/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/adeetie_hellogtx/application/modules/home/controllers/Home.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Home extends MY_Controller
{
	public function __construct() {
		parent::__construct();
		$this->load->helper('text');
		$this->load->library('ion_auth');
		$this->load->model('home/home_model');
	
		$this->data['menu'] = $this->home_model->get_menus();
		$query = $this->db->select('label, value')->get(TBL_GLOBAL)->result_array();
		foreach ($query as $row)
		{
			$details[$row['label']] = $row['value'];
		}
		$this->data['social_urls'] = $details;
		// Counters 
		$this->data['counters'] = $details;

		// footer news 
		$this->data['footer_news']=$this->home_model->footer_news();
		// get footer gallery
		$this->data['footer_gallery']=$this->home_model->footer_gallery();
		$this->data['popupImages']=$this->home_model->popupImages();
	}


	public function index($menuid=0) {
		$query = $this->db->select('label, value')->get(TBL_GLOBAL)->result_array();
		foreach ($query as $row)
		{
			$details[$row['label']] = $row['value'];
		}
		$this->data['home_seo'] = $details;
		// news blocks here
		$this->data['news_block']=$this->home_model->get_news_post();
		// Get latest news two 
		$this->data['news']=$this->home_model->home_news();
		// Get breaking news
		$this->data['breaking_news']=$this->home_model->home_breaking_news();
		// get stakeholders
		$this->data['stakeholders']=$this->home_model->stakeholders();
		//get ourboards 
		$this->data['ourboards']=$this->home_model->ourboards();
		$this->data['divisions']=$this->home_model->divisions();
		$this->data['trainings']=$this->home_model->trainings();
		$this->data['testimonials']=$this->home_model->testimonials();

		$this->data['totaleet']=$this->home_model->get_eet_count();
		$this->data['indcuser']=$this->home_model->get_total_indc();
		$this->data['tficount'] = $this->home_model->get_banks_count();
		
		$this->data['totalworkshop']=$this->home_model->total_workshop();
		$this->data['totalter']=$this->home_model->total_ter_willingness();
		$this->data['totalform']=$this->home_model->total_willingness();
		$this->data['states'] = $this->mwillingstatus->get_state_name();
		$this->data['sti'] = $this->states_wise_investment();
   		$this->data['pi'] = $this->get_potential_investment();

		
		// get youtube videos
		$this->data['videos']=$this->home_model->homevideos();
		$this->data['page_sidemenu']=$this->home_model->get_home_pages();
		$this->data['slider']=$this->home_model->slider();
		$this->data['training_pdfs']=$this->home_model->training_pdfs();
		$this->data['page']='index';
		$this->_render_page(get_template(),$this->data);

	}


	function states_wise_investment() { 
        $data1 = $this->mwillingstatus->statewise_with_projectcost();
        $data['fidata'] = [];
        if(!empty($data1)) {
            foreach($data1 as $res => $val) {
               $data['fidata'][$val['company_state']] = $val['total'];
            }
        }
		return $data;
	}

	function get_potential_investment() {
		
		$data1 = $this->mwillingstatus->statewise_wiseprojectcost();
        $data['pi'] = [];
        if(!empty($data1)) {
            foreach($data1 as $res => $val) {
				if(empty($data['pi'][$val['state_id']])) {
					$data['pi'][$val['state_id']] = $val['project_cost'];
				} else {
					$data['pi'][$val['state_id']] += $val['project_cost'];
				}
            }
        }
		return $data;
		// print_r($data1);
	}

	public function page($page_slug) {
		
		if(empty($page_slug)) {
			redirect('');
		}

		$this->data['details']= $this->db->query('SELECT * FROM '.TBL_PAGES.' WHERE LOWER(page_slug) = ? AND status = ?',array(strtolower($page_slug),1))->row();
		if(empty($this->data['details'])) {
			show_404();
		}

		$page_menu_id= $this->db->query('SELECT * FROM '.TBL_PAGES.' WHERE LOWER(page_slug) = ? AND status=?',array(strtolower($page_slug),1))->row()->page_menu;
		$this->data['page_type']= $this->db->query('SELECT * FROM '.TBL_PAGES.' WHERE LOWER(page_slug) = ? AND status=?',array(strtolower($page_slug),1))->row()->page_type;
		// tabbed Menu
		$this->data['page_sidemenu']=$this->home_model->get_menus($page_menu_id);
		$this->data['parameter']=$this->home_model->allparameter();
		// sector code 
		$sector=$this->home_model->sector();
		$parent_sector=array();
		$parent_sector[]='Select Sector';
		foreach ($sector as $key => $value) {
			$parent_sector[$value['sectorid']]=$value['code']."-".$value['name'];
		}
		
		$this->data['zed_rating']=$this->home_model->allrating();
		$this->data['parent']=$parent_sector;
		if($page_slug=='meet-our-team') {
			$this->data['page']='meet-our-team';

		} elseif($page_slug=='list-of-energy-efficient-technologies') {

			$this->data['eet_archive']=$this->home_model->get_lastest_list();
			$this->db->order_by(''.TBL_EET.'.id','asc');
			$this->data['eet_list']=$this->db->get('eet')->result();
			$this->data['page']='list-of-ee-technology';

		} elseif($page_slug=='energy-efficient-technologies-archives') {
			$this->data['eet_list']=$this->home_model->get_all_list();
			$this->data['page']='energy-efficient-technologies-archives';

		} elseif($page_slug=='workshops') {
			
			$this->db->order_by('training_date','DESC');
			$this->data['training']=$this->db->get('tcb_trainings', 20)->result();
			$this->data['page']='training-and-workshops';

		} elseif($page_slug=='willingness-form') {

			$this->data['sector'] = $this->home_model->sector();
			$this->data['states'] = $this->home_model->getStates();
			$this->data['districts'] = $this->home_model->getDistricts();
			$this->data['page']='willingness_form';

		} elseif($page_slug=='willingness-form-part-a') { 
			if (!$this->ion_auth->logged_in()){
				redirect('auth', 'refresh');
			}else{
				$user = $this->ion_auth->user($this->ion_auth->user()->row()->id)->row();
				$app = $this->beneficiary_model->applicationDetails($this->ion_auth->user()->row()->id);
				if(!empty($app) && $app[0]->declaration == 1){
					redirect(base_url().'view-willingness-form');
				}
				$userDetails = $this->home_model->getUserCompany( $this->ion_auth->user()->row()->id );
				if( count($userDetails) > 0 ){
					$this->data['user'] = $user;
					$this->data['company'] = $userDetails[0];
					$this->data['page']='willingness_form_partA';
				}else{
					redirect('auth', 'refresh');
				}
			}
		} elseif($page_slug=='willingness-form-part-b') {
			if (!$this->ion_auth->logged_in()){
				redirect('auth', 'refresh');
			}else{
				$app = $this->beneficiary_model->applicationDetails($this->ion_auth->user()->row()->id);
				if(!empty($app) && $app[0]->declaration == 1){
					redirect(base_url().'view-willingness-form');
				}
				$sector = $this->home_model->sector();
				$states = $this->home_model->getStates();
				$districts = $this->home_model->getDistricts();
				$banks = $this->home_model->getBanks();
				$getProjects = $this->beneficiary_model->getProjectByUser($this->ion_auth->user()->row()->id);
				$this->data['sector'] = $sector;
				$this->data['states'] = $states;
				$this->data['districts'] = $districts;
				$this->data['banks'] = $banks;
				$this->data['projects'] = $getProjects;
				$this->data['applicationnum'] = '';
				if(count($getProjects) >0){
					$this->data['applicationnum'] = $getProjects[0]->application_num;
					$this->data['application_data'] = $getProjects[0];
					$this->data['app_upload'] = $this->beneficiary_model->getAppUpload($getProjects[0]->application_num);
					$this->data['updateprojecthtml'] = $this->load->view('../../beneficiary/views/updateProject',$this->data,TRUE);	
				}
				$html = $this->load->view('../../beneficiary/views/addProject',$this->data,TRUE);
				$this->data['addprojecthtml'] = $html;
				$this->data['page']='willingness_form_partB';
			}
		} elseif($page_slug=='view-willingness-form') {
			if (!$this->ion_auth->logged_in()){
				redirect('auth', 'refresh');
			}else{
				$userid = ( $this->input->post('userid') ) ? $this->input->post('userid') : $this->ion_auth->user()->row()->id;
				$sector = $this->home_model->sector();
				$appNum = $this->beneficiary_model->getApplicationNum($userid);
				$CompDetails = $this->home_model->getUserCompany( $userid );
				$application = $this->beneficiary_model->applicationDetails( $userid );
				$bank = $this->beneficiary_model->getBankDetails();
				$projectDetails = $this->beneficiary_model->getProjectByUser( $userid, $declare=TRUE);
				$appUploads = $this->beneficiary_model->getAppUpload($appNum[0]->application_num);
				$this->data['sector'] = array_column($sector,"name","sectorid");
				$this->data['appNum'] = $appNum;
				$this->data['company'] = $CompDetails[0];
				$this->data['application'] = $application;
				$this->data['bank'] = array_column($bank,"bank_name","bank_code");
				$this->data['projectDetails'] = $projectDetails;
				$this->data['uploads'] = $appUploads;
				$this->data['page']='view_willingness_form';
			}
		} elseif($page_slug == 'registered-fis') {
			$this->_financialinstitutions();
			return;
		} elseif ($page_slug == 'investment-bazaar') {
			$this->_investment_bazaar($this->data);
			return;
		} elseif ($page_slug == 'bees-training-and-workshop') {
			$this->_bees_training($this->data);
			return;
		}else {
			$this->data['page']='page';
		}
		$this->data['slug']=$page_slug;
		$this->_render_page(get_template(), $this->data);
	}


	function view_willing_form() {
		
	}



	public function posts($post_slug)
	{
		$this->data['details']= $this->db->query('SELECT * FROM '.TBL_POSTS.' WHERE LOWER(post_slug) = ? AND status = ?',array(strtolower($post_slug),1))->row();
		if(empty($this->data['details']))
		{
			//redirect(base_url());
			show_404();
		}
		$this->data['popular_news']=$this->db->select('*')->where('id !=',$this->data['details']->id)->where('status',1)->order_by('id','DESC')->limit(3)->get(TBL_POSTS)->result();
		$this->data['page']='post';
		$this->_render_page(get_template(),$this->data);
	}


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

			$data['contact_name']=$this->input->post('name');
			$data['contact_email']=$this->input->post('email');
			$data['contact_phone']=$this->input->post('phone');
			$data['enterprise_name']=$this->input->post('enterprise_name');
			$data['query_category']=$this->input->post('query_category');
			$data['contact_query']=$this->input->post('message');
			$data['created_on']=global_datetime();
	
			if($this->db->insert(TBL_CONTACT,$data)) {

				$subject="Contact Details";
				$message='<p>Conatact Name:'.$data['contact_name'].'</p>';
				$message.='<p>Contact Email:'.$data['contact_email'].'</p>';
				$message.='<p>Conatact Phone:'.$data['contact_phone'].'</p>';
				$message.='<p>Enterprise Name:'.$data['enterprise_name'].'</p>';
				$message.='<p>Query Categroy:'.$data['query_category'].'</p>';
				$message.='<p>Contact Query:'.$data['contact_query'].'</p>';

				if($data['query_category']!='Training Program' && $data['query_category']!='Awareness Program') {

					$cc = 'parasuram@geostat.in';
					$to = $data['contact_email'];

				} else {
					$cc = 'parasuram@geostat.in';
					$to = $data['contact_email'];
				}
				
				$success = sendEmail($subject,$message,$to,$cc);
				$this->session->set_flashdata('message', 'Your details submit successfully !');
				redirect(base_url().'contact-us');
			}
		}

		$this->data['page']='contactus';
		$this->_render_page(get_template(),$this->data);
	}


	public function video()
	{
		$this->data['page']='video';
		$this->_render_page(get_template(),$this->data);
	}


	public function gallery()
	{
		$query = $this->db->select('label, value')->get(TBL_GLOBAL)->result_array();
		foreach ($query as $row)
		{
			$details[$row['label']] = $row['value'];
		}
		$this->data['gallery_seo'] = $details;
		$this->data['details']=$this->home_model->gallery();
		
		$this->data['page']='gallery';
		$this->_render_page(get_template(),$this->data);

	}


	public function gallery_month()
	{
		$year=$this->uri->segment(2);
		$month=ucfirst($this->uri->segment(3));
		$this->data['details']=$this->home_model->gallery_month($year,$month);
		$query = $this->db->select('label, value')->get(TBL_GLOBAL)->result_array();
		foreach ($query as $row)
		{
			$details[$row['label']] = $row['value'];
		}
		$this->data['gallery_seo'] = $details;
		$this->data['year']=$year;
		$this->data['month']=$month;
		$this->data['page']='individual-gallery';
		$this->_render_page(get_template(),$this->data);
	}
	
	public function search()
	{
		if($this->input->post('search_query'))
		{
			$this->data['search']=$this->input->post('search_query');
			$search_query=$this->input->post('search_query');
			$result_array=$this->home_model->search($search_query);
			if ($result_array) {
				$this->data['details']=$result_array;
			} else {
				$this->data['error']='No Results found';
			}
			
		}
		$this->data['page']='search';
		$this->_render_page(get_template(),$this->data);
		

	}



	public function disciplineparameter()
	{
		if(isset($_POST['id']))
		{
			$sector_id=$_POST['id'];
			$discipline_parmeter=$this->home_model->disciplineresults($sector_id);
			$discipline=array();
			foreach ($discipline_parmeter as $key => $value) {
				if(!empty($discipline[$value['code']]))
					array_push($discipline[$value['code']]["data"],$value);
				else{

					$discipline[$value['code']]["para_discipline"] = $value['para_discipline'];
					$discipline[$value['code']]["data"] = array();
					array_push($discipline[$value['code']]["data"],$value);
				}
				
			}
			echo json_encode(array('success'=>FALSE,'discipline'=>$discipline,'token'=>$this->security->get_csrf_hash()));
		}
		else	
		echo json_encode(array('success'=>FALSE,'token'=>$this->security->get_csrf_hash()));
		
	}





	public function zedmatrixparameter() {
		if(isset($_POST['id']))
		{
			$sector_id=$_POST['id'];
			$discipline_parmeter=$this->home_model->zedmaturity($sector_id);
			echo json_encode(array('success'=>TRUE,'discipline'=>$discipline_parmeter,'token'=>$this->security->get_csrf_hash()));
		}
		else	
		echo json_encode(array('success'=>FALSE,'token'=>$this->security->get_csrf_hash()));
		
	}


	public function news() {
		$this->data['details']=$this->home_model->news();
		$this->data['page']='news';
		$this->_render_page(get_template(),$this->data);
	}


	public function fidetail($bankname) {

		$this->data['nodal'] = $this->home_model->nodal_detail($bankname);
		$this->data['details'] = 'List Of Financial Institution';
		$this->data['bank'] = $this->home_model->get_banks($bankname);
		$this->data['selectedbank'] = $bankname;
		$this->data['page']='bank_detail';
		$this->_render_page(get_template(),$this->data);
	}



	public function downloadTrainingPDF() {
		$this->load->helper('download');
		$data = file_get_contents("https://tcb.qcin.org//uploads/upcoming-trinings-pdf/Upcoming-Training-eLearning-Program-27-Jan-2021.pdf"); // Read the file's contents
		$name = 'Upcoming-Training-eLearning-Program.pdf';
		force_download($name, $data);
	}


	public function fis($bankname) {
		$this->data['details'] = 'List Of Financial Institution';
		$this->data['banklist'] = $this->home_model->get_list_ofbanks($bankname);
		$this->data['selectedbank'] = $bankname;
		$this->data['page']='list_banks';
		$this->_render_page(get_template(),$this->data);
	}


	function _financialinstitutions() {
		$this->data['selectedbank'] = 'scb';
		$this->data['details'] = 'List Of Financial Institution';
		$this->data['banklist'] = $this->home_model->get_list_ofbanks('scb');
		$this->data['page']='list_banks';
		$this->_render_page(get_template(),$this->data);
	}

	function _investment_bazaar($data) {
		$data['investment'] = $this->home_model->investment_bazaar('ib');
		$data['page']='investment-bazaar';
		$this->_render_page(get_template(), $data);
	}


	function _bees_training($data) {
		$data['investment'] = $this->home_model->investment_bazaar('training');
		$data['page']='bees_training';
		$this->_render_page(get_template(), $data);
	}
		

	function exporteet() {
		$this->db->where(''.TBL_EET.'.status!=', 2);
		$this->db->order_by(''.TBL_EET.'.id','DESC');
		$eet_list=$this->db->get('eet')->result();

        $table = '<table>';
        $table .= '<thead>';
        $table .= '<tr>';
        $table .= '<th>Name Of Technology</th>';
		$table .= '<th>About Technology</th>';
		$table .= '<th>Potential saving(%)</th>';
		$table .= '<th>Sector</th>';
		$table .= '<th>Investment (&#8377; Lakh)</th>';
		$table .= '<th>Annual Monetry Saving (&#8377; Lakh)</th>';
		$table .= '<th>Payback (Months)</th>';
		$table .= '<th>Equipment Capacity</th>';
        $table .= '</tr>';
        $table .= '</thead>';
        $table .= '<tbody>';
        if(!empty($eet_list)) { 
         foreach($eet_list as $eet) {
                $table .= '<tr>';
                $table .= '<td>'.$eet->eet_name.'</td>';
                $table .= '<td>'.$eet->about_technology.'</td>';
                $table .= '<td>'.$eet->esp .'</td>';
                $table .= '<td>'.$eet->sector_name.'</td>';
                $table .= '<td>'.$eet->investment.'</td>';
                $table .= '<td>'.$eet->saving.'</td>';
                $table .= '<td>'.$eet->payback.'</td>';
				$table .= '<td>'.$eet->equipment_capacity.'</td>';
                $table .= '</tr>';
         }}
        $table .= '</tbody>';
        $table .= '</table>';
      	header("Content-type: application/vnd.ms-excel");
        $file="eet_data.xls";
        header("Content-Disposition: attachment; filename=$file");
        echo $table;
    }


	function projects() {
		$data['menu'] = $this->home_model->get_menus();
		$data['states'] = $this->mwillingstatus->get_state_name();
		$data['sti'] = $this->states_wise_investment();
		$data['pi'] = $this->get_potential_investment();
		$data['page']='bees_project';
		$this->_render_page(get_template(), $data);
	}



}

Youez - 2016 - github.com/yon3zu
LinuXploit