%PDF- %PDF-
Mini Shell

Mini Shell

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

<?php
class Branches extends CI_Controller{
  function __construct(){
    parent::__construct();
      if(isset($_SESSION['username'])){
      
    }else{
      redirect('login');
    }
      $this->load->library('datatables'); //load library ignited-dataTable
      $this->load->model('Branches_model'); //load model crud_model
  }
  function index(){
      $x['category']=$this->Branches_model->get_branches();
      $data['content']='Branches_view';
      $this->load->view('common/layout',$data);
      $this->load->view('Branches_view',$x);
  }

  function get_product_json() { //get product data and encode to be JSON object
      header('Content-Type: application/json');
      echo $this->Branches_model->get_all_product();
  }

  function save(){ //insert record method

        
      $this->Branches_model->insert_product();
      redirect('branches');
  }
public function add()
  { 
    
   $data['content'] = $this->load->view('add');
    $this->load->view('common/layout',$data);
 
    
  }

  public function edit($id)
  { 

$data['branch'] = $this->Branches_model->get_branch($id);
$data['content'] = $this->load->view('edit',$data);
$this->load->view('common/layout',$data);

   
  }
   function update(){ //update record method

      $this->Branches_model->update_product();
      redirect('branches');

  }
}

Zerion Mini Shell 1.0