%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/public_html/website_1ec2d7c2/apps/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/public_html/website_1ec2d7c2/apps/controllers/Packages.php
    <?php
    ob_start();
    defined('BASEPATH') OR exit('No direct script access allowed');

    class Packages extends CI_Controller {
	
	
	function __construct(){
		
	 parent::__construct();
	$this->load->library('form_validation');	
    $this->load->helper(array('form', 'url')); 	 
    $this->load->helper('cookie');
    //
    $this->load->library('pagination');
    $this->load->library('session'); 
    $this->load->library('cart'); 
    $this->load->helper('security');
    $this->load->helper('common');
    $this->load->library('email'); 
    $this->load->library('encrypt');
    // Custom Ours
  
     $this->load->library('login');   
    // $this->login->check_login();	 
     $this->load->model('content_model');   
     $this->load->model('user_model');   
     $this->load->model('commonmod_model');   
     $this->load->model('package_model');   
     
     $this->load->database();   
	}

	
	public function index($page="")
	{
		$data['Content'] =  $this->content_model->GetContentByID(24);
		  if(!is_numeric($page)){
			 $url_title = str_replace(".htm","",$page);
		
		    $cat_id	= $this->commonmod_model->GetcategoryIdCatUrl($url_title); 
		  if($page=='products.htm'){
			 $flag = '1';
		}  else  if( $cat_id > 0)
			  $flag=2;
		      else
				  $flag=3;
		}else{
			 $flag = '1';
		}
        if($page==''){
			 $flag = '1';
		} 
		
		 if($flag=="1"){
      
		$data['ProductData'] =  $this->package_model->GetALLPackageListingFrontByCategoryId($page);
		
		$data['id'] = $page;
		
		$this->load->view('front/package/product-page',$data);
		}
		else if($flag=="2"){
        $page = ($cat_id > 0)?$cat_id:$page;
		
		$data['CatData'] =  $this->commonmod_model->GetcategoryData($page);
		$data['ProductData'] =  $this->package_model->GetALLPackageListingFrontByCategoryId($page);
		
		$data['id'] = $page;
		
		$this->load->view('front/package/index',$data);
		}
		
		else{
		  $url_title = str_replace(".htm","",$page);
		
		
		$id	= $this->commonmod_model->getPackageIdByUrlTitle($page);
		if($id=="") redirect(BASE_URL.'products.htm');
		$data['url_title'] =  $page;
		$data['id'] =  $id;
		$data['SupportSingleData'] = $productdata =    $this->package_model->GetPackageListingByID($id);
		$data['CatData'] =  $this->commonmod_model->GetcategoryData($productdata[0]['category_id']);
		
		
		
		if($this->input->post('submit_contact') && $this->input->post('submit_contact')=="1") 
		 {


         $config11 = array( 	           
			array('field' => 'name','label' => 'Name','rules' => 'trim|required|xss_clean'),
			array('field' => 'email','label' => 'Email','rules' => 'trim|required|xss_clean|valid_email'),
			array('field' => 'phone','label' => 'Phone','rules' => 'trim|required|max_length[12]|min_length[8]'),
		
			array('field' => 'message','label' => 'Message','rules' => 'trim|required|xss_clean')
			
			
			);
			
			$this->form_validation->set_rules($config11);	
          // $this->form_validation->set_rules('phone', 'Contact Number ', 'required|regex_match[/^[0-9]{10}$/]'); //{10} for 10 digits number
			//$this->_check_phone($this->input->post('phone'));
			if ($this->form_validation->run() === FALSE)
			{	
		
	        $data['token'] = $this->login->token();
			
			$this->load->view('front/package/package-details',$data);
			
			
			}
			else{
			$package_url = BASE_URL.$url_title.'.htm';
			
		
          /*  Send Admin Email  */ 
	  
		    $subject = $this->security->xss_clean($this->input->post('subject'));
				 //  $countryCode2 = explode("~",$this->security->xss_clean($this->input->post('countryCode')));
		    // $countryCode =  $countryCode2[0];
		    // $countryname = $countryCode2[1];
		     $datasaved = array(
		  "package_name" =>trim($productdata[0]['listing_title']),
		  "package_url" => $package_url,
		  "name"=>$this->security->xss_clean($this->input->post('name')),
		  "email"=>$this->security->xss_clean($this->input->post('email')),
		  "contact_number"=>trim($this->input->post('phone')),
		  "subject" => $subject,
		  "message"=>$this->security->xss_clean($this->input->post('message')),
		  "add_date"=>date("Y-m-d h:i:s")
		  
		  );
		  $this->db->insert("bh_package_enquiry",$datasaved);
			 $config['protocol']    = 'smtp';
        $config['smtp_host']    = 'ssl://mail.mpl-liner.com';
        $config['smtp_port']    = '465';
        $config['smtp_timeout'] = '7';
        $config['smtp_user']    = 'info@mpl-liner.com';
        $config['smtp_pass']    = 'Omsai@123#$';
        $config['charset']    = 'utf-8';
        $config['newline']    = "\r\n";
        $config['mailtype'] = 'html'; // or html
        $config['validation'] = TRUE; // bool whether to validate email or not      

				$this->email->initialize($config);


				$this->email->from(FROM_EMAIL, FROM_NAME);
				$this->email->to(ADMIN_EMAIL_ID);
				$this->email->cc(CC_EMAIL_ID);
				//$this->email->bcc('them@their-example.com');
                $url_title = create_url($productdata[0]['listing_title']);
				
			   
				$this->email->subject('Servive Enquiry - '.trim($productdata[0]['listing_title']).' | '. WEBSITE_EMAIL_TITLE);
				$message = '<h2>'.WEBSITE_EMAIL_TITLE.'</h2>';
				$message .= '<p>'.$this->security->xss_clean($this->input->post('name'))." ".$this->security->xss_clean($this->input->post('lname')).' have contact with Us.</p>';
				$message .= '<p>Service Name: <a href="'.$package_url.'">'.trim($productdata[0]['listing_title']).'</a></p>';
				$message .= '<p>Name: '.trim( $this->security->xss_clean($this->input->post('name'))).'</p>';
				$message .= '<p>Email: '.trim( $this->security->xss_clean($this->input->post('email'))).'</p>';
				$message .= '<p>Phone Number: '.trim($this->input->post('phone')).'</p>';
				
				$message .= '<p>Message: '.trim($this->security->xss_clean($this->input->post('message'))).'</p>';

				$message .='<p>Thanks <br>
				'.WEBSITE_SIGNATURE.'
				</p>';
	
				$this->email->message($message);
               
			    if($this->email->send()){
   //Success email Sent
  // echo $this->email->print_debugger();
}else{
   //Email Failed To Send
   //echo $this->email->print_debugger();
}
				
				
          /*  Send User Email  */ 
		  
		  $User_EmailId = $this->input->post('email');
		  
		  $config['protocol']    = 'smtp';
        $config['smtp_host']    = 'ssl://mail.mpl-liner.com';
        $config['smtp_port']    = '465';
        $config['smtp_timeout'] = '7';
        $config['smtp_user']    = 'info@mpl-liner.com';
        $config['smtp_pass']    = 'Omsai@123#$';
        $config['charset']    = 'utf-8';
        $config['newline']    = "\r\n";
        $config['mailtype'] = 'html'; // or html
        $config['validation'] = TRUE; // bool whether to validate email or not      

				$this->email->initialize($config);
				$this->email->from(FROM_EMAIL, FROM_NAME);
				$this->email->to($User_EmailId);
				//$this->email->cc(CC_EMAIL_ID);
				//$this->email->bcc('them@their-example.com');

				$this->email->subject(' Enquiry - '.trim($productdata[0]['listing_title']).' | '.WEBSITE_EMAIL_TITLE);
				$message = '<h2>'.WEBSITE_EMAIL_TITLE.'</h2>';
				$message .= '<p>Hi '.trim( $this->security->xss_clean($this->input->post('name'))).' <br> you have successfully send your message for service </p>
<p>Service Name: <a href="'.BASE_URL.create_url($productdata[0]['listing_title']).'.html">'.trim($productdata[0]['listing_title']).'</a>		
		<br><br> We will contact you soon.</p>';
				

				$message .='<p>Thanks <br>
				'.WEBSITE_SIGNATURE.'
				</p>';

				$this->email->message($message);

				 $this->email->send();

	
			
			
			$this->session->set_flashdata('error',"<span style='color:green;'>Your Service Enquiry has been sent successfully.</a>");
			
	  
	  $url_title = create_url($productdata[0]['listing_title']);
	  redirect(BASE_URL.$url_title.'.htm');
			}
		 }
		 
			 
		 else{
			 $data['token'] = $this->login->token();
			 
		$this->load->view('front/package/package-details',$data);
		 }
		 
		 
		 
			
		}
		
	 }
	
	
	
	
	
	public function package_detail($url_title="",$id="")
	{
			
		$url_title = str_replace(".html","",$url_title);
		
		$id	= $this->commonmod_model->getPackageIdByUrlTitle($url_title);
		if($id=="") redirect(BASE_URL.'packages');
		$data['url_title'] =  $url_title;
		$data['id'] =  $id;
		$data['SupportSingleData'] = $productdata =    $this->package_model->GetPackageListingByID($id);
		
		
		
		if($this->input->post('submit_contact') && $this->input->post('submit_contact')=="1" && $this->input->post('check_form')=="") 
		 {


         $config11 = array( 	           
			array('field' => 'name','label' => 'Name','rules' => 'trim|required|xss_clean'),
			array('field' => 'email','label' => 'Email','rules' => 'trim|required|xss_clean'),
			array('field' => 'phone','label' => 'Phone','rules' => 'trim|required|xss_clean'),
			array('field' => 'subject','label' => 'Address','rules' => 'trim|required|xss_clean'),
			array('field' => 'message','label' => 'Message','rules' => 'trim|required|xss_clean')
			
			
			);
			
			$this->form_validation->set_rules($config11);	
          // $this->form_validation->set_rules('phone', 'Contact Number ', 'required|regex_match[/^[0-9]{10}$/]'); //{10} for 10 digits number
			//$this->_check_phone($this->input->post('phone'));
			if ($this->form_validation->run() === FALSE)
			{	
		
	        $data['token'] = $this->login->token();
			$this->output->cache(1);
			$this->load->view('front/package/package-details',$data);
			
			
			}
			else{
			$package_url = BASE_URL.'package-detail/'.$url_title;
			
		
          /*  Send Admin Email  */ 
	   if($this->input->post('token') == $this->session->userdata('token')){
		    $subject = $this->security->xss_clean($this->input->post('subject'));
				
		     $datasaved = array(
		  "package_name" =>trim($productdata[0]['listing_title']),
		  "package_url" => $package_url,
		  "name"=>$this->security->xss_clean($this->input->post('name'))." ".$this->security->xss_clean($this->input->post('lname')),
		  "email"=>$this->security->xss_clean($this->input->post('email')),
		  "contact_number"=>$this->security->xss_clean('+'.$this->input->post('countryCode').' '.$this->input->post('phone')),
		  "subject"=>$subject,
		  "message"=>$this->security->xss_clean($this->input->post('message')),
		  "add_date"=>date("Y-m-d h:i:s")
		  
		  );
		  $this->db->insert("bh_package_enquiry",$datasaved);
				$config2['protocol'] = 'sendmail';
				$config2['mailpath'] = '/usr/sbin/sendmail';
				$config2['mailtype'] = 'html';
				$config2['charset'] = 'iso-8859-1';
				$config2['wordwrap'] = TRUE;

				$this->email->initialize($config2);


				$this->email->from(FROM_EMAIL, FROM_NAME);
				$this->email->to(ADMIN_EMAIL_ID);
				$this->email->cc(CC_EMAIL_ID);
				//$this->email->bcc('them@their-example.com');
                $url_title = create_url($productdata[0]['listing_title']);
				
			   
				$this->email->subject('Product Enquiry - '.trim($productdata[0]['listing_title']).' | '. WEBSITE_EMAIL_TITLE);
				$message = '<h2>'.WEBSITE_EMAIL_TITLE.'</h2>';
				$message .= '<p>'.$this->security->xss_clean($this->input->post('name'))." ".$this->security->xss_clean($this->input->post('lname')).' have contact with Us.</p>';
				$message .= '<p>Product Name: <a href="'.BASE_URL.'product-detail/'.$url_title.'">'.trim($productdata[0]['listing_title']).'</a></p>';
				$message .= '<p>Name: '.trim( $this->security->xss_clean($this->input->post('name'))).'</p>';
				$message .= '<p>Email: '.trim( $this->security->xss_clean($this->input->post('email'))).'</p>';
				$message .= '<p>Phone Number: '.trim( $this->security->xss_clean('+'.$this->input->post('countryCode').' '.$this->input->post('phone'))).'</p>';
				$message .= '<p>Subject: '.trim($subject).'</p>';
				$message .= '<p>Message: '.trim($this->security->xss_clean($this->input->post('message'))).'</p>';

				$message .='<p>Thanks <br>
				'.WEBSITE_SIGNATURE.'
				</p>';
	
				$this->email->message($message);
               
			    if($this->email->send()){
   //Success email Sent
  // echo $this->email->print_debugger();
}else{
   //Email Failed To Send
   //echo $this->email->print_debugger();
}
				
				
          /*  Send User Email  */ 
		  
		  $User_EmailId = $this->input->post('email');
		  
		  $config2['protocol'] = 'sendmail';
				$config2['mailpath'] = '/usr/sbin/sendmail';
				$config2['mailtype'] = 'html';
				$config2['charset'] = 'iso-8859-1';
				$config2['wordwrap'] = TRUE;

				$this->email->initialize($config2);
				$this->email->from(FROM_EMAIL, FROM_NAME);
				$this->email->to($User_EmailId);
				//$this->email->cc(CC_EMAIL_ID);
				//$this->email->bcc('them@their-example.com');

				$this->email->subject('Product Enquiry - '.trim($productdata[0]['listing_title']).' | '.WEBSITE_EMAIL_TITLE);
				$message = '<h2>'.WEBSITE_EMAIL_TITLE.'</h2>';
				$message .= '<p>Hi '.trim( $this->security->xss_clean($this->input->post('name'))).' <br> you have successfully send your message for product </p>
<p>Package Name: <a href="'.BASE_URL.'product-detail/'.create_url($productdata[0]['listing_title']).'">'.trim($productdata[0]['listing_title']).'</a>				<br><br> We will contact you soon.</p>';
				

				$message .='<p>Thanks <br>
				'.WEBSITE_SIGNATURE.'
				</p>';

				$this->email->message($message);

				 $this->email->send();

	
			
			
			$this->session->set_flashdata('error',"<span style='color:green;'>Your enquiry has been sent successfully.</a>");
			
	   }else {
	   $this->session->set_flashdata('error',"Form Token not Matching"); 
	   
	   }
	  $url_title = create_url($productdata[0]['listing_title']);
	  redirect(BASE_URL.'product-detail/'.$url_title.'/'.$id);
			}
		 }
		 
			 
		 else{
			 $data['token'] = $this->login->token();
			 $this->output->cache(1);
		$this->load->view('front/package/package-details',$data);
		 }
		
	}
	
	public function _check_phone($phone)
	{
	   	if(preg_match('/^([0-9]( |-)?)?((?[0-9]{3})?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$/',$phone))
			{
				return true;
			} else {
					$this->form_validation->set_message('_check_phone', '%s '.$phone.' is invalid format');
					return false;
			}
	}
	
	
	
	
	
	
	

	
}

VaKeR 2022