db->table('users')->where('user_id', $user_id)->get()->getRowArray(); } public function dashboard_live_data($logged_user_branch_id) { $this->select('job_card.*, vehicle.reg_no, vehicle.make, vehicle.colour, vehicle.model, make.make as bike_name, model.model_name as bike_modal_name'); $this->from('job_card'); $this->join('vehicle', 'vehicle.vehicle_id = job_card.vehicle_id', 'left'); $this->join('make', 'make.make_id = vehicle.make', 'left'); $this->join('model', 'model.model_id = vehicle.model', 'left'); $this->where('job_card.isactive', 1); $this->where('job_card.branch_id',$logged_user_branch_id); $current_date = date('Y-m-d'); $this->where('DATE(job_card.created_at)', $current_date); $this->groupBy('job_card.job_card_id'); $this->orderBy('job_card.job_card_id','DESC'); return $this->findAll(); } public function today_delivery($logged_user_branch_id) { $this->select('job_card.*, vehicle.reg_no, vehicle.make, vehicle.colour, vehicle.model, make.make as bike_name, model.model_name as bike_modal_name'); $this->from('job_card'); $this->join('vehicle', 'vehicle.vehicle_id = job_card.vehicle_id', 'left'); $this->join('make', 'make.make_id = vehicle.make', 'left'); $this->join('model', 'model.model_id = vehicle.model', 'left'); $this->where('job_card.isactive', 1); $this->where('job_card.branch_id',$logged_user_branch_id); $current_date = date('Y-m-d'); $this->where('DATE(job_card.created_at)', $current_date); $this->groupBy('job_card.job_card_id'); $this->orderBy('job_card.job_card_id','DESC'); return $this->findAll(); } }