!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/laravel-crm/packages/Webkul/Admin/src/Traits/   drwxrwxrwx
Free 13.08 GB of 57.97 GB (22.56%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Webkul\Admin\Traits;

/**
 * Single place for all dropdown options. Sets of sorted dropdown
 * options methods. Use as per your need.
 */
trait ProvideDropdownOptions
{
    
/**
     * Dropdown choices.
     *
     * @var array
     */
    
public $booleanDropdownChoices = [
        
'active_inactive',
        
'yes_no',
    ];

    
/**
     * Is boolean dropdown choice exists.
     *
     * @param  string  $choice
     */
    
public function isBooleanDropdownChoiceExists($choice): bool
    
{
        return 
in_array($choice$this->booleanDropdownChoices);
    }

    
/**
     * Get boolean dropdown options.
     *
     * @param  string  $choice
     */
    
public function getBooleanDropdownOptions($choice 'active_inactive'): array
    {
        return 
$this->isBooleanDropdownChoiceExists($choice) && $choice == 'active_inactive'
            
$this->getActiveInactiveDropdownOptions()
            : 
$this->getYesNoDropdownOptions();
    }

    
/**
     * Get active/inactive dropdown options.
     */
    
public function getActiveInactiveDropdownOptions(): array
    {
        return [
            [
                
'value'    => '',
                
'label'    => __('admin::app.common.select-options'),
                
'disabled' => true,
                
'selected' => true,
            ],
            [
                
'label'    => trans('admin::app.datagrid.active'),
                
'value'    => 1,
                
'disabled' => false,
                
'selected' => false,
            ], [
                
'label'    => trans('admin::app.datagrid.inactive'),
                
'value'    => 0,
                
'disabled' => false,
                
'selected' => false,
            ],
        ];
    }

    
/**
     * Get yes/no dropdown options.
     */
    
public function getYesNoDropdownOptions(): array
    {
        return [
            [
                
'value'    => '',
                
'label'    => __('admin::app.common.select-options'),
                
'disabled' => true,
                
'selected' => true,
            ],
            [
                
'value'    => 0,
                
'label'    => __('admin::app.common.no'),
                
'disabled' => false,
                
'selected' => false,
            ], [
                
'value'    => 1,
                
'label'    => __('admin::app.common.yes'),
                
'disabled' => false,
                
'selected' => false,
            ],
        ];
    }

    
/**
     * Get user dropdown options.
     */
    
public function getUserDropdownOptions(): array
    {
        
$options app(\Webkul\User\Repositories\UserRepository::class)
            ->
get(['id as value''name as label'])
            ->
map(function ($item$key) {
                
$item->disabled false;

                
$item->selected false;

                return 
$item;
            })
            ->
toArray();

        return [
            [
                
'label'    => __('admin::app.common.select-users'),
                
'value'    => '',
                
'disabled' => true,
                
'selected' => true,
            ],
            ...
$options,
        ];
    }

    
/**
     * Get lead source options.
     */
    
public function getLeadSourcesOptions(): array
    {
        
$options app(\Webkul\Lead\Repositories\SourceRepository::class)
            ->
get(['id as value''name as label'])
            ->
map(function ($item$key) {
                
$item->disabled false;

                
$item->selected false;

                return 
$item;
            })
            ->
toArray();

        return [
            [
                
'label'    => __('admin::app.common.select-users'),
                
'value'    => '',
                
'disabled' => true,
                
'selected' => true,
            ],
            ...
$options,
        ];
    }

    
/**
     * Get organization dropdown options.
     */
    
public function getOrganizationDropdownOptions(): array
    {
        
$options app(\Webkul\Contact\Repositories\OrganizationRepository::class)
            ->
get(['id as value''name as label'])
            ->
map(function ($item$key) {
                
$item->disabled false;

                
$item->selected false;

                return 
$item;
            })
            ->
toArray();

        return [
            [
                
'label'    => __('admin::app.common.select-organization'),
                
'value'    => '',
                
'disabled' => true,
                
'selected' => true,
            ],
            ...
$options,
        ];
    }

    
/**
     * Get role dropdown options.
     */
    
public function getRoleDropdownOptions(): array
    {
        return [
            [
                
'label'    => trans('admin::app.settings.roles.all'),
                
'value'    => 'all',
                
'disabled' => false,
                
'selected' => false,
            ], [
                
'label'    => trans('admin::app.settings.roles.custom'),
                
'value'    => 'custom',
                
'disabled' => false,
                
'selected' => false,
            ],
        ];
    }

    
/**
     * Get activity type dropdown options.
     */
    
public function getActivityTypeDropdownOptions(): array
    {
        return [
            [
                
'label'    => trans('admin::app.common.select-type'),
                
'value'    => '',
                
'disabled' => true,
                
'selected' => true,
            ], [
                
'label'    => trans('admin::app.common.select-call'),
                
'value'    => 'call',
                
'disabled' => false,
                
'selected' => false,
            ], [
                
'label'    => trans('admin::app.common.select-meeting'),
                
'value'    => 'meeting',
                
'disabled' => false,
                
'selected' => false,
            ], [
                
'label'    => trans('admin::app.common.select-lunch'),
                
'value'    => 'lunch',
                
'disabled' => false,
                
'selected' => false,
            ],
        ];
    }

    
/**
     * Get attribute type dropdown options.
     */
    
public function getAttributeTypeDropdownOptions(): array
    {
        return [
            [
                
'label'    => trans('admin::app.common.select-options'),
                
'value'    => '',
                
'disabled' => true,
                
'selected' => true,
            ],
            [
                
'label'    => trans('admin::app.common.system_attribute'),
                
'value'    => '0',
                
'disabled' => false,
                
'selected' => false,
            ],
            [
                
'label'    => trans('admin::app.common.custom_attribute'),
                
'value'    => '1',
                
'disabled' => false,
                
'selected' => false,
            ],
        ];
    }

    
/**
     * Get organization dropdown options.
     */
    
public function getWarehouseDropdownOptions(): array
    {
        
$options app(\Webkul\Warehouse\Repositories\WarehouseRepository::class)
            ->
get(['id as value''name as label'])
            ->
map(function ($item$key) {
                
$item->disabled false;

                
$item->selected false;

                return 
$item;
            })
            ->
toArray();

        return [
            [
                
'label'    => __('admin::app.common.select-warehouse'),
                
'value'    => '',
                
'disabled' => true,
                
'selected' => true,
            ],
            ...
$options,
        ];
    }
}

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