File: //var/www/html/qcr24/app/application/models/admin/ModometerNotification_old.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class ModometerNotification extends CI_Model {
public function __construct() {
parent::__construct();
}
public function get_odometer_notification(){
$this->db->select('count(on.odometer_notification_id) total_notification,on.rent_out_id,md.first_name,md.middle_name,md.last_name,md.mobile,mc.car_no,rov.rent_out_no,rov.is_rent_in');
$this->db->from('odometer_notifications on');
$this->db->join('rent_out_vehcile rov','rov.rent_out_id=on.rent_out_id','inner');
$this->db->join('master_driver md','md.driver_id=rov.driver_id','inner');
$this->db->join('master_car mc','mc.car_id=rov.car_id','inner');
$this->db->group_by('on.rent_out_id');
$this->db->order_by('on.odometer_notification_id', 'DESC');
$query=$this->db->get();
return $query->result_array();
}
public function get_odometer_notifications_date($rent_out_id){
$this->db->select('date_format(odometer_notifications.created_ts,"%d/%m/%Y %H:%i:%s") created_ts');
$this->db->from('odometer_notifications');
$this->db->where('odometer_notifications.rent_out_id',$rent_out_id);
$this->db->order_by('odometer_notifications.created_ts', 'DESC');
$query=$this->db->get();
return $query->result_array();
}
}