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/pmw_live_testing/application/models/admin/Mdriverrefundsettlement.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Mdriverrefundsettlement extends CI_Model {

	public function __construct() {        
		parent::__construct();
	}
	public function GetDriverRefundSettlement($table,$condition){
        $result         = array();
        $this->db->select('*');
        $this->db->from($table);
        $this->db->where($condition);
        $this->db->order_by('dr_refund_settlement_id','desc');
        $this->db->limit('1');
        $query  = $this->db->get();        
        $result = $query->row_array();
        return $result;
    }
    public function totalRefund($table,$condition){
        $result         = array();
        $total_refund   = 0.00;
        $this->db->select('sum(refund_amt) as total_refund');
        $this->db->from($table);
        $this->db->where($condition);        
        $query  = $this->db->get();
        //echo $this->db->last_query();exit();
        $result = $query->row_array();
        if(!empty($result) && !empty($result['total_refund'])){
            $total_refund   = $result['total_refund'];
        } 

        return $total_refund;
    }
    
}