HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: /var/www/html/taxicamera/old/application/models/admin/Mmisc.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Mmisc extends CI_Model {

    /*
    author: soma
    purpose: Get misc list
    date: 13-9-2019
    */

    public function get_misc()
    {
        $result =  array();
        //$this->db->select('master_misc_setup.*');

        $this->db->select('master_misc_setup.*,user_profile.first_name,user_profile.middle_name,user_profile.last_name');
        $this->db->from('master_misc_setup'); 
        $this->db->join('user_profile', 'user_profile.user_id = master_misc_setup.user_id', 'left');      
        //$this->db->where('status',1);       
        $this->db->order_by('id','DESC');       
        $query = $this->db->get();
        $result = $query->result_array();
       // echo $this->db->last_query();die;
        return $result;

    } 

     /*
    author: soma
    purpose: Add  misc
    date: 13-9-2019
    */
    
    public function submit_misc($data)
    {
        $this->db->insert('master_misc_setup', $data);

        return true;
    }

    /*
    author: soma
    purpose: Update misc
    date: 13-9-2019
    */
    public function update_misc($data,$mid)
    {
        $this->db->where('id', $mid);
        $this->db->update('master_misc_setup', $data);
        return true;
    }

    public function misc_driver(){
        $result=array();
        $query = "select mu.*,up.*,
        CONCAT(up.first_name,' ',ifnull(up.middle_name,''),' ',up.last_name) as full_name,
        CONCAT('Unit: ',up.flat_no,',Street: ',up.street_no,',',up.street_name,',Suburb: ',up.suburb,',Postcode: ',up.pin) as full_address, 
        date_format(up.dr_licence_expiry,'%d/%m/%Y') dr_licence_expiry,
        date_format(up.dr_dc_expiry,'%d/%m/%Y') dr_dc_expiry from master_user mu
        inner join user_profile up  on mu.user_id=up.user_id 
        where mu.role_id=2 AND status = 1 AND is_active = 1 AND  is_delete != 1";
        $query1 = $this->db->query($query);
       // echo $this->db->last_query();die;
        $result=$query1->result_array();
        return $result;
    }

   
       


   
}