%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/ugotscom/www/BOS/application/modules/branches/models/
Upload File :
Create Path :
Current File : /home/ugotscom/www/BOS/application/modules/branches/models/Branches_model.php

<?php
class Branches_model extends CI_Model{
  //get all categories method
  function get_branches(){
      $result=$this->db->get('branches');
      return $result;
  }
   function get_source(){
      $result=$this->db->get('enquiry_source');
      return $result;
  }
     function get_location(){
      $result=$this->db->get('locations');
      return $result;
  }
  //generate dataTable serverside method
  function get_all_product() {
     
      $this->datatables->select('branch_id,branch_name');
      $this->datatables->from('branches');
      return $this->datatables->generate();
  }
  //insert data method
  function insert_product(){

      $data=array(
        'branch_name'        => $this->input->post('branch_name'),                        
      );

      $result=$this->db->insert('branches', $data);
      return $result;
  }
  //update data method
  function update_product(){
      $branch_id=$this->input->post('branch_id');
      $data=array(
        'branch_name'         => $this->input->post('branch_name')
         );
      $this->db->where('branch_id',$branch_id);
      $result=$this->db->update('branches', $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_branch($id) {

$this->db->select('*');
$this->db->from('branches');
  $this->db->where('branch_id',$id);
    $query = $this->db->get();
    $row = $query->row_array();
    return $row;
         
    }
}

Zerion Mini Shell 1.0