| 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 : |
<?php
class Ui_model extends CI_Model {
public function __construct() {
parent::__construct();
}
public function check_cplist($email,$project_name){
$res = $this->db->get_where("tbl_cplist",array("email_id" => $email))->row_array();
return $res;
}
public function iframe_for_plans($floor_plan_id){
$this->db->where('id', $floor_plan_id);
$query = $this->db->get('projects_floor_plan')->row_array();
return $query;
}
public function fetch_blogs(){
$this->blogs_db = $this->load->database('blogs', true);
//echo $this->blogs_db;exit;
$qry = "SELECT node_field_data.nid, node_field_data.title, body.body_value, body.body_summary, FROM_UNIXTIME(node_field_data.created) AS Created/*, file_managed.filename AS image*/
FROM node_field_data
INNER JOIN node_revision__body AS body
ON node_field_data.nid = body.entity_id
/*INNER JOIN file_usage
ON file_usage.id = node_field_data.nid */
/* INNER JOIN file_managed
ON file_usage.fid = file_managed.fid*/
WHERE node_field_data.type = 'blog_post'
order by node_field_data.created desc
LIMIT 0,3";
$data = $this->blogs_db->query($qry)->result_array();
//print_r($data);exit;
foreach ($data as $key => $value) {
$query = "SELECT file_managed.uri AS image
FROM file_usage
LEFT JOIN file_managed
ON file_usage.fid = file_managed.fid
WHERE file_usage.id = '".$value['nid']."'";
$data[$key]['images'] = $this->blogs_db->query($query)->result_array();
}
return $data;
}
/*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.sequence_no asc";
//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 save_whatsapp_enquiry($data){
$query = $this->db->insert('whatsapp_enquiries', $data);
$insert_id = $this->db->insert_id();
return $insert_id;
}
public function save_nri_details($data){
$query = $this->db->insert('nri_enquiries', $data);
$insert_id = $this->db->insert_id();
return $insert_id;
}
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' ORDER BY id desc";
$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' ORDER BY created_date desc ";
$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)->result_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("media_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 fetch_event_gallery($page_name){
$q1 = "select g.*,c.name event_name
from event_gallery g
inner join event_category c
on g.category_id=c.id
where c.page_name = '".$page_name."'
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 page_name='$category' order by id desc";
$query = $this->db->query($q1)->result_array();
return $query;
}
public function mbassy_project_list(){
$q1 = "select * 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;
}
//added new fn by tushar on 01 sep 2017
public function save_upcoming_project_form($data){
$query = $this->db->insert('saved_upcoming_project_form', $data);
$insert_id = $this->db->insert_id();
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;
}
}
public function fetch_plans($id, $plan_type){
return $this->db->get_where("projects_floor_plan", array("project_id" => $id, "plan_type" => $plan_type))->result_array();
}
// public function fetch_plans($project_id){
// return $this->db->get_where("projects_floor_plan", array("project_id" => $project_id))->result_array();
// }
public function fetch_project_gallary_images($project_id){
return $this->db->get_where("projects_gallery", array("project_id" => $project_id, "category" => 'Project Gallary'))->result_array();
}
public function fetch_project_walkthrough($project_id){
return $this->db->get_where("projects_video", array("project_id" => $project_id))->result_array();
}
public function fetch_project_partner($project_id){
return $this->db->get_where("projects_partners", array("project_id" => $project_id))->result_array();
}
public function sampleflat_info($id){
$q1 = "select * from projects_sample_flat where project_id='".$id."' AND status = 1";
$rz1 = $this->db->query($q1)->result_array();
return $rz1;
}
/*code added by shubhangi to infographic is as follow*/
/*--------list image infographic------------*/
public function get_all_list_image()
{
$q1 = "select * from tbl_infographics where status='1' order by id DESC ";
$query = $this->db->query($q1)->result_array();
return $query;
}
/*--------------------*/
/*--------get date year data------------*/
public function get_date()
{
$this->db->order_by("id","desc");
$this->db->group_by('YEAR(publish_date)');
$this->db->where('status','1');
$query = $this->db->get('tbl_infographics')->result_array();
return $query;
echo $this->db->last_query();exit;
}
public function get_all_date_info()
{
$q1 = "SELECT YEAR(publish_date) from tbl_infographics";
$rz1 = $this->db->query($q1)->result_array();
return $rz1;
}
/*--------------------*/
/*--------get data from selected Year------------*/
public function get_year_data($selectvalue)
{
$this->db->select('*');
$this->db->from('tbl_infographics');
$this->db->like('DATE_FORMAT(publish_date,"%Y")', $selectvalue);
$this->db->where('status','1');
$this->db->order_by("id","desc");
$res = $this->db->get();
if($res)
{
return $res->result_array();
}
else
{
return FALSE;
}
}
public function get_infographic_detail_data($currentURL)
{
return $this->db->get_where("tbl_infographics", array("url" => $currentURL))->result_array();
}
/*--------------------*/
public function floor_plan_enquiry($data){
$query = $this->db->insert('floor_plan_enquiry', $data);
$insert_id = $this->db->insert_id();
return $insert_id;
}
public function fetch_project_showreel($project_id)
{
return $this->db->get_where("project_showreel_video", array("project_id" => $project_id, "status" => '1'))->result_array();
}
public function fetch_floor_plan_image($project_id)
{
return $this->db->get_where("projects_floor_plan", array("project_id" => $project_id))->result_array();
}
public function contact_enquire_image($project_id){
return $this->db->get_where("project_enquire_image", array("project_id" => $project_id))->result_array();
}
}?>