403Webshell
Server IP : 94.136.191.34  /  Your IP : 216.73.216.25
Web Server : Apache
System : Linux hostpanel.netbiz.in 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
User : omkar.com_6nnuz6y629h ( 10087)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system,proc_open,popen
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  /var/www/vhosts/omkar.com/httpdocs/application/controllers/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /var/www/vhosts/omkar.com/httpdocs/application/controllers/Home02092017.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Home extends CI_Controller {

	public function __construct() {
        parent::__construct();
		$this->load->model('ui/ui_model', 'ui_model');
    }
	
	public function index($id = '')
	{
		$data['page_info'] = $this->ui_model->page_info('1');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'home';
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['rz1'] = $this->ui_model->home_page_projects();
		$data['banners'] = $this->ui_model->home_page_banners();
		$data['news_info'] = $this->ui_model->home_page_news();
		$this->load->view('home', $data);
	}
	
	public function about()
	{
		$data['page_info'] = $this->ui_model->page_info('2');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'about';
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$this->load->view('about', $data);
	}
	/* changes */
	public function residential_ongoing_projects()
	{
		$data['page_info'] = $this->ui_model->page_info('3');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		
		$data['page_active'] = 'projects';
		$data['project_type'] = 'residential';
		$data['pt']='rop';
		$data['url_tab1'] = base_url().'home/residential_ongoing_projects';
		$data['url_tab2'] = base_url().'home/residential_completed_projects';
		$data['url_tab3'] = base_url().'home/residential_upcoming_projects';
		$data['tab_active1'] = 'active';
		$data['tab_active2'] = '';
		$data['tab_active3'] = '';
		$data['locations'] = $this->ui_model->get_location_on_property_type('Residential');
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['rz1'] = $this->ui_model->get_projects_list('Residential','ongoing_project');
		$this->load->view('ongoing_projects', $data);
	}
	
	public function residential_completed_projects()
	{
		$data['page_info'] = $this->ui_model->page_info('4');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'projects';
		$data['url_tab1'] = base_url().'home/residential_ongoing_projects';
		$data['url_tab2'] = base_url().'home/residential_completed_projects';
		$data['url_tab3'] = base_url().'home/residential_upcoming_projects';
		$data['tab_active1'] = '';
		$data['tab_active2'] = 'active';
		$data['tab_active3'] = '';
		$data['locations'] = $this->ui_model->get_location_on_property_type('Residential');
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['rz1'] = $this->ui_model->get_projects_list('Residential','completed_project');
		$this->load->view('completed_projects', $data);
	}
	
	public function residential_upcoming_projects()
	{
		$data['page_info'] = $this->ui_model->page_info('4');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'projects';
        $data['project_type']='residential_upcoming_projects';
		$data['url_tab1'] = base_url().'home/residential_ongoing_projects';
		$data['url_tab2'] = base_url().'home/residential_completed_projects';
		$data['url_tab3'] = base_url().'home/residential_upcoming_projects';
		$data['tab_active1'] = '';
		$data['tab_active2'] = '';
		$data['tab_active3'] = 'active';
		$data['locations'] = $this->ui_model->get_location_on_property_type('Residential');
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['rz1'] = $this->ui_model->get_projects_list('Residential','upcoming_project');
		$this->load->view('upcoming_projects', $data);
	}
	
	public function commercial_ongoing_projects()
	{
		$data['page_info'] = $this->ui_model->page_info('3');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		
		$data['page_active'] = 'projects';
		$data['project_type'] = 'residential';
		
		$data['pt']='cop';
		$data['url_tab1'] = base_url().'home/commercial_ongoing_projects';
		$data['url_tab2'] = base_url().'home/commercial_completed_projects';
		$data['url_tab3'] = base_url().'home/commercial_upcoming_projects';
		$data['tab_active1'] = 'active';		
		$data['tab_active2'] = '';
		$data['tab_active3'] = '';
		$data['locations'] = $this->ui_model->get_location_on_property_type('Commercial');
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['rz1'] = $this->ui_model->get_projects_list('Commercial','ongoing_project');
		$this->load->view('ongoing_projects', $data);
	}
	
	public function commercial_completed_projects()
	{
		$data['page_info'] = $this->ui_model->page_info('4');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'projects';
		$data['url_tab1'] = base_url().'home/commercial_ongoing_projects';
		$data['url_tab2'] = base_url().'home/commercial_completed_projects';
		$data['url_tab3'] = base_url().'home/commercial_upcoming_projects';
		$data['tab_active1'] = '';
		$data['tab_active2'] = 'active';
		$data['tab_active3'] = '';
		$data['locations'] = $this->ui_model->get_location_on_property_type('Commercial');
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['rz1'] = $this->ui_model->get_projects_list('Commercial','completed_project');
		$this->load->view('completed_projects', $data);
	}
	
	public function commercial_upcoming_projects()
	{
		$data['page_info'] = $this->ui_model->page_info('4');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'projects';
		$data['project_type']='commercial_upcoming_projects';
		$data['url_tab1'] = base_url().'home/commercial_ongoing_projects';
		$data['url_tab2'] = base_url().'home/commercial_completed_projects';
		$data['url_tab3'] = base_url().'home/commercial_upcoming_projects';
		$data['tab_active1'] = '';
		$data['tab_active2'] = '';
		$data['tab_active3'] = 'active';
		$data['locations'] = $this->ui_model->get_location_on_property_type('Commercial');
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['rz1'] = $this->ui_model->get_projects_list('Commercial','upcoming_project');
		$this->load->view('upcoming_projects', $data);
	}
//added new method to save resdential/commercial form
    public function save_upcoming_project_form(){
    	

    	$name = $this->input->post('name');
    	$phone = $this->input->post('phone');
    	$city = $this->input->post('city');
    	$email_id = $this->input->post('email_id');
    	$project_type = $this->input->post('project_type');
    	$selected_project = $this->input->post('selected_project');

		$data =	array(
			'name'=>$name,
			'phone'=>$phone,
			'city'=>$city,
			'email_id'=>$email_id,
            'project_type'=>$project_type,
			'selected_project_type'=>$selected_project,
			'created_date'=>date('Y-m-d h:i:s')
			);


		$status = $this->ui_model->save_upcoming_project_form($data);
		if($status>0){
			$this->session->set_flashdata('success', 'Enquiry upcoming prjcts submitted successfully');
		//	redirect($_SERVER['HTTP_REFERER'].'#resi_comm_upcoming_prjct_form');
			redirect('home/'.$project_type);
		}else{
			$this->session->set_flashdata('error', 'Some error occured');
			//redirect($_SERVER['HTTP_REFERER'].'#resi_comm_upcoming_prjct_form');
			redirect('home/'.$project_type);
		}

    }


	/* changes */
	public function ongoing_projects()
	{
		$data['page_info'] = $this->ui_model->page_info('3');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'projects';
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['rz1'] = $this->ui_model->ongoing_projects_list();
		$this->load->view('ongoing_projects', $data);
	}

	public function completed_projects()
	{
		$data['page_info'] = $this->ui_model->page_info('4');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'projects';
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['rz1'] = $this->ui_model->completed_projects_list();
		$this->load->view('completed_projects', $data);
	}
	
	public function media()
	{
		$data['page_info'] = $this->ui_model->page_info('5');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'media';
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['news_info'] = $this->ui_model->fetch_news_details();
		$data['news_range'] = $this->ui_model->news_range();
		$data['press_relese_info'] = $this->ui_model->fetch_press_release_details();
		$data['press_range'] = $this->ui_model->press_range();
		$data['media_kit_info'] = $this->ui_model->fetch_media_kit_details();
		$data['awards_info'] = $this->ui_model->fetch_awards_details();
		$data['corporate_magazine_info'] = $this->ui_model->fetch_corporate_magazine_details();
		$data['video_gallery_info'] = $this->ui_model->fetch_video_gallery_details();
		$data['newsletter_info'] = $this->ui_model->fetch_newsletter_details();
		$data['newsletter_range'] = $this->ui_model->newsletter_range();
		// print_r($data);exit;
		$this->load->view('media', $data);
	}

	public function buyers_guide()
	{
		$data['page_info'] = $this->ui_model->page_info('6');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'buyers_guide';
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		//print_r($data['page_info']);exit;
		$this->load->view('buyers_guide', $data);
	}

	public function career()
	{
		$data['page_info'] = $this->ui_model->page_info('7');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'career';
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['current_openings'] = $this->ui_model->current_openings_list();
		$data['event_gallery'] = $this->ui_model->event_gallery();
		$data['testimonials'] = $this->ui_model->testimonials_list('Individual');
		$this->load->view('career', $data);
	}

	public function mbassy()
	{
		$data['page_info'] = $this->ui_model->page_info('8');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'mbassy';
		$data['event_gallery'] = $this->ui_model->event_gallery();
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		$data['testimonials'] = $this->ui_model->testimonials_list('Individual');
		$this->load->view('mbassy', $data);
	}

	public function contact_us()
	{
		$data['page_info'] = $this->ui_model->page_info('9');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'contact_us';
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		//print_r($data['page_info']);exit;
		$this->load->view('contact_us', $data);
	}

	public function channel_partner()
	{
		$data['page_info'] = $this->ui_model->page_info('10');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'home';
		$data['project_list'] = $this->ui_model->mbassy_project_list();
		//print_r($data['page_info']);exit;
		$this->load->view('channel_partner', $data);
	}
	
	public function project_details($name, $id)
	{
		$data['page_info'] = $this->ui_model->project_info($id);
		if(!empty($data['page_info'])){
			$data['page_active'] = 'projects';
			$data['banner'] = $this->ui_model->banner_info($id);
			$data['description'] = $this->ui_model->description_info($id);
			$data['brochure'] = $this->ui_model->brochure_info($id);
			$data['gallery'] = $this->ui_model->gallery_info($id);
			$data['key_description'] = $this->ui_model->key_description($id);
			$data['amenity'] = $this->ui_model->amenity_info($id);
			$data['video'] = $this->ui_model->video_info($id);
			$data['specification'] = $this->ui_model->specification_info($id);
			$data['locations_adv'] = $this->ui_model->locations_adv($id);
			$data['construction_updates'] = $this->ui_model->construction_updates($id);
			$data['invest'] = $this->ui_model->invest($id);
			$data['location'] = $this->ui_model->location_info($id);
			$data['related_news'] = $this->ui_model->project_related_news($id);
			$data['project_list'] = $this->ui_model->mbassy_project_list();
			$this->load->view('project_details', $data);
		}else{
			show_404();
		}
		
	}
		
	public function current_openings()
	{
		$data['page_info'] = $this->ui_model->current_openings();
		$data['info'] = $this->ui_model->current_openings_list();
		$this->load->view('current_openings', $data);
	}

	public function current_opening_description($id){
		if(isset($id)){
			$data['page_info'] = $this->ui_model->current_openings();
			$data['project_list'] = $this->ui_model->mbassy_project_list();
			$data['info'] = $this->ui_model->current_openings_description($id);
			$this->load->view('job_description', $data);
		}else{
			redirect('home/current_openings/');
		}
	}

	public function apply_job_opening($id){
		if(isset($id)){
			$data['page_info'] = $this->ui_model->current_openings();
			$data['project_list'] = $this->ui_model->mbassy_project_list();
			$data['info'] = $this->ui_model->current_openings_description($id);
			$this->load->view('apply', $data);
		}else{
			redirect('home/current_openings/');
		}
	}

	public function save_job_application($id){
		$candidate_fname = $this->input->post('candidate_fname');
		$candidate_lname = $this->input->post('candidate_lname');
		$candidate_gender = $this->input->post('candidate_gender');
		$candidate_mobile = $this->input->post('candidate_mobile');
		$candidate_phone = $this->input->post('candidate_phone');
		$candidate_email = $this->input->post('candidate_email');
		$candidate_area_interest = $this->input->post('candidate_area_interest');
		$candidate_address = $this->input->post('candidate_address');

		if ($this->form_validation->run() == FALSE){
			redirect('home/current_openings/');
		}else{
			if(isset($id)){
				$data = array(
					'job_id'=>$id,
					'first_name'=>$candidate_fname,
					'last_name'=>$candidate_lname,
					'gender'=>$candidate_gender,
					'mobile_no'=>$candidate_mobile,
					'phone_no'=>$candidate_phone,
					'email_id'=>$candidate_email,
					'area_interest'=>$candidate_area_interest,
					'address'=>$candidate_address,
					'created_date' => date('Y-m-d H:i:s')
					);
				$result = $this->ui_model->save_job_application($data, $_FILES);
				if($result!=""){
					$data['page_info'] = $this->ui_model->current_openings();
					$data['info'] = $this->ui_model->current_openings_description($id);
					$data['info']['message_type'] = 'success';
					$data['info']['message'] = "Thank you for apply this job. We will contact you soon.";
					$this->load->view('apply', $data);

				}else{
					$data['page_info'] = $this->ui_model->current_openings();
					$this->load->view('apply', $data);
				}

			}else{
				redirect('home/current_openings/');
			}
		}
	}
	
	public function campus_recruitment()
	{
		$data['page_info'] = $this->ui_model->campus_recruitment();
		//print_r($data['page_info']);exit;
		$this->load->view('campus_recruitment', $data);
	}
	
	public function residental_project_listing()
	{
		$data['page_info'] = $this->ui_model->residental_info();
		//print_r($data['page_info']);exit;
		$this->load->view('residental_project_listing', $data);
	}
	
	public function commercial_project_listing()
	{
		$data['page_info'] = $this->ui_model->commercial_info();
		//print_r($data['page_info']);exit;
		$this->load->view('commercial_project_listing', $data);
	}
	
	/*public function schedule_visit(){
		$visitor_name = $_POST['visitor_name'];
		$visit_project_location = $_POST['visit_project_location'];
		$visit_select_project = $_POST['visit_select_project'];
		$visit_email_id = $_POST['visit_email_id'];
		$datetimepicker2 = $_POST['datetimepicker2'];
		$datetimepicker1 = $_POST['datetimepicker1'];
		$visitor_mobile = $_POST['visitor_mobile'];
		
		$data = array(
		'name' => $visitor_name,
		'location'=> $visit_project_location,
		'project' => $visit_select_project,
		'email_id'=> $visit_select_project,
		'date'=> $datetimepicker2,
		'time'=> $datetimepicker1,
		'mobile_no'=> $visitor_mobile,
		'created_date' => date('Y-m-d H:i:s')
		);

		$result = $this->ui_model->schedule_visit($data);
		echo  $result;
		exit;
	}*/

	/*public function get_partner_us(){
		$partner_name = $_POST['partner_name'];
		$identity = $_POST['identity'];
		$partner_email_id = $_POST['partner_email_id'];
		$partner_mobile_no = $_POST['partner_mobile_no'];
		$partner_telephone = $_POST['partner_telephone'];
		$poperty_title = $_POST['poperty_title'];
		$property_country = $_POST['property_country'];
		$property_state = $_POST['property_state'];
		$property_city = $_POST['property_city'];
		$property_locality = $_POST['property_locality'];
		$fsi_potentials = $_POST['fsi_potentials'];
		$fsi_potentials_measurement = $_POST['fsi_potentials_measurement'];
		$size_of_property_measurement = $_POST['size_of_property_measurement'];
		$nature_of_transaction = $_POST['nature_of_transaction'];
		$size_of_property = $_POST['size_of_property'];
		$proposal = $_POST['proposal'];

		$data = array(
		'name' => $partner_name,
		'identity'=> $identity,
		'email_id' => $partner_email_id,
		'mobile_no'=> $partner_mobile_no,
		'telephone'=> $partner_telephone,
		'property_title'=> $poperty_title,
		'country'=> $property_country,
		'property_state'=> $property_state,
		'property_city'=> $property_city,
		'locality'=> $property_locality,
		'fsi_potential'=> $fsi_potentials,
		'fsi_potential_measurement'=> $fsi_potentials_measurement,
		'size_of_property'=> $size_of_property,
		'size_of_property_measurement'=> $size_of_property_measurement,
		'transaction'=> $nature_of_transaction,
		'proposal'=> $proposal,
		'created_date' => date('Y-m-d H:i:s')
		);

		$result = $this->ui_model->save_partner_us($data, $_FILES);
		if($result!=""){
			$data['success'] = "Your enquiry has been successfully submitted!";
		  //$this->load->view('partner_us', $data);	
			redirect('home/partner_us/', $data);
		}
	}*/

	public function get_location()
	{
		$project_type = $_POST['project_type'];
		$results = $this->ui_model->get_location($project_type);
		if($project_type == 'Residential'){
			$html = '<option value="">Select Location</option><option value="Thane">Thane</option>';
		}else{
			$html = '<option value="">Select Location</option>';
		}
		
		if(!empty($results)){
			foreach($results as $rz) {
				$html .='<option value="'.$rz["location"].'">'.$rz["location"].'</option>';
			}
		}
		echo $html;
		exit;
	}
	
	public function get_projects()
	{
		$project_type = $_POST['project_type'];
		$location = $_POST['location'];
		$results = $this->ui_model->get_projects($project_type, $location);
		$html = '<option value="">Property Finder</option>';
		if(!empty($results)){
			foreach($results as $rz) {
				$html .='<option value="'. base_url().'home/project-details/'.strtolower(str_replace(' ', '-', $rz['name'])) .'/'.$rz['id'].'">'.$rz["name"].'</option>';
			}
		}
		echo $html;
		exit;
	}

	public function project_enquiry(){
		$name = $this->input->post('name');
		$email = $this->input->post('email');
		$phone = $this->input->post('phone');
		$project_interested = $this->input->post('project_interested');
		$type = $this->input->post('type');

		$message = $this->input->post('message');

		$data = array(
					'name' => $name,
					'email' => $email,
					'phone' => $phone,
					'project_name' => $project_interested,
					'message' => $message
				);

		$status = $this->ui_model->project_enquiry($data);

		if($type == 2){
			echo 'success';
			exit;
		}else{
			$this->session->set_flashdata('project_success_msg', 'Enquiry submitted successfully');
			redirect($_SERVER['HTTP_REFERER'].'#project-form');
		}


		
	}

	function force_download($name,$folder_name)
    {
        $data = file_get_contents($_SERVER["DOCUMENT_ROOT"].folder_name.'/resources/uploads/'.$folder_name.'/'.$name);
        $name = $name;
        force_download($name, $data);
	}

	public function get_location_on_property_type(){
		$property_type = $this->input->post('property_type');
		$result = $this->ui_model->get_location_on_property_type($property_type);
		if(!empty($result)){
			$str ="<option value=''>Select Location</option>";
			foreach($result as $property_loc) {

					$str .= "<option value='".$property_loc['location']."'>".$property_loc['location']."</option>";

			}
			echo $str;
			exit;		
		}
			
	}

	public function get_property_on_property_location(){
		$property_loc = $this->input->post('property_loc');
		$result = $this->ui_model->get_property_on_property_location($property_loc);
		if(!empty($result)){
			$str ="<option value=''>Select Property</option>";
			foreach($result as $property_loc) {

					/*$str .= "<option value ='".base_url().'home/project-details/'.strtolower(str_replace(' ', '-', $property_loc['name'])) .'/'.$property_loc['id']."'>".$property_loc['name']."</option>";*/

					$str .= "<option value ='".$property_loc['url']."'>".$property_loc['name']."</option>";

			}
			echo $str;
			exit;		
		}
			
	}

	public function filter_news(){
		$year = $this->input->post('year');
		$result = $this->ui_model->filter_news($year);
		if(!empty($result)){
			$str ='';
			foreach($result as $rz) {
				$string = $rz['news_date'];
				$timestamp = strtotime($string);
				$str .='<div class="news-item news-press filter_news">
							<div class="top-wrp">
								<div class="date-wrp">
									<p>'.date("d", $timestamp).'</p>
									<p>'.strtoupper(date("M", $timestamp)).'. '.date("Y", $timestamp).'</p>
								</div>
								<img src="'.base_url().'uploads/news/'.$rz['image'].'">
							</div>
							<div class="content-wrp">
								<p class="heading">'.$rz['title'].'</p>
								<span><p class="para">'.$rz['description'].'</p></span>
								<a href="'.base_url().'uploads/news_document/'.$rz['document'].'" target="_blank" class="btn-01">Read More</a>
							</div>
						</div>';
			}
			echo $str;
			exit;		
		}
		exit;
	}

	public function filter_press(){
		$year = $this->input->post('year');
		$result = $this->ui_model->filter_press($year);
		if(!empty($result)){
			$str ='';
			foreach($result as $rz) {
				$string = $rz['press_date'];
				$timestamp = strtotime($string);
				$str .='<div class="news-press filter_news">
						<div class="top-wrp">
							<div class="date-wrp">
								<p>'.date("d", $timestamp).'</p>
								<p>'.strtoupper(date("M", $timestamp)).'. '.date("Y", $timestamp).'</p>
							</div>
						</div>
						<div class="content-wrp">
							<p class="heading">'.$rz['title'].'</p>
							<p class="para">'.strip_tags($rz['description']).'</p>
							<a href="'.base_url().'uploads/press_release/'.$rz['image'].'" class="btn-01" target="_blank">Read More</a>
						</div>
					</div>';
			}
			echo $str;
			exit;		
		}
		exit;
	}

	public function filter_newsletter(){
		$year = $this->input->post('year');
		$result = $this->ui_model->filter_newsletter($year);
		if(!empty($result)){
			$str ='';
			foreach($result as $rz) {
				$str .='<a href="'.$rz['link'].'" target="_blank">
							<img src="'.base_url().'uploads/newsletters/'.$rz['image'].'">
							<p>'.$rz['name'].'</p>
						</a>';
			}
			echo $str;
			exit;		
		}
		exit;
	}

	public function contact_enquiry(){
		$name = $this->input->post('name');
		$email = $this->input->post('email_id');
		$phone = $this->input->post('phone');
		$location = $this->input->post('location');
		$comments = $this->input->post('comments');
		$data = array(
					'name' => $name,
					'email_id' => $email,
					'contact_no' => $phone,
					'location' => $location,
					'comments' => $comments
				);

		$status = $this->ui_model->contact_enquiry($data);
		$this->session->set_flashdata('project_success_msg', 'Enquiry submitted successfully');
		redirect($_SERVER['HTTP_REFERER'].'#offc-info');
	}

	public function vendor_enquiry(){
		$name = $this->input->post('name');
		$phone = $this->input->post('phone');
		$company_name = $this->input->post('company_name');
		$category = $this->input->post('category');
		$comments = $this->input->post('comments');
		if(!empty($_FILES['company_profile']['tmp_name'])){
			$temp_name = $_FILES['company_profile']['tmp_name'];
			$file_name = time().rand().$_FILES['company_profile']['name'];
			$check_mime = $this->check_mime($temp_name,$file_name);
			if($check_mime){
				$data = array(
					'name' => $name,
					'phone' => $phone,
					'company_name' => $company_name,
					'category' => $category,
					'comments' => $comments,
					'file_name' => $file_name
				);
				$path = $_SERVER['DOCUMENT_ROOT'].FOLDER_NAME."uploads/vendor_registration/";	
				if(move_uploaded_file($temp_name, $path.$file_name)){
					$status = $this->ui_model->vendor_enquiry($data);
					$this->session->set_flashdata('vendor-register_msg', 'Enquiry submitted successfully');
					redirect($_SERVER['HTTP_REFERER'].'#vendor-register');
				}			
			}else{
				$this->session->set_flashdata('vendor-register_msg', 'Some error occured');
				redirect($_SERVER['HTTP_REFERER'].'#vendor-register');
			}
		}else{
			$this->session->set_flashdata('vendor-register_msg', 'Some error occured');
			redirect($_SERVER['HTTP_REFERER'].'#vendor-register');
		}
	}

	public function check_mime($temp_name,$extension){	
			
		$finfo = finfo_open(FILEINFO_MIME_TYPE);
		$type = finfo_file($finfo, $temp_name);
		if ($type == 'application/pdf' || $type == 'application/msword' || $type == 'application/vnd.ms-powerpoint') {
			finfo_close($finfo);
			$extension = explode('.', $extension);
			$allowedExts = array("pdf", "doc", "ppt");
			if (in_array($extension['1'], $allowedExts)){
				return TRUE;
			}else{
				return false;
			}
		}else{
			finfo_close($finfo);
			return false;
		}
	}


	public function save_chanel_partner_data(){
		$name = $this->input->post('name');
		$owner_name = $this->input->post('owner_name');
		$entity = $this->input->post('entity');
		$office_address = $this->input->post('office_address');
		$telephone_no = $this->input->post('telephone_no');
		$phone = $this->input->post('phoneno');
		$website = $this->input->post('website');
		$email_id = $this->input->post('email_id');
		$area = implode(',', $this->input->post('area'));
		$years_in_operation = $this->input->post('years_in_operation');
		$expertise = implode(',', $this->input->post('expertise'));
		$expertise_other =  $this->input->post('other_expertise');
		$pan_card_no = $this->input->post('pan_card_no');
		$gst_no = $this->input->post('gst_no');
		$rera_no = $this->input->post('rera_no');
		$broker_asso = $this->input->post('broker_asso');
		$interested_in =  implode(',', $this->input->post('interested_in'));	
		$interested_in_other = $this->input->post('other_intrested_in');
		$authorised_signatories = $this->input->post('authorised_signatories');
		$authorised_signatories_name1 = $this->input->post('authorised_signatories_name1');
		$authorised_signatories_designation1 = $this->input->post('authorised_signatories_designation1');
		$authorised_signatories_name2 = $this->input->post('authorised_signatories_name2');
		$authorised_signatories_designation2 = $this->input->post('authorised_signatories_designation2');
		$years_in_operation = $this->input->post('years_in_operation');
		$other_cities_of_mumbai = $this->input->post('other_area_city');
		$other_countries = $this->input->post('other_countries');
		//echo $interested_in;
		//exit;

		$data =	array(
			'name'=>$name,
			'owner_name'=>$owner_name,
			'entity'=>$entity,
			'office_address'=>$office_address,
			'telephone_no'=>$telephone_no,
			'mobile_no'=>$phone,
			'website'=>$website,
			'email'=>$email_id,
			'area'=>$area,
			'years_in_operation'=>$years_in_operation,
			'expertise'=>$expertise,
			'pan_no'=>$pan_card_no,
			'gst_no'=>$gst_no,
			'rera_no'=>$rera_no,
			'broker_association'=>$broker_asso,
			'project_interest'=>$interested_in,
			'other_interested_project'=>$interested_in_other,
			'authorised_signatories'=>$authorised_signatories,
			'authorised_signatories_name1'=>$authorised_signatories_name1,
			'authorised_signatories_designation1'=>$authorised_signatories_designation1,
			'authorised_signatories_name2'=>$authorised_signatories_name2,
			'authorised_signatories_designation2'=>$authorised_signatories_designation2,
			'years_in_operation'=>$years_in_operation,
			'other_cities_of_mumbai_city'=>$other_cities_of_mumbai,
			'other_countries'=>$other_countries,
			'expertise_other'=>$expertise_other,
			'created_date'=>date('Y-m-d h:i:s')
			);


		$status = $this->ui_model->save_channel_partner_data($data,$_FILES);
		if($status!=""){
			$this->session->set_flashdata('message', 'Enquiry submitted successfully');
			redirect($_SERVER['HTTP_REFERER'].'#channel_partner_form');
		}else{
			$this->session->set_flashdata('message', 'Some error occured');
			redirect($_SERVER['HTTP_REFERER'].'#channel_partner_form');
		}

	}

	public function mbassy_enquiry(){
		$name = $this->input->post('name');
		$residential_address_zone = $this->input->post('residential_address_zone');
		$registered_with_name = $this->input->post('registered_with_name');
		if($registered_with_name == ''){
			$registered_with_name = 'No';
		}
		$residential_address = $this->input->post('residential_address');
		$project_name = $this->input->post('project_name');
		$phone1 = $this->input->post('phone1');
		$flat_no = $this->input->post('flat_no');
		$alternate_no = $this->input->post('alternate_no');
		$wing_no = $this->input->post('wing_no');
		$email = $this->input->post('email');
		$ref_name1 = $this->input->post('ref_name1');
		$ref_phone1 = $this->input->post('ref_phone1');
		$ref_email1 = $this->input->post('ref_email1');
		$ref_name2 = $this->input->post('ref_name2');
		$ref_phone2 = $this->input->post('ref_phone2');
		$ref_email2 = $this->input->post('ref_email2');
		$ref_name3 = $this->input->post('ref_name3');
		$ref_phone3 = $this->input->post('ref_phone3');
		$ref_email3 = $this->input->post('ref_email3');
		$data = array(
					'name' => $name,
					'residential_address_zone' => $residential_address_zone,
					'registered_with_name' => $registered_with_name,
					'residential_address' => $residential_address,
					'project_name' => $project_name,
					'phone' => $phone1,
					'flat_no' => $flat_no,
					'alternate_no' => $alternate_no,
					'wing_no' => $wing_no,
					'email' => $email,
					'ref_name1' => $ref_name1,
					'ref_phone1' => $ref_phone1,
					'ref_email1' => $ref_email1,
					'ref_name2' => $ref_name2,
					'ref_phone2' => $ref_phone2,
					'ref_email2' => $ref_email2,
					'ref_name3' => $ref_name3,
					'ref_phone3' => $ref_phone3,
					'ref_email3' => $ref_email3
				);

		$status = $this->ui_model->mbassy_enquiry($data);
		$this->session->set_flashdata('project_success_msg', 'Enquiry submitted successfully');
		redirect($_SERVER['HTTP_REFERER'].'#mbassy_form_id');
	}

	public function send_otp_message(){
		header("Access-Control-Allow-Origin: *");

		$mobile = '91'.$_POST['mob1'];
		$digits = 4;
		$otp = rand(pow(10, $digits-1), pow(10, $digits)-1);
		$msg = "Your 4 digit OTP number is $otp";

		$sms_url = "http://nimbusit.net/api.php?username=t4xanadu&password=579709&sender=OMKRDS&sendto=".$mobile."&message=".urlencode($msg);
		$result = file_get_contents($sms_url);

		if($result){
			echo md5($otp);
			exit;
		}else{
			echo "error";
			var_dump( $result );
			exit;
		}
	}

	public function match_otp(){
		$hidden_otp = $_POST['otp_hidden1'];
		$otp = md5($_POST['otp1']);
		if($hidden_otp==$otp){
			echo 'match';
			exit;
		}else{
			echo "error";
			exit;
		}
	}

	public function thank_you(){
		$data['page_info'] = $this->ui_model->page_info('27');
		if($data['page_info']->status =='0'){
			show_404();
			exit;
		}
		$data['page_active'] = 'Thank You';
		$this->load->view('thank_you',$data);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit