<?php
	namespace App\Http\Controllers;
	use Illuminate\Foundation\Bus\DispatchesJobs;
	use Illuminate\Routing\Controller as BaseController;
	use Illuminate\Foundation\Validation\ValidatesRequests;
	use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
	use Illuminate\Foundation\Auth\Access\AuthorizesResources;
	use Illuminate\Http\Request;
	use DB;
	use App\Http\Model\IncomeExpeneModel;
	use Validator;
	
	class IncomeExpenceController extends Controller
	{
		public function __construct()
		{
			$this->IncomeExpene= new IncomeExpeneModel;
		}
		public function Income()
		{
			$data['income']=$this->IncomeExpene->Income();
			return view('income',compact('data'));
		}
		public function submitincome(Request $request)
		{
			$data['duration1']=$request->input('duration1');
			$data['duration']=$request->input('duration');
			$data['amount']=$request->input('amount');
			return $AddIncome=$this->IncomeExpene->submitincome($data);
		}
		public function Expense()
		{
			$data['Expense']=$this->IncomeExpene->Expence();
			return view('Expense',compact('data'));
		}
		public function submitExpense(Request $request)
		{
			$data['duration1']=$request->input('duration1');
			$data['duration']=$request->input('duration');
			$data['amount']=$request->input('amount');
			return $AddIncome=$this->IncomeExpene->submitExpense($data);
		}
		public function Incomecategory()
		{
			return view('Incomecategory');
		}
		public function IncomecategoryUpdate(Request $request)
		{
			$data['Incomecategory']=$request->input('Incomecategory');
			$data['Incomecategory1']=$request->input('Incomecategory1');
			$data['amount']=$request->input('amount');
			return $AddCategory=$this->IncomeExpene->IncomecategoryUpdate($data);
		}
		public function Expencecategory()
		{
			return view('ExpenseCategory');
		}
		public function ExpencecategoryUpdate(Request $request)
		{
			$data['Incomecategory']=$request->input('Incomecategory');
			$data['Incomecategory1']=$request->input('Incomecategory1');
			$data['amount']=$request->input('amount');
			return $AddCategory=$this->IncomeExpene->ExpencecategoryUpdate($data);
		}
		public function IncomeReport()
		{
			$data['IncomeReport']=$this->IncomeExpene->IncomeReport();
			return view('incomeReport',compact('data'));
		}
		public function ExpenseReport()
		{
			$data['ExpenceReport']=$this->IncomeExpene->ExpenseReport();
			return view('ExpenseReport',compact('data'));
			
		}
		
	}
