<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Paymnt extends Agent_Controller {

    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     * 		http://example.com/index.php/welcome
     * 	- or -
     * 		http://example.com/index.php/welcome/index
     * 	- or -
     * Since this controller is set as the default controller in
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /index.php/welcome/<method_name>
     * @see https://codeigniter.com/user_guide/general/urls.html
     */
    function __construct() {
        parent::__construct();
    }

    public function index() {
        $data = array();

        $in['agent_id'] = $_SESSION['agent_id'];
        $in['limit'] = 10;
        $in['action'] = MEDTRANS_USER_GET_TRANSLIST;
        $out = array();
        $ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
        $data['result_list'] = $out['result_list'];

        $in['limit'] = 5;
        $ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out);
        $data['today_list'] = $out['result_list'];
//echo $out['status'];
        //print_r($out);        

        $this->renderAgentPage('view_agent_dash', $data);
    }

    public function calendar() {

        $data = array();

        $in['agent_id'] = $_SESSION['agent_id'];
        $in['limit'] = 10;
       

        $this->renderAgentPage('view_agent_calendar', $data);
    }

    public function profile() {

        $data = array();

        $in['agent_id'] = $_SESSION['agent_id'];
        $in['limit'] = 10;

        
        $this->renderAgentPage('view_agent_profile', $data);
    }

    
    public function mylog()
    {
        
        $data = array();

        $in['agent_id'] = $_SESSION['agent_id'];
        $in['limit'] = 10;
     

        $this->renderAgentPage('view_agent_mylog', $data);
        
    }
    
    public function invoice()
    {
        
        $data = array();

        $in['agent_id'] = $_SESSION['agent_id'];
        $in['limit'] = 10;
    
        $data['page_name'] = "Pending Invoice";

        $this->renderAgentPage('view_agent_pinvoice', $data);
        
    }
    
    
}
