403Webshell
Server IP : 77.68.25.176  /  Your IP : 216.73.216.24
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/tap2teach.dazzlingwebplanet.com/app/Helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/vhosts/dazzlingwebplanet.co.uk/tap2teach.dazzlingwebplanet.com/app/Helpers/print.php
<?php

use App\Models\RequestStatus;
use App\Models\School;
use App\Models\SchoolSubject;
use App\Models\SchoolYearGroup;
use App\Models\User;
use App\Models\UserDetail;
use Tymon\JWTAuth\Claims\Subject;

function userName($id)
{
    $user = UserDetail::where('user_id', $id)->first();

    if (!empty($user)) {
        return $user->first_name . ' ' . $user->last_name;
    } else {
        return 'Not Found Or Deleted';
    }
}

function statusName($id)
{
    $RequestStatus = RequestStatus::where('id', $id)->first();

    if (!empty($RequestStatus)) {
        return $RequestStatus->name;
    } else {
        return 'Not Found Or Deleted';
    }
}

function schoolName($id)
{
    $chool = School::find($id);

    if (!empty($chool)) {
        return $chool->name;
    } else {
        return 'Not Found Or Deleted';
    }
}

function status($id)
{
    if ($id == 1) {
        return "Active";
    } else {
        return "In-Active";
    }
}

function Newstatus($id)
{
    if ($id == 1) {
        return "In-Active";
    } else {
        return "Active";
    }
}

function subjectName($id)
{
    $subject = SchoolSubject::find($id);

    if (!empty($subject)) {
        return $subject->name;
    } else {
        return 'Not Found Or Deleted';
    }
}

function subjectYearName($id)
{
    $year = SchoolYearGroup::find($id);

    if (!empty($year)) {
        return $year->name;
    } else {
        return 'Not Found Or Deleted';
    }
}

function userType($id)
{
    if ($id == 1) {
        return "Student";
    } elseif ($id == '2') {
        return "Teacher";
    } else {
        return "Admin";
    }
}
/* --------------------------------------- Drop Down----------------------------------------------------- */
function userTypeDropdown()
{
    $type[0] = 'Admin';
    $type[1] = 'Student';
    $type[2] = 'Teacher';

    return $type;
}

function schoolDropdown()
{
    $chool = School::where('status', 0)->get()->toArray();

    $option[''] = 'Please select School';
    foreach ($chool as $key => $value) {
        $option[$value['id']] = $value['name'];
    }

    return $option;
}
function allSubjectDropdown()
{
    $schoolSubject = SchoolSubject::where('status', 1)->get()->toArray();

    $option[''] = 'Please select Subject';
    foreach ($schoolSubject as $key => $value) {
        $option[$value['id']] = $value['name'];
    }

    return $option;
}

function allYearGroupDropdown()
{
    $schoolSubject = SchoolYearGroup::where('status', 1)->get()->toArray();

    $option[''] = 'Please select Year Group';
    foreach ($schoolSubject as $key => $value) {
        $option[$value['id']] = $value['name'];
    }

    return $option;
}

function StudentDropDown()
{
    $user = UserDetail::where('user_type', 1)->get()->toArray();

    $option[''] = 'Please select Student';
    foreach ($user as $key => $value) {
        if (!empty($value['first_name'])) {
            $option[$value['user_id']] = $value['first_name'] . ' ' . $value['last_name'];
        } else {
            $option[$value['user_id']] = $value['user_id'] . ' | Not found Name';
        }
    }
    return $option;
}

function requestStatusDropdown()
{
    $status = RequestStatus::get();
    $option[''] = 'Please select';

    if ($status !== NULL) {
        $status = $status->toArray();

        foreach ($status as $key => $value) {
            $option[$value['id']] = $value['name'];
        }
    }
    return $option;
}

function title()
{
    $type['Mr'] = 'Mr';
    $type['Mrs'] = 'Mrs';
    $type['Ms'] = 'Ms';

    return $type;
}

Youez - 2016 - github.com/yon3zu
LinuXploit