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


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

namespace App\Http\Controllers;

use 
App\Models\ActivityLog;
use 
App\Models\ClientDeal;
use 
App\Models\Deal;
use 
App\Models\DealDiscussion;
use 
App\Models\DealFile;
use 
App\Models\DealTask;
use 
App\Models\Pipeline;
use 
App\Models\UserDeal;
use 
Illuminate\Http\Request;

class 
PipelineController extends Controller
{
    public function 
__construct()
    {
        
$this->middleware(
            [
                
'auth',
                
'XSS',
            ]
        );
    }

    
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    
public function index()
    {
        if(
\Auth::user()->can('manage pipeline'))
        {
            
$pipelines Pipeline::where('created_by''='\Auth::user()->creatorId())->get();

            return 
view('pipelines.index')->with('pipelines'$pipelines);
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission Denied.'));
        }
    }

    
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    
public function create()
    {
        if(
\Auth::user()->can('create pipeline'))
        {
            return 
view('pipelines.create');
        }
        else
        {
            return 
response()->json(['error' => __('Permission Denied.')], 401);
        }
    }

    
/**
     * Store a newly created resource in storage.
     *
     * @param \Illuminate\Http\Request $request
     *
     * @return \Illuminate\Http\Response
     */
    
public function store(Request $request)
    {
        if(
\Auth::user()->can('create pipeline'))
        {

            
$validator \Validator::make(
                
$request->all(), [
                                   
'name' => 'required|max:20',
                               ]
            );

            if(
$validator->fails())
            {
                
$messages $validator->getMessageBag();

                return 
redirect()->route('pipelines.index')->with('error'$messages->first());
            }

            
$pipeline             = new Pipeline();
            
$pipeline->name       $request->name;
            
$pipeline->created_by \Auth::user()->creatorId();
            
$pipeline->save();

            return 
redirect()->route('pipelines.index')->with('success'__('Pipeline successfully created!'));
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission Denied.'));
        }
    }

    
/**
     * Display the specified resource.
     *
     * @param \App\Pipeline $pipeline
     *
     * @return \Illuminate\Http\Response
     */
    
public function show(Pipeline $pipeline)
    {
        return 
redirect()->route('pipelines.index');
    }

    
/**
     * Show the form for editing the specified resource.
     *
     * @param \App\Pipeline $pipeline
     *
     * @return \Illuminate\Http\Response
     */
    
public function edit(Pipeline $pipeline)
    {
        if(
\Auth::user()->can('edit pipeline'))
        {
            if(
$pipeline->created_by == \Auth::user()->creatorId())
            {
                return 
view('pipelines.edit'compact('pipeline'));
            }
            else
            {
                return 
response()->json(['error' => __('Permission Denied.')], 401);
            }
        }
        else
        {
            return 
response()->json(['error' => __('Permission Denied.')], 401);
        }
    }

    
/**
     * Update the specified resource in storage.
     *
     * @param \Illuminate\Http\Request $request
     * @param \App\Pipeline $pipeline
     *
     * @return \Illuminate\Http\Response
     */
    
public function update(Request $requestPipeline $pipeline)
    {
        if(
\Auth::user()->can('edit pipeline'))
        {

            if(
$pipeline->created_by == \Auth::user()->creatorId())
            {

                
$validator \Validator::make(
                    
$request->all(), [
                                       
'name' => 'required|max:20',
                                   ]
                );

                if(
$validator->fails())
                {
                    
$messages $validator->getMessageBag();

                    return 
redirect()->route('pipelines.index')->with('error'$messages->first());
                }

                
$pipeline->name $request->name;
                
$pipeline->save();

                return 
redirect()->route('pipelines.index')->with('success'__('Pipeline successfully updated!'));
            }
            else
            {
                return 
redirect()->back()->with('error'__('Permission Denied.'));
            }
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission Denied.'));
        }
    }

    
/**
     * Remove the specified resource from storage.
     *
     * @param \App\Pipeline $pipeline
     *
     * @return \Illuminate\Http\Response
     */
    
public function destroy(Pipeline $pipeline)
    {
        if(
\Auth::user()->can('delete pipeline'))
        {
            if(
$pipeline->created_by == \Auth::user()->creatorId())
            {
                if(
count($pipeline->stages) == 0)
                {
                    foreach(
$pipeline->stages as $stage)
                    {
                        
$deals Deal::where('pipeline_id''='$pipeline->id)->where('stage_id''='$stage->id)->get();
                        foreach(
$deals as $deal)
                        {
                            
DealDiscussion::where('deal_id''='$deal->id)->delete();
                            
DealFile::where('deal_id''='$deal->id)->delete();
                            
ClientDeal::where('deal_id''='$deal->id)->delete();
                            
UserDeal::where('deal_id''='$deal->id)->delete();
                            
DealTask::where('deal_id''='$deal->id)->delete();
                            
ActivityLog::where('deal_id''='$deal->id)->delete();

                            
$deal->delete();
                        }

                        
$stage->delete();
                    }

                    
$pipeline->delete();

                    return 
redirect()->route('pipelines.index')->with('success'__('Pipeline successfully deleted!'));
                }
                else
                {
                    return 
redirect()->route('pipelines.index')->with('error'__('There are some Stages and Deals on Pipeline, please remove it first!'));
                }
            }
            else
            {
                return 
redirect()->back()->with('error'__('Permission Denied.'));
            }
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission Denied.'));
        }
    }
}

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