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

class PaymentSetup extends CI_Controller
{
	public function index()
	{
		isset($_SESSION['sec_rf_admin']) ? $_SESSION['sec_rf_admin'] == true ? null : redirect('/') : redirect('/');
		$this->load->model('PaymentMethod');

		$this->load->view('templates/1_head.php');
		$this->load->view('templates/2_nav.php');
		$this->load->view('templates/3_sidebar_menu_left.php');

		$data['methods'] = $this->PaymentMethod->allMethods();

		$this->load->view('payment-setup/add-payment-setup', $data); //4_dynamic

		$this->load->view('templates/5_footer.php');
		$this->load->view('templates/6_script_end.php');
	}

	public function updatePaymentMethod()
	{
		$this->load->model('PaymentMethod');
		$mobile = $this->input->post('mobile');
		$fee = $this->input->post('fee');
		$id = $this->input->post('id');
		$this->db->query("UPDATE join_fee_income SET mobile='$mobile', join_fee=$fee WHERE id=$id");
		return 1;
	}
}
