<?php

namespace Config;

class App_config extends \CodeIgniter\Config\BaseConfig
{
    public $template = [
        'form' => [
            'class_element'            => 'form-control',
            'class_element_select'     => 'form-control automatic-selection',
            'class_element_checkbox'   => 'form-check-input',
            'class_element_editor'     => 'form-control plugin_editor',
            'class_element_datepicker' => 'form-control datepicker',
            'class_element_text_emoji' => 'form-control text-emoji',
        ],
        'datetime' => [
            'long' => 'Y-m-d H:i:s',
            'short' => 'Y-m-d',
        ],

        'status' => [
            '1'      => ['name' => 'Active',   'class' => 'bg-success', 'class-badge' => 'bg-label-success'],
            '0'      => ['name' => 'Deactive', 'class' => 'bg-danger', 'class-badge' => 'bg-label-danger'],
            '2'      => ['name' => 'Unknow',   'class' => 'bg-warning', 'class-badge' => 'bg-label-warning'],
            'all'      => ['name' => 'All',      'class' => 'bg-primary'],
        ],
        'store_data_status' => [
            '1'      => ['name' => 'Success',   'class' => 'bg-success', 'class-badge' => 'bg-label-success'],
            '0'      => ['name' => 'Pending', 'class' => 'bg-warning', 'class-badge' => 'bg-label-danger'],
        ],
        'tickets_status' => [
            'pending'     => ['name' => 'Pending',  'class' => 'bg-warning', 'class-badge' => 'bg-warning'],
            'answered'    => ['name' => 'Answered', 'class' => 'bg-primary',  'class-badge' => 'bg-secondary'],
            'closed'      => ['name' => 'Closed',   'class' => 'bg-success', 'class-badge' => 'bg-success'],
            'unread'      => ['name' => 'Unread',      'class' => 'bg-info', 'class-badge' => 'bg-info'],
            'all'         => ['name' => 'All',      'class' => 'bg-primary', 'class-badge' => 'bg-primary'],

        ],

        'transactions_status' => [
            '3'     => ['name' => 'Cancelled', 'class' => 'bg-red',    'class-badge' => 'bg-red'],
            '2'      => ['name' => 'Success',      'class' => 'bg-indigo', 'class-badge' => 'bg-indigo-lt'],
            '0'      => ['name' => 'Pending',   'class' => 'bg-orange', 'class-badge' => 'bg-orange-lt'],
            '1'      => ['name' => 'Initiated',    'class' => 'bg-orange', 'class-badge' => 'bg-orange-lt'],
            'all'      => ['name' => 'All',      'class' => 'bg-info'],
        ],
        'bank_transactions_status' => [
            '3'     => ['name' => 'Cancelled', 'class' => 'bg-red',    'class-badge' => 'bg-red'],
            '2'      => ['name' => 'Success',      'class' => 'bg-indigo', 'class-badge' => 'bg-indigo-lt'],
            '0'      => ['name' => 'Pending',   'class' => 'bg-orange', 'class-badge' => 'bg-orange-lt'],
            '1'      => ['name' => 'Initiated',    'class' => 'bg-orange', 'class-badge' => 'bg-orange-lt'],
            'all'      => ['name' => 'All',      'class' => 'bg-info'],
        ],

        'button' => [
            'edit'         => ['name' => 'Edit',   'class' => 'ajaxModal',      'icon' => 'fa fa-edit', 'route-name' => '/update/'],
            'edit2'         => ['name' => 'Edit',   'class' => 'ajaxModal',      'icon' => 'fa fa-edit', 'route-name' => '/update/'],
            'delete'       => ['name' => 'Delete', 'class' => 'ajaxDeleteItem', 'icon' => 'fa fa-trash', 'route-name' => '/delete/'],
            'view_user'    => ['name' => 'View User', 'class' => 'ajaxViewUser', 'icon' => 'fa fa-eye', 'route-name' => '/view_user/'],
            'view_invoice'    => ['name' => 'View invoice', 'class' => '', 'icon' => 'fa fa-eye', 'route-name' => '/view/'],
            'view'         => ['name' => 'View', 'class' => 'ajaxModal', 'icon' => 'fa fa-eye', 'route-name' => '/view/'],
            'more_detail'  => ['name' => 'More detail', 'class' => 'ajaxModal', 'icon' => 'fa-solid fa-circle-info', 'route-name' => '/info/'],
            'set_password'  => ['name' => 'Set Password', 'class' => 'ajaxModal', 'icon' => 'fa fa-lock', 'route-name' => '/set_password/'],
            'add_funds'     => ['name' => 'Add Funds', 'class' => 'ajaxModal', 'icon' => 'fa fa-dollar-sign', 'route-name' => '/add_funds/'],
            'set_balance'   => ['name' => 'Set balance', 'class' => 'ajaxModal', 'icon' => 'fa fa-credit-card', 'route-name' => '/edit_funds/'],
            'send_mail'     => ['name' => 'Send Mail', 'class' => 'ajaxModal', 'icon' => 'fa fa-envelope', 'route-name' => '/mail/'],
            'balance'       => ['name' => 'Update balance', 'class' => 'ajaxUpdateApiProvider', 'icon' => 'fa fa-dollar-sign', 'route-name' => '/balance/'],
            'sync_services' => ['name' => 'Sync services', 'class' => 'ajaxModal', 'icon' => 'fa fa-refresh-cw', 'route-name' => '/sync_services/'],
            'services'      => ['name' => 'Services Lists', 'class' => '', 'icon' => 'fa fa-list', 'route-name' => '/services/'],
            'resend'        => ['name'  => 'Resend Order', 'class' => '', 'icon' => 'fa fa-refresh-cw', 'route-name' => '/resend/'],
        ],
        'bulk_action' => [
            'delete'   => ['name' => 'Delete', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-trash',      'route-name' => '/bulk_action/'],
            'empty'    => ['name' => 'Empty The Data', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-trash-2',      'route-name' => '/bulk_action/'],
            'deactive' => ['name' => 'Deactive All', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-lock',     'route-name' => '/bulk_action/'],
            'active'   => ['name' => 'Active', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-check-square', 'route-name' => '/bulk_action/'],
            'pending'  => ['name' => 'Mark as Pending',  'class' => 'ajaxActionOptions', 'icon' => 'fa fa-navigation',  'route-name' => '/bulk_action/'],
            'closed'   => ['name' => 'Mark as Closed',   'class' => 'ajaxActionOptions', 'icon' => 'fa fa-lock',        'route-name' => '/bulk_action/'],
            'answered' => ['name' => 'Mark as Answered', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-check',       'route-name' => '/bulk_action/'],
            'unread'   => ['name' => 'Mark as Unread', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-eye-slash',       'route-name' => '/bulk_action/'],
            'csv'      => ['name' => 'Export CSV',   'class' => '', 'icon' => 'fa fa-download',  'route-name' => '/export/'],
            'excel'    => ['name' => 'Export excel', 'class' => '', 'icon' => 'fa fa-download',  'route-name' => '/export/'],
            'pending'      => ['name' => 'Pending', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-clock', 'route-name' => '/bulk_action/'],
            'inprogress'   => ['name' => 'In progress', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-loader', 'route-name' => '/bulk_action/'],
            'completed'    => ['name' => 'Completed', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-check-square', 'route-name' => '/bulk_action/'],
            'resend'       => ['name' => 'Resend Order', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-refresh-cw', 'route-name' => '/bulk_action/'],
            'cancel'       => ['name' => 'Cancel and Refund', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-x', 'route-name' => '/bulk_action/'],
            'rejected'     => ['name' => 'Rejected', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-x', 'route-name' => '/bulk_action/'],
            'paused'       => ['name' => 'Paused', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-alert-triangle', 'route-name' => '/bulk_action/'],
            'copy_id'      => ['name' => 'Copy to Clipboard (ID)', 'class' => 'ajaxActionOptions', 'icon' => 'fa fa-copy', 'route-name' => '/bulk_action/'],
        ],
        'search_field' => [
            'all'           => ['name' => 'All'],
            'id'            => ['name' => 'ID'],
            'ids'            => ['name' => 'ID'],
            'email'         => ['name' => 'Email'],
            'name'          => ['name' => 'Name'],
            'order_id'      => ['name' => 'Order ID'],
            'sort'          => ['name' => 'Sort'],
            'question'      => ['name' => 'Question'],
            'answer'        => ['name' => 'Answer'],
            'title'         => ['name' => 'Title'],
            'description'    => ['name' => 'Description'],
            'ip'             => ['name' => 'IP address'],
            'history_ip'     => ['name' => 'History ip'],
            'country'        => ['name' => 'Location'],
            'first_name'     => ['name' => 'First name'],
            'last_name'      => ['name' => 'Last name'],
            'username'      => ['name'  => 'Username'],
            'transaction_id' => ['name' => 'Transaction id'],
            'note'           => ['name' => 'Note'],
            'subject'        => ['name' => 'Subject'],
            'api_service_id' => ['name' => 'API service id'],
            'api_order_id'   => ['name' => 'API Order id'],
            'service_id'     => ['name' => 'Service id'],
            'link'           => ['name' => 'Link'],
            'customer_name'  => ['name' => 'Customer Name'],
            'customer_email' => ['name' => 'Customer Email'],
            'domain' => ['name' => 'Domain'],
            'support_mail' => ['name' => 'Email'],
            'code' => ['name' => 'Code'],
            'plans' => ['name' => 'Plans'],
            'transaction_id' => ['name' => 'Transaction ID'],
            'type' => ['name' => 'Payment method'],
            'device_key' => ['name' => 'Device key'],
            'device_name' => ['name' => 'Device name'],
            'device_ip' => ['name' => 'Device Ip'],
            'user_email' => ['name' => 'User Email'],
        ],
        'service_type' => [
            'default'                 => 'Default',
            'subscriptions'           => 'Subscriptions',
            'custom_comments'         => 'Custom comments',
            'custom_comments_package' => 'Custom comments package',
            'mentions_with_hashtags'  => 'Mentions with hashtags',
            'mentions_custom_list'    => 'Mentions custom list',
            'mentions_hashtag'        => 'Mentions hashtag',
            'mentions_user_followers' => 'Mentions user followers',
            'mentions_media_likers'   => 'Mentions media likers',
            'package'                 => 'Package',
            'comment_likes'           => 'Comment likes',
        ]
    ];

    public $config = [
        'button' => [
            'default'          => ['edit', 'delete'],
            'blogs'            => ['edit2', 'delete'],
            'order'            => ['edit', 'resend', 'delete'],
            'news'             => ['edit', 'view', 'delete'],
            'store_data'       => ['delete'],
            'subscriptions'    => ['edit', 'resend', 'delete'],
            'tickets'          => ['delete'],
            'category'         => ['edit', 'delete'],
            'payments'         => ['edit', 'delete'],
            'provider'         => ['edit', 'balance', 'sync_services', 'services', 'delete'],
            'subscribers'      => ['delete', 'send_mail'],
            'users'            => ['edit', 'view_user', 'add_funds', 'set_password', 'send_mail', 'delete',],
            'staffs'            => ['edit', 'add_funds', 'set_password', 'send_mail', 'delete',],
            'users_banned_ip'  => ['edit', 'delete'],
            'invoice'  => ['edit', 'delete', 'view_invoice'],
        ],
        'status' => [
            'default'  => [
                '0' => 'inactive',
                '1' => 'active'
            ],
            'store_data'  => [
                '0' => 'pending',
                '1' => 'success'
            ],
            'transactions'  => [
                '0' => 'Pending',
                '1' => 'Initiated',
                '2' => 'Success',
                '3' => 'Failed'
            ],
            'bank_transactions'  => [
                '0' => 'Pending',
                '1' => 'Initiated',
                '2' => 'Success',
                '3' => 'Failed'
            ],

            'tickets'  => [
                'pending'   => 'pending',
                'answered'  => 'answered',
                'closed'    => 'closed'
            ],
            'order'          => ['all', 'processing', 'inprogress', 'pending', 'completed', 'partial', 'canceled', 'error', 'fail'],
            'dripfeed'       => ['all', 'active', 'completed',  'canceled'],
            'subscriptions'  => ['all', 'active', 'paused', 'expired', 'completed', 'error'],
            'refill'         => ['all', 'pending', 'awaiting', 'inprogress', 'rejected', 'completed'],
        ],

        'search' => [
            'default'         => ['all', 'name'],
            'payments'        => ['name'],
            'faqs'            => ['question', 'answer'],
            'news'            => ['description'],
            'blogs'            => ['description', 'title'],
            'subscribers'     => ['email', 'ip', 'country'],
            'users'           => ['email', 'first_name', 'last_name'],
            'staffs'          => ['email', 'first_name', 'last_name'],
            'users_activity'  => ['email', 'first_name', 'last_name', 'ip'],
            'users_banned_ip' => ['ip', 'description'],
            'tickets'         => ['all', 'ids', 'email', 'subject'],
            'provider'        => ['name'],
            'subscriptions'   => ['id', 'api_order_id', 'username', 'email'],
            'refill'          => ['id', 'order_id', 'link', 'email'],
            'affiliates'      => ['email'],
            'coupon'          =>  ['all', 'code', 'description'],
            'invoice'          => ['all', 'customer_name', 'customer_email'],
            'domain'          =>  ['all', 'ip', 'domain', 'support_mail'],
            'devices'          =>  ['all', 'device_ip', 'device_key', 'user_email'],
            'plans'          =>  ['all', 'name'],
            'transactions'   =>  ['all', 'transaction_id', 'type'],
            'bank_transactions'   =>  ['all', 'transaction_id', 'type'],
        ],
        'bulk_action' => [
            'default'          => ['active', 'deactive', 'delete'],
            'coupon'           => ['active', 'deactive', 'delete'],
            'devices'           => ['delete'],
            'services'         => ['active', 'deactive', 'delete_custom_rates', 'delete'],
            'tickets'          => ['pending', 'answered', 'unread', 'closed', 'delete'],
            'category'         => ['active', 'deactive', 'delete'],
            'payments'         => ['active', 'deactive'],
            'users'            => ['active', 'deactive', 'csv', 'excel', 'delete'],
            'staffs'            => ['active', 'deactive', 'csv', 'excel', 'delete'],
            'users_activity'   => ['delete', 'empty'],
            'users_banned_ip'  => ['delete', 'empty'],
            'transactions'      => ['csv', 'excel'],
            'order'            => ['pending', 'inprogress', 'completed', 'resend', 'cancel', 'copy_id', 'copy_api_order_id'],
            'dripfeed'         => ['completed', 'cancel'],
            'refill'           => ['completed', 'rejected', 'copy_order_id', 'copy_api_order_id', 'copy_api_refill_id'],
            'subscriptions'    => ['active', 'completed', 'paused', 'cancel'],
        ],
    ];
}
