<?php

class Report_model extends CI_Model {

	public function transfer_report(){
	$query=$this->db->query('SELECT sending_money.*,users.first_name,users.last_name FROM
	sending_money,users WHERE sending_money.agent_id=users.id');
	return $query->result();
	}
	
	public function payment_report(){
	$query=$this->db->query('SELECT payment.*,users.first_name,users.last_name FROM
	payment,users WHERE payment.agent_id=users.id');
	return $query->result();
	}
	
	public function agent_wise_transfer($id){
	$query=$this->db->query("SELECT sending_money.*,users.first_name,users.last_name FROM
	sending_money,users WHERE sending_money.agent_id=users.id AND sending_money.agent_id='".$id."'");
	return $query->result();
	}
	
	public function agent_wise_payment($id){
	$query=$this->db->query("SELECT payment.*,users.first_name,users.last_name FROM
	payment,users WHERE payment.agent_id=users.id AND payment.agent_id='".$id."'");
	return $query->result();
	}
	

}