403Webshell
Server IP : 77.68.25.176  /  Your IP : 216.73.216.25
Web Server : Apache
System : Linux plesk 4.15.0-159-generic #167-Ubuntu SMP Tue Sep 21 08:55:05 UTC 2021 x86_64
User : dwp ( 10001)
PHP Version : 7.4.33
Disable Function : opcache_get_status
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/vhosts/dazzlingwebplanet.co.uk/rightway-admin.dazzlingwebplanet.co.uk/app/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/vhosts/dazzlingwebplanet.co.uk/rightway-admin.dazzlingwebplanet.co.uk/app/Company.php
<?php

namespace App;

use App\EmployeeModal\EmpBasicInfo;
use Illuminate\Database\Eloquent\Model;
use Auth;
use DB;
use Illuminate\Support\Facades\Session;

class Company extends Model
{
    protected $table = 'companies';

    protected $guarded = [];

    protected $fillable = [
        'company_name',
        'cmp_start_date',
        'enrolled_date',
        'de_enrolled_date',
        'company_dot_no',
        'company_mc_no',
        'comopnay_type',
        'company_address_line_1',
        'company_address_line_2',
        'company_address_city',
        'company_address_postcode',
        'company_address_state',
        'company_address_country',
        'postal_address',
        'company_status',
        'notification',
        'type_of_business',
        'other_type_business',
        'dba',
        'cc',
        'ein',
        'ca',
        'mcp',
        'epn_code',
        'trucrs',
        'scac_code',
        'canada_code',
        'ubi',
        'dun_brandstreet',
        'saw_id',
        'ifta_account',
        'ifta_base_state',
        'irp_account',
        'irp_base_state',
        'odot_account',
        'nm_wdt',
        'kyu',
        'kytc',
        'ny_hut',
        'ct_hut',
        'prepass_account',
        'last_updated_by_ip',
        'last_updated_by',
        'from_sheet',
        'email',
        'phone',
    ];

    public function get_slected_company_list_on_user_id($snUserId)
    {
        $user = User::where('id', $snUserId)->first();

        $saGetSelectedCmp = DB::table('company_user')->select('company_id')
            ->where('user_id', $snUserId)->get()->toArray();

        if (!empty($saGetSelectedCmp)) {
            $saCmpList = array_column($saGetSelectedCmp, 'company_id');
        } else {
            if ($user->role_id == 3) {
                $saCmpList = array();
            } else {
                $all_company = Company::select('id')->get()->toArray();
                $saCmpList = array_column($all_company, 'id');
            }
        }
        return $saCmpList;
    }

    public function get_company_users($company_id)
    {
        $saUserList = DB::table('company_user')
            ->select('users.id as user_id', 'role_id', 'roles.name as role_name', 'company_user.id as cmp_user_id', 'users.name', 'users.email', 'users.avatar', 'company_user.created_at')
            ->join('users', 'company_user.user_id', '=', 'users.id')
            ->join('roles', 'users.role_id', '=', 'roles.id')
            ->whereNull('company_user.deleted_at');

        if ($company_id == 'All' || $company_id == '') {
            $saGetCompanyList = with(new User)->get_company_list();
            $saArrayCmp = array_column($saGetCompanyList, 'id');

            $saUserList->whereIn('company_user.company_id', $saArrayCmp);
        } else {
            $saUserList->where('company_user.company_id', $company_id);
        }

        //                        ->where('company_user.created_by', $company_id)
        $saResult = $saUserList->orderBy('company_user.id', 'desc')->get()->toArray();

        return $saResult;
    }

    public function get_company_name($company_id)
    {
        $get_name = DB::table('companies')->select('company_name')->where('id', $company_id)->first();
        if (!empty($get_name)) {
            return $get_name->company_name;
        } else {
            return 'Not Found';
        }
    }

    public function get_company_status($company_id)
    {
        $company_detail = Company::select('company_status')->where('id', $company_id)->first();

        if (!empty($company_detail)) {
            return $company_detail->company_status;
        } else {
            return 'Not Found';
        }
    }

    public function get_company_address($company_id)
    {
        $get_address = DB::table('companies')->select('email', 'company_address_line_1', 'company_address_line_2', 'company_address_city', 'company_address_state', 'company_address_country', 'company_address_postcode')->where('id', $company_id)->first();
        if (!empty($get_address)) {
            return $get_address;
        } else {
            return 'Not Found';
        }
    }

    public function get_company_detail_of_driver($snApplicationId)
    {

        $get_detail = DB::table('driver_applications')
            ->select('companies.*')
            ->join('companies', 'driver_applications.company_id', '=', 'companies.id')
            ->where('driver_applications.id', $snApplicationId)
            ->first();

        return $get_detail;
    }

    public function get_all_company_list()
    {
        $saGetDetail = DB::table('companies')
            ->select('id', 'company_name')
            ->get()->toArray();

        return $saGetDetail;
    }

    public function get_company_owner($company_id)
    {
        return CmpOwnership::where('cmp_id', $company_id)->first();
    }

    public function get_company_dropdown()
    {
        $option = array();

        $get_company_list = with(new \App\User)->get_company_list();
        $cmp_id = array_column($get_company_list, 'id');

        $companies = Company::select('id', 'company_name')->whereIn('id', $cmp_id)
            ->orderBy('company_name', 'asc')->get()->toArray();

        foreach ($companies as $key => $value) {
            $option[$value['id']] = $value['company_name'];
        }

        return $option;
    }

    public function owners()
    {
        return $this->hasMany(CmpOwnership::class, 'cmp_id', 'id');
    }

     public function employees()
    {
        return $this->hasMany(EmpBasicInfo::class, 'cmp_id', 'id');
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit