%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/ugotscom/www/boniface/Admin/application/modules/Packages/models/
Upload File :
Create Path :
Current File : /home/ugotscom/www/boniface/Admin/application/modules/Packages/models/Packages_model.php

<?php
class Packages_model extends CI_Model{
  //get all categories method
  function get_category(){
      $result=$this->db->get('enquiry_source');
      return $result;
  }
   function get_source(){
      $result=$this->db->get('enquiry_source');
      return $result;
  }
     function get_location(){
      $result=$this->db->get('locations');
      return $result;
  }
     function get_international(){
     $this->db->select('*');
     $this->db->from('international');
    $query = $this->db->get();
    $row = $query->result_array();
    return $row;
        
  }
  //generate dataTable serverside method
  function get_all_product() {
      $branch_id =$_SESSION['branch_id'];
      $this->datatables->select('*');
      $this->datatables->from('packages');
       return $this->datatables->generate();
   
  }

    function get_offers() {
     
      $this->datatables->select('*');
      $this->datatables->from('offers');
       return $this->datatables->generate();
   
  }

function get_all_products_dayplanner($planner_id){

   $this->db->select('*');
    $this->db->from('dayplanner');
    $this->db->where('planner_id',$planner_id);
   $query = $this->db->get();
    $row = $query->row_array();
    return $row;

}

      public function icities(){
    $this->db->select('id,cities,country');
    $this->db->from('international');
    $this->db->where('status','1');
    $query = $this->db->get();
    $row = $query->result_array();
    return $row;  
  }
  //insert data method
  function insert_product(){

      $data=array(
       
 'customer_name'        => $this->input->post('customer_name'),
        'enquiry_source'        => $this->input->post('enquiry_source'),
        'product_price'       => $this->input->post('price'),
        'product_category_id' => $this->input->post('category'),
        'mobile_no' => $this->input->post('mobile_no'),
        'alt_mobile_no' => $this->input->post('alt_mobile_no'),
        'landline_no' => $this->input->post('landline_no'),
        'email' => $this->input->post('email'),
        'location' => $this->input->post('location'),
        'gender' => $this->input->post('gender'),
        'dob' => $this->input->post('dob'),
        'aadhar_no' => $this->input->post('aadhar_no'),
        'model_name' => $this->input->post('model_name'),
        'lead_type_id' => $this->input->post('lead_type_id'),
        'followup_date' => $this->input->post('followup_date'),
        'payment_type' => $this->input->post('payment_type'),
        'test_ride_taken' => $this->input->post('test_ride_taken'),
        'customer_type' => $this->input->post('customer_type'),
        'cus_int_exe' => $this->input->post('cus_int_exe'),
        'remarks' => $this->input->post('remarks'),
        'enquiry_status' => $this->input->post('enquiry_status'),
        'added_by' => $this->input->post('added_by')
        
        
        
      );
      $result=$this->db->insert('leads', $data);
      return $result;
  }
  //update data method
  function update_product(){
      $lead_id=$this->input->post('lead_id');
         $data=array(
        'customer_name'        => $this->input->post('customer_name'),
        'enquiry_source'        => $this->input->post('enquiry_source'),
        'mobile_no' => $this->input->post('mobile_no'),
        'alt_mobile_no' => $this->input->post('alt_mobile_no'),
        'landline_no' => $this->input->post('landline_no'),
        'email' => $this->input->post('email'),
        'location' => $this->input->post('location'),
        'gender' => $this->input->post('gender'),
        'dob' => $this->input->post('dob'),
        'aadhar_no' => $this->input->post('aadhar_no'),
        'model_name' => $this->input->post('model_name'),
        'lead_type_id' => $this->input->post('lead_type_id'),
        'followup_date' => $this->input->post('followup_date'),
        'payment_type' => $this->input->post('payment_type'),
        'test_ride_taken' => $this->input->post('test_ride_taken'),
        'customer_type' => $this->input->post('customer_type'),
        'cus_int_exe' => $this->input->post('cus_int_exe'),
        'remarks' => $this->input->post('remarks'),
        'enquiry_status' => $this->input->post('enquiry_status'),
        'added_by' => $this->input->post('added_by')
      );
      $this->db->where('lead_id',$lead_id);
      $result=$this->db->update('leads', $data);
      return $result;
  }
   
  //delete data method
  function delete_product(){
      $user_id=$this->input->post('user_id');
      $this->db->where('user_id',$user_id);
      $result=$this->db->delete('leads');
      return $result;
  }

      public function get_customer($id) {

$this->db->select('*');
$this->db->from('packages');
  $this->db->where('package_id',$id);
    $query = $this->db->get();
    $row = $query->row_array();
    return $row;
         
    }
     function add_remark(){

      $data=array(
       
        'lead_id'        => $this->input->post('lead_id'),
        'remarks'        => $this->input->post('remarks')       
     
      );
      $result=$this->db->insert('remarks', $data);
      return $result;
  }
  public function rlisting($id){
    $this->db->select('*');
    $this->db->from('remarks');
    $this->db->where('lead_id',$id);
    $query = $this->db->get();    
    $row = $query->result_array();
    return $row;  
  
}
          public function get_dayplan($id) {

$this->db->select('*');
$this->db->from('dayplanner');
  $this->db->where('package_id',$id);
    $query = $this->db->get();
    $row = $query->result_array();
    return $row;
         
    }
  
            public function get_hotels($id) {

$this->db->select('*');
$this->db->from('package_hotels');
  $this->db->where('package_id',$id);
    $query = $this->db->get();
    $row = $query->result_array();
    return $row;
         
    }
      function insert_policies(){
$lead_id=$this->input->post('package_id');

      $data=array(
       
 'policies'        => $this->input->post('policies'),
     
        
      );
  $this->db->where('package_id',$lead_id);
      $result=$this->db->update('packages', $data);
      return $result;
  }
        function insert_terms(){
$lead_id=$this->input->post('package_id');

      $data=array(
       
 'terms'        => $this->input->post('terms'),
     
        
      );
  $this->db->where('package_id',$lead_id);
      $result=$this->db->update('packages', $data);
      return $result;
  }
          function insert_package(){


      $data=array(
       
        'package_name'        => $this->input->post('package_name'),
     'price'        => $this->input->post('price'),
     'days_nights'        => $this->input->post('days_nights'),
        'city'        => $this->input->post('city'),
      );

      $result=$this->db->insert('packages', $data);
      return $result;
  }

 function update_package(){
      $id= $this->input->post('package_id');

      $data=array(
       
                 'package_name'        => $this->input->post('package_name'),
                  'price'        => $this->input->post('price'),
     'days_nights'        => $this->input->post('days_nights'),
                 'city'        => $this->input->post('city'),
                  );

      $this->db->where('package_id',$id);
      $result=$this->db->update('packages', $data);
      return $result;
  }
  
  
 function insert_dayplan($file_name){


      $data=array(
       
        'day'        => $this->input->post('day'),
        'description'        => $this->input->post('description'),
        'package_id'        => $this->input->post('package_id'),
        'image_name'=> $file_name,
      );

      $result=$this->db->insert('dayplanner', $data);
      return $result;
  }


 function insert_offers($file_name){


      $data=array(
       
        'offer'        => $this->input->post('day'),
        'city'        => $this->input->post('description'),
        'status'      => 1,
        'image'=> $file_name,
      );

      $result=$this->db->insert('offers', $data);
      return $result;
  }



   function update_dayplan($file_name,$pid,$packageid){


      $data=array(
       
        'day'        => $this->input->post('day'),
        'description'        => $this->input->post('description'),
        'package_id'        => $packageid,
        'image_name'=> $file_name,
      );
      $this->db->where('planner_id',$pid);
      $result=$this->db->update('dayplanner', $data);
      return $result;
  }
}

Zerion Mini Shell 1.0