<?php
$url = $_SERVER['HTTP_HOST']=="localhost" ? $_SERVER['DOCUMENT_ROOT'].'/ethics-prosperity' : $_SERVER['DOCUMENT_ROOT'];
require_once($url."/config/database.php");
require_once($url."/model/class.phpmailer.php");



class model
{
   public $con;
   public $mail;
   

  /*public function __construct()
  {
      $databaseService = new DatabaseService();
      $this->con = $databaseService->getConnection();

      $this->mail = new PHPMailer(true);
      //Server settings
      //$this->mail->SMTPDebug = 2;   // Enable verbose debug output
      $this->mail->isSMTP();        // Set mailer to use SMTP
      $this->mail->Host = 'sg2plcpnl0194.prod.sin2.secureserver.net';  // Specify main and backup SMTP servers
      $this->mail->SMTPAuth = true;    // Enable SMTP authentication
      $this->mail->Username = 'noreply@mymachinesexpert.com';  // SMTP username
      $this->mail->Password = 'zl{d4s^9gtAj';       // SMTP password
      $this->mail->SMTPSecure = 'ssl';       // Enable TLS encryption, `ssl` also accepted
      $this->mail->Port = 465;        // TCP port to connect to
      $this->mail->setFrom('noreply@mymachinesexpert.com');

  }*/

public function __construct()
   {
       $databaseService = new DatabaseService();
      $this->con = $databaseService->getConnection();

      $this->mail = new PHPMailer(true);
      $ex = $this->view_email_setting();
         if(mysqli_num_rows($ex))
      {
         $fet = mysqli_fetch_array($ex);
         //Server settings
         $this->mail->SMTPDebug = 1;   // Enable verbose debug output
         $this->mail->isSMTP();        // Set mailer to use SMTP
         $this->mail->Host = $fet['e_smtp_host'];  // Specify main and backup SMTP servers
         $this->mail->SMTPAuth = true;    // Enable SMTP authentication
         $this->mail->Username = $fet['e_email'];  // SMTP username
         $this->mail->Password = $fet['e_password'];       // SMTP password
         $this->mail->SMTPSecure = $fet['e_smtp'];       // Enable TLS encryption, `ssl` also accepted
         $this->mail->Port = $fet['e_smtp_port'];        // TCP port to connect to
         $this->mail->setFrom($fet['e_email']);
      }
      else{
      //Server settings
      $this->mail->SMTPDebug = 1;   // Enable verbose debug output
      $this->mail->isSMTP();        // Set mailer to use SMTP
      $this->mail->Host = 'md-99.webhostbox.net';  // Specify main and backup SMTP servers
      $this->mail->SMTPAuth = true;    // Enable SMTP authentication
      $this->mail->Username = 'noreply@ethicsprosperity.com';  // SMTP username
      $this->mail->Password = 'O.GYoE@dnq(W';       // SMTP password
      $this->mail->SMTPSecure = 'SSL';       // Enable TLS encryption, `ssl` also accepted
      $this->mail->Port = 587;        // TCP port to connect to
      $this->mail->setFrom('noreply@ethicsprosperity.com');
  }

   }
   
   //email Configuration
   /*-------------------Email Configuration----------------------*/
  
  public function email_configuration($row)
   {
      try { 
      //Server settings
      //$this->mail->SMTPDebug = 1;   // Enable verbose debug output
      $this->mail->isSMTP();        // Set mailer to use SMTP
      $this->mail->Host = $row['e_smtp_host'];  // Specify main and backup SMTP servers
      $this->mail->SMTPAuth = true;    // Enable SMTP authentication
      $this->mail->Username = $row['e_email'];  // SMTP username
      $this->mail->Password = $row['e_password'];       // SMTP password
      $this->mail->SMTPSecure = $row['e_smtp'];       // Enable TLS encryption, `ssl` also accepted
      $this->mail->Port = $row['e_smtp_port'];        // TCP port to connect to
      $this->mail->setFrom($row['e_email']);

      $this->mail->addAddress($row['e_email']);      

      $this->mail->isHTML(true);      // Set email format to HTML

      $this->mail->Subject = "Email Configuration in Ethics Prosperity";
      $body = "Email Configuration in Ethics Prosperity successfully.";
      $this->mail->MsgHTML($body);

      $response = $this->mail->Send();

      
      if($response)
      {
      
         $select="SELECT * FROM `email_configuration`";
         $ex = mysqli_query($this->con,$select);
         if(mysqli_num_rows($ex) > 0)
         {
            $up="UPDATE `email_configuration` SET `e_name`='".$row['e_name']."',`e_email`='".$row['e_email']."',`e_password`='".$row['e_password']."',`e_income_host`='".$row['e_income_host']."',`e_income_port`='".$row['e_income_port']."',`e_income_protocol`='".$row['e_income_protocol']."',`e_smtp_host`='".$row['e_smtp_host']."',`e_smtp_port`='".$row['e_smtp_port']."',`e_smtp`='".$row['e_smtp']."',`e_remark`='".$row['e_remark']."',`e_updated`='".date('Y-m-d H:i:s')."'";
            $ex = mysqli_query($this->con,$up);
         }
         else
         {
            $ins="INSERT INTO `email_configuration`(`e_name`, `e_email`, `e_password`, `e_income_host`, `e_income_port`, `e_income_protocol`, `e_smtp_host`, `e_smtp_port`,`e_smtp`, `e_remark`,`e_created`) VALUES ('".$row['e_name']."','".$row['e_email']."','".$row['e_password']."','".$row['e_income_host']."','".$row['e_income_port']."','".$row['e_income_protocol']."','".$row['e_smtp_host']."','".$row['e_smtp_port']."','".$row['e_smtp']."','".$row['e_remark']."','".date('Y-m-d H:i:s')."')";
            $ex = mysqli_query($this->con,$ins);
         }
         return 1;
      }
      
      }
      catch (Exception $e) {
         return "EMAIL SENDING FAILED. INFO: " . $this->mail->ErrorInfo;
      }

      

   }   
   public function view_email_setting()
   {
   $select="select * from `email_configuration`";
   $ex = mysqli_query($this->con,$select);
   return $ex;
   }
   public function get_email_setting_id($e_id)
   {
   $select="select * from `email_configuration` where `e_id`='$e_id'";
   $ex = mysqli_query($this->con,$select);
   return $ex;
   }
   
   ///Contact Form

   public function contact_email($email)
   {
      $ex = $this->view_site_configuration();
      $coi=mysqli_fetch_array($ex);
      $to_mail =$coi['contact_inquiry_mail_id'];
      $this->mail->addAddress($to_mail);
      $this->mail->isHTML(true);      // Set email format to HTML
      $this->mail->Subject = "Contact Inquiry from Ethics Prosperity Website";
      $body = "Contact Inquiry from Ethics Prosperity Website:<br/>

      Name : ".$email['name']." <br/>
      Phone : ".$email['phone']." <br/>
      Email : ".$email['email']." <br/>
      Subject : ".$email['subject']." <br/>
      Message : ".$email['message']." <br/>
      ";
      $this->mail->MsgHTML($body);

      if(!$this->mail->Send()) {
         return "Error";
      } 
      else 
      {
        return "Mail Send Successfully Thank you for filling out your information!";
      }
   }

   // Subscribe Form
   public function subscribe($email)
   {
      $ex = $this->view_site_configuration();
      $sub=mysqli_fetch_array($ex);
      $to_mail = $sub['subscribe_email_id'];
      $this->mail->ClearAllRecipients();
      $this->mail->addAddress($to_mail);
      $this->mail->isHTML(true);      // Set email format to HTML
      $this->mail->Subject = "Subscription Request - Ethics InfoTech LLP";
      $body = "Subscription Request - Ethics InfoTech LLP:<br/>

      
      Email : ".$email['email']." <br/>
      ";
      $this->mail->MsgHTML($body);

      if(!$this->mail->Send()) {
         return "Error";
      } 
      else 
      {
         return "Mail Send Successfully Thank you for filling out your information!";
      }
   }
   // Subscribe Form Thank Message
   public function subscribe_thankyou($email)
   {
      
      $to_mail = $email['email'];
      $this->mail->ClearAllRecipients();
      $this->mail->addAddress($to_mail);
      $this->mail->isHTML(true);      // Set email format to HTML
      $this->mail->Subject = "Thanks You For Subscribe  - Ethics InfoTech LLP";
      $body = "Thanks You For Subscribe - Ethics InfoTech LLP:<br/>

      
      Email : ".$email['email']." <br/>
      ";
      $this->mail->MsgHTML($body);

      if(!$this->mail->Send()) {
         return "Error";
      } 
      else 
      {
         return "Mail Send Successfully Thank you for filling out your information!";
      }
   }

//// Apply Job 
   public function apply_job($apply)
   {
      $ex = $this->view_site_configuration();
      $coi=mysqli_fetch_array($ex);
      $to_mail =$coi['contact_inquiry_mail_id'];
      $this->mail->addAddress($to_mail);
      $this->mail->isHTML(true);      // Set email format to HTML
      $this->mail->Subject = "Job Inquiry from Ethics Prosperity Website";
      $this->mail->AddAttachment( $apply['doc']["tmp_name"], $apply['doc']["name"] );
      $body = "Job Inquiry from Ethics Prosperity Website:<br/>
      Job Position : ".$apply['post-title']." <br/>
      Name : ".$apply['name']." <br/>
      Phone : ".$apply['phone']." <br/>
      Email : ".$apply['email']." <br/>
      Notice Period In Days: ".$apply['notice_period']." <br/>
      Gender : ".$apply['gender']." <br/>
      Location : ".$apply['relocate_vadodara']." <br/>
      ";
      $this->mail->MsgHTML($body);

      if(!$this->mail->Send()) {
         return "Error";
      } 
      else 
      {
         return "Mail Sent Successfully, Thank you for filling out your information!";
      }
   }

   
   //Admin Login 
   public function login($username,$password)
   {
      $select="SELECT * FROM `login` 
      where BINARY username='$username' && BINARY password='$password'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   
     public function change_password($user_id,$new_password)
   {
      $newPassword = md5($new_password);
      $select="UPDATE `login` SET `password`='$newPassword' WHERE  login_id='$user_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function check_password($user_id,$password)
   {
      $newPassword = md5($password);
      $select="select * from login WHERE BINARY `password`='$newPassword' && login_id='$user_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function add_site_configuration($site_config)
   {
      echo$select="insert into site_configuration (about_text,get_in_touch_text,get_in_touch_email,address,contact_no,contact_no2,email_id,contact_inquiry_mail_id,subscribe_email_id,website,map_code,facebook,twitter,youtube,instagram,linkedin,pinterest,header_logo,fevicon,header_banner,footer_logo,newsletter,how_can_text,copy_right)values('".$site_config['about_text']."','".$site_config['get_in_touch_text']."','".$site_config['get_in_touch_email']."','".$site_config['address']."','".$site_config['contact_no']."','".$site_config['contact_no2']."','".$site_config['email_id']."','".$site_config['contact_inquiry_mail_id']."','".$site_config['subscribe_email_id']."','".$site_config['website']."','".$site_config['map_code']."','".$site_config['facebook']."','".$site_config['twitter']."','".$site_config['youtube']."','".$site_config['instagram']."','".$site_config['linkedin']."','".$site_config['pinterest']."','".$site_config['header_logo']."','".$site_config['fevicon']."','".$site_config['header_banner']."','".$site_config['footer_logo']."','".$site_config['newsletter']."','".$site_config['how_can_text']."','".$site_config['copy_right']."')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function view_site_configuration()
   {
      $select="select * from site_configuration";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_site_configuration_id($site_config_id)
   {
      $select="select * from site_configuration where id='$site_config_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_site_configuration($site_config)
   {
     $select="UPDATE `site_configuration` SET `about_text`='".$site_config['about_text']."',`get_in_touch_text`='".$site_config['get_in_touch_text']."',`get_in_touch_email`='".$site_config['get_in_touch_email']."',`address`='".$site_config['address']."',`contact_no`='".$site_config['contact_no']."',`contact_no2`='".$site_config['contact_no2']."',`email_id`='".$site_config['email_id']."',`contact_inquiry_mail_id`='".$site_config['contact_inquiry_mail_id']."',`subscribe_email_id`='".$site_config['subscribe_email_id']."',`website`='".$site_config['website']."',`map_code`='".$site_config['map_code']."',`facebook`='".$site_config['facebook']."',`twitter`='".$site_config['twitter']."',`youtube`='".$site_config['youtube']."',`instagram`='".$site_config['instagram']."',`linkedin`='".$site_config['linkedin']."',`pinterest`='".$site_config['pinterest']."',`header_logo`='".$site_config['header_logo']."',`fevicon`='".$site_config['fevicon']."',`header_banner`='".$site_config['header_banner']."',`footer_logo`='".$site_config['footer_logo']."',`newsletter`='".$site_config['newsletter']."',`how_can_text`='".$site_config['how_can_text']."',`copy_right`='".$site_config['copy_right']."' WHERE id='".$site_config['id']."'";   
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function logo_slider_img($slider_img)
   {
      $select="insert into logo_slider(logo_slider_img) value('$slider_img')";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_slider_id($slider_id)
   {
      $select="select * from logo_slider where id='$slider_id'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_Slider_logo()
   {
      $select = "select * from logo_slider where slider_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_slider_logo($slider_id,$slider_img)
   { 
      $select="UPDATE `logo_slider` SET `logo_slider_img`='$slider_img' WHERE id='$slider_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function delete_logo($slider_id,$slider_status)
   {
      $select = "update logo_slider set slider_status='$slider_status' where id='$slider_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function deleted_logo_slider()
   {
      $select = "select * from logo_slider where slider_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
      ///About Page Insert
   
    public function insert_about_page($aboutpage_info)
   {
    $select ="INSERT INTO `aboutus`(`title`, `subtitle`, `about_desc`,`vision`,`mission`,`core_values`, `director1_tit`, `director1_img`, `director1_desc`, `director2_tit`, `director2_img`, `director2_desc`, `director3_tit`, `director3_img`, `director3_desc`, `status`) VALUES ('".$aboutpage_info['title']."','".$aboutpage_info['subtitle']."','".$aboutpage_info['about_desc']."','".$aboutpage_info['vision']."','".$aboutpage_info['mission']."','".$aboutpage_info['core_values']."','".$aboutpage_info['director1_tit']."','".$aboutpage_info['director1_img']."','".$aboutpage_info['director1_desc']."','".$aboutpage_info['director2_tit']."','".$aboutpage_info['director2_img']."','".$aboutpage_info['director2_desc']."','".$aboutpage_info['director3_tit']."','".$aboutpage_info['director3_img']."','".$aboutpage_info['director3_desc']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_aboutpage()
   {
      $select = "select * from aboutus where status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function get_about_page_id($about_page_id)
   {
    $select = "select * from aboutus where about_page_id ='$about_page_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   
   public function update_about_page($update_about_page)
   {
        $select="UPDATE `aboutus` SET `title`='".$update_about_page['title']."',`subtitle`='".$update_about_page['subtitle']."',`about_desc`='".$update_about_page['about_desc']."',`vision`='".$update_about_page['vision']."',`mission`='".$update_about_page['mission']."',`core_values`='".$update_about_page['core_values']."',`director1_tit`='".$update_about_page['director1_tit']."',`director1_img`='".$update_about_page['director1_img']."',`director1_desc`='".$update_about_page['director1_desc']."',`director2_tit`='".$update_about_page['director2_tit']."',`director2_img`='".$update_about_page['director2_img']."',`director2_desc`='".$update_about_page['director2_desc']."',`director3_tit`='".$update_about_page['director3_tit']."',`director3_img`='".$update_about_page['director3_img']."',`director3_desc`='".$update_about_page['director3_desc']."'  WHERE about_page_id='".$update_about_page['about_page_id']."'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function insert_service($service_info)
   {
      $created_by = $_SESSION['login_id'];
      $select="insert into service_menu(service_name,service_banner ,service_createdon,service_createdby,service_status,service_url)values('".$service_info['service_name']."','".$service_info['service_banner']."','".date('Y-m-d H:i:s')."','$created_by','1','".$service_info['service_url']."')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_service()
   {
      $select="select * from service_menu where service_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_service($update_service)
   {
      $select="UPDATE `service_menu` SET service_name='".$update_service['service_name']."',service_banner='".$update_service['service_banner']."',service_updatedon='".date('Y-m-d H:i:s')."' WHERE service_id='".$update_service['service_id']."'";  
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_service_id($service_id)
   {
      $select="select * from service_menu where service_id='$service_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function softdel_service($service_id,$service_status)
   {
       
        $select="UPDATE `service_menu` SET `service_status`='$service_status' WHERE service_id='$service_id'"; 
       $ex = mysqli_query($this->con,$select);

       $select="UPDATE `service_page` SET `ser_page_status`='$service_status' WHERE ser_page_service_id='$service_id'"; 
       $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_service()
   {
      $select="SELECT * from service_menu where service_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function view_service_details($service_id)
   {
      $select="SELECT * from service_menu where service_id='$service_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   // SERVICE PAGE CONTENT SECTION//

    public function insert_service_page($servicepage_info)
   {
      $created_by = $_SESSION['login_id'];
       $select="insert into service_page(ser_page_service_id,ser_page_title,ser_page_desc,ser_page_image,ser_page_createdon,ser_page_createdby,ser_page_status)values('".$servicepage_info['ser_page_service_id']."','".$servicepage_info['ser_sub_title']."','".$servicepage_info['ser_page_desc']."','".$servicepage_info['ser_page_image']."','".date('Y-m-d H:i:s')."','$created_by','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_servicepage()
   {
      $select = "select * from service_page
               join service_menu on service_menu.service_id = service_page.ser_page_service_id
       where service_page.ser_page_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_ser_page_id($ser_page_id)
   {
    $select = "select * from service_page
               join service_menu on service_menu.service_id = service_page.ser_page_service_id
       where service_page.ser_page_id ='$ser_page_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   
   public function update_ser_page($update_ser_page)
   {
       $select="UPDATE `service_page` SET ser_page_service_id='".$update_ser_page['ser_page_service_id']."',ser_page_title='".$update_ser_page['ser_sub_title']."',ser_page_desc='".$update_ser_page['ser_page_desc']."',ser_page_image='".$update_ser_page['ser_page_image']."'
      ,ser_page_updatedon='".date('Y-m-d H:i:s')."' WHERE ser_page_id='".$update_ser_page['ser_page_id']."'";  
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
  public function softdel_servicepage($ser_page_id,$ser_page_status)
   {
      $select="UPDATE `service_page` SET `ser_page_status`='$ser_page_status' WHERE ser_page_id='$ser_page_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_servicepage()
   {
      $select="select * from service_page
               join service_menu on service_menu.service_id = service_page.ser_page_service_id where ser_page_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function view_service_page($id)
   {
     $select="select * from service_page
               join service_menu on service_menu.service_id = service_page.ser_page_service_id
       where service_page.ser_page_id ='$id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_service_pagecont($ser_page_id)
   {
	 $select="SELECT * FROM service_menu where service_url='$ser_page_id'";
     $ex = mysqli_query($this->con,$select);
	 $row = mysqli_fetch_array($ex);
	 $services_id = $row['service_id'];  
	   
	   
     $select="SELECT * FROM service_page
   join service_menu on service_menu.service_id = service_page.ser_page_service_id
     where service_page.ser_page_service_id='$services_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
    }
      public function view_service_content($id)
   {
  
    $select="SELECT * FROM service_page
   join service_menu on service_menu.service_id = service_page.ser_page_service_id
     where service_page.ser_page_service_id='$id' && service_page.ser_page_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }

    public function insert_why_us_info($why_us_info)
   {
  
     $select="insert into why_us(why_desc,side_img,bottom_desc,status) values('".$why_us_info['why_desc']."','".$why_us_info['side_img']."','".$why_us_info['bottom_desc']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }  
   public function get_why_us()
   {
      $select = "select * from why_us where status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
   public function get_whyus_id($id)
   {
      $select="select * from why_us where id='$id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_why_us($update_why_us)
   {
      $select="UPDATE `why_us` SET section1_text='".$update_why_us['section1_text']."',section2_text='".$update_why_us['section2_text']."',section3_text='".$update_why_us['section3_text']."',where_we_oprate_title='".$update_why_us['where_we_oprate_title']."',where_we_oprate_text='".$update_why_us['where_we_oprate_text']."',section1_img='".$update_why_us['section1_img']."',section2_img='".$update_why_us['section2_img']."',section3_img='".$update_why_us['section3_img']."' WHERE id='".$update_why_us['id']."'";  
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function insert_why_us_points($why_uspoint)
   {
  
      $select="insert into why_us_points(title,subtitle,status) values('".$why_uspoint['title']."','".$why_uspoint['subtitle']."','1')";  
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
   public function get_why_us_points_id($id)
   {
      $select="select * from why_us_points where id='$id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function update_why_us_points($update_why_us_points)
   {
       $select="UPDATE `why_us_points` SET title='".$update_why_us_points['title']."',subtitle='".$update_why_us_points['subtitle']."' WHERE id='".$update_why_us_points['id']."'";  
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
   public function view_why_us_points()
   {
      $select = "select * from why_us_points where status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
   public function insert_webinfo($web_info)
   {
      $created_by = $_SESSION['login_id'];
     $select="insert into webdesign_services (web_service_id,web_title,web_desc,web_icon,web_createdon,web_createdby,web_status)values('".$web_info['web_service_id']."','".$web_info['web_title']."','".$web_info['web_desc']."','".$web_info['web_icon']."','".date('Y-m-d H:i:s')."','$created_by','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   
   public function update_webinfo($update_webinfo)
   {
      $select="UPDATE `webdesign_services` SET web_service_id='".$update_webinfo['web_service_id']."',web_title='".$update_webinfo['web_title']."',web_desc='".$update_webinfo['web_desc']."',web_icon='".$update_webinfo['web_icon']."',web_updatedon='".date('Y-m-d H:i:s')."' WHERE web_id='".$update_webinfo['web_id']."'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }

   public function get_webinfo()
   {
      $select = "select * from webdesign_services
               join service_menu on service_menu.service_id = webdesign_services.web_service_id
       where webdesign_services.web_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_webinfopage($web_service_id)
   {
      $select = "select * from webdesign_services
               join service_menu on service_menu.service_id = webdesign_services.web_service_id
       where webdesign_services.web_status='1' && webdesign_services.web_service_id='$web_service_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_webinfo_id($web_id)
   {
     $select = "select * from webdesign_services
              join service_menu on service_menu.service_id = webdesign_services.web_service_id
       where webdesign_services.web_status='1' && webdesign_services.web_id='$web_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }

   public function softdel_webdesign($web_id,$web_status)
   {
      $select="UPDATE `webdesign_services` SET `web_status`='$web_status' WHERE web_id='$web_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_webdesign()
   {
      $select="select * from webdesign_services
               join service_menu on service_menu.service_id = webdesign_services.web_service_id where web_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_home_top_banner()
   {
      $select="select * from home";
     $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_home_top_banner($home_top_banner)
   {
      $select="update home set banner_img='".$home_top_banner['banner_img']."',banner_main_text='".$home_top_banner['banner_main_text']."',banner_animated_text='".$home_top_banner['banner_animated_text']."',banner_text='".$home_top_banner['banner_text']."',banner_link='".$home_top_banner['banner_link']."' where id='".$home_top_banner['id']."'";
     $ex = mysqli_query($this->con,$select);
      return $ex;
   }
       public function add_industryservice_info($inds_info)
   {
  
     echo $select="insert into indusrty_services(bg_img,icon,title,status) values('".$inds_info['bg_img']."','".$inds_info['icon']."','".$inds_info['title']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
   public function get_inds_id($id)
   {
      $select="select * from indusrty_services where id='$id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function update_industryservice_info($update_info)
   {
       echo $select="UPDATE `indusrty_services` SET bg_img='".$update_info['bg_img']."',icon='".$update_info['icon']."',title='".$update_info['title']."' WHERE id='".$update_info['id']."'";  
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
   public function view_industryservice()
   {
      $select = "select * from indusrty_services where status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
     public function softdel_industryservice($id,$status)
   {
      $select="UPDATE `indusrty_services` SET `status`='$status' WHERE id='$id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_industryservice()
   {
      $select = "select * from indusrty_services where status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   /* Home Slider */
public function insert_home_slider($homeslider_info)
   {
     $select="insert into home_slider(home_slider_bg,home_slider_img,title,subtitle,home_slider_text) value('".$homeslider_info['home_slider_bg']."','".$homeslider_info['home_slider_img']."','".$homeslider_info['title']."','".$homeslider_info['subtitle']."','".$homeslider_info['home_slider_text']."')"; 
      $ex = mysqli_query($this->con,$select); 
      return $ex;
   }


public function get_home_slider_id($home_slider_id)
   {
      $select="select * from home_slider where home_slider_id='$home_slider_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_home_slider()
   {
      $select = "select * from home_slider where home_slider_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_home_slider($update_home_slider)
   {
      $select="UPDATE `home_slider` SET home_slider_text='".$update_home_slider['home_slider_text']."',home_slider_bg='".$update_home_slider['home_slider_bg']."',home_slider_img='".$update_home_slider['home_slider_img']."',title='".$update_home_slider['title']."',subtitle='".$update_home_slider['subtitle']."' WHERE home_slider_id='".$update_home_slider['home_slider_id']."'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }

    public function softdel_home_slider($home_slider_id,$home_slider_status)
   {
      $select="UPDATE `home_slider` SET `home_slider_status`='$home_slider_status' WHERE home_slider_id='$home_slider_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_home_slider()
   {
      $select="select * from home_slider where home_slider.home_slider_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   
  public function insert_end_to_end_info($end_to_end_info)
   {
       $select="insert into home_end_to_end(h_end_title,h_end_icon,h_end_number,h_end_desc,h_end_status)values('".$end_to_end_info['h_end_title']."','".$end_to_end_info['h_end_icon']."','".$end_to_end_info['h_end_number']."','".$end_to_end_info['h_end_desc']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_home_end_to_end()
   {
      $select="select * from home_end_to_end where h_end_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_end_to_end_info($end_to_end_info)
   {
       $select="UPDATE `home_end_to_end` SET h_end_title='".$end_to_end_info['h_end_title']."',h_end_icon='".$end_to_end_info['h_end_icon']."',h_end_number='".$end_to_end_info['h_end_number']."',h_end_desc='".$end_to_end_info['h_end_desc']."' WHERE h_end_id='".$end_to_end_info['h_end_id']."'";   
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_h_end_id($h_end_id)
   {
      $select="select * from home_end_to_end where h_end_id='$h_end_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_end_to_end()
   {
      $select="select * from home_end_to_end where h_end_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function softdel_home_end_to_end($h_end_id,$h_end_status)
   {
      $select="UPDATE `home_end_to_end` SET `h_end_status`='$h_end_status' WHERE h_end_id='$h_end_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function add_supply_chain($supply_chain)
   {
       $select="insert into home_supply_chain (h_supply_title,h_supply_desc,h_supply_img,h_supply_status)values('".$supply_chain['h_supply_title']."','".$supply_chain['h_supply_desc']."','".$supply_chain['h_supply_img']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_supply_chain()
   {
      $select="select * from home_supply_chain where h_supply_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_supply_chain($supply_chain)
   {
      echo $select="UPDATE `home_supply_chain` SET h_supply_title='".$supply_chain['h_supply_title']."',h_supply_desc='".$supply_chain['h_supply_desc']."',h_supply_img='".$supply_chain['h_supply_img']."' WHERE h_supply_id='".$supply_chain['h_supply_id']."'";   
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_h_supply_id($h_supply_id)
   {
      $select="select * from home_supply_chain  where h_supply_id='$h_supply_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function add_homeservice_info($homeservice_info)
   {
     $created_by = $_SESSION['login_id'];
   $select="INSERT INTO `home_service`(`hs_service_id`,`hs_simg`, `hs_stitle`,`hs_sdesc`,`hs_createdon`, `hs_createdby`, `hs_status`) VALUES ('".$homeservice_info['hs_service_id']."','".$homeservice_info['hs_simg']."','".$homeservice_info['hs_stitle']."','".$homeservice_info['hs_sdesc']."','".date('Y-m-d H:i:s')."','$created_by','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_homeservice_info()
   {
  
    $select="SELECT * FROM `home_service`
     join service_menu on service_menu.service_id = home_service.hs_service_id
       where home_service.hs_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function get_hs_id($hs_id)
   {
  
    $select="SELECT * FROM `home_service` 
    join service_menu on service_menu.service_id = home_service.hs_service_id
    WHERE home_service.hs_id='$hs_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
  public function update_homeservice_info($update_info)
   {
    $select="UPDATE `home_service` SET  `hs_service_id`='".$update_info['hs_service_id']."',`hs_simg`='".$update_info['hs_simg']."',`hs_stitle`='".$update_info['hs_stitle']."',`hs_sdesc`='".$update_info['hs_sdesc']."',`hs_updatedon`='".date('Y-m-d H:i:s')."' WHERE `hs_id`='".$update_info['hs_id']."'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function softdel_homeservices($hs_id,$hs_status)
   {
      $select="UPDATE `home_service` SET `hs_status`='$hs_status' WHERE hs_id='$hs_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_homeservice()
   {
      $select="select * from home_service
      join service_menu on service_menu.service_id = home_service.hs_service_id
      where hs_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function add_homeourfacility_info($homeourfacility_info)
   {
       $select="insert into our_facilities(of_title,of_image,of_status)values('".$homeourfacility_info['of_title']."','".$homeourfacility_info['of_image']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_homeourfacility_info()
   {
      $select="select * from our_facilities where of_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_homeourfacility_info($update_info)
   {
       $select="UPDATE `our_facilities` SET of_title='".$update_info['of_title']."',of_image='".$update_info['of_image']."' WHERE of_id='".$update_info['of_id']."'";   
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_of_id($of_id)
   {
      $select="select * from our_facilities where of_id='$of_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_homeourfacility()
   {
      $select="select * from our_facilities where of_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function softdel_homeourfacility($of_id,$of_status)
   {
      $select="UPDATE `our_facilities` SET `of_status`='$of_status' WHERE of_id='$of_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function add_homewedeploy_info($homewedeploy_info)
   {
       $select="insert into home_we_deploy(home_we_deploy_title,home_we_deploy_icon,home_we_deploy_status)values('".$homewedeploy_info['home_we_deploy_title']."','".$homewedeploy_info['home_we_deploy_icon']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_homewedeploy_info()
   {
      $select="select * from home_we_deploy where home_we_deploy_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_homewedeploy_info($update_info)
   {
       $select="UPDATE `home_we_deploy` SET home_we_deploy_title='".$update_info['home_we_deploy_title']."',home_we_deploy_icon='".$update_info['home_we_deploy_icon']."' WHERE home_we_deploy_id='".$update_info['home_we_deploy_id']."'";   
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_home_we_deploy_id($home_we_deploy_id)
   {
      $select="select * from home_we_deploy where home_we_deploy_id='$home_we_deploy_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_homewedeploy()
   {
      $select="select * from home_we_deploy where home_we_deploy_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function softdel_homewedeploy($home_we_deploy_id,$home_we_deploy_status)
   {
      $select="UPDATE `home_we_deploy` SET `home_we_deploy_status`='$home_we_deploy_status' WHERE home_we_deploy_id='$home_we_deploy_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function insert_software_info($software_info)
   {
       $select="insert into software (title,problem,solution,status)values('".$software_info['title']."','".$software_info['problem']."','".$software_info['solution']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_software_info()
   {
      //$select="select * from software where status='1'";
      $select="select *from software where status='1' limit 1,4";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_software_info_bottom()
   {
      //$select="select * from software where status='1'";
      $select="select * from software where status='1' limit 5,10";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_software_info_bk()
   {
      $select="select * from software where status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_software_info($software_info)
   {
      echo $select="UPDATE `software` SET title='".$software_info['title']."',problem='".$software_info['problem']."',solution='".$software_info['solution']."' WHERE software_id='".$software_info['software_id']."'";   
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_software_id($software_id)
   {
      $select="select * from software where software_id='$software_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function softdel_software($software_id,$status)
   {
      $select="UPDATE `software` SET `status`='$status' WHERE software_id='$software_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_software()
   {
      $select = "select * from software where status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function insert_software_top_info($soft_top_sec)
   {
       $select="insert into software_top_sec (soft_top_img)values('".$soft_top_sec['soft_top_img']."')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_soft_top_sec($soft_top_sec)
   {
       $select="UPDATE `software_top_sec` SET soft_top_img='".$soft_top_sec['soft_top_img']."' WHERE soft_top_id='".$soft_top_sec['soft_top_id']."'";  
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function get_soft_top_id($soft_top_id)
   {
      $select="select * from software_top_sec where soft_top_id='$soft_top_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_software_top_sec()
   {
      $select = "select * from software_top_sec";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function insert_qp_info($qp_info)
   {
  
     $select="insert into quality_policy(qp_img,qp_desc,qp_status) values('".$qp_info['qp_img']."','".$qp_info['qp_desc']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }  
   public function get_quality_policy()
   {
      $select = "select * from quality_policy where qp_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
   public function get_qp_id($qp_id)
   {
      $select="select * from quality_policy where qp_id='$qp_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_qp_info($qp_info)
   {
       $select="UPDATE `quality_policy` SET qp_img='".$qp_info['qp_img']."',qp_desc='".$qp_info['qp_desc']."' WHERE qp_id='".$qp_info['qp_id']."'";  
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function insert_qp_commited($qpc)
   {
  
      $select="insert into qp_commited_points(title,status) values('".$qpc['title']."','1')";  
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
   public function get_qp_commited_id($id)
   {
      $select="select * from qp_commited_points where id='$id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function update_qp_commited($update_qpc)
   {
       $select="UPDATE `qp_commited_points` SET title='".$update_qpc['title']."' WHERE id='".$update_qpc['id']."'";  
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
   public function view_qp_commited()
   {
      $select = "select * from qp_commited_points where status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   } 
   public function insert_aboutdetails_info($aboutdetails_info)
   {
    $select ="INSERT INTO `about_details`(`about_details_top`, `about_details_bottom`,`about_details_status`) VALUES ('".$aboutdetails_info['about_details_top']."','".$aboutdetails_info['about_details_bottom']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }

   public function update_aboutdetails_info($aboutdetails_info)
   {
     $select="UPDATE `about_details` SET `about_details_top`='".$aboutdetails_info['about_details_top']."',`about_details_bottom`='".$aboutdetails_info['about_details_bottom']."'  WHERE about_details_id='".$aboutdetails_info['about_details_id']."'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function get_aboutdetails()
   {
      $select = "select * from about_details where about_details_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function get_aboutdetails_id($about_details_id)
   {
    $select = "select * from about_details where about_details_id ='$about_details_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function insert_adsinfo($adsinfo)
   {
    $select ="INSERT INTO `about_details_services`(`ads_title`, `ads_desc`,`ads_status`) VALUES ('".$adsinfo['ads_title']."','".$adsinfo['ads_desc']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }

   public function update_adsinfo($adsinfo)
   {
        $select="UPDATE `about_details_services` SET `ads_title`='".$adsinfo['ads_title']."',`ads_desc`='".$adsinfo['ads_desc']."'  WHERE ads_id='".$adsinfo['ads_id']."'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function get_aboutdetails_services()
   {
      $select = "select * from about_details_services where ads_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function get_ads_id($ads_id)
   {
    $select = "select * from about_details_services where ads_id ='$ads_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function softdel_aboutdetails_services($ads_id,$ads_status)
   {
      $select="UPDATE `about_details_services` SET `ads_status`='$ads_status' WHERE ads_id='$ads_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_aboutdetails_services()
   {
      $select="select * from about_details_services where ads_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function add_faqmenu_info($faq_info)
   {
    $select ="INSERT INTO `faq_menu`(`faq_menu_name`, `faq_menu_img`,`faq_menu_status`) VALUES ('".$faq_info['faq_menu_name']."','".$faq_info['faq_menu_img']."','1')"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_faqmenu()
   {
      $select = "select * from faq_menu where faq_menu_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_faqmenu_id($faq_menu_id)
   {
    $select = "select * from faq_menu where faq_menu_id ='$faq_menu_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function softdel_faqmenu($faq_menu_id,$faq_menu_status)
   {
      $select="UPDATE `faq_menu` SET `faq_menu_status`='$faq_menu_status' WHERE faq_menu_id='$faq_menu_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_faqmenu_info($faq_info)
   {
        $select="UPDATE `faq_menu` SET `faq_menu_name`='".$faq_info['faq_menu_name']."',`faq_menu_img`='".$faq_info['faq_menu_img']."'  WHERE faq_menu_id='".$faq_info['faq_menu_id']."'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_faqmenu()
   {
      $select = "select * from faq_menu where faq_menu_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function add_faq_info($faq_info)
   {
  $select ="INSERT INTO `faq`(`faq_faq_menu_id`, `faq_title`,`faq_desc`,`faq_status`) VALUES ('".$faq_info['faq_faq_menu_id']."','".$faq_info['faq_title']."','".$faq_info['faq_desc']."','1')"; 
     $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_faqinfo()
   {
      $select = "select * from faq
      join faq_menu on faq_menu.faq_menu_id = faq.faq_faq_menu_id where faq_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_faq()
   {
      $select = "select * from faq
      join faq_menu on faq_menu.faq_menu_id = faq.faq_faq_menu_id where faq_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_faq_content($id)
   {
  
   $select="SELECT * FROM faq
    join faq_menu on faq_menu.faq_menu_id = faq.faq_faq_menu_id
   where faq.faq_faq_menu_id='$id' && faq.faq_status='1'";
   $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   
   public function get_faq_id($faq_id)
   {
    $select = "select * from faq
    join faq_menu on faq_menu.faq_menu_id = faq.faq_faq_menu_id where faq_id ='$faq_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function softdel_faq($faq_id,$faq_status)
   {
    echo  $select="UPDATE `faq` SET `faq_status`='$faq_status' WHERE faq_id='$faq_id'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_faq_info($faq_info)
   {
       $select="UPDATE `faq` SET `faq_faq_menu_id`='".$faq_info['faq_faq_menu_id']."',`faq_title`='".$faq_info['faq_title']."',`faq_desc`='".$faq_info['faq_desc']."'  WHERE faq_id='".$faq_info['faq_id']."'"; 
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function insert_team($team_info)
   {
      $select="insert into team(team_name,position,team_email,team_contact_no,team_profile,team_telephone,team_details,linkedin,team_status,team_created_date)values('".$team_info['team_name']."','".$team_info['position']."','".$team_info['team_email']."','".$team_info['team_contact_no']."','".$team_info['team_profile']."','".$team_info['team_telephone']."','".$team_info['team_details']."','".$team_info['linkedin']."','1','".date('Y-m-d H:i:s')."')";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_team()
   {
      $select="select * from team where team_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function softdel_team($team_id,$team_status)
   {
      $select="UPDATE `team` SET `team_status`='$team_status' WHERE team_id='$team_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_team()
   {
      $select="SELECT * from team where team_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function view_team_details($team_id)
   {
	   $select="SELECT * from team where team_id='$team_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_team_id($team_id)
   {
      $select="select * from team where team_id='$team_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_team($update_team)
   {
      $select="UPDATE `team` SET `team_name`='".$update_team['team_name']."',`team_profile`='".$update_team['team_profile']."',`position`='".$update_team['position']."',`team_email`='".$update_team['team_email']."',`team_contact_no`='".$update_team['team_contact_no']."',`team_telephone`='".$update_team['team_telephone']."',`team_details`='".$update_team['team_details']."', `linkedin`='".$update_team['linkedin']."' WHERE team_id='".$update_team['id']."'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
       public function insert_our_teamtoinfo($our_team_top_info)
   {
      $select="insert into our_team_top(our_board_title,our_board_desc,our_management_title,our_management_desc,our_team_top_status)values('".$our_team_top_info['our_board_title']."','".$our_team_top_info['our_board_desc']."','".$our_team_top_info['our_management_title']."','".$our_team_top_info['our_management_desc']."','1')";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_our_teamtoinfo($our_team_top_info)
   {
      $select="UPDATE `our_team_top` SET `our_board_title`='".$our_team_top_info['our_board_title']."',`our_board_desc`='".$our_team_top_info['our_board_desc']."',`our_management_title`='".$our_team_top_info['our_management_title']."',`our_management_desc`='".$our_team_top_info['our_management_desc']."' WHERE our_team_top_id='".$our_team_top_info['our_team_top_id']."'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_our_team_topinfo()
   {
      $select="SELECT * from our_team_top";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_our_team_topinfo($our_team_top_id)
   {
      $select="select * from our_team_top where our_team_top_id='$our_team_top_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function insert_integration($integration_info)
   {
      $select="insert into  integration(integration_top,integration_bottom,integration_img,integration_status)values('".$integration_info['integration_top']."','".$integration_info['integration_bottom']."','".$integration_info['integration_img']."','1')";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_integration($integration_info)
   {
      $select="UPDATE `integration` SET `integration_top`='".$integration_info['integration_top']."',`integration_bottom`='".$integration_info['integration_bottom']."',`integration_img`='".$integration_info['integration_img']."' WHERE integration_id='".$integration_info['integration_id']."'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_integration()
   {
      $select="SELECT * from  integration";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_integration($integration_id)
   {
      $select="select * from  integration where integration_id='$integration_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function insert_integration__mgtsys($int_mgt_sys_info)
   {
      $select="insert into  integration_mgt_sys(int_mgt_sys_title,int_mgt_sys_desc,int_mgt_sys_status)values('".$int_mgt_sys_info['int_mgt_sys_title']."','".$int_mgt_sys_info['int_mgt_sys_desc']."','1')";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_integration_mgtsys($int_mgt_sys_info)
   {
      $select="UPDATE `integration_mgt_sys` SET `int_mgt_sys_title`='".$int_mgt_sys_info['int_mgt_sys_title']."',`int_mgt_sys_desc`='".$int_mgt_sys_info['int_mgt_sys_desc']."' WHERE int_mgt_sys_id='".$int_mgt_sys_info['int_mgt_sys_id']."'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_integration_mgt_sys()
   {
      $select="SELECT * from  integration_mgt_sys where int_mgt_sys_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_integration_mgt_sys($int_mgt_sys_id)
   {
      $select="select * from  integration_mgt_sys where int_mgt_sys_id='$int_mgt_sys_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function softdel_integration_mgt_sys($int_mgt_sys_id,$int_mgt_sys_status)
   {
      $select="UPDATE `integration_mgt_sys` SET `int_mgt_sys_status`='$int_mgt_sys_status' WHERE int_mgt_sys_id='$int_mgt_sys_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_integration_mgt_sys()
   {
      $select="SELECT * from integration_mgt_sys where int_mgt_sys_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function insert_integration_supply_chain($int_supply_chain_info)
   {
      $select="insert into  integration_supply_chain(int_supp_ch_icon,int_supp_ch_title,int_supp_ch_desc,int_supp_ch_status)values('".$int_supply_chain_info['int_supp_ch_icon']."','".$int_supply_chain_info['int_supp_ch_title']."','".$int_supply_chain_info['int_supp_ch_desc']."','1')";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_integration_supply_chain($int_supply_chain_info)
   {
      $select="UPDATE `integration_supply_chain` SET `int_supp_ch_icon`='".$int_supply_chain_info['int_supp_ch_icon']."', `int_supp_ch_title`='".$int_supply_chain_info['int_supp_ch_title']."',`int_supp_ch_desc`='".$int_supply_chain_info['int_supp_ch_desc']."' WHERE int_supp_ch_id='".$int_supply_chain_info['int_supp_ch_id']."'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_integration_supply_chain()
   {
      $select="SELECT * from  integration_supply_chain where int_supp_ch_status='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_integration_supply_chain($int_supp_ch_id)
   {
      $select="select * from  integration_supply_chain where int_supp_ch_id='$int_supp_ch_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function softdel_integration_supply_chain($int_supp_ch_id,$int_supp_ch_status)
   {
      $select="UPDATE `integration_supply_chain` SET `int_supp_ch_status`='$int_supp_ch_status' WHERE int_supp_ch_id='$int_supp_ch_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_del_integration_supply_chain()
   {
      $select="SELECT * from integration_supply_chain where int_supp_ch_status='0'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
      public function insert_currentopenings_info($co_info)
   {
     $select="insert into current_opening(co_title,co_open,co_city,co_responsibility,co_skills,co_education,co_status,co_url)values('".$co_info['co_title']."','".$co_info['co_open']."','".$co_info['co_city']."','".$co_info['co_responsibility']."','".$co_info['co_skills']."','".$co_info['co_education']."','1','".$co_info['co_url']."')";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_currentopening_id($co_id)
   {
      $select="select * from current_opening where co_id='$co_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_currentopenings_info($co_info)
   {
     echo  $select="UPDATE `current_opening` SET `co_title`='".$co_info['co_title']."',`co_open`='".$co_info['co_open']."',`co_city`='".$co_info['co_city']."',`co_responsibility`='".$co_info['co_responsibility']."',`co_skills`='".$co_info['co_skills']."',`co_education`='".$co_info['co_education']."' WHERE co_id='".$co_info['co_id']."'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_currentopenings()
   {
      $select="select * from current_opening";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function delete_currentopening($co_id)
   {
      $select="delete from `current_opening` WHERE co_id='$co_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
    public function view_currentopenings_details($co_id)
   {
	   $select="SELECT * from current_opening where co_url='$co_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
      public function add_careerwork_info($cw_info)
   {
      $select="insert into career_works(cw_sec_title,cw_title,cw_img,cw_status)values('".$cw_info['cw_sec_title']."','".$cw_info['cw_title']."','".$cw_info['cw_img']."','1')";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_careerwork_id($cw_id)
   {
      $select="select * from career_works where cw_id='$cw_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function update_careerwork_info($cw_info)
   {
      $select="UPDATE `career_works` SET `cw_sec_title`='".$cw_info['cw_sec_title']."',`cw_title`='".$cw_info['cw_title']."',`cw_img`='".$cw_info['cw_img']."' WHERE cw_id='".$cw_info['cw_id']."'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function view_careerwork()
   {
      $select="select * from career_works";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function delete_careerwork($cw_id)
   {
      $select="delete from `career_works` WHERE cw_id='$cw_id'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_careerworktopsec_id()
   {
      $select="select * from career_works where cw_sec_title='What it’s like to work at Ethics'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   public function get_careerworkbenifit_id()
   {
      $select="select * from career_works where cw_sec_title='Benefits'";
      $ex = mysqli_query($this->con,$select);
      return $ex;
   }
   
   /*** Ak Code Start***/
   
   /** Home Supply Chain Code Start**/
   public function add_supply_chain_home($supply_chain)
   {
	   $select = "insert into home_spply_chain(supply_chain_title,supply_chain_icon) values('".$supply_chain['supply_chain_title']."','".$supply_chain['supply_chain_icon']."')";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   public function view_home_supply_chain()
   {
	   $select = "select * from home_spply_chain";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   public function del_supply_chain($supply_chain_home)
   {
	   $select = "delete from home_spply_chain where supply_chain_id='$supply_chain_home'";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   public function view_supply_chain_by_id($supply_chain_id)
   {
	   $select = "select * from home_spply_chain where supply_chain_id='$supply_chain_id'";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   public function edit_supply_chain_home($supply_chain)
   {
	   $select = "update home_spply_chain SET supply_chain_title='".$supply_chain['supply_chain_title']."',supply_chain_icon='".$supply_chain['supply_chain_icon']."' where supply_chain_id='".$supply_chain['supply_chain_id']."'";
       $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   /** Home Supply Chain Code End**/
   
   /** Home Ethics Glnace Code start***/
   public function add_ethics_glance($glance)
   {
	   $select = "insert into home_ethics_glance(ethics_glance_number,ethics_glance_text,ethics_glance_icon)values('".$glance['ethics_glance_number']."','".$glance['ethics_glance_text']."','".$glance['ethics_glance_icon']."')";
       $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   public function view_ethics_glance()
   {
	   $select  = "select * from home_ethics_glance";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   public function del_ethics_glance($ethics_glance_home)
   {
	   $select  = "delete from home_ethics_glance where ethics_glance_id='$ethics_glance_home'";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   public function view_ethics_glance_by_id($ethics_glance_id)
   {
	   $select  = "select * from home_ethics_glance where ethics_glance_id='$ethics_glance_id'";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   public function edit_ethics_glance_home($glance)
   {
	   $select = "update home_ethics_glance SET ethics_glance_number='".$glance['ethics_glance_number']."',ethics_glance_text='".$glance['ethics_glance_text']."',ethics_glance_icon='".$glance['ethics_glance_icon']."' where ethics_glance_id='".$glance['ethics_glance_id']."'";
       $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   /** Home Ethics Glnace Code end***/

   /** Home What Make Code Start***/
   public function view_what_make_section()
   {
	$select = "SELECT * FROM `home_what_make_ethics` WHERE what_make_id='1'";
    $ex = mysqli_query($this->con,$select);
    return $ex;	
   }
   public function update_what_make($what_make)
   {
       $select = "update home_what_make_ethics SET what_make_title='".$what_make['what_make_title']."',what_make_text='".$what_make['what_make_text']."',what_make_bg_img='".$what_make['what_make_bg_img']."' where what_make_id='1'";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
  /*** Home What Make Code End ***/
  
  /*** Home Page Video Section ***/
   public function view_video_section()
   {
	$select = "SELECT * FROM `home_video_section` WHERE home_video_id='1'";
    $ex = mysqli_query($this->con,$select);
    return $ex;	
   }
    public function update_video_section($update_video)
   {
	   $select ="update home_video_section SET home_video='".$update_video['home_video']."',home_video_text='".$update_video['home_video_text']."' where home_video_id ='".$update_video['home_video_id']."'";
       $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
  /*** Home Page End Video***/
  
  /*** Why Us 360 Visibility**/
  public function view_whyus_visibility()
  {
	  $select = "select * from 360_visibility";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function view_whyus_visibility_id($why_visibility_id)
  {
	  $select = "select * from 360_visibility where 360_id ='$why_visibility_id'";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function update_why_visibility($why_visibility)
   {
       $select = "update 360_visibility SET 360_title='".$why_visibility['360_title']."',360_content='".$why_visibility['360_content']."',360_icon='".$why_visibility['360_icon']."' where 360_id='".$why_visibility['360_id']."'";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   public function view_digital_promotion()
   {
	   $select = "select * from digital_promotion";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   public function view_digital_promo_id($digital_promotion_id)
  {
	  $select = "select * from digital_promotion where digital_promo_id='$digital_promotion_id'";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
   public function update_why_digital_promo($why_digital_promo)
   {
       $select = "update digital_promotion SET digital_promo_title='".$why_digital_promo['digital_promo_title']."',digital_promo_content='".$why_digital_promo['digital_promo_content']."',digital_promo_icon='".$why_digital_promo['digital_promo_icon']."' where digital_promo_id='".$why_digital_promo['digital_promo_id']."'";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
   }
   
  
  /*** End Why Us 360 Visibility**/
  
  
  /*** Contact Us Code Start**/
  public function add_contact_info($office_info)
  {
	  $select = "insert into contact (office_address,office_email,office_phone,office_map,office_bg_img) values('".$office_info['office_address']."','".$office_info['office_email']."','".$office_info['office_phone']."','".$office_info['office_map']."','".$office_info['office_bg_img']."')";
      $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function view_contact_info()
  {
	   $select = "select * from contact";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
  }
  public function delete_office_location($office_id)
  {
	   $select = "delete from contact where contact_id='$office_id'";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
  }
  public function get_office_address_by_id($office_id)
  {
	   $select = "select * from contact where contact_id='$office_id'";
	   $ex = mysqli_query($this->con,$select);
	   return $ex;
  }
  public function update_office_address($office_info)
  {
	  $select = "update contact SET office_address='".$office_info['office_address']."',office_email='".$office_info['office_email']."',office_phone='".$office_info['office_phone']."',office_map='".$office_info['office_map']."',office_bg_img='".$office_info['office_bg_img']."' where contact_id ='".$office_info['contact_id']."'";
      $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  /*** Contact us Code End**/
  
  /*** career Page**/
  public function view_career_top_content()
  {
	  $select = "select * from careers";
	  $ex = mysqli_query($this->con,$select);
      return $ex;
  }
  public function update_career_content($careers)
  {
	  $select ="update careers SET careers_title='".$careers['careers_title']."',careers_text='".$careers['careers_text']."',careers_img='".$careers['careers_img']."' where careers_id='1'";
      $ex = mysqli_query($this->con,$select);
      return $ex;	  
 }
  
  /** Career Page End**/
  
  /*** life at ethics**/
  
  public function add_life_at_ethics_cat($lf_info)
  {
	  $select ="insert into life_at_ethics_category (life_at_ethics_title) values('".$lf_info['life_at_ethics_title']."')";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function view_life_at_ethics_category()
  {
	  $select = "select * from life_at_ethics_category";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function del_life_at_ethics_cat_id($life_at_ethics_cat_id)
  {
	  $select = "delete from life_at_ethics_category where life_at_ethics_id='$life_at_ethics_cat_id'";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function get_datafrom_id_wise($lf_at_ethics_id)
  {
	  $select = "select * from life_at_ethics_category where life_at_ethics_id='$lf_at_ethics_id'";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function update_lf_at_ethics_cat($update_lf_at_ethics)
  {
	  $select = "update life_at_ethics_category SET life_at_ethics_title='".$update_lf_at_ethics['life_at_ethics_title']."' where life_at_ethics_id='".$update_lf_at_ethics['life_at_ethics_id']."'";
      $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function insert_life_at_ethics_gallery($life_at_ethics)
  {
	  $select = "insert into life_at_ethics_gallery (life_at_ethics_gallery_cate_id,life_at_ethics_gallery_img)values('".$life_at_ethics['life_at_ethics_gallery_cate_id']."','".$life_at_ethics['life_at_ethics_gallery_img']."')";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function view_gallery()
  {
	  $select ="select * from life_at_ethics_gallery
	  join life_at_ethics_category 	on life_at_ethics_category.life_at_ethics_id = life_at_ethics_gallery.life_at_ethics_gallery_cate_id";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function delete_gallery_img($gallery_id)
  {
	  $select ="delete from life_at_ethics_gallery where life_at_ethics_gallery_id='$gallery_id'";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function get_life_at_ethics_id_wise_data($life_at_ethics_gallery_id)
  {
	  $select = "select * from life_at_ethics_gallery 
	  join life_at_ethics_category 	on life_at_ethics_category.life_at_ethics_id = life_at_ethics_gallery.life_at_ethics_gallery_cate_id
	  where life_at_ethics_gallery_id='$life_at_ethics_gallery_id'";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function update_ethics_gallery($update_ethics_gallery)
  {
	  $select = "update life_at_ethics_gallery SET life_at_ethics_gallery_cate_id='".$update_ethics_gallery['life_at_ethics_gallery_cate_id']."',life_at_ethics_gallery_img='".$update_ethics_gallery['life_at_ethics_gallery_img']."' where life_at_ethics_gallery_id = '".$update_ethics_gallery['life_at_ethics_gallery_id']."'";
      $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  /*** SEO Meta info**/
  public function add_seo_meta_info($row)
  {
	  $select = "insert into seo_meta_info(seo_meta_page,seo_meta_url,seo_meta_title,seo_meta_description,seo_meta_keyword,seo_meta_extrabox)values('".$row['seo_meta_page']."','".$row['seo_meta_url']."','".$row['seo_meta_title']."','".$row['seo_meta_description']."','".$row['seo_meta_keyword']."','".$row['seo_meta_extrabox']."')";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function view_metainfo()
  {
	  $select = "select * from seo_meta_info";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function deleteseometainfo($seo_id)
  {
	  $select = "delete from seo_meta_info where seo_meta_id='".$seo_id['seo_meta_id']."'";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function get_seometa_page_id($seo_meta_id)
  {
	  $select = "select * from seo_meta_info where seo_meta_id='$seo_meta_id'";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function update_seo_meta($update_seo)
  {
	  $select = "update seo_meta_info SET seo_meta_page='".$update_seo['seo_meta_page']."',seo_meta_url='".$update_seo['seo_meta_url']."',seo_meta_title='".$update_seo['seo_meta_title']."',seo_meta_description='".$update_seo['seo_meta_description']."',seo_meta_keyword='".$update_seo['seo_meta_keyword']."',seo_meta_extrabox='".$update_seo['seo_meta_extrabox']."' where seo_meta_id='".$update_seo['seo_meta_id']."'";
      $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  public function view_meta_info_page_wise($current_page)
  {
	  $select = "select * from seo_meta_info where seo_meta_url='$current_page'";
	  $ex = mysqli_query($this->con,$select);
	  return $ex;
  }
  
  
}
