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

class Expense_management extends Admin_Core_Controller {

    public function __construct()
    {
        parent::__construct();
    }

    public function all_expense()
    {
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_expense'] = $this->setting_model->get_all_expense_by_atp_id();
        $data['all_account_head'] = $this->setting_model->get_all_account_head_by_atp_id();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/expense_management/all_expense');
        $this->load->view('admin/include/footer');
    }

    function add_new_expense()
    {
        if ($this->setting_model->add_new_expense()) 
        {
            $this->session->set_userdata('success', "Expense Successfully Added");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', " Expense Added Failed");
            redirect($this->agent->referrer());
        }
    }

  
}
