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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/main_file/app/Http/Controllers/   drwxrwxr-x
Free 13.15 GB of 57.97 GB (22.68%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace App\Http\Controllers;

use 
App\Models\ProductService;
use 
App\Models\ProductStock;
use 
App\Models\Utility;
use 
Illuminate\Http\Request;

class 
ProductStockController extends Controller
{
    
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    
public function index()
    {

        if(
\Auth::user()->can('manage product & service'))
        {

            
$productServices ProductService::where('created_by''='\Auth::user()->creatorId())->where('type''=''product')->get();


            return 
view('productstock.index'compact('productServices'));
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission denied.'));
        }
    }

    
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    
public function create()
    {
        
//
    
}

    
/**
     * Store a newly created resource in storage.
     *
     * @param \Illuminate\Http\Request $request
     *
     * @return \Illuminate\Http\Response
     */
    
public function store(Request $request)
    {


    }


    
/**
     * Display the specified resource.
     *
     * @param \App\Models\ProductStock $productStock
     *
     * @return \Illuminate\Http\Response
     */
    
public function show(ProductStock $productStock)
    {
        
//
    
}

    
/**
     * Show the form for editing the specified resource.
     *
     * @param \App\Models\ProductStock $productStock
     *
     * @return \Illuminate\Http\Response
     */
    
public function edit($id)
    {
        
$productService ProductService::find($id);
        if(
\Auth::user()->can('edit product & service'))
        {
            if(
$productService->created_by == \Auth::user()->creatorId())
            {
                return 
view('productstock.edit'compact('productService'));
            }
            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\Models\ProductStock $productStock
     *
     * @return \Illuminate\Http\Response
     */
    
public function update(Request $request$id)
    {
        if(
\Auth::user()->can('edit product & service'))
        {
            
$productService ProductService::find($id);
            
$total $productService->quantity $request->quantity;

            if(
$productService->created_by == \Auth::user()->creatorId())
            {
                
$productService->quantity   $total;
                
$productService->created_by \Auth::user()->creatorId();
                
$productService->save();

                
//Product Stock Report
                
$type        'manually';
                
$type_id     0;
                
$description $request->quantity '  ' __('quantity added by manually');
                
Utility::addProductStock($productService->id$request->quantity$type$description$type_id);


                return 
redirect()->route('productstock.index')->with('success'__('Product quantity updated manually.'));
            }
            else
            {
                return 
redirect()->back()->with('error'__('Permission denied.'));
            }
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission denied.'));
        }
    }

    
/**
     * Remove the specified resource from storage.
     *
     * @param \App\Models\ProductStock $productStock
     *
     * @return \Illuminate\Http\Response
     */
    
public function destroy(ProductStock $productStock)
    {
        
//
    
}
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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