File: /var/www/html/pmw24/driver_settlement/applicationold/models/admin/Mdocket.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Mdocket extends CI_Model {
/*
author: soumya hazra
purpose: Get all Docket list
date: 9-9-2019
*/
public function get_docket($status =null)
{
$result = array();
$this->db->select('*');
$this->db->from('master_docket');
$this->db->where('is_active',$status);
$this->db->order_by('docket_id','desc');
$query = $this->db->get();
$result = $query->result_array();
return $result;
}
public function set_deactive_docket($docket_id,$updated_by)
{
$this->db->set('is_active',0);
$this->db->set('updated_by',$updated_by);
$this->db->set('updated_ts',date('Y-m-d h:i:s'));
$this->db->where('docket_id',$docket_id);
$this->db->update('master_docket');
//echo $this->db->last_query();die;
return true;
}
/*
author: soma
purpose: Set a expense active
date: 12-9-2019
*/
public function set_active_docket($docket_id,$updated_by)
{
$this->db->set('is_active',1);
$this->db->set('updated_by',$updated_by);
$this->db->set('updated_ts',date('Y-m-d h:i:s'));
$this->db->where('docket_id',$docket_id);
//echo $this->db->last_query();die;
$this->db->update('master_docket');
return true;
}
/*
author: soumya hazra
purpose: Add New Docket
date: 9-9-2019
*/
public function submitdocket($data)
{
$this->db->insert('master_docket', $data);
//echo $this->db->last_query();exit;
return true;
}
/*
author: soumya hazra
purpose: Get singel docket
date: 9-9-2019
*/
public function get_singl_docket($dc)
{
$result = array();
$this->db->select('*');
$this->db->from('master_docket');
$this->db->where('docket_id',$dc);
$query = $this->db->get();
$result = $query->row_array();
return $result;
}
/*
author: soumya hazra
purpose: Update Docket
date: 9-9-2019
*/
public function updatedocket($docket_name,$docket_id)
{
$this->db->set('docket_name',$docket_name);
$this->db->set('updated_by',$this->session->userdata('user_data'));
$this->db->set('updated_ts',date('Y-m-d h:i:s'));
$this->db->where('docket_id',$docket_id);
$this->db->Update('master_docket');
return true;
}
}