diff --git a/build/MagnusBilling-current.tar.gz b/build/MagnusBilling-current.tar.gz index 92d886892..2432cc719 100644 Binary files a/build/MagnusBilling-current.tar.gz and b/build/MagnusBilling-current.tar.gz differ diff --git a/protected/commands/AlarmCommand.php b/protected/commands/AlarmCommand.php index 6dfd7878b..75f8a1613 100755 --- a/protected/commands/AlarmCommand.php +++ b/protected/commands/AlarmCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/commands/BDServiceCommand.php b/protected/commands/BDServiceCommand.php index b3849db27..ef203076d 100755 --- a/protected/commands/BDServiceCommand.php +++ b/protected/commands/BDServiceCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -26,7 +26,7 @@ public function run($args) define('LOGFILE', 'protected/runtime/BDServicePid.log'); define('DEBUG', 0); - if (!defined('PID')) { + if ( ! defined('PID')) { define("PID", "/var/run/magnus/BDServicePid.php"); } @@ -60,15 +60,15 @@ public function tanaSend() foreach ($modelSendCreditSummary as $key => $sendCredit) { $url = "http://takasend.org/ezzeapi/status?id=" . $sendCredit->id . "&user=" . $userBD . "&key=" . $keyBD . ""; - if (!$result = @file_get_contents($url, false)) { + if ( ! $result = @file_get_contents($url, false)) { $result = ''; } echo $result . " $sendCredit->id \n"; $modelRefill = Refill::model()->find('invoice_number = :key AND id_user = :key1', - array( + [ ':key' => $sendCredit->id, ':key1' => $sendCredit->id_user, - )); + ]); if (preg_match("/ERROR|CANCELLED/", strtoupper($result))) { @@ -99,10 +99,10 @@ public function tanaSend() echo "is agent \n"; $id_agent = $modelUser->id_user; $modelRefillAgent = Refill::model()->find('invoice_number = :key AND id_user = :key1', - array( + [ ':key' => $sendCredit->id, ':key1' => $id_agent, - )); + ]); if (isset($modelRefillAgent->id)) { $modelRefillAgent->description = $modelRefillAgent->description . '. Status: ' . $result[0] . '. Ref:' . $result[1]; @@ -148,10 +148,10 @@ public function tanaSend() echo "is agent \n"; $id_agent = $modelUser->id_user; $modelRefillAgent = Refill::model()->find('invoice_number = :key AND id_user = :key1', - array( + [ ':key' => $sendCredit->id, ':key1' => $id_agent, - )); + ]); $modelRefillAgent->description = @$modelRefillAgent->description . '. Status: ' . $result[0] . '. Ref:' . $result[1]; $modelRefillAgent->payment = 1; @@ -184,12 +184,12 @@ public function ezzeapi() $BDService_url = $config['global']['BDService_url']; $url = $BDService_url . "/ezzeapi/balance?user=$userBD&key=$keyBD"; - if (!$result = @file_get_contents($url, false)) { + if ( ! $result = @file_get_contents($url, false)) { $result = ''; } - Configuration::model()->updateAll(array('config_value' => $result), 'config_key = :key', - array(':key' => 'BDService_credit_provider')); + Configuration::model()->updateAll(['config_value' => $result], 'config_key = :key', + [':key' => 'BDService_credit_provider']); $modelSendCreditSummary = SendCreditSummary::model()->findAll('confirmed = 0 AND service != :key AND date > :key1 ', [ ':key' => 'international', @@ -202,7 +202,7 @@ public function ezzeapi() $url = $BDService_url . "/ezzeapi/status?id=" . $idApi . "&user=" . $userBD . "&key=" . $keyBD; - if (!$result = @file_get_contents($url, false)) { + if ( ! $result = @file_get_contents($url, false)) { $result = ''; } @@ -211,19 +211,19 @@ public function ezzeapi() if (preg_match("/SUCCESS/", $result)) { $modelRefill = Refill::model()->find('invoice_number = :key AND id_user = :key1', - array( + [ ':key' => $sendCredit->id, ':key1' => $sendCredit->id_user, - )); + ]); - if (!count($modelRefill)) { + if ( ! count($modelRefill)) { continue; } $message = explode("SUCCESS: ", $result); User::model()->updateByPk($sendCredit->id_user, - array( + [ 'credit' => new CDbExpression('credit + ' . $modelRefill->credit), - ) + ] ); $modelRefill->payment = 1; @@ -238,15 +238,15 @@ public function ezzeapi() echo "\n\nIS A USER AGENT" . $sendCredit->idUser->id_user; $modelRefill = Refill::model()->find('invoice_number = :key AND id_user = :key1', - array( + [ ':key' => $sendCredit->id, ':key1' => $sendCredit->idUser->id_user, - )); + ]); User::model()->updateByPk($sendCredit->idUser->id_user, - array( + [ 'credit' => new CDbExpression('credit + ' . $modelRefill->credit), - ) + ] ); $modelRefill->payment = 1; @@ -259,7 +259,7 @@ public function ezzeapi() $sendCredit->confirmed = 3; $sendCredit->save(); - $modelRefill = Refill::model()->find('invoice_number = :key', array(':key' => $sendCredit->id)); + $modelRefill = Refill::model()->find('invoice_number = :key', [':key' => $sendCredit->id]); if (count($modelRefill)) { $modelRefill->description = $modelRefill->description . '. Ref: ' . $result; $modelRefill->save(); diff --git a/protected/commands/BackupCommand.php b/protected/commands/BackupCommand.php index 2d492fe46..d516af9e7 100755 --- a/protected/commands/BackupCommand.php +++ b/protected/commands/BackupCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/commands/CallArchiveCommand.php b/protected/commands/CallArchiveCommand.php index 8c02b4c35..33e852b68 100755 --- a/protected/commands/CallArchiveCommand.php +++ b/protected/commands/CallArchiveCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -28,7 +28,7 @@ public function run($args) CallFailed::model()->createDataBaseIfNotExist(); $c = 0; - $tables = array('pkg_cdr', 'pkg_cdr_failed'); + $tables = ['pkg_cdr', 'pkg_cdr_failed']; foreach ($tables as $key => $table) { $sql = "SELECT count(*) AS count FROM $table WHERE $condition "; @@ -72,7 +72,7 @@ public function deleteCalls() $prior_cdr_failed_archive_month_delete = $this->config['global']['delete_cdr_failed_archived_prior_x_month']; $c = 0; - $tables = array('pkg_cdr_archive', 'pkg_cdr_failed_archive'); + $tables = ['pkg_cdr_archive', 'pkg_cdr_failed_archive']; foreach ($tables as $key => $table) { if ($table == 'pkg_cdr_archive') { diff --git a/protected/commands/CallChartCommand.php b/protected/commands/CallChartCommand.php index 9b81b85d2..09fd8012e 100755 --- a/protected/commands/CallChartCommand.php +++ b/protected/commands/CallChartCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -37,7 +37,7 @@ public function run($args) break; } try { - Servers::model()->updateAll(array('status' => 1), 'status = 2'); + Servers::model()->updateAll(['status' => 1], 'status = 2'); $calls = AsteriskAccess::getCoreShowCdrChannels(); } catch (Exception $e) { sleep(4); @@ -77,7 +77,7 @@ public function user_cdr_show($calls) $totalUp = $this->totalUpCalls = 0; $totalCalls = $this->totalCalls = 0; } catch (Exception $e) { - $modelCallOnlineChart = CallOnlineChart::model()->find('date = :key', array(':key' => date('Y-m-d H:i:') . '00')); + $modelCallOnlineChart = CallOnlineChart::model()->find('date = :key', [':key' => date('Y-m-d H:i:') . '00']); } if ($modelCallOnlineChart->id > 0) { @@ -88,14 +88,14 @@ public function user_cdr_show($calls) if (count($calls) > 0) { - $sql = array(); + $sql = []; if ($this->debug > 1) { print_r($calls); } $config = LoadConfig::getConfig(); $ip_tech_length = $config['global']['ip_tech_length']; - $sql = array(); + $sql = []; foreach ($calls as $key => $call) { $modelDid = $modelSip = []; $type = ''; @@ -133,7 +133,7 @@ public function user_cdr_show($calls) if (preg_match('/^MC\!/', $sip_account)) { echo "torpedo\n"; $campaingName = preg_split('/\!/', $call[1]); - $modelCampaing = Campaign::model()->find('name = :key', array(':key' => $campaingName[1])); + $modelCampaing = Campaign::model()->find('name = :key', [':key' => $campaingName[1]]); $id_user = isset($modelCampaing->id_user) ? $modelCampaing->id_user : 'NULL'; $trunk = "Campaign " . $campaingName[1]; } else { @@ -177,7 +177,7 @@ public function user_cdr_show($calls) //try get user if (preg_match('/^SIP\/sipproxy\-/', $channel)) { - if (!strlen($sip_account)) { + if ( ! strlen($sip_account)) { $sip_account = $call[1] = $call[3]; } if (false !== $key = array_search($sip_account, $this->sipNames)) { @@ -188,10 +188,10 @@ public function user_cdr_show($calls) } else if (strlen($ndiscado) > 15) { $tech = substr($ndiscado, 0, $ip_tech_length); - $modelSip = Sip::model()->find('techprefix = :key AND host != "dynamic" ', array(':key' => $tech)); + $modelSip = Sip::model()->find('techprefix = :key AND host != "dynamic" ', [':key' => $tech]); } - if (!count($modelSip)) { + if ( ! count($modelSip)) { if ($status == 'Ring') { $sip_account = $originate; } @@ -204,19 +204,19 @@ public function user_cdr_show($calls) } else if (strlen($accountcode)) { //echo "check per accountcode $accountcode\n"; $modelSip = Sip::model()->find('accountcode = :key', - array( + [ ':key' => $accountcode, - )); + ]); } - if (!count($modelSip)) { + if ( ! count($modelSip)) { if (preg_match('/^IAX/', strtoupper($channel))) { - $modelSip = Iax::model()->find('name = :key', array(':key' => $originate)); + $modelSip = Iax::model()->find('name = :key', [':key' => $originate]); } else { //check if is via IP from proxy $callProxy = AsteriskAccess::getCoreShowChannel($channel, null, $call['server']); - $modelSip = Sip::model()->find('host = :key', array(':key' => $callProxy['X-AUTH-IP'])); + $modelSip = Sip::model()->find('host = :key', [':key' => $callProxy['X-AUTH-IP']]); } } } @@ -253,7 +253,7 @@ public function user_cdr_show($calls) //torpedo $campaingName = preg_split('/\!/', $call[1]); - $modelCampaing = Campaign::model()->find('name = :key', array(':key' => $campaingName[1])); + $modelCampaing = Campaign::model()->find('name = :key', [':key' => $campaingName[1]]); $id_user = isset($modelCampaing->id_user) ? $modelCampaing->id_user : 'NULL'; $trunk = "Campaign " . $campaingName[1]; @@ -302,7 +302,7 @@ public function user_cdr_show($calls) //torpedo $campaingName = preg_split('/\!/', $call[1]); - $modelCampaing = Campaign::model()->find('name = :key', array(':key' => $campaingName[1])); + $modelCampaing = Campaign::model()->find('name = :key', [':key' => $campaingName[1]]); $id_user = isset($modelCampaing->id_user) ? $modelCampaing->id_user : 'NULL'; $trunk = "Campaign " . $campaingName[1]; @@ -336,13 +336,13 @@ public function user_cdr_show($calls) continue; } - if (!is_numeric($id_user)) { + if ( ! is_numeric($id_user)) { echo "continue because not found id_user\n"; continue; } - if (!is_numeric($id_user) || !is_numeric($cdr)) { + if ( ! is_numeric($id_user) || ! is_numeric($cdr)) { echo "continue because not foun id_user or cdr\n"; continue; } @@ -357,8 +357,8 @@ public function user_cdr_show($calls) if (count($callShopIds)) { if (in_array($id_user, $callShopIds)) { - if (!isset($modelSip->id)) { - $modelSip = Sip::model()->find('name =:key', array(':key' => $sip_account)); + if ( ! isset($modelSip->id)) { + $modelSip = Sip::model()->find('name =:key', [':key' => $sip_account]); if (isset($modelSip->id)) { $modelSip->status = 3; @@ -427,7 +427,7 @@ public function use_concise() $totalUp = $this->totalUpCalls = 0; $totalCalls = $this->totalCalls = 0; } catch (Exception $e) { - $modelCallOnlineChart = CallOnlineChart::model()->find('date = :key', array(':key' => date('Y-m-d H:i:') . '00')); + $modelCallOnlineChart = CallOnlineChart::model()->find('date = :key', [':key' => date('Y-m-d H:i:') . '00']); } if ($modelCallOnlineChart->id > 0) { @@ -451,7 +451,7 @@ public function use_concise() print_r($calls); } - $sql = array(); + $sql = []; foreach ($calls as $key => $call) { if (isset($_GET['log'])) { @@ -493,7 +493,7 @@ public function use_concise() //torpedo $cdr = $call[13]; $ndiscado = $call[2]; - $modelCampaing = Campaign::model()->find('name = :key', array(':key' => $call[9])); + $modelCampaing = Campaign::model()->find('name = :key', [':key' => $call[9]]); $id_user = isset($modelCampaing->id_user) ? $modelCampaing->id_user : 'NULL'; $trunk = "Campaign " . $call[9]; @@ -507,36 +507,36 @@ public function use_concise() $config = LoadConfig::getConfig(); $tech = substr($ndiscado, 0, $config['global']['ip_tech_length']); - $modelSip = Sip::model()->find('techprefix = :key AND host != "dynamic" ', array(':key' => $tech)); - if (!count($modelSip)) { + $modelSip = Sip::model()->find('techprefix = :key AND host != "dynamic" ', [':key' => $tech]); + if ( ! count($modelSip)) { if (preg_match('/^SIP\/sipproxy\-/', $channel)) { $modelSip = Sip::model()->find('name = :key', - array( + [ ':key' => $peername, - )); + ]); } else { $modelSip = Sip::model()->find('name = :key', - array( + [ ':key' => $originate, - )); + ]); } - if (!count($modelSip)) { + if ( ! count($modelSip)) { //check if is via IP from proxy $callProxy = AsteriskAccess::getCoreShowChannel($channel, null, $call['server']); - $modelSip = Sip::model()->find('host = :key', array(':key' => $callProxy['X-AUTH-IP'])); + $modelSip = Sip::model()->find('host = :key', [':key' => $callProxy['X-AUTH-IP']]); } } if (count($modelSip)) { $userType = 'User'; } else { - $resultTrunk = Trunk::model()->find('trunkcode = :key', array(':key' => $originate)); + $resultTrunk = Trunk::model()->find('trunkcode = :key', [':key' => $originate]); if (count($resultTrunk)) { $userType = 'Trunk'; } } - if (!count($userType)) { + if ( ! count($userType)) { //not fount the type call continue; } elseif ($userType == 'User') { @@ -565,15 +565,15 @@ public function use_concise() } elseif (strlen($call[12]) > 5 || $status == 'Up') { //chamada DID foi atendida $usernameReceive = explode("/", substr($call[12], 0, strrpos($call[12], "-"))); - $resultUser = Sip::model()->findAll(array( + $resultUser = Sip::model()->findAll([ 'select' => 'pkg_user.id, username', 'join' => 'LEFT JOIN pkg_user ON t.id_user = pkg_user.id', 'condition' => "t.name = '" . $usernameReceive[1] . "'", - )); + ]); if (isset($resultUser[0]['id'])) { $id_user = $resultUser[0]['id']; } else { - $modelDid = Did::model()->find('did = :key', array(':key' => $call[2])); + $modelDid = Did::model()->find('did = :key', [':key' => $call[2]]); $id_user = count($modelDid) ? $modelDid->id_user : null; } } @@ -586,7 +586,7 @@ public function use_concise() //torpedo $cdr = $call[12]; $ndiscado = $call['2']; - $modelCampaing = Campaign::model()->find('name = :key', array(':key' => $call[9])); + $modelCampaing = Campaign::model()->find('name = :key', [':key' => $call[9]]); $id_user = isset($modelCampaing->id_user) ? $modelCampaing->id_user : 'NULL'; $trunk = "Campaign " . $call[9]; @@ -645,11 +645,11 @@ public function use_concise() continue; } - if (!is_numeric($id_user) || !is_numeric($cdr)) { + if ( ! is_numeric($id_user) || ! is_numeric($cdr)) { continue; } - $modelDid = Did::model()->find('did =:key', array(':key' => $ndiscado)); + $modelDid = Did::model()->find('did =:key', [':key' => $ndiscado]); if (isset($modelDid->id)) { $didChannel = AsteriskAccess::getCoreShowChannel($channel); // is a DID diff --git a/protected/commands/ConvertAudiotoGSMCommand.php b/protected/commands/ConvertAudiotoGSMCommand.php index 15546bb80..fa63411f8 100755 --- a/protected/commands/ConvertAudiotoGSMCommand.php +++ b/protected/commands/ConvertAudiotoGSMCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/commands/CriaClienteSLCommand.php b/protected/commands/CriaClienteSLCommand.php index 3e41ee226..7340aa664 100755 --- a/protected/commands/CriaClienteSLCommand.php +++ b/protected/commands/CriaClienteSLCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -24,7 +24,7 @@ public function run($args) { $modelUser = User::model()->findAll('id_sacado_sac IS NULL AND id_group > 1'); foreach ($modelUser as $key => $user) { - $modelMethodPay = Methodpay::model()->find('payment_method = :key AND active = 0', array(':key' => 'SuperLogica')); + $modelMethodPay = Methodpay::model()->find('payment_method = :key AND active = 0', [':key' => 'SuperLogica']); if (count($modelMethodPay) > 0) { $response = $this->saveUserSLCurl($user, $modelMethodPay->SLAppToken @@ -43,7 +43,7 @@ public function saveUserSLCurl($model, $SLAppToken, $SLAccessToken) { $url = "http://api.superlogica.net:80/v2/financeiro/clientes"; - $params = array("ST_NOME_SAC" => $model->firstname . ' ' . $model->lastname, + $params = ["ST_NOME_SAC" => $model->firstname . ' ' . $model->lastname, "ST_NOMEREF_SAC" => $model->username, "ST_DIAVENCIMENTO_SAC" => date('d'), "ST_CGC_SAC " => $model->vat, @@ -56,7 +56,7 @@ public function saveUserSLCurl($model, $SLAppToken, $SLAccessToken) "SENHA" => $model->password, "SENHA_CONFIRMACAO" => $model->password, "ST_TELEFONE_SAC" => $model->phone, - ); + ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); @@ -66,10 +66,10 @@ public function saveUserSLCurl($model, $SLAppToken, $SLAccessToken) curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); - curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded", + curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/x-www-form-urlencoded", "app_token: " . $SLAppToken, "access_token:" . $SLAccessToken, - )); + ]); $params['identificador'] = '10000' . $model->id; @@ -80,11 +80,11 @@ public function saveUserSLCurl($model, $SLAppToken, $SLAccessToken) curl_close($ch); if (isset($response[0]->status) && $response[0]->status != 200) { - echo json_encode(array( + echo json_encode([ 'success' => false, - 'rows' => array(), + 'rows' => [], 'errors' => Yii::t('zii', $response[0]->msg), - )); + ]); } diff --git a/protected/commands/CuentaDigitalCommand.php b/protected/commands/CuentaDigitalCommand.php index 83818d22d..2003df255 100755 --- a/protected/commands/CuentaDigitalCommand.php +++ b/protected/commands/CuentaDigitalCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -40,12 +40,12 @@ public function run($args) $line = preg_split("/\//", $lines[$i]); $identification = Util::getDataFromMethodPay($line[4]); - if (!is_array($identification)) { + if ( ! is_array($identification)) { exit; } - $modelUser = User::model()->find('username = :key', array(':key' => $identification['id_user'])); - if (!count($modelUser)) { + $modelUser = User::model()->find('username = :key', [':key' => $identification['id_user']]); + if ( ! count($modelUser)) { exit; } diff --git a/protected/commands/DeleteCallCommand.php b/protected/commands/DeleteCallCommand.php index 526d7521f..a5199c4e3 100755 --- a/protected/commands/DeleteCallCommand.php +++ b/protected/commands/DeleteCallCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -24,11 +24,11 @@ public function run($args) ini_set('memory_limit', '-1'); $backdate = $this->subDayIntoDate(date('Ymd'), 15); - Call::model()->deleteAll(array( + Call::model()->deleteAll([ 'condition' => 'sessiontime = 0 AND starttime < :key', - 'params' => array(':key' => $backdate), + 'params' => [':key' => $backdate], 'limit' => 1000, - )); + ]); } public function subDayIntoDate($date, $days) diff --git a/protected/commands/DidCheckCommand.php b/protected/commands/DidCheckCommand.php index 895da10c9..89ec19205 100755 --- a/protected/commands/DidCheckCommand.php +++ b/protected/commands/DidCheckCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -21,20 +21,20 @@ class DidCheckCommand extends ConsoleCommand { public function run($args) { - $modelDidUse = DidUse::model()->findAll(array( + $modelDidUse = DidUse::model()->findAll([ 'condition' => '(releasedate IS NULL OR releasedate < :key) AND status = 1', - 'with' => array( - 'idDid' => array( + 'with' => [ + 'idDid' => [ 'condition' => "idDid.billingtype <> 3 AND idDid.fixrate > 0", - ), - ), - 'params' => array( + ], + ], + 'params' => [ ':key' => '1984-01-01 00:00:00', - ), - ) + ], + ] ); - if (!count($modelDidUse)) { + if ( ! count($modelDidUse)) { exit($this->debug >= 3 ? MagnusLog::writeLog(LOGFILE, ' line:' . __LINE__ . " NO DID IN USE ") : null); exit; } @@ -214,7 +214,7 @@ public function run($args) $modelDid->id_user = null; $modelDid->save(); - Diddestination::model()->deleteAll('id_did = :key', array(':key' => $didUse->id_did)); + Diddestination::model()->deleteAll('id_did = :key', [':key' => $didUse->id_did]); $modelDidHistory = new DidHistory(); $modelDidHistory->username = $didUse->idUser->username; diff --git a/protected/commands/DidwwwCommand.php b/protected/commands/DidwwwCommand.php index 43ccc904d..0689a1134 100755 --- a/protected/commands/DidwwwCommand.php +++ b/protected/commands/DidwwwCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/commands/DineromailCommand.php b/protected/commands/DineromailCommand.php index 64465be4a..b96f30bf5 100755 --- a/protected/commands/DineromailCommand.php +++ b/protected/commands/DineromailCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -46,7 +46,7 @@ public function run($args) $codigo_opcional = $pagos[0]->attributes(); //iduser $identification = Util::getDataFromMethodPay($pagos->Items->Item->Item_Description); - if (!is_array($identification)) { + if ( ! is_array($identification)) { exit; } diff --git a/protected/commands/GerencianetCommand.php b/protected/commands/GerencianetCommand.php index cf1d1423c..e0cc75454 100755 --- a/protected/commands/GerencianetCommand.php +++ b/protected/commands/GerencianetCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -29,7 +29,7 @@ class GerencianetCommand extends ConsoleCommand public function run($args) { - $modelMethodPay = Methodpay::model()->find('payment_method = :key', array(':key' => 'GerenciaNet')); + $modelMethodPay = Methodpay::model()->find('payment_method = :key', [':key' => 'GerenciaNet']); $clientId = $modelMethodPay->client_id; // insira seu Client_Id, conforme o ambiente (Des ou Prod) $clientSecret = $modelMethodPay->client_secret; // insira seu Client_Secret, conforme o ambiente (Des ou Prod) diff --git a/protected/commands/ImportCdrCSV_CCommand.php b/protected/commands/ImportCdrCSV_CCommand.php index f5352b16c..3f5250c2e 100755 --- a/protected/commands/ImportCdrCSV_CCommand.php +++ b/protected/commands/ImportCdrCSV_CCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/commands/MassiveCallCommand.php b/protected/commands/MassiveCallCommand.php index 10d11f4e6..cfc2869ec 100755 --- a/protected/commands/MassiveCallCommand.php +++ b/protected/commands/MassiveCallCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -24,24 +24,24 @@ public function run($args) $config = LoadConfig::getConfig(); $UNIX_TIMESTAMP = "UNIX_TIMESTAMP("; - $tab_day = array(1 => 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'); + $tab_day = [1 => 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']; $num_day = date('N'); $name_day = $tab_day[$num_day]; $filter = 'status = :key AND type = :key AND ' . $name_day . ' = :key AND startingdate <= :key1 AND expirationdate > :key1 AND daily_start_time <= :key2 AND daily_stop_time > :key2 AND frequency > 0'; - $params = array( + $params = [ ':key' => 1, ':key1' => date('Y-m-d H:i:s'), ':key2' => date('H:i:s'), - ); + ]; - $modelCampaign = Campaign::model()->findAll(array( + $modelCampaign = Campaign::model()->findAll([ 'condition' => $filter, 'params' => $params, 'order' => 'RAND()', - )); + ]); if ($this->debug >= 1) { echo "\nFound " . count($modelCampaign) . " Campaign\n\n"; @@ -74,20 +74,20 @@ public function run($args) continue; } - $modelServers = Servers::model()->count('status = 1 AND weight > 0 AND (type = :key OR type = :key1)', array(':key' => 'mbilling', ':key1' => 'asterisk')); + $modelServers = Servers::model()->count('status = 1 AND weight > 0 AND (type = :key OR type = :key1)', [':key' => 'mbilling', ':key1' => 'asterisk']); $campaign->frequency = $modelServers > 0 ? ceil($campaign->frequency / $modelServers) : $campaign->frequency; //get all campaign phonebook $modelCampaignPhonebook = CampaignPhonebook::model()->findAll( - array( + [ 'condition' => 'id_campaign = :key', - 'params' => array(':key' => $campaign->id), + 'params' => [':key' => $campaign->id], 'order' => 'RAND()', - ) + ] ); - $ids_phone_books = array(); + $ids_phone_books = []; foreach ($modelCampaignPhonebook as $key => $phonebook) { $ids_phone_books[] = $phonebook->id_phonebook; } @@ -104,7 +104,7 @@ public function run($args) echo 'Found ' . count($modelPhoneNumber) . ' Numbers in Campaign ' . "\n"; } - if (!isset($modelPhoneNumber[0])) { + if ( ! isset($modelPhoneNumber[0])) { if ($this->debug >= 1) { echo "NO PHONE FOR CALL" . "\n\n\n"; } @@ -122,7 +122,7 @@ public function run($args) } $i = 0; - $ids = array(); + $ids = []; $sleepNext = 1; foreach ($modelPhoneNumber as $phone) { @@ -132,10 +132,10 @@ public function run($args) $criteria = new CDbCriteria(); $criteria->addInCondition('id', $ids); PhoneNumber::model()->updateAll( - array( + [ 'status' => '2', 'try' => new CDbExpression('try + 1'), - ), + ], $criteria ); @@ -146,7 +146,7 @@ public function run($args) $destination = $phone->number; if ($campaign->restrict_phone == 1) { - $modelCampaignRestrictPhone = CampaignRestrictPhone::model()->find('number = :key', array(':key' => $destination)); + $modelCampaignRestrictPhone = CampaignRestrictPhone::model()->find('number = :key', [':key' => $destination]); if (isset($modelCampaignRestrictPhone->id)) { $phone->status = 4; @@ -170,7 +170,7 @@ public function run($args) continue; } - if (!strlen($destination)) { + if ( ! strlen($destination)) { $phone->status = 0; $phone->save(); if ($this->debug >= 1) { @@ -183,7 +183,7 @@ public function run($args) $searchTariff = Plan::model()->searchTariff($id_plan, $destination); - if (!isset($searchTariff[1][0])) { + if ( ! isset($searchTariff[1][0])) { $phone->status = 0; $phone->save(); if ($this->debug >= 1) { @@ -218,7 +218,7 @@ public function run($args) break; } - if (!isset($idTrunk) || $idTrunk < 1) { + if ( ! isset($idTrunk) || $idTrunk < 1) { continue; } diff --git a/protected/commands/NotifyClientCommand.php b/protected/commands/NotifyClientCommand.php index 556a66535..fb11e2973 100755 --- a/protected/commands/NotifyClientCommand.php +++ b/protected/commands/NotifyClientCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -35,10 +35,10 @@ public function run($args) $filter = 'credit_notification > 0 AND active = 1 AND credit + creditlimit < credit_notification AND ' . $delayClause; - $modelUser = User::model()->findAll(array( + $modelUser = User::model()->findAll([ 'condition' => $filter, 'order' => 'id', - )); + ]); foreach ($modelUser as $user) { if ($user->id_user == null || $user->id_user == '') { @@ -46,9 +46,9 @@ public function run($args) $user->save(); } - $modelSmtp = Smtps::model()->find('id_user = :key', array(':key' => $user->id_user)); + $modelSmtp = Smtps::model()->find('id_user = :key', [':key' => $user->id_user]); - if (!isset($modelSmtp->id)) { + if ( ! isset($modelSmtp->id)) { continue; } diff --git a/protected/commands/NotifyClientDailyCommand.php b/protected/commands/NotifyClientDailyCommand.php index 797821eac..a32ffc34e 100755 --- a/protected/commands/NotifyClientDailyCommand.php +++ b/protected/commands/NotifyClientDailyCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -22,15 +22,15 @@ class NotifyClientDailyCommand extends ConsoleCommand public function run($args) { - $modelUser = User::model()->findAll(array( + $modelUser = User::model()->findAll([ 'condition' => 'credit_notification_daily = 1', - )); + ]); foreach ($modelUser as $user) { - $modelSmtp = Smtps::model()->find('id_user = :key', array(':key' => $user->id_user)); + $modelSmtp = Smtps::model()->find('id_user = :key', [':key' => $user->id_user]); - if (!isset($modelSmtp->id)) { + if ( ! isset($modelSmtp->id)) { continue; } diff --git a/protected/commands/PhoneBooksReprocessCommand.php b/protected/commands/PhoneBooksReprocessCommand.php index 663344f74..d7641983d 100755 --- a/protected/commands/PhoneBooksReprocessCommand.php +++ b/protected/commands/PhoneBooksReprocessCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -25,9 +25,9 @@ public function run($args) $modelCampaign = Campaign::model()->findAll('status = 1 AND auto_reprocess = 1'); foreach ($modelCampaign as $key => $campaign) { - $modelCampaignPhonebook = CampaignPhonebook::model()->findAll('id_campaign = :key', array(':key' => $campaign->id)); + $modelCampaignPhonebook = CampaignPhonebook::model()->findAll('id_campaign = :key', [':key' => $campaign->id]); - if (!isset($modelCampaignPhonebook[0]->id_phonebook)) { + if ( ! isset($modelCampaignPhonebook[0]->id_phonebook)) { continue; } @@ -49,7 +49,7 @@ public function run($args) $criteria = new CDbCriteria; $criteria->addInCondition('id_phonebook', $ids_phone_books); $criteria->addCondition('status = 2'); - PhoneNumber::model()->updateAll(array('status' => 1, 'try' => 0), $criteria); + PhoneNumber::model()->updateAll(['status' => 1, 'try' => 0], $criteria); } } } diff --git a/protected/commands/PlanCheckCommand.php b/protected/commands/PlanCheckCommand.php index c32f56378..2b0ea156b 100755 --- a/protected/commands/PlanCheckCommand.php +++ b/protected/commands/PlanCheckCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -23,15 +23,15 @@ public function run($args) { $this->debug = 10; - $modelOfferUse = OfferUse::model()->findAll(array( + $modelOfferUse = OfferUse::model()->findAll([ 'condition' => '(releasedate IS NULL OR releasedate < :key) AND status = 1', - 'params' => array( + 'params' => [ ':key' => '1984-01-01 00:00:00', - ), - ) + ], + ] ); - if (!count($modelOfferUse)) { + if ( ! count($modelOfferUse)) { if ($this->debug >= 1) { echo " NO PLAN IN USE "; } @@ -89,9 +89,9 @@ public function run($args) $refill->save(); User::model()->updateByPk($offerUse->idUser->id, - array( + [ 'credit' => new CDbExpression('credit - ' . $offerUse->idOffer->price), - ) + ] ); $mail = new Mail(Mail::$TYPE_PLAN_PAID, $offerUse->idUser->id); @@ -133,9 +133,9 @@ public function run($args) $refill->save(); User::model()->updateByPk($offerUse->idUser->id, - array( + [ 'credit' => new CDbExpression('credit - ' . $offerUse->idOffer->price), - ) + ] ); $mail = new Mail(Mail::$TYPE_PLAN_PAID, $offerUse->idUser->id); @@ -152,7 +152,7 @@ public function run($args) $offerUse->releasedate = date('Y-m-d H:i:s'); $offerUse->status = 0; $offerUse->save(); - User::model()->updateByPk((int) $offerUse->idUser->id, array('id_offer' => 0)); + User::model()->updateByPk((int) $offerUse->idUser->id, ['id_offer' => 0]); $mail = new Mail(Mail::$TYPE_PLAN_RELEASED, $offerUse->idUser->id); $mail->replaceInEmail(Mail::$PLAN_LABEL, $offerUse->idOffer->label); diff --git a/protected/commands/PortabilidadeCommand.php b/protected/commands/PortabilidadeCommand.php index f0ae68d5d..a1b931858 100755 --- a/protected/commands/PortabilidadeCommand.php +++ b/protected/commands/PortabilidadeCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/commands/ServicesCheckCommand.php b/protected/commands/ServicesCheckCommand.php index 69e886198..ac5819999 100755 --- a/protected/commands/ServicesCheckCommand.php +++ b/protected/commands/ServicesCheckCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -19,17 +19,17 @@ */ class ServicesCheckCommand extends ConsoleCommand { - private $userNotify = array(); + private $userNotify = []; private $next_due_date; private $days_remaining; public function run($args) { - $modelServiceUser = ServicesUse::model()->findAll(array( + $modelServiceUser = ServicesUse::model()->findAll([ 'condition' => 'status=1', - )); + ]); - if (!count($modelServiceUser)) { + if ( ! count($modelServiceUser)) { if ($this->debug >= 1) { echo " NO SERVICE IN USE "; } @@ -145,7 +145,7 @@ public function checkIfUserHaveCredit($service) public function notifyUser($service, $type) { - if (!in_array($service->idUser, $this->userNotify)) { + if ( ! in_array($service->idUser, $this->userNotify)) { echo 'Send notify email'; $this->userNotify[] = $service->idUser; diff --git a/protected/commands/SipProxyAccountsCommand.php b/protected/commands/SipProxyAccountsCommand.php index 0fee547ad..50e8adb50 100755 --- a/protected/commands/SipProxyAccountsCommand.php +++ b/protected/commands/SipProxyAccountsCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/commands/SmsCommand.php b/protected/commands/SmsCommand.php index 2b1868e01..ced4d653f 100755 --- a/protected/commands/SmsCommand.php +++ b/protected/commands/SmsCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -30,7 +30,7 @@ public function run($args) { $UNIX_TIMESTAMP = "UNIX_TIMESTAMP("; - $tab_day = array(1 => 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'); + $tab_day = [1 => 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']; $num_day = date('N'); $name_day = $tab_day[$num_day]; @@ -39,18 +39,18 @@ public function run($args) $filter = 'status = :key1 AND type = :key0 AND ' . $name_day . ' = :key1 AND startingdate <= :key2 AND expirationdate > :key2 AND daily_start_time <= :key3 AND daily_stop_time > :key3'; - $params = array( + $params = [ ':key0' => 0, ':key1' => 1, ':key2' => date('Y-m-d H:i:s'), ':key3' => date('H:i:s'), - ); + ]; - $modelCampaign = Campaign::model()->findAll(array( + $modelCampaign = Campaign::model()->findAll([ 'condition' => $filter, 'params' => $params, - )); + ]); if ($this->debug >= 1) { echo "\nFound " . count($modelCampaign) . " Campaign\n\n"; @@ -63,8 +63,8 @@ public function run($args) } //get all campaign phonebook - $modelCampaignPhonebook = CampaignPhonebook::model()->findAll('id_campaign = :key', array(':key' => $campaign->id)); - $ids_phone_books = array(); + $modelCampaignPhonebook = CampaignPhonebook::model()->findAll('id_campaign = :key', [':key' => $campaign->id]); + $ids_phone_books = []; foreach ($modelCampaignPhonebook as $key => $phonebook) { $ids_phone_books[] = $phonebook->id_phonebook; } @@ -81,7 +81,7 @@ public function run($args) echo 'Found ' . count($modelPhoneNumber) . ' Numbers in Campaign ' . "\n"; } - if (!count($modelPhoneNumber)) { + if ( ! count($modelPhoneNumber)) { if ($this->debug >= 1) { echo "NO PHONE FOR CALL" . "\n\n\n"; } @@ -115,7 +115,7 @@ public function run($args) $text = preg_replace("/\%email\%/", $sms->email, $text); $text = preg_replace("/\%info\%/", $sms->info, $text); - if ($sms->number == '' || !is_numeric($sms->number)) { + if ($sms->number == '' || ! is_numeric($sms->number)) { PhoneNumber::model()->deleteByPk((int) $sms->id); continue; } diff --git a/protected/commands/SsmtpConfigCommand.php b/protected/commands/SsmtpConfigCommand.php index 404872e06..a6567ac93 100755 --- a/protected/commands/SsmtpConfigCommand.php +++ b/protected/commands/SsmtpConfigCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/commands/StatusSystemCommand.php b/protected/commands/StatusSystemCommand.php index 3e665c5ba..3cc07e0fa 100755 --- a/protected/commands/StatusSystemCommand.php +++ b/protected/commands/StatusSystemCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -52,7 +52,7 @@ public function run($args) foreach ($byGroup as $time => $group) { $cps = count($group); $hour_minute = date('Y-m-d H:i', $time) . ':00'; - if (!isset($old_CPS[$hour_minute])) { + if ( ! isset($old_CPS[$hour_minute])) { $old_CPS[$hour_minute] = 0; } if ($cps > $old_CPS[$hour_minute]) { @@ -90,8 +90,8 @@ public function run($args) break; } } - $networkin = !isset($rx1) ? 0 : (($rx2 - $rx1) / 1000) / 10; - $networkout = !isset($tx1) ? 0 : (($tx2 - $tx1) / 1000) / 10; + $networkin = ! isset($rx1) ? 0 : (($rx2 - $rx1) / 1000) / 10; + $networkout = ! isset($tx1) ? 0 : (($tx2 - $tx1) / 1000) / 10; $memory = $sysinfo->memory(); @@ -125,7 +125,7 @@ public function run($args) } public function group_by($key, $data) { - $result = array(); + $result = []; foreach ($data as $val) { if (array_key_exists($key, $val)) { @@ -154,8 +154,8 @@ class average_rate_calculator public function __construct(&$storage_array, $max_age) { $this->_max_age = $max_age; - if (!is_array($storage_array)) { - $storage_array = array(); + if ( ! is_array($storage_array)) { + $storage_array = []; } $this->_values = &$storage_array; } @@ -165,7 +165,7 @@ public function __construct(&$storage_array, $max_age) */ public function add($value, $timestamp = null) { - if (!$timestamp) { + if ( ! $timestamp) { $timestamp = time(); } @@ -178,7 +178,7 @@ public function average() { $this->_clean(); - $avgs = array(); + $avgs = []; $last_time = false; $last_val = false; foreach ($this->_values as $time => $val) { @@ -219,7 +219,7 @@ public function rfts($strFileName, $intLines = 0, $intBytes = 4096, $booErrorRep if (file_exists($strFileName)) { if ($fd = fopen($strFileName, 'r')) { - while (!feof($fd)) { + while ( ! feof($fd)) { $strFile .= fgets($fd, $intBytes); if ($intLines <= $intCurLine && $intLines != 0) { break; @@ -256,7 +256,7 @@ public function chostname() // get the IP address of our canonical hostname public function ip_addr() { - if (!($result = getenv('SERVER_ADDR'))) { + if ( ! ($result = getenv('SERVER_ADDR'))) { $result = gethostbyname($this->chostname()); } return $result; @@ -295,8 +295,8 @@ public function cpu_info() if ($bufr != "ERROR") { $bufe = explode("\n", $bufr); - $results = array('cpus' => 0, 'bogomips' => 0); - $ar_buf = array(); + $results = ['cpus' => 0, 'bogomips' => 0]; + $ar_buf = []; foreach ($bufe as $buf) { if (trim($buf) != "") { @@ -378,7 +378,7 @@ public function network() //$rx recebe //$tx envia - $results = array(); + $results = []; $bufr = $this->rfts('/proc/net/dev'); if ($bufr != "ERROR") { @@ -390,7 +390,7 @@ public function network() $dev_name = trim($dev_name); $stats = preg_split('/\s+/', trim($stats_list)); - $results[$dev_name] = array(); + $results[$dev_name] = []; $results[$dev_name]['rx_bytes'] = $stats[0]; $results[$dev_name]['rx_packets'] = $stats[1]; @@ -413,9 +413,9 @@ public function network() public function memory() { - $results['ram'] = array(); - $results['swap'] = array(); - $results['devswap'] = array(); + $results['ram'] = []; + $results['swap'] = []; + $results['devswap'] = []; $bufr = $this->rfts('/proc/meminfo'); if ($bufr != "ERROR") { @@ -469,7 +469,7 @@ public function memory() for ($i = 1; $i < (sizeof($swaps)); $i++) { if (trim($swaps[$i]) != "") { $ar_buf = preg_split('/\s+/', $swaps[$i], 6); - $results['devswap'][$i - 1] = array(); + $results['devswap'][$i - 1] = []; $results['devswap'][$i - 1]['dev'] = $ar_buf[0]; $results['devswap'][$i - 1]['total'] = $ar_buf[2]; $results['devswap'][$i - 1]['used'] = $ar_buf[3]; @@ -520,14 +520,14 @@ public function execute_program($programname, $args = '', $booErrorRep = true) echo $program . $args; if ($fp = popen("($program $args > /dev/null) 3>&1 1>&2 2>&3", 'r')) { print_r($fp); - while (!feof($fp)) { + while ( ! feof($fp)) { $buffer .= fgets($fp, 4096); } pclose($fp); $buffer = trim($buffer); } if ($fp = popen("$program $args", 'r')) { - while (!feof($fp)) { + while ( ! feof($fp)) { $buffer .= fgets($fp, 4096); } pclose($fp); @@ -542,8 +542,8 @@ public function find_program($program) { global $addpaths; - $path = array('/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', - '/usr/local/sbin'); + $path = ['/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', + '/usr/local/sbin']; if (isset($addpaths) && is_array($addpaths)) { $path = array_merge($path, $addpaths); @@ -559,7 +559,6 @@ public function find_program($program) } else { return strpos($program, '.exe'); } - ; return; } @@ -568,7 +567,7 @@ public function loadavg($bar = false) { $buf = $this->rfts('/proc/loadavg'); if ($buf == "ERROR") { - $results['avg'] = array('N.A.', 'N.A.', 'N.A.'); + $results['avg'] = ['N.A.', 'N.A.', 'N.A.']; } else { $results['avg'] = preg_split("/\s/", $buf, 4); unset($results['avg'][3]); // don't need the extra values, only first three diff --git a/protected/commands/TrunkSIPCodesCommand.php b/protected/commands/TrunkSIPCodesCommand.php index 4fb6b81be..b010be01f 100755 --- a/protected/commands/TrunkSIPCodesCommand.php +++ b/protected/commands/TrunkSIPCodesCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/commands/UpdateMysqlCommand.php b/protected/commands/UpdateMysqlCommand.php index 4fa707b9d..e0f9ff05f 100755 --- a/protected/commands/UpdateMysqlCommand.php +++ b/protected/commands/UpdateMysqlCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/commands/UserDiskSpaceCommand.php b/protected/commands/UserDiskSpaceCommand.php index 835c770c2..bc8bc9325 100755 --- a/protected/commands/UserDiskSpaceCommand.php +++ b/protected/commands/UserDiskSpaceCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/AccessManager.php b/protected/components/AccessManager.php index f7676c378..f48ae6552 100755 --- a/protected/components/AccessManager.php +++ b/protected/components/AccessManager.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Heitor Gianastasio Pipet de Oliveira. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/ApiAccess.php b/protected/components/ApiAccess.php index 0068379dd..f5cc883e6 100755 --- a/protected/components/ApiAccess.php +++ b/protected/components/ApiAccess.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/ConsoleCommand.php b/protected/components/ConsoleCommand.php index b9228ddbd..cd16615c9 100755 --- a/protected/components/ConsoleCommand.php +++ b/protected/components/ConsoleCommand.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/CsvExport.php b/protected/components/CsvExport.php index cee393539..cd746bef4 100755 --- a/protected/components/CsvExport.php +++ b/protected/components/CsvExport.php @@ -11,7 +11,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v3 diff --git a/protected/components/LoadConfig.php b/protected/components/LoadConfig.php index f3563cd91..bb7075ec3 100755 --- a/protected/components/LoadConfig.php +++ b/protected/components/LoadConfig.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/Model.php b/protected/components/Model.php index 4f6e45902..dfcebcb1a 100755 --- a/protected/components/Model.php +++ b/protected/components/Model.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/Portabilidade.php b/protected/components/Portabilidade.php index b50c721f9..d51c7db7b 100755 --- a/protected/components/Portabilidade.php +++ b/protected/components/Portabilidade.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/Process.php b/protected/components/Process.php index 85d06ad8b..5aef0e00b 100755 --- a/protected/components/Process.php +++ b/protected/components/Process.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/Report.php b/protected/components/Report.php index e0f88c931..6351e99ca 100755 --- a/protected/components/Report.php +++ b/protected/components/Report.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/SLUserSave.php b/protected/components/SLUserSave.php index 5abeb3d7c..c2d714399 100755 --- a/protected/components/SLUserSave.php +++ b/protected/components/SLUserSave.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -24,18 +24,18 @@ public static function saveUserSLCurl($modelUser, $SLAppToken, $SLAccessToken, $ { $url = "http://api.superlogica.net:80/v2/financeiro/clientes"; $params = ["ST_NOME_SAC" => $modelUser->firstname . ' ' . $modelUser->lastname, - "ST_NOMEREF_SAC" => $modelUser->username, - "ST_DIAVENCIMENTO_SAC" => date('d'), - "ST_CGC_SAC " => $modelUser->doc, - "ST_CEP_SAC" => $modelUser->zipcode, - "ST_ENDERECO_SAC" => $modelUser->address, - "ST_CIDADE_SAC" => $modelUser->city, - "ST_ESTADO_SAC" => $modelUser->state, - "ST_EMAIL_SAC" => $modelUser->email, - "SENHA" => $modelUser->password, - "SENHA_CONFIRMACAO" => $modelUser->password, - "ST_TELEFONE_SAC" => $modelUser->phone, - "ST_ENDERECOENTREGA_SAC" => $modelUser->address, + "ST_NOMEREF_SAC" => $modelUser->username, + "ST_DIAVENCIMENTO_SAC" => date('d'), + "ST_CGC_SAC " => $modelUser->doc, + "ST_CEP_SAC" => $modelUser->zipcode, + "ST_ENDERECO_SAC" => $modelUser->address, + "ST_CIDADE_SAC" => $modelUser->city, + "ST_ESTADO_SAC" => $modelUser->state, + "ST_EMAIL_SAC" => $modelUser->email, + "SENHA" => $modelUser->password, + "SENHA_CONFIRMACAO" => $modelUser->password, + "ST_TELEFONE_SAC" => $modelUser->phone, + "ST_ENDERECOENTREGA_SAC" => $modelUser->address, ]; $ch = curl_init(); @@ -90,14 +90,14 @@ public static function criarBoleto($methodPay, $modelUser) ]); $SLparams = ["ID_SACADO_SAC" => $modelUser->id_sacado_sac, - "ST_NOMEREF_SAC" => $modelUser->username, - "COMPO_RECEBIMENTO" => [[ + "ST_NOMEREF_SAC" => $modelUser->username, + "COMPO_RECEBIMENTO" => [[ 'ID_PRODUTO_PRD' => $methodPay->SLIdProduto, "VL_UNITARIO_PRD" => $_GET['amount'], "NM_QUANTIDADE_COMP" => 1, ]], - "VL_EMITIDO_RECB" => $_GET['amount'], - "DT_VENCIMENTO_RECB" => date("m/d/Y", mktime(0, 0, 0, date("m"), date("d") + 7, date("Y"))), + "VL_EMITIDO_RECB" => $_GET['amount'], + "DT_VENCIMENTO_RECB" => date("m/d/Y", mktime(0, 0, 0, date("m"), date("d") + 7, date("Y"))), ]; diff --git a/protected/components/SearchTariff.php b/protected/components/SearchTariff.php index 6b9b21b18..59ac096ed 100755 --- a/protected/components/SearchTariff.php +++ b/protected/components/SearchTariff.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/ServicesProcess.php b/protected/components/ServicesProcess.php index f2be5956a..b868c4511 100755 --- a/protected/components/ServicesProcess.php +++ b/protected/components/ServicesProcess.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/SmsSend.php b/protected/components/SmsSend.php index 4eb789bd4..1b31ede9e 100755 --- a/protected/components/SmsSend.php +++ b/protected/components/SmsSend.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/SqlInject.php b/protected/components/SqlInject.php index 66590a24f..bc0ff6fb1 100755 --- a/protected/components/SqlInject.php +++ b/protected/components/SqlInject.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/Tts.php b/protected/components/Tts.php index c0ceb1d5e..1c0a39c1a 100755 --- a/protected/components/Tts.php +++ b/protected/components/Tts.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/UserCreditManager.php b/protected/components/UserCreditManager.php index 166d2a098..1bc693cc6 100755 --- a/protected/components/UserCreditManager.php +++ b/protected/components/UserCreditManager.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/components/Util.php b/protected/components/Util.php index 5ce244297..cdb0480da 100755 --- a/protected/components/Util.php +++ b/protected/components/Util.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/config/cron.php b/protected/config/cron.php index c7d421dd0..02f06eb33 100755 --- a/protected/config/cron.php +++ b/protected/config/cron.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -19,13 +19,13 @@ */ $configFile = '/etc/asterisk/res_config_mysql.conf'; $array = parse_ini_file($configFile); -return array( +return [ 'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..', 'name' => 'cron', - 'preload' => array('log'), + 'preload' => ['log'], 'language' => 'en', 'sourceLanguage' => 'en', - 'import' => array( + 'import' => [ 'application.models.*', 'application.components.*', 'application.components.AGI.*', @@ -33,48 +33,48 @@ 'ext.phpAGI.AGI', 'ext.phpAGI.AGI_AsteriskManager', 'ext.fpdf.FPDF', - ), - 'components' => array( - 'mail' => array( + ], + 'components' => [ + 'mail' => [ 'class' => 'ext.yii-mail.YiiMail', 'transportType' => 'smtp', - 'transportOptions' => array( + 'transportOptions' => [ 'host' => '', 'encryption' => '', 'username' => '', 'password' => '', 'port' => '', 'encryption' => '', - ), + ], 'viewPath' => 'application.views.mails', 'logging' => true, 'dryRun' => false, - ), - 'db' => array( + ], + 'db' => [ 'connectionString' => 'mysql:host=' . $array['dbhost'] . ';dbname=' . $array['dbname'] . '', 'emulatePrepare' => true, 'username' => $array['dbuser'], 'password' => $array['dbpass'], 'charset' => 'utf8', - 'attributes' => array( + 'attributes' => [ PDO::MYSQL_ATTR_LOCAL_INFILE => true, - ), - ), - 'coreMessages' => array( + ], + ], + 'coreMessages' => [ 'basePath' => 'locale/php', - ), - 'log' => array( + ], + 'log' => [ 'class' => 'CLogRouter', - 'routes' => array( - array( + 'routes' => [ + [ 'class' => 'CFileLogRoute', 'logFile' => 'cron.log', 'levels' => 'error, fatal', - ), - ), - ), - 'cache' => array( + ], + ], + ], + 'cache' => [ 'class' => 'system.caching.CDbCache', - ), - ), -); + ], + ], +]; diff --git a/protected/config/main.php b/protected/config/main.php index 1f3cf9e09..308923e19 100755 --- a/protected/config/main.php +++ b/protected/config/main.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -20,12 +20,12 @@ $configFile = '/etc/asterisk/res_config_mysql.conf'; $array = parse_ini_file($configFile); -return array( +return [ 'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..', 'name' => 'MagnusBilling', - 'preload' => array('log'), + 'preload' => ['log'], # autoload das models e componentes - 'import' => array( + 'import' => [ 'application.models.*', 'application.components.*', 'application.components.AGI.*', @@ -33,66 +33,66 @@ 'ext.phpAGI.AGI', 'ext.phpAGI.AGI_AsteriskManager', 'ext.fpdf.FPDF', - ), + ], # application components - 'components' => array( + 'components' => [ # criacao de urls amigaveis - 'urlManager' => array( + 'urlManager' => [ 'urlFormat' => 'path', - 'rules' => array( + 'rules' => [ '/' => '/view', '//' => '/', '/' => '/', - ), - ), - 'mail' => array( + ], + ], + 'mail' => [ 'class' => 'ext.yii-mail.YiiMail', 'transportType' => 'smtp', - 'transportOptions' => array( + 'transportOptions' => [ 'host' => '', 'encryption' => '', 'username' => '', 'password' => '', 'port' => '', 'encryption' => '', - ), + ], 'viewPath' => 'application.views.mails', 'logging' => true, 'dryRun' => false, - ), + ], # configuracao da conexao com banco de dados - 'db' => array( + 'db' => [ 'connectionString' => 'mysql:host=' . $array['dbhost'] . ';dbname=' . $array['dbname'] . '', 'emulatePrepare' => true, 'username' => $array['dbuser'], 'password' => $array['dbpass'], 'charset' => 'utf8', - 'attributes' => array( + 'attributes' => [ PDO::MYSQL_ATTR_LOCAL_INFILE => true, - ), + ], //'enableProfiling' => true, - ), - 'coreMessages' => array( + ], + 'coreMessages' => [ 'basePath' => 'resources/locale/php', - ), + ], # exibicao dos logs de erro - 'log' => array( + 'log' => [ 'class' => 'CLogRouter', - 'routes' => array( - array( + 'routes' => [ + [ 'class' => 'CFileLogRoute', 'levels' => 'error, fatal', - ), + ], # desabilitar para exibir logs da aplicacao /*array( 'class'=>'CWebLogRoute', ),*/ - ), - ), - 'cache' => array( + ], + ], + 'cache' => [ 'class' => 'system.caching.CDbCache', - ), - ), -); + ], + ], +]; diff --git a/protected/config/permissions.php b/protected/config/permissions.php index b243211d0..9c4a2b743 100755 --- a/protected/config/permissions.php +++ b/protected/config/permissions.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Heitor Gianastasio Pipet de Oliveira. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -18,6 +18,6 @@ * */ -return array( - 'only_admin' => array('refillprovider', 'provider', 'trunk', 'configuration'), -); +return [ + 'only_admin' => ['refillprovider', 'provider', 'trunk', 'configuration'], +]; diff --git a/protected/controllers/AlarmController.php b/protected/controllers/AlarmController.php index 73ab42935..15d21d602 100755 --- a/protected/controllers/AlarmController.php +++ b/protected/controllers/AlarmController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -23,15 +23,15 @@ class AlarmController extends Controller { public $attributeOrder = 't.id'; - public $extraValues = array('idPlan' => 'name'); + public $extraValues = ['idPlan' => 'name']; - public $fieldsFkReport = array( - 'id_user' => array( + public $fieldsFkReport = [ + 'id_user' => [ 'table' => 'pkg_plan', 'pk' => 'id', 'fieldReport' => 'name', - ), - ); + ], + ]; public function init() { diff --git a/protected/controllers/ApiController.php b/protected/controllers/ApiController.php index 36fec9cbe..1bd465c0e 100755 --- a/protected/controllers/ApiController.php +++ b/protected/controllers/ApiController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -23,15 +23,15 @@ class ApiController extends Controller { public $attributeOrder = 't.id'; - public $extraValues = array('idUser' => 'username'); + public $extraValues = ['idUser' => 'username']; - public $fieldsFkReport = array( - 'id_user' => array( + public $fieldsFkReport = [ + 'id_user' => [ 'table' => 'pkg_user', 'pk' => 'id', 'fieldReport' => 'username', - ), - ); + ], + ]; public function init() { diff --git a/protected/controllers/AtaController.php b/protected/controllers/AtaController.php index 8a4028835..64b0f855d 100755 --- a/protected/controllers/AtaController.php +++ b/protected/controllers/AtaController.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -42,9 +42,9 @@ public function actionIndex() $Profile_Rule = "http://" . $proxy . "/mbilling/index.php/ata?mac=$mac"; $modelo = explode(" ", $_SERVER["HTTP_USER_AGENT"]); - $modelSipuras = Sipuras::model()->find('macadr = :mac', array(':mac' => $mac)); + $modelSipuras = Sipuras::model()->find('macadr = :mac', [':mac' => $mac]); - if (!isset($modelSipuras->id)) { + if ( ! isset($modelSipuras->id)) { echo 'Ata no found'; $info = 'Username or password is wrong - User ' . $mac . ' from IP - ' . $_SERVER['REMOTE_ADDR']; Yii::log($info, 'error'); @@ -62,7 +62,7 @@ public function actionIndex() $modelSipuras->fultlig = $date; //verfica se a senha da linha 1 foi alterada - $modelSip = Sip::model()->find('name = :name', array(':name' => $modelSipuras->User_ID_1)); + $modelSip = Sip::model()->find('name = :name', [':name' => $modelSipuras->User_ID_1]); if (isset($modelSip->id) && $modelSip->secret != $modelSipuras->Password_1) { $modelSipuras->Password_1 = $modelSip->secret; @@ -71,7 +71,7 @@ public function actionIndex() } //verfica se a senha da linha 2 foi alterada - $modelSip = Sip::model()->find("name = :name", array(':name' => $modelSipuras->User_ID_2)); + $modelSip = Sip::model()->find("name = :name", [':name' => $modelSipuras->User_ID_2]); if (isset($modelSip->id) && $modelSip->secret != $modelSipuras->Password_2) { $modelSipuras->Password_2 = $modelSip->secret; diff --git a/protected/controllers/AuthenticationController.php b/protected/controllers/AuthenticationController.php index b7e06f024..77e3c7708 100755 --- a/protected/controllers/AuthenticationController.php +++ b/protected/controllers/AuthenticationController.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/BackupController.php b/protected/controllers/BackupController.php index 2a69290ad..faf4c719b 100755 --- a/protected/controllers/BackupController.php +++ b/protected/controllers/BackupController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/Call0800WebController.php b/protected/controllers/Call0800WebController.php index 2248ac167..d8fa135f8 100755 --- a/protected/controllers/Call0800WebController.php +++ b/protected/controllers/Call0800WebController.php @@ -10,7 +10,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -30,23 +30,23 @@ public function actionIndex() Yii::app()->setLanguage($this->config['global']['base_language']); - if (!isset($_REQUEST['number'])) { + if ( ! isset($_REQUEST['number'])) { - $this->render('index', array( + $this->render('index', [ 'send' => false, - )); + ]); } else { $destination = isset($_REQUEST['number']) ? $_REQUEST['number'] : ''; $user = isset($_GET['user']) ? $_GET['user'] : ''; - $model = Sip::model()->find("name = :user", array(':user' => $user)); + $model = Sip::model()->find("name = :user", [':user' => $user]); - if (!isset($model->id)) { + if ( ! isset($model->id)) { - $model = Iax::model()->find("name = :user", array(':user' => $user)); - if (!isset($model->id)) { + $model = Iax::model()->find("name = :user", [':user' => $user]); + if ( ! isset($model->id)) { $error_msg = Yii::t('zii', 'Error : User no Found!'); echo $error_msg; exit; @@ -79,9 +79,9 @@ public function actionIndex() AsteriskAccess::generateCallFile($call); - $this->render('index', array( + $this->render('index', [ 'send' => true, - )); + ]); } @@ -96,13 +96,13 @@ public function actionCallback() Yii::log(print_r($data, true), 'error'); - if (!isset($data[2])) { + if ( ! isset($data[2])) { echo 'Your number is required'; } else if (strlen($data[2]) < 4) { echo 'The minimum length for your number is 4'; - } else if (!isset($data[3])) { + } else if ( ! isset($data[3])) { echo 'Destination is required'; } else if (strlen($data[3]) < 4) { @@ -115,7 +115,7 @@ public function actionCallback() $modelSip = AccessManager::checkAccess($user, $pass); - if (!isset($modelSip->id)) { + if ( ! isset($modelSip->id)) { echo 'User or password is invalid'; exit; } @@ -165,7 +165,7 @@ public function actionCallback() $callTrunk = $SearchTariff->find($yournumber, $modelSip->idUser->id_plan, $modelSip->idUser->id); $result = Plan::model()->searchTariff($modelSip->idUser->id_plan, $yournumber); - if (!is_array($result) || count($result) == 0) { + if ( ! is_array($result) || count($result) == 0) { return 0; } @@ -173,10 +173,10 @@ public function actionCallback() $result = $result[1]; //Select custom rate to user - $modelUserRate = UserRate::model()->find('id_prefix = :key AND id_user = :key1', array( + $modelUserRate = UserRate::model()->find('id_prefix = :key AND id_user = :key1', [ ':key' => $result[0]['id_prefix'], ':key1' => $modelSip->idUser->id, - )); + ]); //change custom rate to user if (count($modelUserRate)) { @@ -185,7 +185,7 @@ public function actionCallback() $result[0]['billingblock'] = $modelUserRate->billingblock; } - if (!is_array($callTrunk) || !count($callTrunk)) { + if ( ! is_array($callTrunk) || ! count($callTrunk)) { echo Yii::t('zii', 'Prefix not found to you number'); exit; } @@ -194,7 +194,7 @@ public function actionCallback() $callTrunkDestination = $SearchTariff->find($destination, $modelSip->idUser->id_plan, $modelSip->idUser->id); - if (!is_array($callTrunkDestination) || count($callTrunkDestination) == 0) { + if ( ! is_array($callTrunkDestination) || count($callTrunkDestination) == 0) { echo $sql; echo Yii::t('zii', 'Prefix not found to destination'); diff --git a/protected/controllers/CallAppController.php b/protected/controllers/CallAppController.php index 0be3e026b..2c0dd803f 100755 --- a/protected/controllers/CallAppController.php +++ b/protected/controllers/CallAppController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -47,7 +47,7 @@ public function int() public function actionIndex() { - if (!isset($_GET['number'])) { + if ( ! isset($_GET['number'])) { echo 'error, numer is necessary'; @@ -63,10 +63,10 @@ public function actionIndex() $modelPhoneNumber->save(); $idNumber = $modelPhoneNumber->getPrimaryKey(); - $array = array( + $array = [ 'msg' => 'success', 'id' => $idNumber, - ); + ]; echo json_encode($array); @@ -76,22 +76,22 @@ public function actionIndex() public function actionGetReturn() { - if (!isset($_GET['id'])) { + if ( ! isset($_GET['id'])) { - if (!isset($_GET['number'])) { + if ( ! isset($_GET['number'])) { echo 'error, numer is necessary'; exit; } $modelPhoneNumber = PhoneNumber::model()->find( - array( + [ 'condition' => 'id_phonebook = :id_phonebook AND number = :destination AND name = :name', - 'params' => array( + 'params' => [ ':id_phonebook' => $this->id_phonebook, ':destination' => $this->destination, ':name' => $this->name, - ), - ) + ], + ] ); } else { $modelPhoneNumber = PhoneNumber::model()->findByPk((int) $_GET['id']); @@ -105,19 +105,19 @@ public function actionGetReturn() $msg = 'Invalid Number'; } - $array = array( + $array = [ 'msg' => $msg, 'status' => $status, - ); + ]; echo json_encode($array); } public function getIdPhoneBook() { - $modelUser = User::model()->find("username = :username", array(':username' => $this->user)); + $modelUser = User::model()->find("username = :username", [':username' => $this->user]); - if (!is_array($modelUser) || !count($modelUser)) { + if ( ! is_array($modelUser) || ! count($modelUser)) { $error_msg = Yii::t('zii', 'Error : User no Found!'); echo $error_msg; exit; @@ -126,20 +126,20 @@ public function getIdPhoneBook() $id_user = $modelUser->id; $modelCampaign = Campaign::model()->find("status = 1 AND id_user = :id_user", - array(':id_user' => $id_user) + [':id_user' => $id_user] ); if (is_array($modelUser) && count($modelCampaign)) { $modelCampaignPhonebook = CampaignPhonebook::model()->find("id_campaign = :id_campaign", - array(':id_campaign' => $modelCampaign->id) + [':id_campaign' => $modelCampaign->id] ); } else { echo "User not have campaign"; exit; } - if (!$modelCampaignPhonebook) { + if ( ! $modelCampaignPhonebook) { echo "Campaign not have PhoneBook"; exit; } diff --git a/protected/controllers/CallArchiveController.php b/protected/controllers/CallArchiveController.php index 85d619011..1818df796 100755 --- a/protected/controllers/CallArchiveController.php +++ b/protected/controllers/CallArchiveController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/CallBackController.php b/protected/controllers/CallBackController.php index bac6b0770..de0795ce6 100755 --- a/protected/controllers/CallBackController.php +++ b/protected/controllers/CallBackController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -23,10 +23,10 @@ class CallBackController extends Controller { public $attributeOrder = 't.id DESC'; - public $extraValues = array('idUser' => 'username', 'idDid' => 'did'); - public $fieldsInvisibleClient = array( + public $extraValues = ['idUser' => 'username', 'idDid' => 'did']; + public $fieldsInvisibleClient = [ 'variable', - ); + ]; public function init() { @@ -45,10 +45,10 @@ public function actionReprocesar($value = '') $filter = preg_replace('/t.status/', 'status', $filter); - CallBack::model()->updateAll(array('status' => '1', 'num_attempt' => 0, 'sessiontime' => 0), $filter, $this->paramsFilter); - echo json_encode(array( + CallBack::model()->updateAll(['status' => '1', 'num_attempt' => 0, 'sessiontime' => 0], $filter, $this->paramsFilter); + echo json_encode([ 'success' => true, 'msg' => $this->msgSuccess, - )); + ]); } } diff --git a/protected/controllers/CallController.php b/protected/controllers/CallController.php index 461b2cab5..02a58ada3 100755 --- a/protected/controllers/CallController.php +++ b/protected/controllers/CallController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/CallFailedController.php b/protected/controllers/CallFailedController.php index 111c34ca5..a57befc03 100755 --- a/protected/controllers/CallFailedController.php +++ b/protected/controllers/CallFailedController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/CallOnlineChartController.php b/protected/controllers/CallOnlineChartController.php index 7a85e8566..926a1d6bc 100755 --- a/protected/controllers/CallOnlineChartController.php +++ b/protected/controllers/CallOnlineChartController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -25,7 +25,7 @@ class CallOnlineChartController extends Controller public function init() { - if (!Yii::app()->session['id_user']) { + if ( ! Yii::app()->session['id_user']) { die("Access denied to save in module: CallOnlineChart"); exit; } @@ -65,18 +65,18 @@ public function actionRead($asJson = true, $condition = null) $group = 1; } - $modelCallOnlineChart = CallOnlineChart::model()->findAll(array( + $modelCallOnlineChart = CallOnlineChart::model()->findAll([ 'select' => $select, 'order' => 'id DESC', 'group' => $group, 'condition' => $filter, - )); + ]); # envia o json requisitado - echo json_encode(array( + echo json_encode([ $this->nameRoot => $this->getAttributesModels($modelCallOnlineChart, $this->extraValues), $this->nameCount => 0, - )); + ]); } diff --git a/protected/controllers/CallShopCdrController.php b/protected/controllers/CallShopCdrController.php index 07c06d942..b03f9f227 100755 --- a/protected/controllers/CallShopCdrController.php +++ b/protected/controllers/CallShopCdrController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -35,7 +35,7 @@ public function init() $_GET['filter'] = $_GET['filters']; } - if (!Yii::app()->session['id_user']) { + if ( ! Yii::app()->session['id_user']) { exit; } @@ -48,23 +48,23 @@ public function init() public function applyFilterToLimitedAdmi2() { if (Yii::app()->session['user_type'] == 1 && Yii::app()->session['adminLimitUsers'] == true) { - $this->relationFilter = array( - 'idUser' => array( + $this->relationFilter = [ + 'idUser' => [ 'condition' => "id_group IN (SELECT gug.id_group FROM pkg_group_user_group gug WHERE gug.id_group_user = :idgA0) ", - ), - ); + ], + ]; $this->paramsFilter['idgA0'] = Yii::app()->session['id_group']; } } public function getSumPrice() { - return $this->abstractModel->find(array( + return $this->abstractModel->find([ 'select' => "SUM(price) price", 'join' => $this->join, 'condition' => $this->filter, 'params' => $this->paramsFilter, - ) + ] ); } diff --git a/protected/controllers/CalleridController.php b/protected/controllers/CalleridController.php index 1a26565e2..0d7011c35 100755 --- a/protected/controllers/CalleridController.php +++ b/protected/controllers/CalleridController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -23,20 +23,20 @@ class CalleridController extends Controller { public $attributeOrder = 't.id'; - public $extraValues = array('idUser' => 'username'); - public $fieldsInvisibleClient = array( + public $extraValues = ['idUser' => 'username']; + public $fieldsInvisibleClient = [ 'tipo', 'tmp', 'idUserusername', - ); + ]; - public $fieldsFkReport = array( - 'id_user' => array( + public $fieldsFkReport = [ + 'id_user' => [ 'table' => 'pkg_user', 'pk' => 'id', 'fieldReport' => 'username', - ), - ); + ], + ]; public function init() { diff --git a/protected/controllers/CampaignController.php b/protected/controllers/CampaignController.php index f54715c33..871173fb4 100755 --- a/protected/controllers/CampaignController.php +++ b/protected/controllers/CampaignController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/CampaignDashBoardController.php b/protected/controllers/CampaignDashBoardController.php index efe2130f1..046e8e611 100755 --- a/protected/controllers/CampaignDashBoardController.php +++ b/protected/controllers/CampaignDashBoardController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -23,7 +23,7 @@ class CampaignDashBoardController extends Controller { public $attributeOrder = 't.id DESC'; - public $extraValues = array('idUser' => 'username'); + public $extraValues = ['idUser' => 'username']; private $uploaddir; public function init() @@ -50,35 +50,35 @@ public function setAttributesModels($attributes, $models) $pkCount = is_array($attributes) || is_object($attributes) ? $attributes : []; for ($i = 0; $i < count($pkCount); $i++) { //get all campaign phonebook - $modelCampaignPhonebook = CampaignPhonebook::model()->findAll('id_campaign = :key', array(':key' => $attributes[$i]['id'])); + $modelCampaignPhonebook = CampaignPhonebook::model()->findAll('id_campaign = :key', [':key' => $attributes[$i]['id']]); - $ids_phone_books = array(); + $ids_phone_books = []; foreach ($modelCampaignPhonebook as $key => $phonebook) { $ids_phone_books[] = $phonebook->id_phonebook; } //Calls Being Placed $modelCallOnline = CallOnLine::model()->count('id_user = :key AND sip_account LIKE :key1 ', - array( + [ ':key' => $attributes[$i]['id_user'], ':key1' => 'MC!' . $attributes[$i]['name'] . '%', - )); + ]); $attributes[$i]['callsPlaced'] = $modelCallOnline; // Calls Ringing $modelCallOnline = CallOnLine::model()->count('id_user = :key AND status LIKE :key1 ', - array( + [ ':key' => $attributes[$i]['id_user'], ':key1' => 'Ring%', - )); + ]); $attributes[$i]['callsringing'] = $modelCallOnline; //Calls in Transfer $modelCallOnline = CallOnLine::model()->count('id_user = :key AND status = :key1 ', - array( + [ ':key' => $attributes[$i]['id_user'], ':key1' => 'Up', - )); + ]); $attributes[$i]['callsInTransfer'] = $modelCallOnline; //Calls Transfered diff --git a/protected/controllers/CampaignPollController.php b/protected/controllers/CampaignPollController.php index c193ddbce..4e75a90f6 100755 --- a/protected/controllers/CampaignPollController.php +++ b/protected/controllers/CampaignPollController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/CampaignRestrictPhoneController.php b/protected/controllers/CampaignRestrictPhoneController.php index 6e4569029..a35731f9e 100755 --- a/protected/controllers/CampaignRestrictPhoneController.php +++ b/protected/controllers/CampaignRestrictPhoneController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -36,16 +36,16 @@ public function actionDeleteDuplicados() { $this->abstractModel->deleteDuplicatedrows(); - echo json_encode(array( + echo json_encode([ $this->nameSuccess => true, $this->nameMsg => 'Números duplicado deletados com successo', - )); + ]); } public function actionImportFromCsv() { - if (!Yii::app()->session['id_user'] || Yii::app()->session['isClient'] == true) { + if ( ! Yii::app()->session['id_user'] || Yii::app()->session['isClient'] == true) { exit(); } @@ -63,10 +63,10 @@ public function actionImportFromCsv() $this->importNumbers($handle, $values); fclose($handle); - echo json_encode(array( + echo json_encode([ $this->nameSuccess => true, 'msg' => $this->msgSuccess, - )); + ]); } else { parent::actionImportFromCsv(); } @@ -74,16 +74,16 @@ public function actionImportFromCsv() public function importNumbers($handle, $values) { - $sqlNumbersInsert = array(); + $sqlNumbersInsert = []; $sqlNumbersDelete = ''; while (($row = fgetcsv($handle, 32768, $values['delimiter'])) !== false) { if (isset($row[1])) { - if (!isset($row[0]) || $row[0] == '') { - echo json_encode(array( + if ( ! isset($row[0]) || $row[0] == '') { + echo json_encode([ $this->nameSuccess => false, 'errors' => 'Prefix not exit in the CSV file . Line: ' . print_r($row, true), - )); + ]); exit; } $number = preg_replace('/-/', '', trim($row[0])); @@ -107,10 +107,10 @@ public function importNumbers($handle, $values) $result = CampaignRestrictPhone::model()->insertNumbers($sqlNumbersInsert); if (isset($result->errorInfo)) { - echo json_encode(array( + echo json_encode([ $this->nameSuccess => false, 'errors' => $this->getErrorMySql($result), - )); + ]); exit; } } @@ -121,10 +121,10 @@ public function importNumbers($handle, $values) $result = CampaignRestrictPhone::model()->deleteNumbers($sqlNumbersDelete); if (isset($result->errorInfo)) { - echo json_encode(array( + echo json_encode([ $this->nameSuccess => false, 'errors' => $this->getErrorMySql($result), - )); + ]); exit; } } diff --git a/protected/controllers/ConfigurationController.php b/protected/controllers/ConfigurationController.php index 23921315c..50a59a513 100755 --- a/protected/controllers/ConfigurationController.php +++ b/protected/controllers/ConfigurationController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -35,55 +35,55 @@ public function init() public function actionLayout() { - if (!isset($_POST['status'])) { + if ( ! isset($_POST['status'])) { exit; } - $model = Configuration::model()->find('config_key = :config_key', array('config_key' => 'layout')); + $model = Configuration::model()->find('config_key = :config_key', ['config_key' => 'layout']); $model->status = $_POST['status']; if ($_POST['status'] == 0) { $model->config_value = 0; } $model->save(); - echo json_encode(array( + echo json_encode([ $this->nameSuccess => true, $this->nameMsg => '', - )); + ]); } public function actionTheme() { - if (!isset($_POST['field']) || !isset($_POST['value'])) { + if ( ! isset($_POST['field']) || ! isset($_POST['value'])) { exit; } $info = 'User change the theme ' . $_POST['value']; MagnusLog::insertLOG(2, $info); - $model = Configuration::model()->find('config_key = :config_key', array(':config_key' => $_POST['field'])); + $model = Configuration::model()->find('config_key = :config_key', [':config_key' => $_POST['field']]); $model->config_value = $_POST['value']; $model->save(); - echo json_encode(array( + echo json_encode([ $this->nameSuccess => true, $this->nameMsg => '', - )); + ]); } public function actionSetData() { - if (!isset($_POST)) { + if ( ! isset($_POST)) { exit; } - $model = Configuration::model()->find('config_key = :config_key', array('config_key' => 'admin_email')); + $model = Configuration::model()->find('config_key = :config_key', ['config_key' => 'admin_email']); $model->config_value = $_POST['email']; $model->save(); - $model = Configuration::model()->find('config_key = :config_key', array('config_key' => 'base_country')); + $model = Configuration::model()->find('config_key = :config_key', ['config_key' => 'base_country']); $model->config_value = $_POST['countryiso']; $model->save(); - $model = Configuration::model()->find('config_key = :config_key', array('config_key' => 'base_currency')); + $model = Configuration::model()->find('config_key = :config_key', ['config_key' => 'base_currency']); $model->config_value = $_POST['currency']; $model->save(); @@ -91,10 +91,10 @@ public function actionSetData() Yii::app()->session['email'] = $_POST['email']; Yii::app()->session['currency'] = $_POST['currency']; - echo json_encode(array( + echo json_encode([ $this->nameSuccess => true, $this->nameMsg => 'Success', - )); + ]); } public function setAttributesModels($attributes, $models) diff --git a/protected/controllers/DidController.php b/protected/controllers/DidController.php index dee6031f2..ae000d3a1 100755 --- a/protected/controllers/DidController.php +++ b/protected/controllers/DidController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/DidHistoryController.php b/protected/controllers/DidHistoryController.php index aa1328be3..b2d148233 100755 --- a/protected/controllers/DidHistoryController.php +++ b/protected/controllers/DidHistoryController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/DidUseController.php b/protected/controllers/DidUseController.php index 4571963e6..cb72e999d 100755 --- a/protected/controllers/DidUseController.php +++ b/protected/controllers/DidUseController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -23,14 +23,14 @@ class DidUseController extends Controller { public $attributeOrder = 'status DESC, DAY( reservationdate ) ASC'; - public $extraValues = array('idDid' => 'did', 'idUser' => 'username'); + public $extraValues = ['idDid' => 'did', 'idUser' => 'username']; - public $fieldsInvisibleClient = array( + public $fieldsInvisibleClient = [ 'id_user', 'month_payed', 'reminded', 'idUserusername', - ); + ]; public function init() { diff --git a/protected/controllers/DiddestinationController.php b/protected/controllers/DiddestinationController.php index d207d48df..f72a8b881 100755 --- a/protected/controllers/DiddestinationController.php +++ b/protected/controllers/DiddestinationController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/DidwwController.php b/protected/controllers/DidwwController.php index acfd5e77d..be384d288 100755 --- a/protected/controllers/DidwwController.php +++ b/protected/controllers/DidwwController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/ExtraController.php b/protected/controllers/ExtraController.php index 7756efa1f..a47d7de52 100755 --- a/protected/controllers/ExtraController.php +++ b/protected/controllers/ExtraController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/GAuthenticatorController.php b/protected/controllers/GAuthenticatorController.php index 3a7acc340..1ddc9e65d 100755 --- a/protected/controllers/GAuthenticatorController.php +++ b/protected/controllers/GAuthenticatorController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -61,12 +61,12 @@ public function googleAuthenticator($modelUser, $values) $oneCodePost = $values['code']; $checkResult = $ga->verifyCode($secret, $oneCodePost, 2); - if (!$checkResult) { - echo json_encode(array( + if ( ! $checkResult) { + echo json_encode([ 'success' => false, - 'rows' => array(), + 'rows' => [], 'errors' => Yii::t('zii', 'Invalid Code'), - )); + ]); $info = 'Username ' . Yii::app()->session['username'] . ' try inactive GoogleToken with Invalid Code to user ' . $modelUser->username; MagnusLog::insertLOG(2, $info); exit; diff --git a/protected/controllers/GroupUserGroupController.php b/protected/controllers/GroupUserGroupController.php index c5891d000..2cb94957d 100755 --- a/protected/controllers/GroupUserGroupController.php +++ b/protected/controllers/GroupUserGroupController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/HolidaysController.php b/protected/controllers/HolidaysController.php index 884ce8b2e..9209eb496 100755 --- a/protected/controllers/HolidaysController.php +++ b/protected/controllers/HolidaysController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/IvrController.php b/protected/controllers/IvrController.php index bfe6de593..4efdfd674 100755 --- a/protected/controllers/IvrController.php +++ b/protected/controllers/IvrController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/controllers/LogUsersController.php b/protected/controllers/LogUsersController.php index 782353ad3..b27bf906f 100755 --- a/protected/controllers/LogUsersController.php +++ b/protected/controllers/LogUsersController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -23,21 +23,21 @@ class LogUsersController extends Controller { public $attributeOrder = 't.date DESC'; - public $extraValues = array('idUser' => 'username', 'idLogActions' => 'name'); + public $extraValues = ['idUser' => 'username', 'idLogActions' => 'name']; - public $fieldsFkReport = array( - 'id_user' => array( + public $fieldsFkReport = [ + 'id_user' => [ 'table' => 'pkg_user', 'pk' => 'id', 'fieldReport' => 'username', - ), - 'idLogActionsname' => array( + ], + 'idLogActionsname' => [ 'table' => 'pkg_log_actions', 'pk' => 'id', 'fieldReport' => 'name', - 'where' => 'id', - ), - ); + 'where' => 'id', + ], + ]; public function init() { $this->instanceModel = new LogUsers; @@ -48,10 +48,10 @@ public function init() public function actionDestroy() { - echo json_encode(array( + echo json_encode([ $this->nameSuccess => false, $this->nameMsgErrors => Yii::t('zii', 'Not allowed delete in this module'), - )); + ]); exit; } diff --git a/protected/controllers/MBillingSoftphoneController.php b/protected/controllers/MBillingSoftphoneController.php index 49a24cde5..f65806619 100755 --- a/protected/controllers/MBillingSoftphoneController.php +++ b/protected/controllers/MBillingSoftphoneController.php @@ -8,7 +8,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 @@ -37,7 +37,7 @@ public function actionRead($asJson = true, $condition = null) $modelSip = AccessManager::checkAccess($user, $pass); - if (!isset($modelSip->id)) { + if ( ! isset($modelSip->id)) { echo 'false'; exit; } @@ -54,11 +54,11 @@ public function actionRead($asJson = true, $condition = null) } //$result[0]['version'] = 'MPhone-1.0.5'; - $result = json_encode(array( + $result = json_encode([ $this->nameRoot => $result, $this->nameCount => 1, $this->nameSum => '', - )); + ]); $result = json_decode($result, true); @@ -71,7 +71,7 @@ public function actionTotalPerCall() if (isset($_GET['l'])) { $user = $_GET['l']; - $modelSip = Sip::model()->find("name = :user", array(':user' => $user)); + $modelSip = Sip::model()->find("name = :user", [':user' => $user]); if (isset($modelSip->callshopnumber) && strlen($modelSip->callshopnumber) > 5) { $sessiontime = $modelSip->callshoptime; @@ -104,7 +104,7 @@ public function actionCallshopTotal() $modelSip = AccessManager::checkAccess($user, $pass); - if (!isset($modelSip->id)) { + if ( ! isset($modelSip->id)) { echo 'false'; exit; } @@ -115,19 +115,19 @@ public function actionCallshopTotal() $result[0]['lastname'] = $modelSip->idUser->lastname; $result[0]['currency'] = $this->config['global']['base_currency']; - $modelCallShop = CallShopCdr::model()->find(array( + $modelCallShop = CallShopCdr::model()->find([ 'select' => 'SUM(price) price', 'condition' => 'status = 0 AND cabina = :user', - 'params' => array(":user" => $user), - )); + 'params' => [":user" => $user], + ]); $result[0]['credit'] = count($modelCallShop) ? number_format($modelCallShop->price, 2) : '0.00'; - $result = json_encode(array( + $result = json_encode([ $this->nameRoot => $result, $this->nameCount => 1, $this->nameSum => '', - )); + ]); $result = json_decode($result, true); echo '
';
             print_r($result);
diff --git a/protected/controllers/MethodpayController.php b/protected/controllers/MethodpayController.php
index 404eb3d03..32913dc19 100755
--- a/protected/controllers/MethodpayController.php
+++ b/protected/controllers/MethodpayController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,17 +23,17 @@
 class MethodpayController extends Controller
 {
     public $attributeOrder = 'id';
-    public $extraValues    = array('idUser' => 'username');
+    public $extraValues    = ['idUser' => 'username'];
 
-    public $fieldsFkReport = array(
-        'id_user' => array(
+    public $fieldsFkReport = [
+        'id_user' => [
             'table'       => 'pkg_user',
             'pk'          => 'id',
             'fieldReport' => 'username',
-        ),
-    );
+        ],
+    ];
 
-    public $fieldsInvisibleClient = array(
+    public $fieldsInvisibleClient = [
         'pagseguro_TOKEN',
         'P2P_CustomerSiteID',
         'P2P_KeyID',
@@ -48,10 +48,10 @@ class MethodpayController extends Controller
         'SLIdProduto',
         'SLvalidationtoken',
 
-    );
-    public $fieldsInvisibleAgent = array(
+    ];
+    public $fieldsInvisibleAgent = [
         'id_group',
-    );
+    ];
 
     public function init()
     {
@@ -66,21 +66,21 @@ public function actionRead2()
 
         $values = explode(":", $this->config['global']['purchase_amount']);
 
-        $amount = array();
+        $amount = [];
 
         foreach ($values as $key => $value) {
 
-            array_push($amount, array(
+            array_push($amount, [
                 'id'     => $key + 1,
-                'amount' => $value)
+                'amount' => $value]
             );
         }
 
-        echo json_encode(array(
+        echo json_encode([
             $this->nameRoot  => $amount,
             $this->nameCount => 10,
-            $this->nameSum   => array(),
-        ));
+            $this->nameSum   => [],
+        ]);
 
     }
 
diff --git a/protected/controllers/ModuleController.php b/protected/controllers/ModuleController.php
index 20fad1f71..98d582650 100755
--- a/protected/controllers/ModuleController.php
+++ b/protected/controllers/ModuleController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
diff --git a/protected/controllers/OfferCdrController.php b/protected/controllers/OfferCdrController.php
index 81c951675..f957211c0 100755
--- a/protected/controllers/OfferCdrController.php
+++ b/protected/controllers/OfferCdrController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,20 +23,20 @@
 class OfferCdrController extends Controller
 {
     public $attributeOrder = 'date_consumption DESC';
-    public $extraValues    = array('idOffer' => 'label', 'idUser' => 'username');
+    public $extraValues    = ['idOffer' => 'label', 'idUser' => 'username'];
 
-    public $fieldsFkReport = array(
-        'id_user'  => array(
+    public $fieldsFkReport = [
+        'id_user'  => [
             'table'       => 'pkg_user',
             'pk'          => 'id',
             'fieldReport' => 'username',
-        ),
-        'id_offer' => array(
+        ],
+        'id_offer' => [
             'table'       => 'pkg_offer',
             'pk'          => 'id',
             'fieldReport' => 'label',
-        ),
-    );
+        ],
+    ];
 
     public function init()
     {
@@ -45,15 +45,15 @@ public function init()
         $this->titleReport   = Yii::t('zii', 'Offer') . ' CDR';
 
         if (Yii::app()->session['isAdmin']) {
-            $this->relationFilter['idOffer'] = array(
+            $this->relationFilter['idOffer'] = [
                 'condition' => "(idOffer.id_user < 2 OR idOffer.id_user IS NULL)",
-            );
+            ];
         }
 
         /*Aplica filtro padrao por data e causa de temrinao*/
         $filter         = isset($_REQUEST['filter']) ? $_REQUEST['filter'] : null;
         $filter         = $this->createCondition(json_decode($filter));
-        $whereStarttime = !preg_match("/date_consumption/", $filter) ? ' AND date_consumption > "' . date('Y-m-d') . '"' : false;
+        $whereStarttime =  ! preg_match("/date_consumption/", $filter) ? ' AND date_consumption > "' . date('Y-m-d') . '"' : false;
         //$this->filter = $whereStarttime;
         parent::init();
     }
@@ -64,9 +64,9 @@ public function extraFilterCustomAgent($filter)
         if (array_key_exists('idOffer', $this->relationFilter)) {
             $this->relationFilter['idOffer']['condition'] .= " AND idOffer.id_user = :agfby";
         } else {
-            $this->relationFilter['idOffer'] = array(
+            $this->relationFilter['idOffer'] = [
                 'condition' => "idOffer.id_user = :agfby",
-            );
+            ];
         }
         $this->paramsFilter[':agfby'] = Yii::app()->session['id_user'];
 
diff --git a/protected/controllers/OfferController.php b/protected/controllers/OfferController.php
index 26f0d0c1e..98106f47d 100755
--- a/protected/controllers/OfferController.php
+++ b/protected/controllers/OfferController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -24,14 +24,14 @@ class OfferController extends Controller
 {
     public $attributeOrder = 't.id';
     public $filterByUser   = false;
-    public $extraValues    = array('idUser' => 'username');
-    public $fieldsFkReport = array(
-        'id_user' => array(
+    public $extraValues    = ['idUser' => 'username'];
+    public $fieldsFkReport = [
+        'id_user' => [
             'table'       => 'pkg_user',
             'pk'          => 'id',
             'fieldReport' => 'username',
-        ),
-    );
+        ],
+    ];
     public function init()
     {
         $this->instanceModel = new Offer;
diff --git a/protected/controllers/OfferUseController.php b/protected/controllers/OfferUseController.php
index fc6bbb629..d881c7750 100755
--- a/protected/controllers/OfferUseController.php
+++ b/protected/controllers/OfferUseController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,20 +23,20 @@
 class OfferUseController extends Controller
 {
     public $attributeOrder = 't.id';
-    public $extraValues    = array('idOffer' => 'label', 'idUser' => 'username');
+    public $extraValues    = ['idOffer' => 'label', 'idUser' => 'username'];
 
-    public $fieldsFkReport = array(
-        'id_user'  => array(
+    public $fieldsFkReport = [
+        'id_user'  => [
             'table'       => 'pkg_user',
             'pk'          => 'id',
             'fieldReport' => 'username',
-        ),
-        'id_offer' => array(
+        ],
+        'id_offer' => [
             'table'       => 'pkg_offer',
             'pk'          => 'id',
             'fieldReport' => 'label',
-        ),
-    );
+        ],
+    ];
 
     public function init()
     {
@@ -45,9 +45,9 @@ public function init()
         $this->titleReport   = Yii::t('zii', 'Offer Use');
 
         if (Yii::app()->session['isAdmin']) {
-            $this->relationFilter['idUser'] = array(
+            $this->relationFilter['idUser'] = [
                 'condition' => "idUser.id_user < 2",
-            );
+            ];
         }
         parent::init();
     }
diff --git a/protected/controllers/PagHiperController.php b/protected/controllers/PagHiperController.php
index 18826d24b..bd7800187 100755
--- a/protected/controllers/PagHiperController.php
+++ b/protected/controllers/PagHiperController.php
@@ -9,7 +9,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -31,21 +31,21 @@ public function actionIndex()
         } else {
             $filter = "payment_method = 'paghiper'";
         }
-        $params = array();
+        $params = [];
 
         if (isset($_GET['id_agent'])) {
             $filter .= " AND id_user = :key1";
-            $params = array(':key1' => (int) $_GET['id_agent']);
+            $params = [':key1' => (int) $_GET['id_agent']];
         } else {
             $filter .= " AND id = 1";
         }
 
-        $modelMethodpay = Methodpay::model()->find(array(
+        $modelMethodpay = Methodpay::model()->find([
             'condition' => $filter,
             'params'    => $params,
-        ));
+        ]);
 
-        if (!count($modelMethodpay)) {
+        if ( ! count($modelMethodpay)) {
             Yii::log(print_r('Not found paghiper method', true), 'error');
             exit;
         }
@@ -153,9 +153,9 @@ public function actionIndex()
                 if ($status == 'Aprovado') {
                     $modelUser = User::model()->find(
                         "username = :usuario AND id = :key",
-                        array(
+                        [
                             ':usuario' => $usuario,
-                            ':key'     => $id_user)
+                            ':key'     => $id_user]
                     );
 
                     if (count($modelUser) && Refill::model()->countRefill($transacaoID, $modelUser->id) == 0) {
diff --git a/protected/controllers/PhoneBookController.php b/protected/controllers/PhoneBookController.php
index d96ae38ee..480c57de2 100755
--- a/protected/controllers/PhoneBookController.php
+++ b/protected/controllers/PhoneBookController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,22 +23,22 @@
 class PhoneBookController extends Controller
 {
     public $attributeOrder      = 't.name ASC';
-    public $extraValues         = array('idUser' => 'username');
+    public $extraValues         = ['idUser' => 'username'];
     public $filterByUser        = true;
     public $defaultFilterByUser = 'b.id_user';
     public $join                = 'JOIN pkg_user b ON t.id_user = b.id';
 
-    public $fieldsFkReport = array(
-        'id_user' => array(
+    public $fieldsFkReport = [
+        'id_user' => [
             'table'       => 'pkg_user',
             'pk'          => 'id',
             'fieldReport' => 'username',
-        ),
-    );
-    public $fieldsInvisibleClient = array(
+        ],
+    ];
+    public $fieldsInvisibleClient = [
         'id_user',
         'idCardusername',
-    );
+    ];
 
     public function init()
     {
@@ -63,7 +63,7 @@ public function actionRead($asJson = true, $condition = null)
     {
         $filter       = isset($_REQUEST['filter']) ? $_REQUEST['filter'] : null;
         $filter       = $this->createCondition(json_decode($filter));
-        $this->filter = !preg_match("/status/", $filter) ? ' AND status = 1' : '';
+        $this->filter =  ! preg_match("/status/", $filter) ? ' AND status = 1' : '';
         parent::actionRead($asJson = true, $condition = null);
     }
 
diff --git a/protected/controllers/PhoneNumberController.php b/protected/controllers/PhoneNumberController.php
index 12d28c5e6..618242b8b 100755
--- a/protected/controllers/PhoneNumberController.php
+++ b/protected/controllers/PhoneNumberController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
diff --git a/protected/controllers/PlanController.php b/protected/controllers/PlanController.php
index e178f020e..f5e077da9 100755
--- a/protected/controllers/PlanController.php
+++ b/protected/controllers/PlanController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,7 +23,7 @@
 class PlanController extends Controller
 {
     public $attributeOrder = 't.name';
-    public $extraValues    = array('idUser' => 'username');
+    public $extraValues    = ['idUser' => 'username'];
 
     public $nameModelRelated   = 'ServicesPlan';
     public $nameFkRelated      = 'id_plan';
@@ -89,19 +89,19 @@ public function importPortabilidade($idPlan, $type)
 
         $modelRate = Rate::model()->findAll($filter);
 
-        if (!isset($modelRate[0]->id)) {
+        if ( ! isset($modelRate[0]->id)) {
             $url = "https://www.magnusbilling.com/download/cod_operadora.csv";
-            if (!$file = @file_get_contents($url, false)) {
+            if ( ! $file = @file_get_contents($url, false)) {
                 return;
             }
 
             $file    = explode("\n", $file);
-            $prefixs = array();
+            $prefixs = [];
 
             //adiciona o codigo para qualquer operarado
             $file[] = preg_replace("/1111/", '55', $filterPrefix) . ",Brasil $filter_name Outras Operadoras";
 
-            $rates = array();
+            $rates = [];
 
             $price            = '0.1000';
             $initblock        = 30;
@@ -118,7 +118,7 @@ public function importPortabilidade($idPlan, $type)
                 $prefix      = '1111' . substr($collum[0], 2);
                 $destination = trim($collum[1]);
 
-                if (!strlen($destination)) {
+                if ( ! strlen($destination)) {
                     continue;
                 }
                 if (preg_match("/$filter_name/", $destination)) {
@@ -174,7 +174,7 @@ public function getAttributesRequest()
         $arrPost = array_key_exists($this->nameRoot, $_POST) ? json_decode($_POST[$this->nameRoot], true) : $_POST;
 
         /*permite salvar quando tem audio e extrafield*/
-        $id_service = array();
+        $id_service = [];
         foreach ($arrPost as $key => $value) {
             if ($key == 'id_services_array') {
                 if (isset($_POST['id_services_array']) && strlen($value) > 0) {
@@ -182,7 +182,7 @@ public function getAttributesRequest()
                 }
 
             }
-        };
+        }
 
         return $arrPost;
     }
diff --git a/protected/controllers/PlayAudioController.php b/protected/controllers/PlayAudioController.php
index 30bfdcbd6..eda1d5910 100755
--- a/protected/controllers/PlayAudioController.php
+++ b/protected/controllers/PlayAudioController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
diff --git a/protected/controllers/PrefixController.php b/protected/controllers/PrefixController.php
index 34fba5ee3..56894695e 100755
--- a/protected/controllers/PrefixController.php
+++ b/protected/controllers/PrefixController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -42,7 +42,7 @@ public function extraFilterCustomAgent($filter)
     public function actionImportFromCsv()
     {
 
-        if (!Yii::app()->session['id_user'] || Yii::app()->session['isAdmin'] != true) {
+        if ( ! Yii::app()->session['id_user'] || Yii::app()->session['isAdmin'] != true) {
             exit();
         }
 
@@ -53,33 +53,33 @@ public function actionImportFromCsv()
 
         fclose($handle);
 
-        echo json_encode(array(
+        echo json_encode([
             $this->nameSuccess => true,
             'msg'              => $this->msgSuccess,
-        ));
+        ]);
     }
 
     private function importPrefixs($handle, $values)
     {
-        $sqlPrefix = array();
+        $sqlPrefix = [];
         while (($row = fgetcsv($handle, 32768, $values['delimiter'])) !== false) {
 
             $checkDelimiter = $values['delimiter'] == ',' ? ';' : ',';
             //erro do separador
             if (preg_match("/$checkDelimiter/", $row[0])) {
-                echo json_encode(array(
+                echo json_encode([
                     $this->nameSuccess => false,
                     'errors'           => Yii::t('zii', 'ERROR: CSV delimiter, please select ( ' . $checkDelimiter . ' ) on the import form'),
-                ));
+                ]);
                 exit;
             }
 
             if (isset($row[1])) {
-                if (!isset($row[0]) || $row[0] == '') {
-                    echo json_encode(array(
+                if ( ! isset($row[0]) || $row[0] == '') {
+                    echo json_encode([
                         $this->nameSuccess => false,
                         'errors'           => 'Prefix not exit in the CSV file . Line: ' . print_r($row, true),
-                    ));
+                    ]);
                     exit;
                 }
                 $prefix      = $row[0];
@@ -106,10 +106,10 @@ private function importPrefixs($handle, $values)
                 Yii::log(print_r($result, true), 'info');
 
                 if (isset($result->errorInfo)) {
-                    echo json_encode(array(
+                    echo json_encode([
                         $this->nameSuccess => false,
                         'errors'           => $this->getErrorMySql($result),
-                    ));
+                    ]);
                     exit;
                 }
             }
diff --git a/protected/controllers/ProviderCNLController.php b/protected/controllers/ProviderCNLController.php
index 59aaded15..0c1a62dc8 100755
--- a/protected/controllers/ProviderCNLController.php
+++ b/protected/controllers/ProviderCNLController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -24,15 +24,15 @@ class ProviderCNLController extends Controller
 {
     public $attributeOrder = 'id';
     public $filterByUser   = false;
-    public $extraValues    = array('idProvider' => 'provider_name');
+    public $extraValues    = ['idProvider' => 'provider_name'];
 
-    public $fieldsFkReport = array(
-        'id_provider' => array(
+    public $fieldsFkReport = [
+        'id_provider' => [
             'table'       => 'pkg_provider',
             'pk'          => 'id',
             'fieldReport' => 'provider_name',
-        ),
-    );
+        ],
+    ];
     public function init()
     {
         $this->instanceModel = new ProviderCNL;
diff --git a/protected/controllers/ProviderController.php b/protected/controllers/ProviderController.php
index c64a20bdc..0666d1d96 100755
--- a/protected/controllers/ProviderController.php
+++ b/protected/controllers/ProviderController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
diff --git a/protected/controllers/QueueController.php b/protected/controllers/QueueController.php
index 7b3e8fff3..c3d9aaf5c 100755
--- a/protected/controllers/QueueController.php
+++ b/protected/controllers/QueueController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
diff --git a/protected/controllers/QueueMemberController.php b/protected/controllers/QueueMemberController.php
index 3d19073ff..93ee908ac 100755
--- a/protected/controllers/QueueMemberController.php
+++ b/protected/controllers/QueueMemberController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,15 +23,15 @@
 class QueueMemberController extends Controller
 {
     public $attributeOrder = 't.id';
-    public $extraValues    = array('idUser' => 'username');
+    public $extraValues    = ['idUser' => 'username'];
 
-    public $fieldsFkReport = array(
-        'id_user' => array(
+    public $fieldsFkReport = [
+        'id_user' => [
             'table'       => 'pkg_user',
             'pk'          => 'id',
             'fieldReport' => 'username',
-        ),
-    );
+        ],
+    ];
 
     public function init()
     {
@@ -47,7 +47,7 @@ public function beforeSave($values)
 
         if (isset($values['interface'])) {
             $modelSip = Sip::model()->find("id = :id",
-                array('id' => $values['interface'])
+                ['id' => $values['interface']]
             );
 
             $values['id_user']   = $modelSip->id_user;
@@ -55,7 +55,7 @@ public function beforeSave($values)
         }
         if (isset($values['queue_name'])) {
             $modelQueue = Queue::model()->find("id = :id OR name = :id",
-                array('id' => $values['queue_name'])
+                ['id' => $values['queue_name']]
             );
             $values['queue_name'] = $modelQueue->name;
         }
@@ -72,11 +72,11 @@ public function checkRelation($values)
             $modelQueue = Queue::model()->findByPk((int) $values['queue_name']);
 
             if ($modelSip->id_user != $modelQueue->id_user) {
-                echo json_encode(array(
+                echo json_encode([
                     'success' => false,
-                    'rows'    => array(),
+                    'rows'    => [],
                     'errors'  => ['interface' => ['The SIP ACCOUNT must belong to the QUEUE owner']],
-                ));
+                ]);
                 exit;
             }
 
@@ -89,11 +89,11 @@ public function checkRelation($values)
                 $modelQueue = Queue::model()->find('name = :key', [':key' => $modelQueueMember['queue_name']]);
 
                 if ($modelSip->id_user != $modelQueue->id_user) {
-                    echo json_encode(array(
+                    echo json_encode([
                         'success' => false,
-                        'rows'    => array(),
+                        'rows'    => [],
                         'errors'  => ['interface' => ['The SIP ACCOUNT must belong to the QUEUE owner']],
-                    ));
+                    ]);
                     exit;
                 }
             }
diff --git a/protected/controllers/QueueMemberDashBoardController.php b/protected/controllers/QueueMemberDashBoardController.php
index 605879add..c1bc095ec 100755
--- a/protected/controllers/QueueMemberDashBoardController.php
+++ b/protected/controllers/QueueMemberDashBoardController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -24,7 +24,7 @@ class QueueMemberDashBoardController extends Controller
 {
 
     public $attributeOrder = 't.id';
-    public $extraValues    = array('idQueue' => 'name');
+    public $extraValues    = ['idQueue' => 'name'];
 
     public function init()
     {
diff --git a/protected/controllers/RateCallshopController.php b/protected/controllers/RateCallshopController.php
index 8231a03d9..ca248d233 100755
--- a/protected/controllers/RateCallshopController.php
+++ b/protected/controllers/RateCallshopController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -36,10 +36,10 @@ public function actionSave()
     {
         $values = $this->getAttributesRequest();
         if (Yii::app()->session['isAdmin'] && (isset($values['id']) && $values['id'] == 0)) {
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => false,
                 $this->nameMsg     => $this->msgError,
-            ));
+            ]);
             exit;
         }
         parent::actionSave();
diff --git a/protected/controllers/RateController.php b/protected/controllers/RateController.php
index 603c4f23f..c7f52c233 100755
--- a/protected/controllers/RateController.php
+++ b/protected/controllers/RateController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,36 +23,36 @@
 class RateController extends Controller
 {
     public $attributeOrder = 't.id';
-    public $extraValues    = array(
+    public $extraValues    = [
         'idTrunkGroup' => 'name',
         'idPlan'       => 'name',
         'idPrefix'     => 'destination,prefix',
-    );
+    ];
 
-    public $fieldsFkReport = array(
-        'id_plan'        => array(
+    public $fieldsFkReport = [
+        'id_plan'        => [
             'table'       => 'pkg_plan',
             'pk'          => 'id',
             'fieldReport' => 'name',
-        ),
-        'id_trunk_group' => array(
+        ],
+        'id_trunk_group' => [
             'table'       => 'pkg_trunk_group',
             'pk'          => 'id',
             'fieldReport' => 'name',
-        ),
-        'id_prefix'      => array(
+        ],
+        'id_prefix'      => [
             'table'       => 'pkg_prefix',
             'pk'          => 'id',
             'fieldReport' => 'prefix',
-        ),
-        't.id'           => array(
+        ],
+        't.id'           => [
             'table'       => 'pkg_prefix',
             'pk'          => 'id',
             'fieldReport' => 'destination',
-        ),
-    );
+        ],
+    ];
 
-    public $fieldsInvisibleClient = array(
+    public $fieldsInvisibleClient = [
         'additional_grace',
         'id_trunk_group',
         'idTrunktrunkcode',
@@ -60,15 +60,15 @@ class RateController extends Controller
         'disconnectcharge',
         'minimal_time_charge',
         'package_offer',
-    );
+    ];
 
-    public $fieldsInvisibleAgent = array(
+    public $fieldsInvisibleAgent = [
         'additional_grace',
         'id_trunk_group',
         'idTrunktrunkcode',
         'connectcharge',
         'disconnectcharge',
-    );
+    ];
 
     public $FilterByUser;
 
@@ -91,11 +91,11 @@ public function init()
         $this->titleReport = Yii::t('zii', 'Tariffs');
 
         parent::init();
-        if (!Yii::app()->session['isAdmin']) {
-            $this->extraValues = array(
+        if ( ! Yii::app()->session['isAdmin']) {
+            $this->extraValues = [
                 'idPlan'   => 'name',
                 'idPrefix' => 'destination,prefix',
-            );
+            ];
         }
     }
 
@@ -110,7 +110,7 @@ public function extraFilterCustomClient($filter)
 
     public function extraFilterCustomAgent($filter)
     {
-        $modelPlan = Plan::model()->findAll('id_user = :key', array(':key' => Yii::app()->session['id_user']));
+        $modelPlan = Plan::model()->findAll('id_user = :key', [':key' => Yii::app()->session['id_user']]);
         $ids_plan  = '';
         foreach ($modelPlan as $key => $plan) {
             $ids_plan .= $plan->id . ',';
@@ -136,7 +136,7 @@ public function afterSave($model, $values)
     {
         if (Yii::app()->session['isAgent'] || Yii::app()->session['id_agent'] > 1) {
             $info = 'Module: rateagent  ' . json_encode($values);
-            LogUsers::model()->updateByPk(Yii::app()->db->getLastInsertID(), array('description' => $info));
+            LogUsers::model()->updateByPk(Yii::app()->db->getLastInsertID(), ['description' => $info]);
         }
     }
 
@@ -160,17 +160,17 @@ public function replaceToExport()
     public function actionImportFromCsv()
     {
 
-        if (!Yii::app()->session['id_user'] || Yii::app()->session['isClient'] == true) {
+        if ( ! Yii::app()->session['id_user'] || Yii::app()->session['isClient'] == true) {
             exit();
         }
         $values = $this->getAttributesRequest();
 
         $this->importRates($values);
 
-        echo json_encode(array(
+        echo json_encode([
             $this->nameSuccess => true,
             'msg'              => $this->msgSuccess,
-        ));
+        ]);
     }
 
     public function importPrefixs($values)
@@ -186,10 +186,10 @@ public function importPrefixs($values)
             try {
                 Yii::app()->db->createCommand($sql)->execute();
             } catch (Exception $e) {
-                echo json_encode(array(
+                echo json_encode([
                     $this->nameSuccess => false,
                     'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-                ));
+                ]);
                 exit;
 
             }
@@ -200,11 +200,11 @@ public function importPrefixs($values)
     public function importRates($values)
     {
 
-        if (!isset($_FILES['file']['tmp_name']) || strlen($_FILES['file']['tmp_name']) < 10) {
-            echo json_encode(array(
+        if ( ! isset($_FILES['file']['tmp_name']) || strlen($_FILES['file']['tmp_name']) < 10) {
+            echo json_encode([
                 $this->nameSuccess => false,
                 'errors'           => Yii::t('zii', 'Please select a CSV file'),
-            ));
+            ]);
             exit;
         }
 
@@ -216,16 +216,16 @@ public function importRates($values)
         $firstLine = explode($values['delimiter'], $firstLine);
 
         if (count($firstLine) < 3) {
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => false,
                 'errors'           => Yii::t('zii', 'CSV format invalid, please check your CSV file and than try again.') . "\n\n" . $firstLine[0],
-            ));
+            ]);
             exit;
         }
 
         $modelPrefix = Prefix::model()->find(1);
 
-        if (!isset($modelPrefix->id)) {
+        if ( ! isset($modelPrefix->id)) {
             $this->importPrefixs($values);
             $modelPrefix = Prefix::model()->find(1);
         }
@@ -242,10 +242,10 @@ public function importRates($values)
             try {
                 Yii::app()->db->createCommand($sql)->execute();
             } catch (Exception $e) {
-                echo json_encode(array(
+                echo json_encode([
                     $this->nameSuccess => false,
                     'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-                ));
+                ]);
                 exit;
 
             }
@@ -265,10 +265,10 @@ public function importRates($values)
             try {
                 Yii::app()->db->createCommand($sql)->execute();
             } catch (Exception $e) {
-                echo json_encode(array(
+                echo json_encode([
                     $this->nameSuccess => false,
                     'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-                ));
+                ]);
                 exit;
 
             }
@@ -290,10 +290,10 @@ public function importRates($values)
                 $sql = "DELETE FROM pkg_rate WHERE dialprefix > 0";
                 Yii::app()->db->createCommand($sql)->execute();
 
-                echo json_encode(array(
+                echo json_encode([
                     $this->nameSuccess => false,
                     'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-                ));
+                ]);
                 exit;
 
             }
@@ -312,10 +312,10 @@ public function importRates($values)
                     try {
                         Yii::app()->db->createCommand($sql)->execute();
                     } catch (Exception $e) {
-                        echo json_encode(array(
+                        echo json_encode([
                             $this->nameSuccess => false,
                             'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-                        ));
+                        ]);
                         exit;
 
                     }
@@ -327,10 +327,10 @@ public function importRates($values)
                 } catch (Exception $e) {
                     $sql = "DELETE FROM pkg_rate WHERE dialprefix > 0";
                     Yii::app()->db->createCommand($sql)->execute();
-                    echo json_encode(array(
+                    echo json_encode([
                         $this->nameSuccess => false,
                         'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-                    ));
+                    ]);
                     exit;
 
                 }
@@ -340,10 +340,10 @@ public function importRates($values)
             try {
                 Yii::app()->db->createCommand($sql)->execute();
             } catch (Exception $e) {
-                echo json_encode(array(
+                echo json_encode([
                     $this->nameSuccess => false,
                     'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-                ));
+                ]);
                 exit;
 
             }
diff --git a/protected/controllers/RateProviderController.php b/protected/controllers/RateProviderController.php
index c08527d31..765f87f19 100755
--- a/protected/controllers/RateProviderController.php
+++ b/protected/controllers/RateProviderController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,22 +23,22 @@
 class RateProviderController extends Controller
 {
     public $attributeOrder = 't.id';
-    public $extraValues    = array(
+    public $extraValues    = [
         'idProvider' => 'provider_name',
         'idPrefix'   => 'destination,prefix',
-    );
+    ];
 
-    public $fieldsFkReport = array(
-        'id_provider' => array(
+    public $fieldsFkReport = [
+        'id_provider' => [
             'table'       => 'pkg_provider',
             'pk'          => 'id',
             'fieldReport' => 'provider_name',
-        ), 'id_prefix' => array(
+        ], 'id_prefix' => [
             'table'       => 'pkg_prefix',
             'pk'          => 'id',
             'fieldReport' => 'destination',
-        ),
-    );
+        ],
+    ];
 
     public function init()
     {
@@ -81,17 +81,17 @@ public function replaceToExport()
     public function actionImportFromCsv()
     {
 
-        if (!Yii::app()->session['id_user'] || Yii::app()->session['isClient'] == true) {
+        if ( ! Yii::app()->session['id_user'] || Yii::app()->session['isClient'] == true) {
             exit();
         }
         $values = $this->getAttributesRequest();
 
         $this->importRates($values);
 
-        echo json_encode(array(
+        echo json_encode([
             $this->nameSuccess => true,
             'msg'              => $this->msgSuccess,
-        ));
+        ]);
     }
 
     public function importPrefixs($values)
@@ -104,10 +104,10 @@ public function importPrefixs($values)
         try {
             Yii::app()->db->createCommand($sql)->execute();
         } catch (Exception $e) {
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => false,
                 'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-            ));
+            ]);
             exit;
 
         }
@@ -117,11 +117,11 @@ public function importPrefixs($values)
     public function importRates($values)
     {
 
-        if (!isset($_FILES['file']['tmp_name']) || strlen($_FILES['file']['tmp_name']) < 10) {
-            echo json_encode(array(
+        if ( ! isset($_FILES['file']['tmp_name']) || strlen($_FILES['file']['tmp_name']) < 10) {
+            echo json_encode([
                 $this->nameSuccess => false,
                 'errors'           => Yii::t('zii', 'Please select a CSV file'),
-            ));
+            ]);
             exit;
         }
 
@@ -133,16 +133,16 @@ public function importRates($values)
         $firstLine = explode($values['delimiter'], $firstLine);
 
         if (count($firstLine) < 3) {
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => false,
                 'errors'           => Yii::t('zii', 'CSV format invalid, please check your CSV file and than try again.') . "\n\n" . $firstLine[0],
-            ));
+            ]);
             exit;
         }
 
         $modelPrefix = Prefix::model()->find(1);
 
-        if (!isset($modelPrefix->id)) {
+        if ( ! isset($modelPrefix->id)) {
             $this->importPrefixs($values);
             $modelPrefix = Prefix::model()->find(1);
         }
@@ -159,10 +159,10 @@ public function importRates($values)
         try {
             Yii::app()->db->createCommand($sql)->execute();
         } catch (Exception $e) {
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => false,
                 'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-            ));
+            ]);
             exit;
 
         }
@@ -178,10 +178,10 @@ public function importRates($values)
         try {
             Yii::app()->db->createCommand($sql)->execute();
         } catch (Exception $e) {
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => false,
                 'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-            ));
+            ]);
             exit;
 
         }
@@ -200,10 +200,10 @@ public function importRates($values)
                 try {
                     Yii::app()->db->createCommand($sql)->execute();
                 } catch (Exception $e) {
-                    echo json_encode(array(
+                    echo json_encode([
                         $this->nameSuccess => false,
                         'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-                    ));
+                    ]);
                     exit;
 
                 }
@@ -213,15 +213,15 @@ public function importRates($values)
             try {
                 Yii::app()->db->createCommand($sql)->execute();
             } catch (Exception $e) {
-                echo json_encode(array(
+                echo json_encode([
                     $this->nameSuccess => false,
                     'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-                ));
+                ]);
                 exit;
 
             }
 
-            RateProvider::model()->updateAll(array('dialprefix' => null, 'destination' => null), 'dialprefix > 0');
+            RateProvider::model()->updateAll(['dialprefix' => null, 'destination' => null], 'dialprefix > 0');
 
         }
 
@@ -229,10 +229,10 @@ public function importRates($values)
         try {
             Yii::app()->db->createCommand($sql)->execute();
         } catch (Exception $e) {
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => false,
                 'errors'           => Yii::t('zii', 'MYSQL message.') . "\n\n" . print_r($e, true),
-            ));
+            ]);
             exit;
 
         }
diff --git a/protected/controllers/RefillproviderController.php b/protected/controllers/RefillproviderController.php
index aece291e8..3faa18709 100755
--- a/protected/controllers/RefillproviderController.php
+++ b/protected/controllers/RefillproviderController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,15 +23,15 @@
 class RefillproviderController extends Controller
 {
     public $attributeOrder = 'id';
-    public $extraValues    = array('idProvider' => 'provider_name');
+    public $extraValues    = ['idProvider' => 'provider_name'];
     public $filterByUser   = false;
-    public $fieldsFkReport = array(
-        'id_provider' => array(
+    public $fieldsFkReport = [
+        'id_provider' => [
             'table'       => 'pkg_provider',
             'pk'          => 'id',
             'fieldReport' => 'provider_name',
-        ),
-    );
+        ],
+    ];
 
     public function init()
     {
@@ -51,7 +51,7 @@ public function afterSave($model, $values)
 
             //add credit
             $resultProvider->credit = $model->credit > 0 ? $resultProvider->credit + $model->credit : $resultProvider->credit - ($model->credit * -1);
-            $resultProvider->saveAttributes(array('credit' => $resultProvider->credit));
+            $resultProvider->saveAttributes(['credit' => $resultProvider->credit]);
 
         }
         return;
diff --git a/protected/controllers/RestrictedPhonenumberController.php b/protected/controllers/RestrictedPhonenumberController.php
index e00ee3e24..6d57625d9 100755
--- a/protected/controllers/RestrictedPhonenumberController.php
+++ b/protected/controllers/RestrictedPhonenumberController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,15 +23,15 @@
 class RestrictedPhonenumberController extends Controller
 {
     public $attributeOrder = 't.id';
-    public $extraValues    = array('idUser' => 'username');
+    public $extraValues    = ['idUser' => 'username'];
 
-    public $fieldsFkReport = array(
-        'id_user' => array(
+    public $fieldsFkReport = [
+        'id_user' => [
             'table'       => 'pkg_user',
             'pk'          => 'id',
             'fieldReport' => 'username',
-        ),
-    );
+        ],
+    ];
 
     public function init()
     {
diff --git a/protected/controllers/SendCreditProductsController.php b/protected/controllers/SendCreditProductsController.php
index de0494417..42b446528 100755
--- a/protected/controllers/SendCreditProductsController.php
+++ b/protected/controllers/SendCreditProductsController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -37,9 +37,9 @@ public function actionResetClientPrice()
 
         SendCreditRates::model()->deleteAll();
 
-        echo json_encode(array(
+        echo json_encode([
             $this->nameSuccess => true,
             $this->nameMsg     => 'Clientes rates reseted',
-        ));
+        ]);
     }
 }
diff --git a/protected/controllers/SendCreditRatesController.php b/protected/controllers/SendCreditRatesController.php
index e43533b51..7f404bf25 100755
--- a/protected/controllers/SendCreditRatesController.php
+++ b/protected/controllers/SendCreditRatesController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2018 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,7 +23,7 @@
 class SendCreditRatesController extends Controller
 {
     public $attributeOrder = 't.id';
-    public $extraValues    = array('idUser' => 'username', 'idProduct' => 'operator_name,country,currency_dest,product,currency_orig,wholesale_price');
+    public $extraValues    = ['idUser' => 'username', 'idProduct' => 'operator_name,country,currency_dest,product,currency_orig,wholesale_price'];
 
     public function init()
     {
@@ -36,9 +36,9 @@ public function init()
     public function actionRead($asJson = true, $condition = null)
     {
         if (Yii::app()->session['isClient']) {
-            $modelSendCreditRates = SendCreditRates::model()->find('id_user = :key', array(':key' => Yii::app()->session['id_user']));
+            $modelSendCreditRates = SendCreditRates::model()->find('id_user = :key', [':key' => Yii::app()->session['id_user']]);
             //add the user sell_price if his not have any change
-            if (!isset($modelSendCreditRates->id)) {
+            if ( ! isset($modelSendCreditRates->id)) {
                 $sql = " INSERT INTO pkg_send_credit_rates (id_user,id_product,retail_price,sell_price)  SELECT " . (int) Yii::app()->session['id_user'] . ",id,wholesale_price,retail_price FROM pkg_send_credit_products ";
                 Yii::app()->db->createCommand($sql)->execute();
 
@@ -53,10 +53,10 @@ public function actionResetSellPrice()
         $sql = " UPDATE pkg_send_credit_rates  a LEFT JOIN  pkg_send_credit_products b ON a.id_product = b.id SET a.sell_price = b.wholesale_price WHERE a.id_user = " . (int) Yii::app()->session['id_user'];
         Yii::app()->db->createCommand($sql)->execute();
 
-        echo json_encode(array(
+        echo json_encode([
             $this->nameSuccess => true,
             $this->nameMsg     => 'Sell price reseted',
-        ));
+        ]);
     }
 
     public function actionResetRetailPrice()
@@ -65,10 +65,10 @@ public function actionResetRetailPrice()
         $sql = " UPDATE pkg_send_credit_rates  a LEFT JOIN  pkg_send_credit_products b ON a.id_product = b.id SET a.sell_price = b.retail_price WHERE a.id_user = " . (int) Yii::app()->session['id_user'];
         Yii::app()->db->createCommand($sql)->execute();
 
-        echo json_encode(array(
+        echo json_encode([
             $this->nameSuccess => true,
             $this->nameMsg     => 'Retail price reseted',
-        ));
+        ]);
     }
 
 }
diff --git a/protected/controllers/SendCreditSummaryController.php b/protected/controllers/SendCreditSummaryController.php
index e55fef593..3258fd8b2 100755
--- a/protected/controllers/SendCreditSummaryController.php
+++ b/protected/controllers/SendCreditSummaryController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -90,17 +90,17 @@ public function actionRead($asJson = true, $condition = null)
 
         }
          */
-        $modelSendCreditSummary = SendCreditSummary::model()->findAll(array(
+        $modelSendCreditSummary = SendCreditSummary::model()->findAll([
             'select'    => $this->select,
             'condition' => $this->filter,
             'params'    => $this->paramsFilter,
             'order'     => 'date DESC, service',
-        ));
+        ]);
 
-        $this->render('index', array(
+        $this->render('index', [
             'model'                  => $model,
             'modelSendCreditSummary' => $modelSendCreditSummary,
-        ));
+        ]);
         exit;
 
         parent::actionRead();
diff --git a/protected/controllers/ServersController.php b/protected/controllers/ServersController.php
index 50b0c3948..bd920a937 100755
--- a/protected/controllers/ServersController.php
+++ b/protected/controllers/ServersController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -50,10 +50,10 @@ public function setAttributesModels($attributes, $models)
             for ($i = 0; $i < count($pkCount); $i++) {
 
                 if ($attributes[$i]['status'] == 4) {
-                    Servers::model()->updateByPk($attributes[$i]['id'], array('status' => 1));
+                    Servers::model()->updateByPk($attributes[$i]['id'], ['status' => 1]);
                 }
                 if ($attributes[$i]['type'] == 'asterisk' && $attributes[$i]['status'] > 0 && $attributes[$i]['weight'] > '0' && $attributes[$i]['last_call'] < $last_call) {
-                    Servers::model()->updateByPk($attributes[$i]['id'], array('status' => 4));
+                    Servers::model()->updateByPk($attributes[$i]['id'], ['status' => 4]);
                 }
             }
         }
@@ -144,11 +144,11 @@ public function generateSipFile()
         }
         $select = 'trunkcode, user, secret, disallow, allow, directmedia, context, dtmfmode, insecure, nat, qualify, type, host, fromdomain,fromuser, register_string,port,transport,encryption,sendrpid,maxuse,sip_config';
         $model  = Trunk::model()->findAll(
-            array(
+            [
                 'select'    => $select,
                 'condition' => 'providertech = :key AND status = 1',
-                'params'    => array(':key' => 'sip'),
-            ));
+                'params'    => [':key' => 'sip'],
+            ]);
 
         if (count($model)) {
             AsteriskAccess::instance()->writeAsteriskFile($model, '/etc/asterisk/sip_magnus.conf', 'trunkcode');
@@ -168,13 +168,13 @@ public function afterDestroy($values)
 
     public function ip_is_private($ip)
     {
-        $pri_addrs = array(
+        $pri_addrs = [
             '10.0.0.0|10.255.255.255', // single class A network
             '172.16.0.0|172.31.255.255', // 16 contiguous class B network
             '192.168.0.0|192.168.255.255', // 256 contiguous class C network
             '169.254.0.0|169.254.255.255', // Link-local address also refered to as Automatic Private IP Addressing
             '127.0.0.0|127.255.255.255', // localhost
-        );
+        ];
 
         $long_ip = ip2long($ip);
         if ($long_ip != -1) {
diff --git a/protected/controllers/ServicesController.php b/protected/controllers/ServicesController.php
index c7a57ae38..eee63f1c5 100755
--- a/protected/controllers/ServicesController.php
+++ b/protected/controllers/ServicesController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -25,8 +25,8 @@ class ServicesController extends Controller
     public $attributeOrder = 't.id';
 
     public $nameModelRelated        = 'ServicesModule';
-    public $extraFieldsRelated      = array('show_menu', 'action', 'id_module', 'createShortCut', 'createQuickStart');
-    public $extraValuesOtherRelated = array('idModule' => 'text');
+    public $extraFieldsRelated      = ['show_menu', 'action', 'id_module', 'createShortCut', 'createQuickStart'];
+    public $extraValuesOtherRelated = ['idModule' => 'text'];
     public $nameFkRelated           = 'id_services';
     public $nameOtherFkRelated      = 'id_module';
 
diff --git a/protected/controllers/ServicesUseController.php b/protected/controllers/ServicesUseController.php
index 20445c21c..db522bd85 100755
--- a/protected/controllers/ServicesUseController.php
+++ b/protected/controllers/ServicesUseController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,13 +23,13 @@
 class ServicesUseController extends Controller
 {
     public $attributeOrder = 'status DESC, DAY( reservationdate ) DESC';
-    public $extraValues    = array('idServices' => 'name,price,type', 'idUser' => 'username');
+    public $extraValues    = ['idServices' => 'name,price,type', 'idUser' => 'username'];
 
-    public $fieldsInvisibleClient = array(
+    public $fieldsInvisibleClient = [
         'id_user',
         'reminded',
         'idUserusername',
-    );
+    ];
     public function init()
     {
         $this->instanceModel = new ServicesUse;
diff --git a/protected/controllers/SipTraceController.php b/protected/controllers/SipTraceController.php
index ff9694954..9da7ada6e 100755
--- a/protected/controllers/SipTraceController.php
+++ b/protected/controllers/SipTraceController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
diff --git a/protected/controllers/SipurasController.php b/protected/controllers/SipurasController.php
index 24674459e..fe3139128 100755
--- a/protected/controllers/SipurasController.php
+++ b/protected/controllers/SipurasController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,7 +23,7 @@
 class SipurasController extends Controller
 {
     public $attributeOrder = 'fultmov DESC';
-    public $extraValues    = array('idUser' => 'username');
+    public $extraValues    = ['idUser' => 'username'];
 
     public function init()
     {
diff --git a/protected/controllers/SmsCallbackController.php b/protected/controllers/SmsCallbackController.php
index 82b7c7626..8cc28f1d0 100755
--- a/protected/controllers/SmsCallbackController.php
+++ b/protected/controllers/SmsCallbackController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -26,16 +26,16 @@ class SmsCallbackController extends Controller
     public function actionRead($asJson = true, $condition = null)
     {
 
-        if (!isset($_GET['number']) || !isset($_GET['callerid'])) {
+        if ( ! isset($_GET['number']) || ! isset($_GET['callerid'])) {
             exit;
         }
         $destination = isset($_GET['number']) ? $_GET['number'] : '';
         $callerid    = isset($_GET['callerid']) ? $_GET['callerid'] : '';
         $date        = date('Y-m-d H:i:s');
 
-        $modelCallerid = Callerid::model()->find("cid = :callerid AND activated = 1", array(':callerid' => $callerid));
+        $modelCallerid = Callerid::model()->find("cid = :callerid AND activated = 1", [':callerid' => $callerid]);
 
-        if (!isset($modelCallerid->id)) {
+        if ( ! isset($modelCallerid->id)) {
             $error_msg = Yii::t('zii', 'Error : Authentication Error!');
             echo $error_msg;
             exit;
diff --git a/protected/controllers/SmsController.php b/protected/controllers/SmsController.php
index 970df0c97..a53edc167 100755
--- a/protected/controllers/SmsController.php
+++ b/protected/controllers/SmsController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,7 +23,7 @@
 class SmsController extends Controller
 {
     public $attributeOrder = 'date DESC';
-    public $extraValues    = array('idUser' => 'username');
+    public $extraValues    = ['idUser' => 'username'];
 
     public function init()
     {
@@ -47,9 +47,9 @@ public function actionRead($asJson = true, $condition = null)
     public function actionSend()
     {
         SqlInject::sanitize($_GET);
-        if (!isset($_GET['number']) || !isset($_GET['text']) || !isset($_GET['username']) || !isset($_GET['password'])) {
+        if ( ! isset($_GET['number']) || ! isset($_GET['text']) || ! isset($_GET['username']) || ! isset($_GET['password'])) {
             exit('invalid data');
-        } elseif (!is_numeric($_GET['number'])) {
+        } elseif ( ! is_numeric($_GET['number'])) {
             exit('invalid non-numeric number');
         } else if (strlen($_GET['number']) > 15) {
             exit('invalid number');
@@ -61,7 +61,7 @@ public function actionSend()
 
         $modelSip = AccessManager::checkAccess($_GET['username'], $_GET['password']);
 
-        if (!isset($modelSip->id)) {
+        if ( ! isset($modelSip->id)) {
             exit('invalid user');
         }
 
@@ -94,7 +94,7 @@ public function actionSendPost()
          */
 
         SqlInject::sanitize($_POST);
-        if (!isset($_POST['number']) || !isset($_POST['text']) || !isset($_POST['username'])) {
+        if ( ! isset($_POST['number']) || ! isset($_POST['text']) || ! isset($_POST['username'])) {
             exit('invalid data');
         } else if (strlen($_POST['text']) > 200) {
             exit('invalid number');
@@ -102,8 +102,8 @@ public function actionSendPost()
             exit('invalid user');
         }
 
-        $modelUser = User::model()->find('username = :key', array(':key' => $_POST['username']));
-        if (!isset($modelUser->id)) {
+        $modelUser = User::model()->find('username = :key', [':key' => $_POST['username']]);
+        if ( ! isset($modelUser->id)) {
             exit('invalid data');
         }
         $numbers = explode(',', $_POST['number']);
diff --git a/protected/controllers/SmtpsController.php b/protected/controllers/SmtpsController.php
index a2b6b30bb..a80e08635 100755
--- a/protected/controllers/SmtpsController.php
+++ b/protected/controllers/SmtpsController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,24 +23,24 @@
 class SmtpsController extends Controller
 {
     public $attributeOrder = 't.id';
-    public $extraValues    = array('idUser' => 'username');
+    public $extraValues    = ['idUser' => 'username'];
 
-    public $fieldsFkReport = array(
-        'id_user' => array(
+    public $fieldsFkReport = [
+        'id_user' => [
             'table'       => 'pkg_user',
             'pk'          => 'id',
             'fieldReport' => 'username',
-        ),
-    );
+        ],
+    ];
 
-    public $fieldsInvisibleClient = array(
+    public $fieldsInvisibleClient = [
         'id_user',
         'password',
         'username',
         'host',
         'port',
         'encryption',
-    );
+    ];
 
     public function init()
     {
@@ -64,9 +64,9 @@ public function extraFilterCustomAgent($filter)
     {
         //se é agente filtrar pelo user.id_user
 
-        $this->relationFilter['idUser'] = array(
+        $this->relationFilter['idUser'] = [
             'condition' => "idUser.id LIKE :agfby",
-        );
+        ];
 
         $this->paramsFilter[':agfby'] = Yii::app()->session['id_user'];
 
@@ -79,11 +79,11 @@ public function beforeSave($values)
 
             $modelUser = Smtps::model()->find("id_user = " . Yii::app()->session['id_user']);
             if (isset($modelUser->id)) {
-                echo json_encode(array(
+                echo json_encode([
                     'success' => false,
-                    'rows'    => array(),
+                    'rows'    => [],
                     'errors'  => Yii::t('zii', 'Do you already have a SMTP'),
-                ));
+                ]);
                 exit;
             }
 
@@ -119,12 +119,12 @@ public function actionTestMail()
 
         $modelUser = User::model()->findByPk((int) Yii::app()->session['id_user']);
 
-        if (!preg_match("/@/", $modelUser->email)) {
+        if ( ! preg_match("/@/", $modelUser->email)) {
 
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => false,
                 $this->nameMsg     => 'PLEASE CONFIGURE A VALID EMAIL TO USER ' . $modelUser->username,
-            ));
+            ]);
             exit;
         }
 
@@ -140,10 +140,10 @@ public function actionTestMail()
             $sussess = true;
         }
 
-        echo json_encode(array(
+        echo json_encode([
             $this->nameSuccess => $sussess,
             $this->nameMsg     => $mail->output,
-        ));
+        ]);
     }
 
 }
diff --git a/protected/controllers/TemplateMailController.php b/protected/controllers/TemplateMailController.php
index c0cc65463..57b30959f 100755
--- a/protected/controllers/TemplateMailController.php
+++ b/protected/controllers/TemplateMailController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -33,9 +33,9 @@ public function init()
         $this->titleReport   = Yii::t('zii', 'Emails');
 
         if (Yii::app()->session['isAdmin']) {
-            $this->relationFilter['idUser'] = array(
+            $this->relationFilter['idUser'] = [
                 'condition' => "idUser.id  = 1",
-            );
+            ];
 
             parent::init();
 
@@ -47,9 +47,9 @@ public function extraFilterCustomAgent($filter)
     {
         //se é agente filtrar pelo user.id_user
 
-        $this->relationFilter['idUser'] = array(
+        $this->relationFilter['idUser'] = [
             'condition' => "idUser.id LIKE :agfby",
-        );
+        ];
 
         $this->paramsFilter[':agfby'] = Yii::app()->session['id_user'];
 
diff --git a/protected/controllers/TrunkController.php b/protected/controllers/TrunkController.php
index 0f7c60b55..05ab5aacf 100755
--- a/protected/controllers/TrunkController.php
+++ b/protected/controllers/TrunkController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -22,21 +22,21 @@
 
 class TrunkController extends Controller
 {
-    public $extraValues    = array('idProvider' => 'provider_name', 'failoverTrunk' => 'trunkcode');
+    public $extraValues    = ['idProvider' => 'provider_name', 'failoverTrunk' => 'trunkcode'];
     public $nameFkRelated  = 'failover_trunk';
     public $attributeOrder = 'id';
-    public $fieldsFkReport = array(
-        'id_provider'    => array(
+    public $fieldsFkReport = [
+        'id_provider'    => [
             'table'       => 'pkg_provider',
             'pk'          => 'id',
             'fieldReport' => 'provider_name',
-        ),
-        'failover_trunk' => array(
+        ],
+        'failover_trunk' => [
             'table'       => 'pkg_trunk',
             'pk'          => 'id',
             'fieldReport' => 'trunkcode',
-        ),
-    );
+        ],
+    ];
     public function init()
     {
         $this->instanceModel = new Trunk;
@@ -57,15 +57,15 @@ public function beforeSave($values)
         }
 
         if ((isset($values['register']) && $values['register'] == 1 && isset($values['register_string']))
-            && !preg_match("/^.{3}.*:.{3}.*@.{5}.*\/.{3}.*/", $values['register_string'])) {
-            echo json_encode(array(
+            && ! preg_match("/^.{3}.*:.{3}.*@.{5}.*\/.{3}.*/", $values['register_string'])) {
+            echo json_encode([
                 'success' => false,
-                'rows'    => array(),
+                'rows'    => [],
                 'errors'  => [
                     'register'        => Yii::t('zii', 'Invalid register string. Only use register option to Trunk authentication via user and password.'),
                     'register_string' => Yii::t('zii', 'Invalid register string'),
                 ],
-            ));
+            ]);
             exit();
         }
 
@@ -136,11 +136,11 @@ public function generateSipFile()
         }
         $select = 'trunkcode, user, secret, disallow, allow, directmedia, context, dtmfmode, insecure, nat, qualify, type, host, fromdomain,fromuser, register_string,port,transport,encryption,sendrpid,maxuse,sip_config';
         $model  = Trunk::model()->findAll(
-            array(
+            [
                 'select'    => $select,
                 'condition' => 'providertech = :key AND status = 1',
-                'params'    => array(':key' => 'sip'),
-            ));
+                'params'    => [':key' => 'sip'],
+            ]);
 
         if (count($model)) {
             AsteriskAccess::instance()->writeAsteriskFile($model, '/etc/asterisk/sip_magnus.conf', 'trunkcode');
@@ -148,11 +148,11 @@ public function generateSipFile()
 
         $select = 'trunkcode, user, secret, disallow, allow, directmedia, context, dtmfmode, insecure, nat, qualify, type, host, register_string,sip_config';
         $model  = Trunk::model()->findAll(
-            array(
+            [
                 'select'    => $select,
                 'condition' => 'providertech = :key AND status = 1',
-                'params'    => array(':key' => 'iax2'),
-            ));
+                'params'    => [':key' => 'iax2'],
+            ]);
 
         if (count($model)) {
             AsteriskAccess::instance()->writeAsteriskFile($model, '/etc/asterisk/iax_magnus.conf', 'trunkcode');
diff --git a/protected/controllers/TrunkGroupController.php b/protected/controllers/TrunkGroupController.php
index 9c7ccc376..9bafa8e55 100755
--- a/protected/controllers/TrunkGroupController.php
+++ b/protected/controllers/TrunkGroupController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -54,10 +54,10 @@ public function saveUpdateAll($ids, $values, $module, $namePk, $subRecords)
     {
         if (Yii::app()->session['isClient']) {
             # retorna o resultado da execucao
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => false,
                 $this->nameMsg     => 'Only admins can batch update this menu',
-            ));
+            ]);
             exit;
         }
 
@@ -80,10 +80,10 @@ public function saveUpdateAll($ids, $values, $module, $namePk, $subRecords)
 
         }
 
-        echo json_encode(array(
+        echo json_encode([
             $this->nameSuccess => $this->success,
             $this->nameMsg     => 'Success',
-        ));
+        ]);
         exit;
 
     }
@@ -92,11 +92,11 @@ public function beforeSave($values)
     {
 
         if (count($values['id_trunk']) > 17) {
-            echo json_encode(array(
+            echo json_encode([
                 'success' => false,
-                'rows'    => array(),
+                'rows'    => [],
                 'errors'  => 'Maximum trunks is 17',
-            ));
+            ]);
             exit;
         }
 
diff --git a/protected/controllers/TrunkSipCodesController.php b/protected/controllers/TrunkSipCodesController.php
index 7eb95173d..9c52b7a35 100755
--- a/protected/controllers/TrunkSipCodesController.php
+++ b/protected/controllers/TrunkSipCodesController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
diff --git a/protected/controllers/VoucherController.php b/protected/controllers/VoucherController.php
index 40c7ae985..6ba20d3db 100755
--- a/protected/controllers/VoucherController.php
+++ b/protected/controllers/VoucherController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -23,17 +23,17 @@
 class VoucherController extends Controller
 {
     public $attributeOrder        = 't.id';
-    public $extraValues           = array('idUser' => 'username');
-    public $fieldsInvisibleClient = array(
+    public $extraValues           = ['idUser' => 'username'];
+    public $fieldsInvisibleClient = [
         'tag',
         'creationdate',
         'expirationdate',
         'used',
         'currency',
-    );
-    public $fieldsInvisibleAgent = array(
+    ];
+    public $fieldsInvisibleAgent = [
         'tag',
-    );
+    ];
 
     public function init()
     {
@@ -55,10 +55,10 @@ public function actionSave()
             $values = $this->getAttributesRequest();
 
             $modelVoucher = $this->abstractModel->find('id_user IS NULL AND voucher= :voucher AND used = 0 AND usedate = :key1',
-                array(
+                [
                     ':voucher' => $values['voucher'],
                     ':key1'    => '0000-00-00 00:00:00',
-                ));
+                ]);
 
             if (isset($modelVoucher->id)) {
                 $modelVoucher->id_user = Yii::app()->session['id_user'];
@@ -82,10 +82,10 @@ public function actionSave()
             }
 
             # retorna o resultado da execucao
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => $this->success,
                 $this->nameMsg     => $this->msg,
-            ));
+            ]);
         } else {
 
             $values = $this->getAttributesRequest();
@@ -106,18 +106,18 @@ public function actionSave()
                 }
             }
 
-            $newRecord = $this->abstractModel->findAll(array(
+            $newRecord = $this->abstractModel->findAll([
                 'select' => $this->select,
                 'join'   => $this->join,
                 'order'  => 'id DESC',
                 'limit'  => 1,
-            ));
+            ]);
 
-            echo json_encode(array(
+            echo json_encode([
                 $this->nameSuccess => true,
                 $this->nameRoot    => $this->getAttributesModels($newRecord, $this->extraValues),
                 $this->nameMsg     => $this->msgSuccess,
-            ));
+            ]);
             exit;
 
         }
diff --git a/protected/controllers/WHMCSController.php b/protected/controllers/WHMCSController.php
index 8d8345836..78ab98789 100755
--- a/protected/controllers/WHMCSController.php
+++ b/protected/controllers/WHMCSController.php
@@ -8,7 +8,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -24,7 +24,7 @@ class WHMCSController extends Controller
 {
 
     public $attributeOrder = 'id';
-    public $extraValues    = array('idUser' => 'username');
+    public $extraValues    = ['idUser' => 'username'];
     public function init()
     {
         $this->instanceModel = new WHMCS;
diff --git a/protected/models/Alarm.php b/protected/models/Alarm.php
index 243a43058..ed474e1e1 100755
--- a/protected/models/Alarm.php
+++ b/protected/models/Alarm.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,13 +52,13 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('type, amount, condition, status', 'required'),
-            array('type, amount, condition, status, id_plan, period', 'numerical', 'integerOnly' => true),
-            array('subject', 'length', 'max' => 200),
-            array('message', 'length', 'max' => 1000),
+        $rules = [
+            ['type, amount, condition, status', 'required'],
+            ['type, amount, condition, status, id_plan, period', 'numerical', 'integerOnly' => true],
+            ['subject', 'length', 'max' => 200],
+            ['message', 'length', 'max' => 1000],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -67,9 +67,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idPlan' => array(self::BELONGS_TO, 'Plan', 'id_plan'),
-        );
+        return [
+            'idPlan' => [self::BELONGS_TO, 'Plan', 'id_plan'],
+        ];
     }
 
     public function beforeSave()
diff --git a/protected/models/Api.php b/protected/models/Api.php
index 03cc055a8..1ec8719bc 100755
--- a/protected/models/Api.php
+++ b/protected/models/Api.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,15 +52,15 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('api_key, api_secret', 'required'),
-            array('api_key, api_secret', 'unique'),
-            array('id_user, status', 'numerical', 'integerOnly' => true),
-            array('api_key, api_secret, api_restriction_ips', 'length', 'max' => 150),
-            array('api_key, api_secret', 'length', 'min' => 15),
-            array('action', 'length', 'max' => 7),
-            array('api_key', 'checksecret'),
-        );
+        $rules = [
+            ['api_key, api_secret', 'required'],
+            ['api_key, api_secret', 'unique'],
+            ['id_user, status', 'numerical', 'integerOnly' => true],
+            ['api_key, api_secret, api_restriction_ips', 'length', 'max' => 150],
+            ['api_key, api_secret', 'length', 'min' => 15],
+            ['action', 'length', 'max' => 7],
+            ['api_key', 'checksecret'],
+        ];
         return $this->getExtraField($rules);
     }
     public function checksecret($attribute, $params)
@@ -83,8 +83,8 @@ public function checksecret($attribute, $params)
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/Balance.php b/protected/models/Balance.php
index 9a059bede..a746f9b65 100755
--- a/protected/models/Balance.php
+++ b/protected/models/Balance.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -40,10 +40,10 @@ public function tableName()
      */
     public function rules()
     {
-        $rules = array(
-            array('last_use,id_prefix', 'numerical', 'integerOnly' => true),
+        $rules = [
+            ['last_use,id_prefix', 'numerical', 'integerOnly' => true],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/BuyCredit.php b/protected/models/BuyCredit.php
index 9ccedd663..d0cf6db03 100755
--- a/protected/models/BuyCredit.php
+++ b/protected/models/BuyCredit.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -40,10 +40,10 @@ public function tableName()
      */
     public function rules()
     {
-        $rules = array(
-            array('username', 'required'),
+        $rules = [
+            ['username', 'required'],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
     /**
@@ -53,8 +53,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/Call.php b/protected/models/Call.php
index baede0b31..b92be9071 100755
--- a/protected/models/Call.php
+++ b/protected/models/Call.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -62,24 +62,24 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, id_plan, calledstation', 'required'),
-            array('id_user, id_plan, id_campaign, id_server, id_trunk, sessiontime, real_sessiontime, sipiax', 'numerical', 'integerOnly' => true),
-            array('uniqueid, starttime, src, calledstation,
-                terminatecauseid, buycost, sessionbill,  agent_bill, callerid', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['id_user, id_plan, calledstation', 'required'],
+            ['id_user, id_plan, id_campaign, id_server, id_trunk, sessiontime, real_sessiontime, sipiax', 'numerical', 'integerOnly' => true],
+            ['uniqueid, starttime, src, calledstation,
+                terminatecauseid, buycost, sessionbill,  agent_bill, callerid', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 
     public function relations()
     {
-        return array(
-            'idPrefix'   => array(self::BELONGS_TO, 'Prefix', 'id_prefix'),
-            'idPlan'     => array(self::BELONGS_TO, 'Plan', 'id_plan'),
-            'idTrunk'    => array(self::BELONGS_TO, 'Trunk', 'id_trunk'),
-            'idUser'     => array(self::BELONGS_TO, 'User', 'id_user'),
-            'idCampaign' => array(self::BELONGS_TO, 'Campaign', 'id_campaign'),
-            'idServer'   => array(self::BELONGS_TO, 'Servers', 'id_server'),
-        );
+        return [
+            'idPrefix'   => [self::BELONGS_TO, 'Prefix', 'id_prefix'],
+            'idPlan'     => [self::BELONGS_TO, 'Plan', 'id_plan'],
+            'idTrunk'    => [self::BELONGS_TO, 'Trunk', 'id_trunk'],
+            'idUser'     => [self::BELONGS_TO, 'User', 'id_user'],
+            'idCampaign' => [self::BELONGS_TO, 'Campaign', 'id_campaign'],
+            'idServer'   => [self::BELONGS_TO, 'Servers', 'id_server'],
+        ];
     }
 }
diff --git a/protected/models/CallArchive.php b/protected/models/CallArchive.php
index b0bad9889..700373f46 100755
--- a/protected/models/CallArchive.php
+++ b/protected/models/CallArchive.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -61,22 +61,22 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, id_plan, calledstation', 'required'),
-            array('id_user, id_plan, id_trunk, sessiontime, real_sessiontime, sipiax', 'numerical', 'integerOnly' => true),
-            array('uniqueid, starttime, src, calledstation,
-                terminatecauseid, buycost, sessionbill,  agent_bill, callerid', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['id_user, id_plan, calledstation', 'required'],
+            ['id_user, id_plan, id_trunk, sessiontime, real_sessiontime, sipiax', 'numerical', 'integerOnly' => true],
+            ['uniqueid, starttime, src, calledstation,
+                terminatecauseid, buycost, sessionbill,  agent_bill, callerid', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 
     public function relations()
     {
-        return array(
-            'idPrefix' => array(self::BELONGS_TO, 'Prefix', 'id_prefix'),
-            'idPlan'   => array(self::BELONGS_TO, 'Plan', 'id_plan'),
-            'idTrunk'  => array(self::BELONGS_TO, 'Trunk', 'id_trunk'),
-            'idUser'   => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idPrefix' => [self::BELONGS_TO, 'Prefix', 'id_prefix'],
+            'idPlan'   => [self::BELONGS_TO, 'Plan', 'id_plan'],
+            'idTrunk'  => [self::BELONGS_TO, 'Trunk', 'id_trunk'],
+            'idUser'   => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/CallBack.php b/protected/models/CallBack.php
index 89e3c1693..63b26a268 100755
--- a/protected/models/CallBack.php
+++ b/protected/models/CallBack.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,13 +52,13 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user,num_attempt, id_server_group,id_did,sessiontime', 'numerical', 'integerOnly' => true),
-            array('uniqueid, server_ip', 'length', 'max' => 40),
-            array('status, callerid', 'length', 'max' => 10),
-            array('channel, exten, account, context, timeout, priority', 'length', 'max' => 60),
-            array('variable', 'length', 'max' => 300),
-        );
+        $rules = [
+            ['id_user,num_attempt, id_server_group,id_did,sessiontime', 'numerical', 'integerOnly' => true],
+            ['uniqueid, server_ip', 'length', 'max' => 40],
+            ['status, callerid', 'length', 'max' => 10],
+            ['channel, exten, account, context, timeout, priority', 'length', 'max' => 60],
+            ['variable', 'length', 'max' => 300],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -67,10 +67,10 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-            'idDid'  => array(self::BELONGS_TO, 'Did', 'id_did'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+            'idDid'  => [self::BELONGS_TO, 'Did', 'id_did'],
+        ];
     }
 
     public function beforeSave()
diff --git a/protected/models/CallFailed.php b/protected/models/CallFailed.php
index 892a27ff2..c437bb291 100755
--- a/protected/models/CallFailed.php
+++ b/protected/models/CallFailed.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,23 +52,23 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, calledstation', 'required'),
-            array('id_user, id_plan, id_trunk, id_server, sipiax, terminatecauseid,hangupcause', 'numerical', 'integerOnly' => true),
-            array('uniqueid, starttime, callerid, src, calledstation', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['id_user, calledstation', 'required'],
+            ['id_user, id_plan, id_trunk, id_server, sipiax, terminatecauseid,hangupcause', 'numerical', 'integerOnly' => true],
+            ['uniqueid, starttime, callerid, src, calledstation', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 
     public function relations()
     {
-        return array(
-            'idPrefix' => array(self::BELONGS_TO, 'Prefix', 'id_prefix'),
-            'idPlan'   => array(self::BELONGS_TO, 'Plan', 'id_plan'),
-            'idTrunk'  => array(self::BELONGS_TO, 'Trunk', 'id_trunk'),
-            'idUser'   => array(self::BELONGS_TO, 'User', 'id_user'),
-            'idServer' => array(self::BELONGS_TO, 'Servers', 'id_server'),
-        );
+        return [
+            'idPrefix' => [self::BELONGS_TO, 'Prefix', 'id_prefix'],
+            'idPlan'   => [self::BELONGS_TO, 'Plan', 'id_plan'],
+            'idTrunk'  => [self::BELONGS_TO, 'Trunk', 'id_trunk'],
+            'idUser'   => [self::BELONGS_TO, 'User', 'id_user'],
+            'idServer' => [self::BELONGS_TO, 'Servers', 'id_server'],
+        ];
     }
 
     public function createDataBaseIfNotExist()
diff --git a/protected/models/CallOnLine.php b/protected/models/CallOnLine.php
index e6ac74648..0b18a1306 100755
--- a/protected/models/CallOnLine.php
+++ b/protected/models/CallOnLine.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'numerical', 'integerOnly' => true),
-            array('canal, tronco, from_ip, sip_account', 'length', 'max' => 50),
-            array('ndiscado, status, duration', 'length', 'max' => 16),
-            array('codec, reinvite', 'length', 'max' => 5),
-        );
+        $rules = [
+            ['id_user', 'numerical', 'integerOnly' => true],
+            ['canal, tronco, from_ip, sip_account', 'length', 'max' => 50],
+            ['ndiscado, status, duration', 'length', 'max' => 16],
+            ['codec, reinvite', 'length', 'max' => 5],
+        ];
         return $this->getExtraField($rules);
 
     }
@@ -67,9 +67,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
     public function insertCalls($sql)
diff --git a/protected/models/CallOnlineChart.php b/protected/models/CallOnlineChart.php
index 0d9132a8b..00cb24f77 100755
--- a/protected/models/CallOnlineChart.php
+++ b/protected/models/CallOnlineChart.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('total', 'numerical', 'integerOnly' => true),
-            array('date, answer', 'length', 'max' => 100),
-        );
+        $rules = [
+            ['total', 'numerical', 'integerOnly' => true],
+            ['date, answer', 'length', 'max' => 100],
+        ];
 
         $rules = $this->getExtraField($rules);
 
diff --git a/protected/models/CallShop.php b/protected/models/CallShop.php
index 7eb250422..9d8314275 100755
--- a/protected/models/CallShop.php
+++ b/protected/models/CallShop.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -54,25 +54,25 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'required'),
-            array('id_user, calllimit', 'numerical', 'integerOnly' => true),
-            array('name, callerid, context, fromuser, fromdomain, md5secret, secret, fullcontact', 'length', 'max' => 80),
-            array('regexten, insecure, regserver, vmexten, callingpres, mohsuggest, allowtransfer, callshoptime', 'length', 'max' => 20),
-            array('amaflags, dtmfmode, qualify', 'length', 'max' => 7),
-            array('callgroup, pickupgroup, auth, subscribemwi, usereqphone, autoframing', 'length', 'max' => 10),
-            array('DEFAULTip, accountcode, ipaddr, maxcallbitrate, rtpkeepalive', 'length', 'max' => 15),
-            array('host', 'length', 'max' => 31),
-            array('language', 'length', 'max' => 2),
-            array('mailbox', 'length', 'max' => 50),
-            array('nat, rtptimeout, rtpholdtimeout', 'length', 'max' => 3),
-            array('deny, permit', 'length', 'max' => 95),
-            array('port', 'length', 'max' => 5),
-            array('type', 'length', 'max' => 6),
-            array('disallow, allow, setvar, useragent', 'length', 'max' => 100),
-            array('lastms', 'length', 'max' => 11),
-            array('defaultuser, cid_number, outboundproxy', 'length', 'max' => 40),
-        );
+        $rules = [
+            ['id_user', 'required'],
+            ['id_user, calllimit', 'numerical', 'integerOnly' => true],
+            ['name, callerid, context, fromuser, fromdomain, md5secret, secret, fullcontact', 'length', 'max' => 80],
+            ['regexten, insecure, regserver, vmexten, callingpres, mohsuggest, allowtransfer, callshoptime', 'length', 'max' => 20],
+            ['amaflags, dtmfmode, qualify', 'length', 'max' => 7],
+            ['callgroup, pickupgroup, auth, subscribemwi, usereqphone, autoframing', 'length', 'max' => 10],
+            ['DEFAULTip, accountcode, ipaddr, maxcallbitrate, rtpkeepalive', 'length', 'max' => 15],
+            ['host', 'length', 'max' => 31],
+            ['language', 'length', 'max' => 2],
+            ['mailbox', 'length', 'max' => 50],
+            ['nat, rtptimeout, rtpholdtimeout', 'length', 'max' => 3],
+            ['deny, permit', 'length', 'max' => 95],
+            ['port', 'length', 'max' => 5],
+            ['type', 'length', 'max' => 6],
+            ['disallow, allow, setvar, useragent', 'length', 'max' => 100],
+            ['lastms', 'length', 'max' => 11],
+            ['defaultuser, cid_number, outboundproxy', 'length', 'max' => 40],
+        ];
 
         $rules = $this->getExtraField($rules);
 
@@ -85,8 +85,8 @@ public function relations()
     {
         // NOTE: you may need to adjust the relation name and the related
         // class name for the relations automatically generated below.
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/CallShopCdr.php b/protected/models/CallShopCdr.php
index 43f184380..8d6e1b6a1 100755
--- a/protected/models/CallShopCdr.php
+++ b/protected/models/CallShopCdr.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -53,14 +53,14 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'required'),
-            array('id_user, status, sessiontime', 'numerical', 'integerOnly' => true),
-            array('price, buycost, markup,price_min', 'length', 'max' => 20),
-            array('cabina', 'length', 'max' => 30),
-            array('calledstation, sessionid', 'length', 'max' => 50),
-            array('destination, sessionid', 'length', 'max' => 100),
-        );
+        $rules = [
+            ['id_user', 'required'],
+            ['id_user, status, sessiontime', 'numerical', 'integerOnly' => true],
+            ['price, buycost, markup,price_min', 'length', 'max' => 20],
+            ['cabina', 'length', 'max' => 30],
+            ['calledstation, sessionid', 'length', 'max' => 50],
+            ['destination, sessionid', 'length', 'max' => 100],
+        ];
         return $this->getExtraField($rules);
 
     }
diff --git a/protected/models/CallSummaryCallShop.php b/protected/models/CallSummaryCallShop.php
index 261a2cc4a..4458bf09e 100755
--- a/protected/models/CallSummaryCallShop.php
+++ b/protected/models/CallSummaryCallShop.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -65,10 +65,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'integerOnly' => true),
-            array('sessiontime, price, buycost, sumbuycost, lucro, aloc_success_call, aloc_all_calls, sumaloc_all_calls', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['id_user', 'integerOnly' => true],
+            ['sessiontime, price, buycost, sumbuycost, lucro, aloc_success_call, aloc_all_calls, sumaloc_all_calls', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
     /**
@@ -76,9 +76,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
 }
diff --git a/protected/models/CallSummaryDayAgent.php b/protected/models/CallSummaryDayAgent.php
index ca78ce42d..426f7a7cb 100755
--- a/protected/models/CallSummaryDayAgent.php
+++ b/protected/models/CallSummaryDayAgent.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -61,18 +61,18 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('sessiontime, id_user, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['sessiontime, id_user, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }/**
      * @return array regras de relacionamento.
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
 }
diff --git a/protected/models/CallSummaryDayTrunk.php b/protected/models/CallSummaryDayTrunk.php
index 6e2aab72c..95b82e97b 100755
--- a/protected/models/CallSummaryDayTrunk.php
+++ b/protected/models/CallSummaryDayTrunk.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -61,9 +61,9 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('sessiontime,day, id_trunk, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['sessiontime,day, id_trunk, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -72,9 +72,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idTrunk' => array(self::BELONGS_TO, 'Trunk', 'id_trunk'),
-        );
+        return [
+            'idTrunk' => [self::BELONGS_TO, 'Trunk', 'id_trunk'],
+        ];
     }
 
 }
diff --git a/protected/models/CallSummaryDayUser.php b/protected/models/CallSummaryDayUser.php
index abfbf446f..c2cdaab0a 100755
--- a/protected/models/CallSummaryDayUser.php
+++ b/protected/models/CallSummaryDayUser.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -62,9 +62,9 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('sessiontime,day, id_user, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['sessiontime,day, id_user, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -73,9 +73,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
 }
diff --git a/protected/models/CallSummaryMonthDid.php b/protected/models/CallSummaryMonthDid.php
index 94e8d9a00..6ef89f1cc 100755
--- a/protected/models/CallSummaryMonthDid.php
+++ b/protected/models/CallSummaryMonthDid.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -58,9 +58,9 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('month, sessiontime, aloc_all_calls, nbcall, sessionbill, id_did', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['month, sessiontime, aloc_all_calls, nbcall, sessionbill, id_did', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -69,9 +69,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idDid' => array(self::BELONGS_TO, 'Did', 'id_did'),
-        );
+        return [
+            'idDid' => [self::BELONGS_TO, 'Did', 'id_did'],
+        ];
     }
 
 }
diff --git a/protected/models/CallSummaryMonthTrunk.php b/protected/models/CallSummaryMonthTrunk.php
index 7839383a9..9d92b5084 100755
--- a/protected/models/CallSummaryMonthTrunk.php
+++ b/protected/models/CallSummaryMonthTrunk.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -61,9 +61,9 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('sessiontime,day, id_trunk, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['sessiontime,day, id_trunk, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -72,9 +72,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idTrunk' => array(self::BELONGS_TO, 'Trunk', 'id_trunk'),
-        );
+        return [
+            'idTrunk' => [self::BELONGS_TO, 'Trunk', 'id_trunk'],
+        ];
     }
 
 }
diff --git a/protected/models/CallSummaryMonthUser.php b/protected/models/CallSummaryMonthUser.php
index 0e2a2fea3..7611570be 100755
--- a/protected/models/CallSummaryMonthUser.php
+++ b/protected/models/CallSummaryMonthUser.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -62,9 +62,9 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('sessiontime,day, id_user, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['sessiontime,day, id_user, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -73,9 +73,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
 }
diff --git a/protected/models/CallSummaryPerDay.php b/protected/models/CallSummaryPerDay.php
index 9c249948e..418421ea3 100755
--- a/protected/models/CallSummaryPerDay.php
+++ b/protected/models/CallSummaryPerDay.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -62,9 +62,9 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('day,id_user,sessiontime,aloc_all_calls,nbcall,buycost,sessionbill,lucro', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['day,id_user,sessiontime,aloc_all_calls,nbcall,buycost,sessionbill,lucro', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/CallSummaryPerMonth.php b/protected/models/CallSummaryPerMonth.php
index 998d2c1df..07e453966 100755
--- a/protected/models/CallSummaryPerMonth.php
+++ b/protected/models/CallSummaryPerMonth.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -60,9 +60,9 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('month,sessiontime, sessionbill, nbcall, buycost, lucro, aloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['month,sessiontime, sessionbill, nbcall, buycost, lucro, aloc_all_calls, nbcall_fail, asr', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/CallSummaryPerTrunk.php b/protected/models/CallSummaryPerTrunk.php
index 5c908c753..4fc7b077d 100755
--- a/protected/models/CallSummaryPerTrunk.php
+++ b/protected/models/CallSummaryPerTrunk.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -62,17 +62,17 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_trunk', 'numerical', 'integerOnly' => true),
-            array('sessiontime, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['id_trunk', 'numerical', 'integerOnly' => true],
+            ['sessiontime, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
     public function relations()
     {
-        return array(
-            'idTrunk' => array(self::BELONGS_TO, 'Trunk', 'id_trunk'),
-        );
+        return [
+            'idTrunk' => [self::BELONGS_TO, 'Trunk', 'id_trunk'],
+        ];
     }
 
 }
diff --git a/protected/models/CallSummaryPerUser.php b/protected/models/CallSummaryPerUser.php
index 90044e666..44bc5986d 100755
--- a/protected/models/CallSummaryPerUser.php
+++ b/protected/models/CallSummaryPerUser.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -63,17 +63,17 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'numerical', 'integerOnly' => true),
-            array('sessiontime, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['id_user', 'numerical', 'integerOnly' => true],
+            ['sessiontime, sessionbill, nbcall, buycost, lucro, aloc_all_calls, sumaloc_all_calls', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
 }
diff --git a/protected/models/Callerid.php b/protected/models/Callerid.php
index b7f616434..528ec5332 100755
--- a/protected/models/Callerid.php
+++ b/protected/models/Callerid.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,13 +52,13 @@ public function primaryKey()
      */
     public function rules()
     {
-        return array(
-            array('cid, id_user', 'required'),
-            array('id_user', 'numerical', 'integerOnly' => true),
-            array('cid, name', 'length', 'max' => 100),
-            array('description', 'length', 'max' => 500),
-            array('activated', 'length', 'max' => 1),
-        );
+        return [
+            ['cid, id_user', 'required'],
+            ['id_user', 'numerical', 'integerOnly' => true],
+            ['cid, name', 'length', 'max' => 100],
+            ['description', 'length', 'max' => 500],
+            ['activated', 'length', 'max' => 1],
+        ];
     }
 
     /**
@@ -66,8 +66,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/Campaign.php b/protected/models/Campaign.php
index a4b36240f..c62aa2904 100755
--- a/protected/models/Campaign.php
+++ b/protected/models/Campaign.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -61,17 +61,17 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('name, id_user', 'required'),
-            array('id_user, digit_authorize, id_plan,restrict_phone, secondusedreal, enable_max_call, nb_callmade, type, monday, tuesday, wednesday, thursday, friday, saturday, sunday, status, frequency, auto_reprocess, max_frequency', 'numerical', 'integerOnly' => true),
-            array('name, audio, audio_2,record_call, callerid', 'length', 'max' => 100),
-            array('startingdate, expirationdate', 'length', 'max' => 50),
-            array('daily_start_time, daily_stop_time', 'length', 'max' => 8),
-            array('forward_number', 'length', 'max' => 160),
-            array('description', 'length', 'max' => 300),
-            array('tts_audio,tts_audio2,asr_audio,asr_options', 'length', 'max' => 200),
-            array('from', 'length', 'max' => 20),
-        );
+        $rules = [
+            ['name, id_user', 'required'],
+            ['id_user, digit_authorize, id_plan,restrict_phone, secondusedreal, enable_max_call, nb_callmade, type, monday, tuesday, wednesday, thursday, friday, saturday, sunday, status, frequency, auto_reprocess, max_frequency', 'numerical', 'integerOnly' => true],
+            ['name, audio, audio_2,record_call, callerid', 'length', 'max' => 100],
+            ['startingdate, expirationdate', 'length', 'max' => 50],
+            ['daily_start_time, daily_stop_time', 'length', 'max' => 8],
+            ['forward_number', 'length', 'max' => 160],
+            ['description', 'length', 'max' => 300],
+            ['tts_audio,tts_audio2,asr_audio,asr_options', 'length', 'max' => 200],
+            ['from', 'length', 'max' => 20],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -80,10 +80,10 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-            'idPlan' => array(self::BELONGS_TO, 'Plan', 'id_plan'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+            'idPlan' => [self::BELONGS_TO, 'Plan', 'id_plan'],
+        ];
     }
 
     public function checkCampaignActive($id_campaign, $nbpage, $name_day)
diff --git a/protected/models/CampaignLog.php b/protected/models/CampaignLog.php
index 7cb997753..2c7663dfa 100755
--- a/protected/models/CampaignLog.php
+++ b/protected/models/CampaignLog.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -51,13 +51,13 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('total', 'required'),
-            array('loops', 'numerical', 'integerOnly' => true),
-            array('trunks, campaigns', 'length', 'max' => 100),
-            array('date', 'length', 'max' => 50),
+        $rules = [
+            ['total', 'required'],
+            ['loops', 'numerical', 'integerOnly' => true],
+            ['trunks, campaigns', 'length', 'max' => 100],
+            ['date', 'length', 'max' => 50],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/CampaignPhonebook.php b/protected/models/CampaignPhonebook.php
index 7e34bf3a0..f558a3ec2 100755
--- a/protected/models/CampaignPhonebook.php
+++ b/protected/models/CampaignPhonebook.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -44,7 +44,7 @@ public function tableName()
      */
     public function primaryKey()
     {
-        return array('id_campaign', 'id_phonebook');
+        return ['id_campaign', 'id_phonebook'];
     }
 
     /**
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_campaign, id_phonebook', 'required'),
-            array('id_campaign, id_phonebook', 'numerical', 'integerOnly' => true),
-        );
+        $rules = [
+            ['id_campaign, id_phonebook', 'required'],
+            ['id_campaign, id_phonebook', 'numerical', 'integerOnly' => true],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -64,9 +64,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idCampaign'  => array(self::BELONGS_TO, 'Campaign', 'id_campaign'),
-            'idPhoneBook' => array(self::BELONGS_TO, 'PhoneBook', 'id_phonebook'),
-        );
+        return [
+            'idCampaign'  => [self::BELONGS_TO, 'Campaign', 'id_campaign'],
+            'idPhoneBook' => [self::BELONGS_TO, 'PhoneBook', 'id_phonebook'],
+        ];
     }
 }
diff --git a/protected/models/CampaignPoll.php b/protected/models/CampaignPoll.php
index dab9d535d..ba55f1b7e 100755
--- a/protected/models/CampaignPoll.php
+++ b/protected/models/CampaignPoll.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,16 +52,16 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('name, id_campaign', 'required'),
-            array('id_user,ordem_exibicao, repeat, id_campaign, digit_authorize, request_authorize',
-                'numerical', 'integerOnly' => true),
-            array('name, arq_audio', 'length', 'max' => 100),
-            array('option0, option1, option2, option3, option4, option5, option6, option7, option8, option9',
-                'length', 'max' => 300),
-            array('description', 'length', 'max' => 300),
+        $rules = [
+            ['name, id_campaign', 'required'],
+            ['id_user,ordem_exibicao, repeat, id_campaign, digit_authorize, request_authorize',
+                'numerical', 'integerOnly' => true],
+            ['name, arq_audio', 'length', 'max' => 100],
+            ['option0, option1, option2, option3, option4, option5, option6, option7, option8, option9',
+                'length', 'max' => 300],
+            ['description', 'length', 'max' => 300],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -70,9 +70,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idCampaign' => array(self::BELONGS_TO, 'Campaign', 'id_campaign'),
-            'idUser'     => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idCampaign' => [self::BELONGS_TO, 'Campaign', 'id_campaign'],
+            'idUser'     => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/CampaignPollInfo.php b/protected/models/CampaignPollInfo.php
index 815a76f55..7efb38eb9 100755
--- a/protected/models/CampaignPollInfo.php
+++ b/protected/models/CampaignPollInfo.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -57,11 +57,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_campaign_poll', 'numerical', 'integerOnly' => true),
-            array('number', 'length', 'max' => 18),
-            array('obs, resposta', 'length', 'max' => 200),
-        );
+        $rules = [
+            ['id_campaign_poll', 'numerical', 'integerOnly' => true],
+            ['number', 'length', 'max' => 18],
+            ['obs, resposta', 'length', 'max' => 200],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -70,8 +70,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idCampaignPoll' => array(self::BELONGS_TO, 'CampaignPoll', 'id_campaign_poll'),
-        );
+        return [
+            'idCampaignPoll' => [self::BELONGS_TO, 'CampaignPoll', 'id_campaign_poll'],
+        ];
     }
 }
diff --git a/protected/models/CampaignReport.php b/protected/models/CampaignReport.php
index 53ed325a6..965328752 100755
--- a/protected/models/CampaignReport.php
+++ b/protected/models/CampaignReport.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -60,9 +60,9 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_campaign, id_phonenumber, id_user, id_trunk, unix_timestamp,status', 'numerical', 'integerOnly' => true),
-        );
+        $rules = [
+            ['id_campaign, id_phonenumber, id_user, id_trunk, unix_timestamp,status', 'numerical', 'integerOnly' => true],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -71,12 +71,12 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idCampaign'    => array(self::BELONGS_TO, 'Campaign', 'id_campaign'),
-            'idPhonenumber' => array(self::BELONGS_TO, 'Phonenumber', 'id_phonenumber'),
-            'idUser'        => array(self::BELONGS_TO, 'User', 'id_user'),
-            'idTrunk'       => array(self::BELONGS_TO, 'Trunk', 'id_trunk'),
-        );
+        return [
+            'idCampaign'    => [self::BELONGS_TO, 'Campaign', 'id_campaign'],
+            'idPhonenumber' => [self::BELONGS_TO, 'Phonenumber', 'id_phonenumber'],
+            'idUser'        => [self::BELONGS_TO, 'User', 'id_user'],
+            'idTrunk'       => [self::BELONGS_TO, 'Trunk', 'id_trunk'],
+        ];
     }
 
     public static function insertReport($data)
diff --git a/protected/models/CampaignRestrictPhone.php b/protected/models/CampaignRestrictPhone.php
index 45d94f143..8fc0d0b38 100755
--- a/protected/models/CampaignRestrictPhone.php
+++ b/protected/models/CampaignRestrictPhone.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,11 +52,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('number', 'required'),
-            array('number', 'numerical', 'integerOnly' => true),
-            array('description', 'length', 'max' => 100),
-        );
+        $rules = [
+            ['number', 'required'],
+            ['number', 'numerical', 'integerOnly' => true],
+            ['description', 'length', 'max' => 100],
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/Configuration.php b/protected/models/Configuration.php
index 987a4ea5c..cd407fe55 100755
--- a/protected/models/Configuration.php
+++ b/protected/models/Configuration.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,15 +52,15 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('config_key', 'required'),
-            array('status', 'numerical', 'integerOnly' => true),
-            array('config_title, config_key', 'length', 'max' => 100),
-            array('config_value', 'length', 'max' => 200),
-            array('config_description', 'length', 'max' => 500),
-            array('config_group_title', 'length', 'max' => 64),
-            array('config_value', 'checkConfg'),
-        );
+        $rules = [
+            ['config_key', 'required'],
+            ['status', 'numerical', 'integerOnly' => true],
+            ['config_title, config_key', 'length', 'max' => 100],
+            ['config_value', 'length', 'max' => 200],
+            ['config_description', 'length', 'max' => 500],
+            ['config_group_title', 'length', 'max' => 64],
+            ['config_value', 'checkConfg'],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -70,9 +70,9 @@ public function checkConfg($attribute, $params)
         //validation values
 
         if ($this->config_key == 'base_language') {
-            $valuesAllow        = array('es', 'en', 'pt_BR', 'it');
+            $valuesAllow        = ['es', 'en', 'pt_BR', 'it'];
             $this->config_value = $this->config_value == 'br' ? 'pt_BR' : $this->config_value;
-            if (!in_array($this->config_value, $valuesAllow)) {
+            if ( ! in_array($this->config_value, $valuesAllow)) {
                 $error = true;
             }
 
@@ -82,7 +82,7 @@ public function checkConfg($attribute, $params)
         }
 
         if ($this->config_key == 'template') {
-            $valuesAllow = array(
+            $valuesAllow = [
                 'black-triton', 'black-neptune', 'black-crisp',
                 'green-triton', 'green-neptune', 'green-crisp',
                 'blue-triton', 'blue-triton', 'blue-neptune', 'blue-crisp',
@@ -90,9 +90,9 @@ public function checkConfg($attribute, $params)
                 'orange-triton', 'orange-neptune', 'orange-crisp',
                 'purple-triton', 'purple-neptune', 'purple-crisp',
                 'gray-triton', 'gray-neptune', 'gray-crisp',
-                'red-triton', 'red-neptune', 'red-crisp');
+                'red-triton', 'red-neptune', 'red-crisp'];
 
-            if (!in_array($this->config_value, $valuesAllow)) {
+            if ( ! in_array($this->config_value, $valuesAllow)) {
                 $this->addError($attribute, Yii::t('zii', 'ERROR: Invalid option'));
             }
         }
@@ -107,7 +107,7 @@ public function updateSqlConfig()
         $modelConfig = Configuration::model()->findAll();
         $sql         = '';
         foreach ($modelConfig as $key => $config) {
-            if (!preg_match('/config_t/', Yii::t('yii', 'config_title_' . $config->config_key))) {
+            if ( ! preg_match('/config_t/', Yii::t('yii', 'config_title_' . $config->config_key))) {
                 $sql .= "UPDATE pkg_configuration SET config_title = '" . Yii::t('yii', 'config_title_' . $config->config_key) . "', config_description = '" . Yii::t('yii', 'config_desc_' . $config->config_key) . "' WHERE  config_key = '" . $config->config_key . "';";
             }
         }
diff --git a/protected/models/Cryptocurrency.php b/protected/models/Cryptocurrency.php
index 2dc5408f3..6cb45d525 100755
--- a/protected/models/Cryptocurrency.php
+++ b/protected/models/Cryptocurrency.php
@@ -41,13 +41,13 @@ public function tableName()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user,status', 'numerical', 'integerOnly' => true),
-            array('amountCrypto,amount', 'numerical', 'integerOnly' => false),
-            array('amountCrypto,amount', 'length', 'max' => 10),
-            array('date, expirationdate', 'safe'),
+        $rules = [
+            ['id_user,status', 'numerical', 'integerOnly' => true],
+            ['amountCrypto,amount', 'numerical', 'integerOnly' => false],
+            ['amountCrypto,amount', 'length', 'max' => 10],
+            ['date, expirationdate', 'safe'],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -56,8 +56,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/Did.php b/protected/models/Did.php
index c7fb8c5d0..982056bb6 100755
--- a/protected/models/Did.php
+++ b/protected/models/Did.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -55,18 +55,18 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('did', 'required'),
-            array('minimal_time_charge,calllimit, charge_of, block_expression_1, block_expression_2,block_expression_3, buyrateinitblock, buyrateincrement, minimal_time_buy, initblock, increment, id_user, cbr_em, activated, reserved, secondusedreal, billingtype,id_server,
+        $rules = [
+            ['did', 'required'],
+            ['minimal_time_charge,calllimit, charge_of, block_expression_1, block_expression_2,block_expression_3, buyrateinitblock, buyrateincrement, minimal_time_buy, initblock, increment, id_user, cbr_em, activated, reserved, secondusedreal, billingtype,id_server,
                 send_to_callback_1,send_to_callback_3,send_to_callback_3,cbr,cbr_ua,
-                cbr_total_try,cbr_time_try, record_call', 'numerical', 'integerOnly' => true),
-            array('fixrate', 'numerical'),
-            array('did,callerid, country', 'length', 'max' => 50),
-            array('description', 'length', 'max' => 150),
-            array('expression_1, expression_2,expression_2,expression_3,TimeOfDay_monFri,TimeOfDay_sat,TimeOfDay_sun,workaudio,noworkaudio', 'length', 'max' => 150),
-            array('connection_charge, selling_rate_1, selling_rate_2,selling_rate_3,buy_rate_1,buy_rate_2,buy_rate_3, connection_sell,
-                agent_client_rate_1,agent_client_rate_2,agent_client_rate_3', 'length', 'max' => 15),
-        );
+                cbr_total_try,cbr_time_try, record_call', 'numerical', 'integerOnly' => true],
+            ['fixrate', 'numerical'],
+            ['did,callerid, country', 'length', 'max' => 50],
+            ['description', 'length', 'max' => 150],
+            ['expression_1, expression_2,expression_2,expression_3,TimeOfDay_monFri,TimeOfDay_sat,TimeOfDay_sun,workaudio,noworkaudio', 'length', 'max' => 150],
+            ['connection_charge, selling_rate_1, selling_rate_2,selling_rate_3,buy_rate_1,buy_rate_2,buy_rate_3, connection_sell,
+                agent_client_rate_1,agent_client_rate_2,agent_client_rate_3', 'length', 'max' => 15],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -75,10 +75,10 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser'   => array(self::BELONGS_TO, 'User', 'id_user'),
-            'idServer' => array(self::BELONGS_TO, 'Servers', 'id_server'),
-        );
+        return [
+            'idUser'   => [self::BELONGS_TO, 'User', 'id_user'],
+            'idServer' => [self::BELONGS_TO, 'Servers', 'id_server'],
+        ];
     }
 
     public function afterSave()
diff --git a/protected/models/DidHistory.php b/protected/models/DidHistory.php
index 5d479d572..99bb16068 100755
--- a/protected/models/DidHistory.php
+++ b/protected/models/DidHistory.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('did, username', 'length', 'max' => 50),
-            array('description', 'length', 'max' => 500),
-            array('month_payed', 'numerical', 'integerOnly' => true),
-            array('reservationdate, releasedate', 'safe'),
-        );
+        $rules = [
+            ['did, username', 'length', 'max' => 50],
+            ['description', 'length', 'max' => 500],
+            ['month_payed', 'numerical', 'integerOnly' => true],
+            ['reservationdate, releasedate', 'safe'],
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/DidUse.php b/protected/models/DidUse.php
index aff78cda7..3adbd793a 100755
--- a/protected/models/DidUse.php
+++ b/protected/models/DidUse.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, id_did, status, month_payed, reminded', 'numerical', 'integerOnly' => true),
-            array('reservationdate, releasedate,next_due_date', 'safe'),
-        );
+        $rules = [
+            ['id_user, id_did, status, month_payed, reminded', 'numerical', 'integerOnly' => true],
+            ['reservationdate, releasedate,next_due_date', 'safe'],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -64,9 +64,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idDid'  => array(self::BELONGS_TO, 'Did', 'id_did'),
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idDid'  => [self::BELONGS_TO, 'Did', 'id_did'],
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/Diddestination.php b/protected/models/Diddestination.php
index 023b31089..de8ab0314 100755
--- a/protected/models/Diddestination.php
+++ b/protected/models/Diddestination.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -53,12 +53,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'required'),
-            array('id_user, id_queue, id_sip, id_ivr, id_did, priority, activated, secondusedreal, voip_call', 'numerical', 'integerOnly' => true),
-            array('destination', 'length', 'max' => 120),
-            array('context', 'safe'),
-        );
+        $rules = [
+            ['id_user', 'required'],
+            ['id_user, id_queue, id_sip, id_ivr, id_did, priority, activated, secondusedreal, voip_call', 'numerical', 'integerOnly' => true],
+            ['destination', 'length', 'max' => 120],
+            ['context', 'safe'],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -67,13 +67,13 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idDid'   => array(self::BELONGS_TO, 'Did', 'id_did'),
-            'idUser'  => array(self::BELONGS_TO, 'User', 'id_user'),
-            'idIvr'   => array(self::BELONGS_TO, 'Ivr', 'id_ivr'),
-            'idQueue' => array(self::BELONGS_TO, 'Queue', 'id_queue'),
-            'idSip'   => array(self::BELONGS_TO, 'Sip', 'id_sip'),
-        );
+        return [
+            'idDid'   => [self::BELONGS_TO, 'Did', 'id_did'],
+            'idUser'  => [self::BELONGS_TO, 'User', 'id_user'],
+            'idIvr'   => [self::BELONGS_TO, 'Ivr', 'id_ivr'],
+            'idQueue' => [self::BELONGS_TO, 'Queue', 'id_queue'],
+            'idSip'   => [self::BELONGS_TO, 'Sip', 'id_sip'],
+        ];
     }
 
     public function beforeSave()
diff --git a/protected/models/Firewall.php b/protected/models/Firewall.php
index 185cdc310..fca57f200 100755
--- a/protected/models/Firewall.php
+++ b/protected/models/Firewall.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('ip, action', 'required'),
-            array('action', 'numerical', 'integerOnly' => true),
-            array('description,jail', 'length', 'max' => 200),
+        $rules = [
+            ['ip, action', 'required'],
+            ['action', 'numerical', 'integerOnly' => true],
+            ['description,jail', 'length', 'max' => 200],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/GAuthenticator.php b/protected/models/GAuthenticator.php
index 2063a53af..7722a166e 100755
--- a/protected/models/GAuthenticator.php
+++ b/protected/models/GAuthenticator.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -59,10 +59,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('googleAuthenticator_enable', 'numerical', 'integerOnly' => true),
-            array('google_authenticator_key', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['googleAuthenticator_enable', 'numerical', 'integerOnly' => true],
+            ['google_authenticator_key', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/GroupModule.php b/protected/models/GroupModule.php
index 70a35ff4d..cfabc188f 100755
--- a/protected/models/GroupModule.php
+++ b/protected/models/GroupModule.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -65,7 +65,7 @@ public function tableName()
      */
     public function primaryKey()
     {
-        return array('id_group', 'id_module');
+        return ['id_group', 'id_module'];
     }
 
     /**
@@ -75,11 +75,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_group, id_module', 'required'),
-            array('id_group, id_module, show_menu, createShortCut, createQuickStart', 'numerical', 'integerOnly' => true),
-            array('action', 'length', 'max' => 5),
-        );
+        $rules = [
+            ['id_group, id_module', 'required'],
+            ['id_group, id_module, show_menu, createShortCut, createQuickStart', 'numerical', 'integerOnly' => true],
+            ['action', 'length', 'max' => 5],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -90,10 +90,10 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idGroup'  => array(self::BELONGS_TO, 'GroupUser', 'id_group'),
-            'idModule' => array(self::BELONGS_TO, 'Module', 'id_module'),
-        );
+        return [
+            'idGroup'  => [self::BELONGS_TO, 'GroupUser', 'id_group'],
+            'idModule' => [self::BELONGS_TO, 'Module', 'id_module'],
+        ];
     }
 
     public function getGroupModule($id_group, $isClient, $id_user)
diff --git a/protected/models/GroupUser.php b/protected/models/GroupUser.php
index 011d4bf1c..a9364d9db 100755
--- a/protected/models/GroupUser.php
+++ b/protected/models/GroupUser.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -76,12 +76,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('name', 'required'),
-            array('id_user_type, hidden_prices, hidden_batch_update', 'numerical', 'integerOnly' => true),
-            array('name', 'length', 'max' => 100),
-            array('user_prefix', 'length', 'max' => 6),
-        );
+        $rules = [
+            ['name', 'required'],
+            ['id_user_type, hidden_prices, hidden_batch_update', 'numerical', 'integerOnly' => true],
+            ['name', 'length', 'max' => 100],
+            ['user_prefix', 'length', 'max' => 6],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -92,11 +92,11 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'modules'      => array(self::MANY_MANY, 'Module', 'group_module(id_group, id_module)'),
-            'groupModules' => array(self::HAS_MANY, 'GroupModule', 'id_group'),
-            'users'        => array(self::HAS_MANY, 'User', 'id_group'),
-            'idUserType'   => array(self::BELONGS_TO, 'UserType', 'id_user_type'),
-        );
+        return [
+            'modules'      => [self::MANY_MANY, 'Module', 'group_module(id_group, id_module)'],
+            'groupModules' => [self::HAS_MANY, 'GroupModule', 'id_group'],
+            'users'        => [self::HAS_MANY, 'User', 'id_group'],
+            'idUserType'   => [self::BELONGS_TO, 'UserType', 'id_user_type'],
+        ];
     }
 }
diff --git a/protected/models/GroupUserGroup.php b/protected/models/GroupUserGroup.php
index 63922a5ff..2ebe1d1e9 100755
--- a/protected/models/GroupUserGroup.php
+++ b/protected/models/GroupUserGroup.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -53,11 +53,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_group_user, id_group', 'required'),
-            array('id_group_user, id_group, ', 'numerical', 'integerOnly' => true),
+        $rules = [
+            ['id_group_user, id_group', 'required'],
+            ['id_group_user, id_group, ', 'numerical', 'integerOnly' => true],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/Holidays.php b/protected/models/Holidays.php
index b4dccecaa..0690cfd80 100755
--- a/protected/models/Holidays.php
+++ b/protected/models/Holidays.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('name, day', 'required'),
-            array('name', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['name, day', 'required'],
+            ['name', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/Iax.php b/protected/models/Iax.php
index 0185ce711..e9c71127e 100755
--- a/protected/models/Iax.php
+++ b/protected/models/Iax.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -59,25 +59,25 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'required'),
-            array('id_user,calllimit ', 'numerical', 'integerOnly' => true),
-            array('name, callerid, context, fromuser, fromdomain, md5secret, secret', 'length', 'max' => 80),
-            array('regexten, insecure, accountcode', 'length', 'max' => 20),
-            array('amaflags, dtmfmode, qualify', 'length', 'max' => 7),
-            array('callgroup, pickupgroup', 'length', 'max' => 10),
-            array('DEFAULTip, ipaddr', 'length', 'max' => 15),
-            array('nat, host', 'length', 'max' => 31),
-            array('language', 'length', 'max' => 2),
-            array('mailbox', 'length', 'max' => 50),
-            array('rtpholdtimeout', 'length', 'max' => 3),
-            array('deny, permit', 'length', 'max' => 95),
-            array('port', 'length', 'max' => 5),
-            array('type', 'length', 'max' => 6),
-            array('disallow, allow, useragent', 'length', 'max' => 100),
-            array('username', 'checkusername'),
-            array('username', 'unique', 'caseSensitive' => 'false'),
-        );
+        $rules = [
+            ['id_user', 'required'],
+            ['id_user,calllimit ', 'numerical', 'integerOnly' => true],
+            ['name, callerid, context, fromuser, fromdomain, md5secret, secret', 'length', 'max' => 80],
+            ['regexten, insecure, accountcode', 'length', 'max' => 20],
+            ['amaflags, dtmfmode, qualify', 'length', 'max' => 7],
+            ['callgroup, pickupgroup', 'length', 'max' => 10],
+            ['DEFAULTip, ipaddr', 'length', 'max' => 15],
+            ['nat, host', 'length', 'max' => 31],
+            ['language', 'length', 'max' => 2],
+            ['mailbox', 'length', 'max' => 50],
+            ['rtpholdtimeout', 'length', 'max' => 3],
+            ['deny, permit', 'length', 'max' => 95],
+            ['port', 'length', 'max' => 5],
+            ['type', 'length', 'max' => 6],
+            ['disallow, allow, useragent', 'length', 'max' => 100],
+            ['username', 'checkusername'],
+            ['username', 'unique', 'caseSensitive' => 'false'],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -102,9 +102,9 @@ public function afterSave()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
 }
diff --git a/protected/models/Ivr.php b/protected/models/Ivr.php
index 46833ae59..3272599d3 100755
--- a/protected/models/Ivr.php
+++ b/protected/models/Ivr.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,14 +52,14 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, use_holidays,direct_extension', 'numerical', 'integerOnly' => true),
-            array('monFriStart,  satStart,  sunStart', 'length', 'max' => 200),
-            array('name, option_0, option_1, option_2, option_3, option_4, option_5, option_6, option_7, option_8, option_9, option_10', 'length', 'max' => 50),
-            array('option_out_0, option_out_1, option_out_2, option_out_3, option_out_4, option_out_5, option_out_6, option_out_7, option_out_8, option_out_9, option_out_10', 'length', 'max' => 50),
-            array('monFriStart,  satStart,  sunStart', 'checkInterval'),
+        $rules = [
+            ['id_user, use_holidays,direct_extension', 'numerical', 'integerOnly' => true],
+            ['monFriStart,  satStart,  sunStart', 'length', 'max' => 200],
+            ['name, option_0, option_1, option_2, option_3, option_4, option_5, option_6, option_7, option_8, option_9, option_10', 'length', 'max' => 50],
+            ['option_out_0, option_out_1, option_out_2, option_out_3, option_out_4, option_out_5, option_out_6, option_out_7, option_out_8, option_out_9, option_out_10', 'length', 'max' => 50],
+            ['monFriStart,  satStart,  sunStart', 'checkInterval'],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -67,14 +67,14 @@ public function checkInterval($attribute, $params)
     {
         $intervals = explode('|', $this->{$attribute});
         foreach ($intervals as $key => $interval) {
-            if (!preg_match('/-/', $interval)) {
+            if ( ! preg_match('/-/', $interval)) {
                 $this->addError($attribute, 'There is a interval with a invalid format, the allowed formatting is: 00:00-00:00. Use | for more than one interval.');
                 return;
             }
 
             $hours = explode('-', $interval);
             foreach ($hours as $key => $hour) {
-                if (!preg_match("/^(?:2[0-3]|[01][0-9]):[0-5][0-9]$/", $hour)) {
+                if ( ! preg_match("/^(?:2[0-3]|[01][0-9]):[0-5][0-9]$/", $hour)) {
                     $this->addError($attribute, 'There is a interval with a invalid format, the allowed formatting is: 00:00-00:00. Use | for more than one interval.');
                 }
             }
@@ -87,9 +87,9 @@ public function checkInterval($attribute, $params)
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
 }
diff --git a/protected/models/LogActions.php b/protected/models/LogActions.php
index 58ab30e05..acf29002e 100755
--- a/protected/models/LogActions.php
+++ b/protected/models/LogActions.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,9 +52,9 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('name', 'length', 'max' => 20),
-        );
+        $rules = [
+            ['name', 'length', 'max' => 20],
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/LogUsers.php b/protected/models/LogUsers.php
index b9650e637..051d1bb6f 100755
--- a/protected/models/LogUsers.php
+++ b/protected/models/LogUsers.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, id_log_actions', 'numerical', 'integerOnly' => true),
-            array('date', 'length', 'max' => 100),
-            array('ip', 'length', 'max' => 16),
-            array('description', 'safe'),
-        );
+        $rules = [
+            ['id_user, id_log_actions', 'numerical', 'integerOnly' => true],
+            ['date', 'length', 'max' => 100],
+            ['ip', 'length', 'max' => 16],
+            ['description', 'safe'],
+        ];
         return $this->getExtraField($rules);
     }
     /**
@@ -65,9 +65,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser'       => array(self::BELONGS_TO, 'User', 'id_user'),
-            'idLogActions' => array(self::BELONGS_TO, 'LogActions', 'id_log_actions'),
-        );
+        return [
+            'idUser'       => [self::BELONGS_TO, 'User', 'id_user'],
+            'idLogActions' => [self::BELONGS_TO, 'LogActions', 'id_log_actions'],
+        ];
     }
 }
diff --git a/protected/models/Methodpay.php b/protected/models/Methodpay.php
index abfb1fa7d..4207458f5 100755
--- a/protected/models/Methodpay.php
+++ b/protected/models/Methodpay.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -59,16 +59,16 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id, payment_method, country', 'required'),
-            array('active, id_user, fee, SLIdProduto,min,max', 'numerical', 'integerOnly' => true),
-            array('obs, client_id, client_secret', 'length', 'max' => 500),
-            array('P2P_tax_amount', 'length', 'max' => 10),
-            array('P2P_CustomerSiteID, P2P_KeyID, P2P_Passphrase, P2P_RecipientKeyID', 'length', 'max' => 100),
-            array('pagseguro_TOKEN,url, show_name, SLvalidationtoken', 'length', 'max' => 100),
-            array('SLAppToken,SLAccessToken,SLSecret', 'length', 'max' => 50),
-            array('username', 'length', 'max' => 1000),
-        );
+        $rules = [
+            ['id, payment_method, country', 'required'],
+            ['active, id_user, fee, SLIdProduto,min,max', 'numerical', 'integerOnly' => true],
+            ['obs, client_id, client_secret', 'length', 'max' => 500],
+            ['P2P_tax_amount', 'length', 'max' => 10],
+            ['P2P_CustomerSiteID, P2P_KeyID, P2P_Passphrase, P2P_RecipientKeyID', 'length', 'max' => 100],
+            ['pagseguro_TOKEN,url, show_name, SLvalidationtoken', 'length', 'max' => 100],
+            ['SLAppToken,SLAccessToken,SLSecret', 'length', 'max' => 50],
+            ['username', 'length', 'max' => 1000],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -79,8 +79,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/Module.php b/protected/models/Module.php
index e1f812fbf..2cef19d5c 100755
--- a/protected/models/Module.php
+++ b/protected/models/Module.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -71,11 +71,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('text', 'required'),
-            array('id_module,priority', 'numerical', 'integerOnly' => true),
-            array('text, icon_cls', 'length', 'max' => 100),
-        );
+        $rules = [
+            ['text', 'required'],
+            ['id_module,priority', 'numerical', 'integerOnly' => true],
+            ['text, icon_cls', 'length', 'max' => 100],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -84,12 +84,12 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'groupUsers'   => array(self::MANY_MANY, 'GroupUser', 'group_module(id_module, id_group)'),
-            'groupModules' => array(self::HAS_MANY, 'GroupModule', 'id_module'),
-            'idModule'     => array(self::BELONGS_TO, 'Module', 'id_module'),
-            'modules'      => array(self::HAS_MANY, 'Module', 'id_module'),
-            'idUserType'   => array(self::BELONGS_TO, 'UserType', 'id_user_type'),
-        );
+        return [
+            'groupUsers'   => [self::MANY_MANY, 'GroupUser', 'group_module(id_module, id_group)'],
+            'groupModules' => [self::HAS_MANY, 'GroupModule', 'id_module'],
+            'idModule'     => [self::BELONGS_TO, 'Module', 'id_module'],
+            'modules'      => [self::HAS_MANY, 'Module', 'id_module'],
+            'idUserType'   => [self::BELONGS_TO, 'UserType', 'id_user_type'],
+        ];
     }
 }
diff --git a/protected/models/Offer.php b/protected/models/Offer.php
index 283fc05ec..f9a949153 100755
--- a/protected/models/Offer.php
+++ b/protected/models/Offer.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('packagetype, id_user, billingtype, startday, freetimetocall,initblock, billingblock, minimal_time_charge', 'numerical', 'integerOnly' => true),
-            array('label, price', 'length', 'max' => 70),
-        );
+        $rules = [
+            ['packagetype, id_user, billingtype, startday, freetimetocall,initblock, billingblock, minimal_time_charge', 'numerical', 'integerOnly' => true],
+            ['label, price', 'length', 'max' => 70],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -64,8 +64,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/OfferCdr.php b/protected/models/OfferCdr.php
index 243b4ef22..15be172f5 100755
--- a/protected/models/OfferCdr.php
+++ b/protected/models/OfferCdr.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, id_offer, used_secondes', 'numerical', 'integerOnly' => true),
-            array('date_consumption', 'length', 'max' => 70),
-        );
+        $rules = [
+            ['id_user, id_offer, used_secondes', 'numerical', 'integerOnly' => true],
+            ['date_consumption', 'length', 'max' => 70],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -64,9 +64,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idOffer' => array(self::BELONGS_TO, 'Offer', 'id_offer'),
-            'idUser'  => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idOffer' => [self::BELONGS_TO, 'Offer', 'id_offer'],
+            'idUser'  => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/OfferUse.php b/protected/models/OfferUse.php
index 34c2e4f5f..4ff5b910e 100755
--- a/protected/models/OfferUse.php
+++ b/protected/models/OfferUse.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, id_offer, status, month_payed, reminded', 'numerical', 'integerOnly' => true),
-            array('reservationdate, releasedate', 'length', 'max' => 70),
-        );
+        $rules = [
+            ['id_user, id_offer, status, month_payed, reminded', 'numerical', 'integerOnly' => true],
+            ['reservationdate, releasedate', 'length', 'max' => 70],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -64,9 +64,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idOffer' => array(self::BELONGS_TO, 'Offer', 'id_offer'),
-            'idUser'  => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idOffer' => [self::BELONGS_TO, 'Offer', 'id_offer'],
+            'idUser'  => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/PhoneBook.php b/protected/models/PhoneBook.php
index 81f6e44f4..4068429d2 100755
--- a/protected/models/PhoneBook.php
+++ b/protected/models/PhoneBook.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'numerical', 'integerOnly' => true),
-            array('name', 'length', 'max' => 30),
-            array('description', 'length', 'max' => 100),
-            array('status', 'length', 'max' => 1),
-        );
+        $rules = [
+            ['id_user', 'numerical', 'integerOnly' => true],
+            ['name', 'length', 'max' => 30],
+            ['description', 'length', 'max' => 100],
+            ['status', 'length', 'max' => 1],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -66,8 +66,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/PhoneNumber.php b/protected/models/PhoneNumber.php
index 199893ba4..39d073421 100755
--- a/protected/models/PhoneNumber.php
+++ b/protected/models/PhoneNumber.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_phonebook, status, try', 'numerical', 'integerOnly' => true),
-            array('name, city', 'length', 'max' => 40),
-            array('number', 'length', 'max' => 30),
-            array('info, doc, email', 'length', 'max' => 200),
-        );
+        $rules = [
+            ['id_phonebook, status, try', 'numerical', 'integerOnly' => true],
+            ['name, city', 'length', 'max' => 40],
+            ['number', 'length', 'max' => 30],
+            ['info, doc, email', 'length', 'max' => 200],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -66,9 +66,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idPhonebook' => array(self::BELONGS_TO, 'PhoneBook', 'id_phonebook'),
-        );
+        return [
+            'idPhonebook' => [self::BELONGS_TO, 'PhoneBook', 'id_phonebook'],
+        ];
     }
 
     public function beforeSave()
diff --git a/protected/models/Portability.php b/protected/models/Portability.php
index a55ad8e95..6cf3e739a 100755
--- a/protected/models/Portability.php
+++ b/protected/models/Portability.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -53,12 +53,12 @@ public function primaryKey()
 
     public function rules()
     {
-        $rules = array(
-            array('number', 'numerical', 'integerOnly' => true),
-            array('number', 'length', 'max' => 15),
-            array('company', 'length', 'max' => 5),
-            array('date', 'length', 'max' => 30),
-        );
+        $rules = [
+            ['number', 'numerical', 'integerOnly' => true],
+            ['number', 'length', 'max' => 15],
+            ['company', 'length', 'max' => 5],
+            ['date', 'length', 'max' => 30],
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/Prefix.php b/protected/models/Prefix.php
index 370834f7b..865a0c956 100755
--- a/protected/models/Prefix.php
+++ b/protected/models/Prefix.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('destination, prefix', 'required'),
-            array('prefix', 'unique'),
-        );
+        $rules = [
+            ['destination, prefix', 'required'],
+            ['prefix', 'unique'],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -108,15 +108,15 @@ public function updateDestination($prefix, $destination)
     public function prefixLength()
     {
 
-        $modelPrefix = Prefix::model()->findAll(array(
+        $modelPrefix = Prefix::model()->findAll([
             'select'    => 'SUBSTRING( prefix, 1, 2 ) AS destination, length(prefix) AS prefix',
             'condition' => 'prefix > 0',
             'order'     => 'LENGTH( prefix ) DESC',
-        ));
+        ]);
 
         $modelPrefix = Util::unique_multidim_obj($modelPrefix, 'destination');
 
-        $insert = array();
+        $insert = [];
         foreach ($modelPrefix as $key => $value) {
             $insert[] = '(' . $value->destination . ',' . $value->prefix . ')';
         }
diff --git a/protected/models/PrefixLength.php b/protected/models/PrefixLength.php
index d88311333..1ebdd2619 100755
--- a/protected/models/PrefixLength.php
+++ b/protected/models/PrefixLength.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,9 +52,9 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('length,code', 'length', 'max' => 5),
-        );
+        $rules = [
+            ['length,code', 'length', 'max' => 5],
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/Provider.php b/protected/models/Provider.php
index 192ffb32c..c838e9d54 100755
--- a/protected/models/Provider.php
+++ b/protected/models/Provider.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('provider_name', 'required'),
-            array('description, credit_control', 'length', 'max' => 100),
-            array('credit', 'type', 'type' => 'double'),
-            array('provider_name', 'unique'),
-        );
+        $rules = [
+            ['provider_name', 'required'],
+            ['description, credit_control', 'length', 'max' => 100],
+            ['credit', 'type', 'type' => 'double'],
+            ['provider_name', 'unique'],
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/ProviderCNL.php b/protected/models/ProviderCNL.php
index 23d3d525f..387eead2e 100755
--- a/protected/models/ProviderCNL.php
+++ b/protected/models/ProviderCNL.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_provider, cnl,zone', 'required'),
-            array('zone, cnl', 'length', 'max' => 11),
-        );
+        $rules = [
+            ['id_provider, cnl,zone', 'required'],
+            ['zone, cnl', 'length', 'max' => 11],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -64,9 +64,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idProvider' => array(self::BELONGS_TO, 'Provider', 'id_provider'),
-        );
+        return [
+            'idProvider' => [self::BELONGS_TO, 'Provider', 'id_provider'],
+        ];
     }
 
     public function beforeSave()
diff --git a/protected/models/Queue.php b/protected/models/Queue.php
index 384bb009e..903368ba5 100755
--- a/protected/models/Queue.php
+++ b/protected/models/Queue.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,18 +52,18 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('name, id_user', 'required'),
-            array('id_user, timeout, retry, wrapuptime, weight, periodic-announce-frequency, max_wait_time', 'numerical', 'integerOnly' => true),
-            array('language, joinempty, leavewhenempty, musiconhold,announce-holdtime,leavewhenempty,strategy, ringinuse, announce-position, announce-holdtime, announce-frequency', 'length', 'max' => 128),
-            array('periodic-announce ', 'length', 'max' => 200),
-            array('ring_or_moh ', 'length', 'max' => 4),
-            array('name', 'length', 'max' => 25),
-            array('max_wait_time_action', 'length', 'max' => 50),
-            array('name', 'checkname'),
-            array('max_wait_time_action', 'check_max_wait_time_action'),
-
-        );
+        $rules = [
+            ['name, id_user', 'required'],
+            ['id_user, timeout, retry, wrapuptime, weight, periodic-announce-frequency, max_wait_time', 'numerical', 'integerOnly' => true],
+            ['language, joinempty, leavewhenempty, musiconhold,announce-holdtime,leavewhenempty,strategy, ringinuse, announce-position, announce-holdtime, announce-frequency', 'length', 'max' => 128],
+            ['periodic-announce ', 'length', 'max' => 200],
+            ['ring_or_moh ', 'length', 'max' => 4],
+            ['name', 'length', 'max' => 25],
+            ['max_wait_time_action', 'length', 'max' => 50],
+            ['name', 'checkname'],
+            ['max_wait_time_action', 'check_max_wait_time_action'],
+
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -72,9 +72,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
     public function check_max_wait_time_action($attribute, $params)
@@ -91,17 +91,17 @@ public function check_max_wait_time_action($attribute, $params)
 
                     switch ($type) {
                         case 'SIP':
-                            $model = Sip::model()->find('UPPER(name) = :key', array(':key' => strtoupper($destination)));
+                            $model = Sip::model()->find('UPPER(name) = :key', [':key' => strtoupper($destination)]);
                             break;
                         case 'QUEUE':
-                            $model = Queue::model()->find('UPPER(name)  = :key', array(':key' => strtoupper($destination)));
+                            $model = Queue::model()->find('UPPER(name)  = :key', [':key' => strtoupper($destination)]);
                             break;
                         case 'IVR':
-                            $model = Ivr::model()->find('UPPER(name)  = :key', array(':key' => strtoupper($destination)));
+                            $model = Ivr::model()->find('UPPER(name)  = :key', [':key' => strtoupper($destination)]);
                             break;
                     }
                 }
-                if (!isset($model->id)) {
+                if ( ! isset($model->id)) {
                     $this->addError($attribute, Yii::t('zii', 'You need add a existent Sip Account, IVR or Queue.'));
                 }
                 $this->max_wait_time_action = $type . '/' . $destination;
@@ -115,7 +115,7 @@ public function checkname($attribute, $params)
             $this->addError($attribute, Yii::t('zii', 'No space allow in name'));
         }
 
-        if (!preg_match('/^[0-9]|^[A-Z]|^[a-z]/', $this->name)) {
+        if ( ! preg_match('/^[0-9]|^[A-Z]|^[a-z]/', $this->name)) {
             $this->addError($attribute, Yii::t('zii', 'Name need start with numbers or letters'));
         }
     }
@@ -169,10 +169,10 @@ public function insertQueueStatus($id_queue, $uniqueid, $queueName, $callerId, $
 
     public function beforeSave()
     {
-        if (!$this->getIsNewRecord()) {
+        if ( ! $this->getIsNewRecord()) {
             $model = Queue::model()->findByPk($this->id);
 
-            QueueMember::model()->updateAll(array('queue_name' => $this->name), 'queue_name = :key', array(':key' => $model->name));
+            QueueMember::model()->updateAll(['queue_name' => $this->name], 'queue_name = :key', [':key' => $model->name]);
 
         }
         return parent::beforeSave();
diff --git a/protected/models/QueueDashBoard.php b/protected/models/QueueDashBoard.php
index cf2566e1e..999cae865 100755
--- a/protected/models/QueueDashBoard.php
+++ b/protected/models/QueueDashBoard.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -53,21 +53,21 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_queue, id_agent, priority', 'numerical', 'integerOnly' => true),
-            array('keyPressed, holdtime, originalPosition, position', 'length', 'max' => 11),
-            array('queue, timestamp, queue_name', 'length', 'max' => 25),
-            array('status', 'length', 'max' => 30),
-            array('callerId,callId', 'length', 'max' => 40),
-        );
+        $rules = [
+            ['id_queue, id_agent, priority', 'numerical', 'integerOnly' => true],
+            ['keyPressed, holdtime, originalPosition, position', 'length', 'max' => 11],
+            ['queue, timestamp, queue_name', 'length', 'max' => 25],
+            ['status', 'length', 'max' => 30],
+            ['callerId,callId', 'length', 'max' => 40],
+        ];
         return $this->getExtraField($rules);
     }
 
     public function relations()
     {
-        return array(
-            'idQueue' => array(self::BELONGS_TO, 'Queue', 'id_queue'),
-        );
+        return [
+            'idQueue' => [self::BELONGS_TO, 'Queue', 'id_queue'],
+        ];
     }
 
 }
diff --git a/protected/models/QueueMember.php b/protected/models/QueueMember.php
index f4500d033..4315e6e09 100755
--- a/protected/models/QueueMember.php
+++ b/protected/models/QueueMember.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id,interface, id_user', 'required'),
-            array('id_user, paused', 'numerical', 'integerOnly' => true),
-            array('membername', 'length', 'max' => 40),
-            array('queue_name, interface', 'length', 'max' => 128),
-        );
+        $rules = [
+            ['id,interface, id_user', 'required'],
+            ['id_user, paused', 'numerical', 'integerOnly' => true],
+            ['membername', 'length', 'max' => 40],
+            ['queue_name, interface', 'length', 'max' => 128],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -66,9 +66,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
     public function beforeSave()
diff --git a/protected/models/QueueMemberDashBoard.php b/protected/models/QueueMemberDashBoard.php
index f56c7985e..362fe49a1 100755
--- a/protected/models/QueueMemberDashBoard.php
+++ b/protected/models/QueueMemberDashBoard.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -54,10 +54,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_queue id_user', 'numerical', 'integerOnly' => true),
-            array('agentStatus, callId', 'length', 'max' => 25),
-        );
+        $rules = [
+            ['id_queue id_user', 'numerical', 'integerOnly' => true],
+            ['agentStatus, callId', 'length', 'max' => 25],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -66,9 +66,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idQueue' => array(self::BELONGS_TO, 'Queue', 'id_queue'),
-        );
+        return [
+            'idQueue' => [self::BELONGS_TO, 'Queue', 'id_queue'],
+        ];
     }
 
 }
diff --git a/protected/models/Rate.php b/protected/models/Rate.php
index 34278129d..894f20daa 100755
--- a/protected/models/Rate.php
+++ b/protected/models/Rate.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -53,11 +53,11 @@ public function primaryKey()
     public function rules()
     {
 
-        $rules = array(
-            array('id_plan', 'required'),
-            array('id_plan, id_prefix, id_trunk_group,initblock, billingblock, package_offer, minimal_time_charge ', 'numerical', 'integerOnly' => true),
-            array('rateinitial,connectcharge,disconnectcharge, additional_grace,status', 'length', 'max' => 15),
-        );
+        $rules = [
+            ['id_plan', 'required'],
+            ['id_plan, id_prefix, id_trunk_group,initblock, billingblock, package_offer, minimal_time_charge ', 'numerical', 'integerOnly' => true],
+            ['rateinitial,connectcharge,disconnectcharge, additional_grace,status', 'length', 'max' => 15],
+        ];
         return $this->getExtraField($rules);
 
     }
@@ -67,11 +67,11 @@ public function rules()
     public function relations()
     {
 
-        return array(
-            'idTrunkGroup' => array(self::BELONGS_TO, 'TrunkGroup', 'id_trunk_group'),
-            'idPlan'       => array(self::BELONGS_TO, 'Plan', 'id_plan'),
-            'idPrefix'     => array(self::BELONGS_TO, 'Prefix', 'id_prefix'),
-        );
+        return [
+            'idTrunkGroup' => [self::BELONGS_TO, 'TrunkGroup', 'id_trunk_group'],
+            'idPlan'       => [self::BELONGS_TO, 'Plan', 'id_plan'],
+            'idPrefix'     => [self::BELONGS_TO, 'Prefix', 'id_prefix'],
+        ];
 
     }
 
diff --git a/protected/models/RateAgent.php b/protected/models/RateAgent.php
index 699406417..9c2c8a330 100755
--- a/protected/models/RateAgent.php
+++ b/protected/models/RateAgent.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,11 +52,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_plan', 'required'),
-            array('id_plan, id_prefix, initblock, billingblock, minimal_time_charge, package_offer', 'numerical', 'integerOnly' => true),
-            array('rateinitial', 'length', 'max' => 15),
-        );
+        $rules = [
+            ['id_plan', 'required'],
+            ['id_plan, id_prefix, initblock, billingblock, minimal_time_charge, package_offer', 'numerical', 'integerOnly' => true],
+            ['rateinitial', 'length', 'max' => 15],
+        ];
         return $this->getExtraField($rules);
     }
     /**
@@ -64,10 +64,10 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idPlan'   => array(self::BELONGS_TO, 'Plan', 'id_plan'),
-            'idPrefix' => array(self::BELONGS_TO, 'Prefix', 'id_prefix'),
-        );
+        return [
+            'idPlan'   => [self::BELONGS_TO, 'Plan', 'id_plan'],
+            'idPrefix' => [self::BELONGS_TO, 'Prefix', 'id_prefix'],
+        ];
     }
 
     public function createAgentRates($model, $id_plan)
diff --git a/protected/models/RateCallshop.php b/protected/models/RateCallshop.php
index 0d789625f..df5cc82d2 100755
--- a/protected/models/RateCallshop.php
+++ b/protected/models/RateCallshop.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
+        $rules = [
             //array('dialprefix', 'required'),
-            array('id_user, minimo, block, minimal_time_charge', 'numerical', 'integerOnly' => true),
-            array('dialprefix, destination', 'length', 'max' => 30),
-            array('buyrate', 'length', 'max' => 15),
-        );
+            ['id_user, minimo, block, minimal_time_charge', 'numerical', 'integerOnly' => true],
+            ['dialprefix, destination', 'length', 'max' => 30],
+            ['buyrate', 'length', 'max' => 15],
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/RateProvider.php b/protected/models/RateProvider.php
index 8e548f2f6..2c22ff748 100755
--- a/protected/models/RateProvider.php
+++ b/protected/models/RateProvider.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,11 +52,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_prefix, id_provider', 'required'),
-            array('id_prefix, id_provider, buyrateinitblock, buyrateincrement, minimal_time_buy', 'numerical', 'integerOnly' => true),
-            array('buyrate', 'length', 'max' => 15),
-        );
+        $rules = [
+            ['id_prefix, id_provider', 'required'],
+            ['id_prefix, id_provider, buyrateinitblock, buyrateincrement, minimal_time_buy', 'numerical', 'integerOnly' => true],
+            ['buyrate', 'length', 'max' => 15],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -65,9 +65,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idProvider' => array(self::BELONGS_TO, 'Provider', 'id_provider'),
-            'idPrefix'   => array(self::BELONGS_TO, 'Prefix', 'id_prefix'),
-        );
+        return [
+            'idProvider' => [self::BELONGS_TO, 'Provider', 'id_provider'],
+            'idPrefix'   => [self::BELONGS_TO, 'Prefix', 'id_prefix'],
+        ];
     }
 }
diff --git a/protected/models/Refill.php b/protected/models/Refill.php
index 9ed02cdfa..0b7ef8ff9 100755
--- a/protected/models/Refill.php
+++ b/protected/models/Refill.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -55,13 +55,13 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'required'),
-            array('payment', 'numerical', 'integerOnly' => true),
-            array('credit', 'numerical', 'integerOnly' => false),
-            array('description, invoice_number, image, date', 'length', 'max' => 500),
+        $rules = [
+            ['id_user', 'required'],
+            ['payment', 'numerical', 'integerOnly' => true],
+            ['credit', 'numerical', 'integerOnly' => false],
+            ['description, invoice_number, image, date', 'length', 'max' => 500],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
     /*
@@ -69,9 +69,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
     public function beforeSave()
     {
@@ -100,7 +100,7 @@ public function getRefillChart($filter)
 
     public function countRefill($code, $id_user)
     {
-        return Refill::model()->count('description LIKE :key AND id_user = :key1', array(':key' => '%' . $code . '%', ':key1' => (int) $id_user));
+        return Refill::model()->count('description LIKE :key AND id_user = :key1', [':key' => '%' . $code . '%', ':key1' => (int) $id_user]);
 
     }
 }
diff --git a/protected/models/RefillIcepay.php b/protected/models/RefillIcepay.php
index f2e7c9823..94eb144e0 100755
--- a/protected/models/RefillIcepay.php
+++ b/protected/models/RefillIcepay.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'required'),
-            array('description, credit,date', 'length', 'max' => 500),
-        );
+        $rules = [
+            ['id_user', 'required'],
+            ['description, credit,date', 'length', 'max' => 500],
+        ];
         return $this->getExtraField($rules);
     }
     /*
@@ -63,8 +63,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/Refillprovider.php b/protected/models/Refillprovider.php
index 226c25740..8f4c5be51 100755
--- a/protected/models/Refillprovider.php
+++ b/protected/models/Refillprovider.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('credit, id_provider', 'required'),
-            array('id_provider, payment', 'numerical', 'integerOnly' => true),
-            array('description', 'length', 'max' => 500),
+        $rules = [
+            ['credit, id_provider', 'required'],
+            ['id_provider, payment', 'numerical', 'integerOnly' => true],
+            ['description', 'length', 'max' => 500],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
     /**
@@ -65,8 +65,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idProvider' => array(self::BELONGS_TO, 'Provider', 'id_provider'),
-        );
+        return [
+            'idProvider' => [self::BELONGS_TO, 'Provider', 'id_provider'],
+        ];
     }
 }
diff --git a/protected/models/RestrictedPhonenumber.php b/protected/models/RestrictedPhonenumber.php
index 07b9e965c..603f49407 100755
--- a/protected/models/RestrictedPhonenumber.php
+++ b/protected/models/RestrictedPhonenumber.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,11 +52,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'required'),
-            array('id_user, direction', 'numerical', 'integerOnly' => true),
-            array('number', 'length', 'max' => 20),
-        );
+        $rules = [
+            ['id_user', 'required'],
+            ['id_user, direction', 'numerical', 'integerOnly' => true],
+            ['number', 'length', 'max' => 20],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -65,8 +65,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/SendCreditProducts.php b/protected/models/SendCreditProducts.php
index 1f4604234..80e776aee 100755
--- a/protected/models/SendCreditProducts.php
+++ b/protected/models/SendCreditProducts.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,16 +52,16 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('country_code,status', 'numerical', 'integerOnly' => true),
-            array('country,operator_name,info', 'length', 'max' => 100),
-            array('product,send_value,wholesale_price,provider', 'length', 'max' => 50),
-            array('currency_dest,currency_orig', 'length', 'max' => 3),
-            array('SkuCode', 'length', 'max' => 30),
-            array('operator_id', 'length', 'max' => 11),
-            array('type,retail_price', 'length', 'max' => 50),
+        $rules = [
+            ['country_code,status', 'numerical', 'integerOnly' => true],
+            ['country,operator_name,info', 'length', 'max' => 100],
+            ['product,send_value,wholesale_price,provider', 'length', 'max' => 50],
+            ['currency_dest,currency_orig', 'length', 'max' => 3],
+            ['SkuCode', 'length', 'max' => 30],
+            ['operator_id', 'length', 'max' => 11],
+            ['type,retail_price', 'length', 'max' => 50],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/SendCreditRates.php b/protected/models/SendCreditRates.php
index 6e8c4ea1d..48d81d222 100755
--- a/protected/models/SendCreditRates.php
+++ b/protected/models/SendCreditRates.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -53,10 +53,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, id_product', 'numerical', 'integerOnly' => true),
-            array('sell_price', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['id_user, id_product', 'numerical', 'integerOnly' => true],
+            ['sell_price', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -65,9 +65,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idProduct' => array(self::BELONGS_TO, 'SendCreditProducts', 'id_product'),
-            'idUser'    => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idProduct' => [self::BELONGS_TO, 'SendCreditProducts', 'id_product'],
+            'idUser'    => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/SendCreditSummary.php b/protected/models/SendCreditSummary.php
index b6f90fb1f..036d3dc61 100755
--- a/protected/models/SendCreditSummary.php
+++ b/protected/models/SendCreditSummary.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -43,12 +43,12 @@ public function tableName()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, confirmed', 'numerical', 'integerOnly' => true),
-            array('service,provider,received_amout', 'length', 'max' => 50),
-            array('operator_name', 'length', 'max' => 100),
-            array('number, cost, sell, earned, amount', 'length', 'max' => 20),
-        );
+        $rules = [
+            ['id_user, confirmed', 'numerical', 'integerOnly' => true],
+            ['service,provider,received_amout', 'length', 'max' => 50],
+            ['operator_name', 'length', 'max' => 100],
+            ['number, cost, sell, earned, amount', 'length', 'max' => 20],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -57,8 +57,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/Servers.php b/protected/models/Servers.php
index 07969afdb..08a267be0 100755
--- a/protected/models/Servers.php
+++ b/protected/models/Servers.php
@@ -54,23 +54,23 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('host', 'required'),
-            array('status, weight, last_call_id', 'numerical', 'integerOnly' => true),
-            array('host,name', 'length', 'max' => 100),
-            array('description', 'length', 'max' => 500),
-            array('password, username, last_call', 'length', 'max' => 50),
-            array('type, port, sip_port', 'length', 'max' => 20),
-            array('public_ip', 'length', 'max' => 80),
-            array('password', 'checkpassword'),
-        );
+        $rules = [
+            ['host', 'required'],
+            ['status, weight, last_call_id', 'numerical', 'integerOnly' => true],
+            ['host,name', 'length', 'max' => 100],
+            ['description', 'length', 'max' => 500],
+            ['password, username, last_call', 'length', 'max' => 50],
+            ['type, port, sip_port', 'length', 'max' => 20],
+            ['public_ip', 'length', 'max' => 80],
+            ['password', 'checkpassword'],
+        ];
         return $this->getExtraField($rules);
     }
 
     public function checkpassword($attribute)
     {
 
-        $modelUser = User::model()->find("password = :password", array(':password' => $this->password));
+        $modelUser = User::model()->find("password = :password", [':password' => $this->password]);
         if (is_array($modelUser) && count($modelUser)) {
             $this->addError($attribute, Yii::t('zii', 'This password in in use'));
         }
@@ -79,11 +79,11 @@ public function checkpassword($attribute)
     public function getAllAsteriskServers()
     {
 
-        $resultServers[0] = array(
+        $resultServers[0] = [
             'host'     => 'localhost',
             'username' => 'magnus',
             'password' => 'magnussolution',
-        );
+        ];
 
         if ($resultServers[0]['host'] == 'localhost' && file_exists('/etc/asterisk/asterisk2.conf')) {
             $configFile               = '/etc/asterisk/asterisk2.conf';
@@ -92,17 +92,17 @@ public function getAllAsteriskServers()
         }
 
         $modelServers = Servers::model()->findAll('type = :key AND status = :key1 AND host != :key2',
-            array(
+            [
                 ':key'  => 'asterisk',
                 ':key1' => 1,
                 ':key2' => 'localhost',
-            ));
+            ]);
         foreach ($modelServers as $key => $server) {
-            array_push($resultServers, array(
+            array_push($resultServers, [
                 'host'     => $server->host,
                 'username' => $server->username,
                 'password' => $server->password,
-            ));
+            ]);
         }
         return $resultServers;
     }
diff --git a/protected/models/ServersServers.php b/protected/models/ServersServers.php
index 908ce8ade..0af55c28f 100755
--- a/protected/models/ServersServers.php
+++ b/protected/models/ServersServers.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -44,7 +44,7 @@ public function tableName()
      */
     public function primaryKey()
     {
-        return array('id_proxy', 'id_server');
+        return ['id_proxy', 'id_server'];
     }
 
     /**
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_proxy, id_server', 'required'),
-            array('id_proxy, id_server', 'numerical', 'integerOnly' => true),
-        );
+        $rules = [
+            ['id_proxy, id_server', 'required'],
+            ['id_proxy, id_server', 'numerical', 'integerOnly' => true],
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/Services.php b/protected/models/Services.php
index cded1be1e..0097533ed 100755
--- a/protected/models/Services.php
+++ b/protected/models/Services.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('name, price', 'required'),
-            array('status,disk_space,sipaccountlimit,calllimit,return_credit', 'numerical', 'integerOnly' => true),
-            array('description', 'length', 'min' => 1),
-            array('type', 'length', 'max' => 50),
-        );
+        $rules = [
+            ['name, price', 'required'],
+            ['status,disk_space,sipaccountlimit,calllimit,return_credit', 'numerical', 'integerOnly' => true],
+            ['description', 'length', 'min' => 1],
+            ['type', 'length', 'max' => 50],
+        ];
         return $this->getExtraField($rules);
     }
     /**
@@ -65,9 +65,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'modules'      => array(self::MANY_MANY, 'Module', 'group_module(id_group, id_module)'),
-            'groupModules' => array(self::HAS_MANY, 'GroupModule', 'id_group'),
-        );
+        return [
+            'modules'      => [self::MANY_MANY, 'Module', 'group_module(id_group, id_module)'],
+            'groupModules' => [self::HAS_MANY, 'GroupModule', 'id_group'],
+        ];
     }
 }
diff --git a/protected/models/ServicesModule.php b/protected/models/ServicesModule.php
index c8b4b5446..d7d449dc5 100755
--- a/protected/models/ServicesModule.php
+++ b/protected/models/ServicesModule.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -65,7 +65,7 @@ public function tableName()
      */
     public function primaryKey()
     {
-        return array('id_services', 'id_module');
+        return ['id_services', 'id_module'];
     }
 
     /**
@@ -75,11 +75,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_services, id_module', 'required'),
-            array('id_services, id_module, show_menu', 'numerical', 'integerOnly' => true),
-            array('action', 'length', 'max' => 5),
-        );
+        $rules = [
+            ['id_services, id_module', 'required'],
+            ['id_services, id_module, show_menu', 'numerical', 'integerOnly' => true],
+            ['action', 'length', 'max' => 5],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -90,8 +90,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idModule' => array(self::BELONGS_TO, 'Module', 'id_module'),
-        );
+        return [
+            'idModule' => [self::BELONGS_TO, 'Module', 'id_module'],
+        ];
     }
 }
diff --git a/protected/models/ServicesPlan.php b/protected/models/ServicesPlan.php
index 05361baf8..a43c8acec 100755
--- a/protected/models/ServicesPlan.php
+++ b/protected/models/ServicesPlan.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -44,7 +44,7 @@ public function tableName()
      */
     public function primaryKey()
     {
-        return array('id_services', 'id_plan');
+        return ['id_services', 'id_plan'];
     }
 
     /**
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_services, id_plan', 'required'),
-            array('id_services, id_plan', 'numerical', 'integerOnly' => true),
-        );
+        $rules = [
+            ['id_services, id_plan', 'required'],
+            ['id_services, id_plan', 'numerical', 'integerOnly' => true],
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/ServicesUse.php b/protected/models/ServicesUse.php
index 7f3abd9aa..8d90ca0f2 100755
--- a/protected/models/ServicesUse.php
+++ b/protected/models/ServicesUse.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, id_services, status, month_payed, reminded', 'numerical', 'integerOnly' => true),
-            array('reservationdate, releasedate, contract_period, termination_date, next_due_date', 'safe'),
-        );
+        $rules = [
+            ['id_user, id_services, status, month_payed, reminded', 'numerical', 'integerOnly' => true],
+            ['reservationdate, releasedate, contract_period, termination_date, next_due_date', 'safe'],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -64,10 +64,10 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idServices' => array(self::BELONGS_TO, 'Services', 'id_services'),
-            'idUser'     => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idServices' => [self::BELONGS_TO, 'Services', 'id_services'],
+            'idUser'     => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
     public function beforeSave()
diff --git a/protected/models/Signup.php b/protected/models/Signup.php
index d689fd897..faed89bd2 100755
--- a/protected/models/Signup.php
+++ b/protected/models/Signup.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -45,33 +45,33 @@ public function tableName()
     public function rules()
     {
 
-        $rules = array(
-            array('username,password,lastname, firstname, email, city, state, phone, id_plan, id_user', 'required'),
-            array('phone, vat, mobile,calllimit', 'numerical'),
-            array('password, password2', 'length', 'min' => 6),
-            array('lastname,firstname, city, state', 'length', 'min' => 2),
-            array('country', 'length', 'min' => 1),
-            array('zipcode', 'length', 'min' => 5),
-            array('doc', 'length', 'min' => 11),
-            array('username', 'length', 'min' => 5),
-            array('username', 'checkusername'),
-            array('password', 'checksecret'),
-            array('doc', 'checkdoc'),
-            array('state_number', 'length', 'max' => 40),
-            array('neighborhood', 'length', 'max' => 50),
-            array('address, company_name', 'length', 'max' => 100),
-            array('mobile, phone', 'length', 'min' => 10),
-            array('email', 'checkemail'),
-            array('email,username', 'unique'),
-            array('verifyCode', 'captcha', 'allowEmpty' => !CCaptcha::checkRequirements() || $this->captcha == false),
-            array('accept_terms', 'required', 'requiredValue' => 1, 'message' => 'You must accept the Terms and Conditons in order to register.'),
-        );
+        $rules = [
+            ['username,password,lastname, firstname, email, city, state, phone, id_plan, id_user', 'required'],
+            ['phone, vat, mobile,calllimit', 'numerical'],
+            ['password, password2', 'length', 'min' => 6],
+            ['lastname,firstname, city, state', 'length', 'min' => 2],
+            ['country', 'length', 'min' => 1],
+            ['zipcode', 'length', 'min' => 5],
+            ['doc', 'length', 'min' => 11],
+            ['username', 'length', 'min' => 5],
+            ['username', 'checkusername'],
+            ['password', 'checksecret'],
+            ['doc', 'checkdoc'],
+            ['state_number', 'length', 'max' => 40],
+            ['neighborhood', 'length', 'max' => 50],
+            ['address, company_name', 'length', 'max' => 100],
+            ['mobile, phone', 'length', 'min' => 10],
+            ['email', 'checkemail'],
+            ['email,username', 'unique'],
+            ['verifyCode', 'captcha', 'allowEmpty' =>  ! CCaptcha::checkRequirements() || $this->captcha == false],
+            ['accept_terms', 'required', 'requiredValue' => 1, 'message' => 'You must accept the Terms and Conditons in order to register.'],
+        ];
         return $this->getExtraField($rules);
     }
 
     public function checkemail($attribute, $params)
     {
-        if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {
+        if ( ! filter_var($this->email, FILTER_VALIDATE_EMAIL)) {
             $this->addError($attribute, Yii::t('zii', 'Invalid Email'));
         }
 
@@ -97,7 +97,7 @@ public function checkdoc($attribute, $params)
         }
 
         if ($config['global']['signup_unique_doc'] == 0 && strlen($this->doc)) {
-            $modelUserCheck = User::model()->find('doc = :key', array(':key' => $this->doc));
+            $modelUserCheck = User::model()->find('doc = :key', [':key' => $this->doc]);
             if (isset($modelUserCheck->id)) {
                 $this->addError($attribute, Yii::t('zii', 'This DOC is already used per other user'));
             }
@@ -109,7 +109,7 @@ public function checkusername($attribute, $params)
             $this->addError($attribute, Yii::t('zii', 'No space allow in username'));
         }
 
-        if (!preg_match('/^[1-9]|^[A-Z]|^[a-z]/', $this->username)) {
+        if ( ! preg_match('/^[1-9]|^[A-Z]|^[a-z]/', $this->username)) {
             $this->addError($attribute, Yii::t('zii', 'Username need start with numbers or letters'));
         }
 
diff --git a/protected/models/Sip.php b/protected/models/Sip.php
index 284f6132f..6241a13a1 100755
--- a/protected/models/Sip.php
+++ b/protected/models/Sip.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
diff --git a/protected/models/SipTrace.php b/protected/models/SipTrace.php
index de21a67ba..052de79d2 100755
--- a/protected/models/SipTrace.php
+++ b/protected/models/SipTrace.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,11 +52,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('status,timeout,in_use', 'numerical', 'integerOnly' => true),
-            array('filter', 'length', 'max' => 50),
-            array('port', 'length', 'max' => 7),
-        );
+        $rules = [
+            ['status,timeout,in_use', 'numerical', 'integerOnly' => true],
+            ['filter', 'length', 'max' => 50],
+            ['port', 'length', 'max' => 7],
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/Sipuras.php b/protected/models/Sipuras.php
index 977f2093e..7f4093d5f 100755
--- a/protected/models/Sipuras.php
+++ b/protected/models/Sipuras.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,24 +52,24 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('macadr, id_user', 'required'),
-            array('macadr', 'length', 'max' => 12),
-            array('senha_admin, senha_user, Use_Pref_Codec_Only_1, Use_Pref_Codec_Only_2, Preferred_Codec_1, Preferred_Codec_2', 'length', 'max' => 8),
-            array('antireset, altera, Enable_Web_Server, STUN_Enable,
+        $rules = [
+            ['macadr, id_user', 'required'],
+            ['macadr', 'length', 'max' => 12],
+            ['senha_admin, senha_user, Use_Pref_Codec_Only_1, Use_Pref_Codec_Only_2, Preferred_Codec_1, Preferred_Codec_2', 'length', 'max' => 8],
+            ['antireset, altera, Enable_Web_Server, STUN_Enable,
                 NAT_Keep_Alive_Enable_1_, NAT_Keep_Alive_Enable_2_, NAT_Mapping_Enable_1_,
-                NAT_Mapping_Enable_2_, STUN_Test_Enable, Substitute_VIA_Addr', 'length', 'max' => 3),
-            array('lastmov', 'length', 'max' => 20),
-            array('marca', 'length', 'max' => 2),
-            array('obs', 'length', 'max' => 50),
-            array('Proxy_1, Proxy_2', 'length', 'max' => 100),
-            array('last_ip, nserie', 'length', 'max' => 15),
-            array('Register_Expires_1, Register_Expires_2', 'length', 'max' => 4),
-            array('fultmov', 'length', 'max' => 30),
-            array('User_ID_1, User_ID_2, Password_1, Password_2', 'length', 'max' => 25),
-            array('STUN_Server,Dial_Tone', 'length', 'max' => 80),
-            array('Dial_Plan_1, Dial_Plan_2', 'length', 'max' => 180),
-        );
+                NAT_Mapping_Enable_2_, STUN_Test_Enable, Substitute_VIA_Addr', 'length', 'max' => 3],
+            ['lastmov', 'length', 'max' => 20],
+            ['marca', 'length', 'max' => 2],
+            ['obs', 'length', 'max' => 50],
+            ['Proxy_1, Proxy_2', 'length', 'max' => 100],
+            ['last_ip, nserie', 'length', 'max' => 15],
+            ['Register_Expires_1, Register_Expires_2', 'length', 'max' => 4],
+            ['fultmov', 'length', 'max' => 30],
+            ['User_ID_1, User_ID_2, Password_1, Password_2', 'length', 'max' => 25],
+            ['STUN_Server,Dial_Tone', 'length', 'max' => 80],
+            ['Dial_Plan_1, Dial_Plan_2', 'length', 'max' => 180],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -78,9 +78,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
     public function beforeSave()
diff --git a/protected/models/Sms.php b/protected/models/Sms.php
index 028914a11..b945e604c 100755
--- a/protected/models/Sms.php
+++ b/protected/models/Sms.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,16 +52,16 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'required'),
-            array('id_user, prefix, status', 'numerical', 'integerOnly' => true),
-            array('telephone', 'numerical'),
-            array('sms', 'length', 'max' => 200),
-            array('result', 'length', 'max' => 500),
-            array('rate', 'length', 'max' => 10),
-            array('sms_from', 'length', 'max' => 16),
+        $rules = [
+            ['id_user', 'required'],
+            ['id_user, prefix, status', 'numerical', 'integerOnly' => true],
+            ['telephone', 'numerical'],
+            ['sms', 'length', 'max' => 200],
+            ['result', 'length', 'max' => 500],
+            ['rate', 'length', 'max' => 10],
+            ['sms_from', 'length', 'max' => 16],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -70,8 +70,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/Smtps.php b/protected/models/Smtps.php
index c88b91e17..57ccab029 100755
--- a/protected/models/Smtps.php
+++ b/protected/models/Smtps.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,12 +52,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'numerical', 'integerOnly' => true),
-            array('host, username, ', 'length', 'max' => 100),
-            array('password', 'length', 'max' => 50),
-            array('encryption, port', 'length', 'max' => 10),
-        );
+        $rules = [
+            ['id_user', 'numerical', 'integerOnly' => true],
+            ['host, username, ', 'length', 'max' => 100],
+            ['password', 'length', 'max' => 50],
+            ['encryption, port', 'length', 'max' => 10],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -66,8 +66,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/StatusSystem.php b/protected/models/StatusSystem.php
index 6195e0372..3fd51eb92 100755
--- a/protected/models/StatusSystem.php
+++ b/protected/models/StatusSystem.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,11 +52,11 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('cpuMediaUso,cpuPercent,memUsed,networkin,networkout,disk_free,disk_perc', 'numerical'),
-            array('date', 'length', 'max' => 30),
+        $rules = [
+            ['cpuMediaUso,cpuPercent,memUsed,networkin,networkout,disk_free,disk_perc', 'numerical'],
+            ['date', 'length', 'max' => 30],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/TablesChanges.php b/protected/models/TablesChanges.php
index f54278a21..6dc20f088 100755
--- a/protected/models/TablesChanges.php
+++ b/protected/models/TablesChanges.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -53,10 +53,10 @@ public function primaryKey()
 
     public function rules()
     {
-        $rules = array(
-            array('module', 'required'),
-            array('last_time', 'numerical', 'integerOnly' => true),
-        );
+        $rules = [
+            ['module', 'required'],
+            ['last_time', 'numerical', 'integerOnly' => true],
+        ];
         return $this->getExtraField($rules);
     }
     public function lastTime($table)
diff --git a/protected/models/TemplateMail.php b/protected/models/TemplateMail.php
index 63699dd77..cedef6c83 100755
--- a/protected/models/TemplateMail.php
+++ b/protected/models/TemplateMail.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,13 +52,13 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user,status', 'numerical', 'integerOnly' => true),
-            array('mailtype', 'length', 'max' => 50),
-            array('fromname, fromemail, language', 'length', 'max' => 70),
-            array('subject', 'length', 'max' => 130),
-            array('messagehtml', 'length', 'max' => 3000),
-        );
+        $rules = [
+            ['id_user,status', 'numerical', 'integerOnly' => true],
+            ['mailtype', 'length', 'max' => 50],
+            ['fromname, fromemail, language', 'length', 'max' => 70],
+            ['subject', 'length', 'max' => 130],
+            ['messagehtml', 'length', 'max' => 3000],
+        ];
         return $this->getExtraField($rules);
     }
     /**
@@ -66,8 +66,8 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/TransferToMobile.php b/protected/models/TransferToMobile.php
index c6ef2f587..8a7f30ebe 100755
--- a/protected/models/TransferToMobile.php
+++ b/protected/models/TransferToMobile.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -74,26 +74,26 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('username, password', 'required'),
-            array('id_user, id_group, id_plan, id_offer, active, enableexpire, expiredays,
+        $rules = [
+            ['username, password', 'required'],
+            ['id_user, id_group, id_plan, id_offer, active, enableexpire, expiredays,
                     typepaid, creditlimit, credit_notification,sipaccountlimit, restriction,
                     callingcard_pin, callshop, plan_day, active_paypal, boleto,
                     boleto_day, calllimit, disk_space,id_group_agent,transfer_dbbl_rocket_profit,
                     transfer_bkash_profit,transfer_flexiload_profit,transfer_international_profit,
                     transfer_dbbl_rocket,transfer_bkash,transfer_flexiload,transfer_international
-                        ', 'numerical', 'integerOnly' => true),
-            array('language,mix_monitor_format', 'length', 'max' => 5),
-            array('username, zipcode, phone, mobile, vat', 'length', 'max' => 20),
-            array('city, state, country, loginkey', 'length', 'max' => 40),
-            array('lastname, firstname, company_name, redial, prefix_local', 'length', 'max' => 50),
-            array('company_website', 'length', 'max' => 60),
-            array('address, email, description, doc', 'length', 'max' => 100),
-            array('credit', 'type', 'type' => 'double'),
-            array('expirationdate, password, lastuse', 'length', 'max' => 100),
-            array('username', 'unique', 'caseSensitive' => 'false'),
+                        ', 'numerical', 'integerOnly' => true],
+            ['language,mix_monitor_format', 'length', 'max' => 5],
+            ['username, zipcode, phone, mobile, vat', 'length', 'max' => 20],
+            ['city, state, country, loginkey', 'length', 'max' => 40],
+            ['lastname, firstname, company_name, redial, prefix_local', 'length', 'max' => 50],
+            ['company_website', 'length', 'max' => 60],
+            ['address, email, description, doc', 'length', 'max' => 100],
+            ['credit', 'type', 'type' => 'double'],
+            ['expirationdate, password, lastuse', 'length', 'max' => 100],
+            ['username', 'unique', 'caseSensitive' => 'false'],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -106,10 +106,10 @@ public function checkmethod($attribute, $params)
 
     public function relations()
     {
-        return array(
-            'idGroup' => array(self::BELONGS_TO, 'GroupUser', 'id_group'),
-            'idPlan'  => array(self::BELONGS_TO, 'Plan', 'id_plan'),
-            'idUser'  => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idGroup' => [self::BELONGS_TO, 'GroupUser', 'id_group'],
+            'idPlan'  => [self::BELONGS_TO, 'Plan', 'id_plan'],
+            'idUser'  => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/Trunk.php b/protected/models/Trunk.php
index 811a84981..f46c221d5 100755
--- a/protected/models/Trunk.php
+++ b/protected/models/Trunk.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -54,26 +54,26 @@ public function rules()
     {
         // NOTE: you should only define rules for those attributes that
         // will receive user inputs.
-        $rules = array(
-            array('trunkcode, id_provider, allow, providertech, host', 'required'),
-            array('allow_error, id_provider, failover_trunk, secondusedreal, register, call_answered,port, call_total, inuse, maxuse, status, if_max_use, cnl', 'numerical', 'integerOnly' => true),
-            array('secret', 'length', 'max' => 50),
-            array('nat, trunkcode, sms_res', 'length', 'max' => 50),
-            array('trunkprefix, providertech, removeprefix, context, insecure, disallow', 'length', 'max' => 20),
-            array('providerip, user,fromuser, allow, host, fromdomain', 'length', 'max' => 80),
-            array('addparameter, block_cid', 'length', 'max' => 120),
-            array('link_sms', 'length', 'max' => 250),
-            array('dtmfmode, qualify', 'length', 'max' => 7),
-            array('directmedia,sendrpid', 'length', 'max' => 10),
-            array('cid_add,cid_remove', 'length', 'max' => 11),
-            array('type, language', 'length', 'max' => 6),
-            array('transport,encryption', 'length', 'max' => 3),
-            array('port', 'length', 'max' => 5),
-            array('register_string', 'length', 'max' => 300),
-            array('sip_config', 'length', 'max' => 500),
-            array('trunkcode', 'checkTrunkCode'),
-            array('trunkcode', 'uniquePeerName'),
-        );
+        $rules = [
+            ['trunkcode, id_provider, allow, providertech, host', 'required'],
+            ['allow_error, id_provider, failover_trunk, secondusedreal, register, call_answered,port, call_total, inuse, maxuse, status, if_max_use, cnl', 'numerical', 'integerOnly' => true],
+            ['secret', 'length', 'max' => 50],
+            ['nat, trunkcode, sms_res', 'length', 'max' => 50],
+            ['trunkprefix, providertech, removeprefix, context, insecure, disallow', 'length', 'max' => 20],
+            ['providerip, user,fromuser, allow, host, fromdomain', 'length', 'max' => 80],
+            ['addparameter, block_cid', 'length', 'max' => 120],
+            ['link_sms', 'length', 'max' => 250],
+            ['dtmfmode, qualify', 'length', 'max' => 7],
+            ['directmedia,sendrpid', 'length', 'max' => 10],
+            ['cid_add,cid_remove', 'length', 'max' => 11],
+            ['type, language', 'length', 'max' => 6],
+            ['transport,encryption', 'length', 'max' => 3],
+            ['port', 'length', 'max' => 5],
+            ['register_string', 'length', 'max' => 300],
+            ['sip_config', 'length', 'max' => 500],
+            ['trunkcode', 'checkTrunkCode'],
+            ['trunkcode', 'uniquePeerName'],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -89,11 +89,11 @@ public function checkTrunkCode($attribute, $params)
      */
     public function relations()
     {
-        return array(
-            'idProvider'    => array(self::BELONGS_TO, 'Provider', 'id_provider'),
-            'failoverTrunk' => array(self::BELONGS_TO, 'trunk', 'failover_trunk'),
-            'trunks'        => array(self::HAS_MANY, 'trunk', 'failover_trunk'),
-        );
+        return [
+            'idProvider'    => [self::BELONGS_TO, 'Provider', 'id_provider'],
+            'failoverTrunk' => [self::BELONGS_TO, 'trunk', 'failover_trunk'],
+            'trunks'        => [self::HAS_MANY, 'trunk', 'failover_trunk'],
+        ];
     }
 
     public function beforeSave()
diff --git a/protected/models/TrunkGroup.php b/protected/models/TrunkGroup.php
index cf6258924..9f0ffee1d 100755
--- a/protected/models/TrunkGroup.php
+++ b/protected/models/TrunkGroup.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -53,12 +53,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('name', 'required'),
-            array('type', 'numerical', 'integerOnly' => true),
-            array('description', 'length', 'max' => 500),
-            array('weight', 'match', 'pattern' => '/^[0-9\,]*$|^$/', 'message' => Yii::t('zii', 'Allowed format int,int,int. Ex: 1,2,1,5,3')),
-        );
+        $rules = [
+            ['name', 'required'],
+            ['type', 'numerical', 'integerOnly' => true],
+            ['description', 'length', 'max' => 500],
+            ['weight', 'match', 'pattern' => '/^[0-9\,]*$|^$/', 'message' => Yii::t('zii', 'Allowed format int,int,int. Ex: 1,2,1,5,3')],
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/TrunkGroupTrunk.php b/protected/models/TrunkGroupTrunk.php
index 160f92343..14f1fcd51 100755
--- a/protected/models/TrunkGroupTrunk.php
+++ b/protected/models/TrunkGroupTrunk.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -44,7 +44,7 @@ public function tableName()
      */
     public function primaryKey()
     {
-        return array('id', 'id_trunk_group', 'id_trunk');
+        return ['id', 'id_trunk_group', 'id_trunk'];
     }
 
     /**
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_trunk_group, id_trunk', 'required'),
-            array('id_trunk_group, id_trunk', 'numerical', 'integerOnly' => true),
-        );
+        $rules = [
+            ['id_trunk_group, id_trunk', 'required'],
+            ['id_trunk_group, id_trunk', 'numerical', 'integerOnly' => true],
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -64,9 +64,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idTrunk'      => array(self::BELONGS_TO, 'Trunk', 'id_trunk'),
-            'idTrunkGroup' => array(self::BELONGS_TO, 'TrunkGroup', 'id_trunk_group'),
-        );
+        return [
+            'idTrunk'      => [self::BELONGS_TO, 'Trunk', 'id_trunk'],
+            'idTrunkGroup' => [self::BELONGS_TO, 'TrunkGroup', 'id_trunk_group'],
+        ];
     }
 }
diff --git a/protected/models/TrunkSipCodes.php b/protected/models/TrunkSipCodes.php
index ce8866747..5f133c0da 100755
--- a/protected/models/TrunkSipCodes.php
+++ b/protected/models/TrunkSipCodes.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -55,14 +55,14 @@ public function rules()
     {
         // NOTE: you should only define rules for those attributes that
         // will receive user inputs.
-        $rules = array(
-            array('ip, code, total,', 'required'),
-            array('total, code', 'numerical', 'integerOnly' => true),
-            array('ip', 'length', 'max' => 100),
-            array('code', 'length', 'max' => 5),
-            array('total', 'length', 'max' => 11),
+        $rules = [
+            ['ip, code, total,', 'required'],
+            ['total, code', 'numerical', 'integerOnly' => true],
+            ['ip', 'length', 'max' => 100],
+            ['code', 'length', 'max' => 5],
+            ['total', 'length', 'max' => 11],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 
diff --git a/protected/models/User.php b/protected/models/User.php
index 9a09f5d75..640856347 100755
--- a/protected/models/User.php
+++ b/protected/models/User.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
diff --git a/protected/models/UserHistory.php b/protected/models/UserHistory.php
index e93a68854..df6a2f91b 100755
--- a/protected/models/UserHistory.php
+++ b/protected/models/UserHistory.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -55,12 +55,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user', 'required'),
-            array('date', 'length', 'max' => 20),
-            array('description', 'length', 'max' => 1000),
+        $rules = [
+            ['id_user', 'required'],
+            ['date', 'length', 'max' => 20],
+            ['description', 'length', 'max' => 1000],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
     /*
@@ -68,9 +68,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
 }
diff --git a/protected/models/UserRate.php b/protected/models/UserRate.php
index f39e2b065..9a51aebc8 100755
--- a/protected/models/UserRate.php
+++ b/protected/models/UserRate.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -53,12 +53,12 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, id_prefix', 'required'),
-            array('id_user, id_prefix, initblock, billingblock', 'numerical', 'integerOnly' => true),
-            array('rateinitial', 'length', 'max' => 10),
+        $rules = [
+            ['id_user, id_prefix', 'required'],
+            ['id_user, id_prefix, initblock, billingblock', 'numerical', 'integerOnly' => true],
+            ['rateinitial', 'length', 'max' => 10],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 
@@ -67,9 +67,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idPrefix' => array(self::BELONGS_TO, 'Prefix', 'id_prefix'),
-            'idUser'   => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idPrefix' => [self::BELONGS_TO, 'Prefix', 'id_prefix'],
+            'idUser'   => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/models/UserType.php b/protected/models/UserType.php
index 1624dca66..0081596ff 100755
--- a/protected/models/UserType.php
+++ b/protected/models/UserType.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,10 +52,10 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('name', 'required'),
-            array('name', 'length', 'max' => 100),
-        );
+        $rules = [
+            ['name', 'required'],
+            ['name', 'length', 'max' => 100],
+        ];
         return $this->getExtraField($rules);
     }
 }
diff --git a/protected/models/Voucher.php b/protected/models/Voucher.php
index 859ccddd4..c44db6e71 100755
--- a/protected/models/Voucher.php
+++ b/protected/models/Voucher.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -52,13 +52,13 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('voucher', 'required'),
-            array('used, id_user, id_plan', 'numerical', 'integerOnly' => true),
-            array('credit', 'numerical'),
-            array('voucher, tag, language, prefix_local', 'length', 'max' => 50),
-            array('usedate, expirationdate', 'safe'),
-        );
+        $rules = [
+            ['voucher', 'required'],
+            ['used, id_user, id_plan', 'numerical', 'integerOnly' => true],
+            ['credit', 'numerical'],
+            ['voucher, tag, language, prefix_local', 'length', 'max' => 50],
+            ['usedate, expirationdate', 'safe'],
+        ];
         return $this->getExtraField($rules);
     }
     /*
@@ -66,9 +66,9 @@ public function rules()
      */
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 
     public function beforeSave()
@@ -80,10 +80,10 @@ public function beforeSave()
             $success = false;
             $msg     = 'Não é possível usar esta opção';
             # retorna o resultado da execucao
-            echo json_encode(array(
+            echo json_encode([
                 'success' => $success,
                 'msg'     => $msg,
-            ));
+            ]);
             exit;
         }
         if ($this->getIsNewRecord()) {
diff --git a/protected/models/WHMCS.php b/protected/models/WHMCS.php
index 88df673ec..4fa8d26bc 100755
--- a/protected/models/WHMCS.php
+++ b/protected/models/WHMCS.php
@@ -7,7 +7,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v3
@@ -54,17 +54,17 @@ public function primaryKey()
      */
     public function rules()
     {
-        $rules = array(
-            array('id_user, pkg_user_whmcs', 'required'),
+        $rules = [
+            ['id_user, pkg_user_whmcs', 'required'],
 
-        );
+        ];
         return $this->getExtraField($rules);
     }
 
     public function relations()
     {
-        return array(
-            'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
-        );
+        return [
+            'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
+        ];
     }
 }
diff --git a/protected/views/buyCredit/authorizenet.php b/protected/views/buyCredit/authorizenet.php
index 453cdb70a..00d288d67 100755
--- a/protected/views/buyCredit/authorizenet.php
+++ b/protected/views/buyCredit/authorizenet.php
@@ -6,7 +6,7 @@
  *
  * @package MagnusBilling
  * @author Adilson Leffa Magnus.
- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
  * ###################################
  *
  * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -54,16 +54,16 @@
     $model->payment     = 1;
     $model->save();
 
-    echo json_encode(array(
+    echo json_encode([
         'success' => true,
         'msg'     => 'Thank You! You have successfully completed the payment!',
-    ));
+    ]);
     exit;
 
 } else {
-    echo json_encode(array(
+    echo json_encode([
         'success' => false,
         'msg'     => 'Oops, some error occured 
' . $response->response_reason_text, - )); + ]); exit; } diff --git a/protected/views/buyCredit/cryptocurrency.php b/protected/views/buyCredit/cryptocurrency.php index 880e88b2d..6dd4ad8ab 100755 --- a/protected/views/buyCredit/cryptocurrency.php +++ b/protected/views/buyCredit/cryptocurrency.php @@ -4,29 +4,29 @@ }, 10000); - * 04/01/2018 - */ - -$wallets = explode('|', $modelMethodPay->username); - -if (!isset($_GET['network']) || !strlen($_GET['network'])) { + /** + * Modelo para a tabela "Balance". + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v3 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * 04/01/2018 + */ + + $wallets = explode('|', $modelMethodPay->username); + + if ( ! isset($_GET['network']) || ! strlen($_GET['network'])) { ?> @@ -54,73 +54,73 @@ ', $wallets[$_GET['network']]); - $address = $data[1]; - $crypto = strtoupper(strtok($data[0], '(')); - $network = '(' . strtok(''); - - if (Yii::app()->session['currency'] == 'U$S' || Yii::app()->session['currency'] == '$') { - $MB_currency = 'USD'; - } else if (Yii::app()->session['currency'] == 'R$') { - $MB_currency = 'BRL'; - } elseif (Yii::app()->session['currency'] == '€') { - $MB_currency = 'EUR'; - } elseif (Yii::app()->session['currency'] == 'AUD$') { - $MB_currency = 'AUD'; } else { - $MB_currency = Yii::app()->session['currency']; - } - if (isset($_SESSION[$crypto]) && $_SESSION[$crypto] == $_GET['amount'] && isset($_SESSION['modelCryptocurrency_id'])) { + $data = explode('=>', $wallets[$_GET['network']]); + $address = $data[1]; + $crypto = strtoupper(strtok($data[0], '(')); + $network = '(' . strtok(''); + + if (Yii::app()->session['currency'] == 'U$S' || Yii::app()->session['currency'] == '$') { + $MB_currency = 'USD'; + } else if (Yii::app()->session['currency'] == 'R$') { + $MB_currency = 'BRL'; + } elseif (Yii::app()->session['currency'] == '€') { + $MB_currency = 'EUR'; + } elseif (Yii::app()->session['currency'] == 'AUD$') { + $MB_currency = 'AUD'; + } else { + $MB_currency = Yii::app()->session['currency']; + } - $amountCrypto = $_SESSION['amountCrypto']; - $modelCryptocurrency = Cryptocurrency::model()->find('id = :key AND status = 0', - array(':key' => $_SESSION['modelCryptocurrency_id'])); + if (isset($_SESSION[$crypto]) && $_SESSION[$crypto] == $_GET['amount'] && isset($_SESSION['modelCryptocurrency_id'])) { - if (isset($modelCryptocurrency->id)) { - unset($_SESSION['modelCryptocurrency_id']); - unset($_SESSION[$crypto]); - echo '


Your PAYMENT was Accepted successfully!
'; - exit; - } - } else { - $mb_credit = $_GET['amount'] + (rand(0, 10) / 10); + $amountCrypto = $_SESSION['amountCrypto']; + $modelCryptocurrency = Cryptocurrency::model()->find('id = :key AND status = 0', + [':key' => $_SESSION['modelCryptocurrency_id']]); + + if (isset($modelCryptocurrency->id)) { + unset($_SESSION['modelCryptocurrency_id']); + unset($_SESSION[$crypto]); + echo '


Your PAYMENT was Accepted successfully!
'; + exit; + } + } else { + $mb_credit = $_GET['amount'] + (rand(0, 10) / 10); - $url = 'https://api.coinconvert.net/convert/' . $MB_currency . '/' . $crypto . '?amount=' . $_GET['amount']; + $url = 'https://api.coinconvert.net/convert/' . $MB_currency . '/' . $crypto . '?amount=' . $_GET['amount']; - $amountCrypto = file_get_contents($url); - $amountCrypto = json_decode($amountCrypto); + $amountCrypto = file_get_contents($url); + $amountCrypto = json_decode($amountCrypto); - $amountCrypto = $amountCrypto->$crypto; + $amountCrypto = $amountCrypto->$crypto; - $amountCrypto = number_format($amountCrypto, 4) . rand(11, 99); + $amountCrypto = number_format($amountCrypto, 4) . rand(11, 99); - //avoid some amount in the same day - for (;;) { - $modelCryptocurrency = Cryptocurrency::model()->find('amountCrypto = :key AND date > :key1', - array(':key' => $amountCrypto, ':key1' => date('Y-m-d'))); - if (isset($modelCryptocurrency->id)) { - $amountCrypto = number_format($bitcoinPrice, 6) . rand(11, 99); + //avoid some amount in the same day + for (;;) { + $modelCryptocurrency = Cryptocurrency::model()->find('amountCrypto = :key AND date > :key1', + [':key' => $amountCrypto, ':key1' => date('Y-m-d')]); + if (isset($modelCryptocurrency->id)) { + $amountCrypto = number_format($bitcoinPrice, 6) . rand(11, 99); - } else { - break; + } else { + break; + } } - } - $modelCryptocurrency = new Cryptocurrency(); - $modelCryptocurrency->id_user = Yii::app()->session['id_user']; - $modelCryptocurrency->currency = $crypto; - $modelCryptocurrency->amountCrypto = $amountCrypto; - $modelCryptocurrency->amount = $_GET['amount']; - $modelCryptocurrency->status = 1; - $modelCryptocurrency->save(); - - $_SESSION[$crypto] = $_GET['amount']; - $_SESSION['amountCrypto'] = $amountCrypto; - $_SESSION['modelCryptocurrency_id'] = $modelCryptocurrency->id; - } + $modelCryptocurrency = new Cryptocurrency(); + $modelCryptocurrency->id_user = Yii::app()->session['id_user']; + $modelCryptocurrency->currency = $crypto; + $modelCryptocurrency->amountCrypto = $amountCrypto; + $modelCryptocurrency->amount = $_GET['amount']; + $modelCryptocurrency->status = 1; + $modelCryptocurrency->save(); + + $_SESSION[$crypto] = $_GET['amount']; + $_SESSION['amountCrypto'] = $amountCrypto; + $_SESSION['modelCryptocurrency_id'] = $modelCryptocurrency->id; + } ?> @@ -137,11 +137,11 @@

Credit:  

-

+

Crypto amount:  

-

+

Crypto Network:  

diff --git a/protected/views/buyCredit/cuentadigital.php b/protected/views/buyCredit/cuentadigital.php index 6b207c467..ea0afa357 100755 --- a/protected/views/buyCredit/cuentadigital.php +++ b/protected/views/buyCredit/cuentadigital.php @@ -1,22 +1,22 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ ?>
libre) * 1.1; + $cambio = trim($result->libre) * 1.1; ?>
diff --git a/protected/views/buyCredit/dineromail.php b/protected/views/buyCredit/dineromail.php index a158459b3..28840c633 100755 --- a/protected/views/buyCredit/dineromail.php +++ b/protected/views/buyCredit/dineromail.php @@ -1,22 +1,22 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ ?>
@@ -27,14 +27,14 @@ }; diff --git a/protected/views/buyCredit/elavon.php b/protected/views/buyCredit/elavon.php index d95dad887..c36400f4f 100755 --- a/protected/views/buyCredit/elavon.php +++ b/protected/views/buyCredit/elavon.php @@ -1,24 +1,24 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ -/* + /* $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
@@ -47,80 +47,80 @@ */ -$error = ''; -$success = ''; -if ($_POST) { + $error = ''; + $success = ''; + if ($_POST) { - $url = 'https://www.myvirtualmerchant.com/VirtualMerchant/process.do'; + $url = 'https://www.myvirtualmerchant.com/VirtualMerchant/process.do'; - //$url = 'https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do'; + //$url = 'https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do'; - if (strlen($_POST['card-address']) > 1) { - $modelUser->address = $_POST['card-address']; - } - if (strlen($_POST['card-city']) > 1) { - $modelUser->city = $_POST['card-city']; - } - if (strlen($_POST['card-state']) > 1) { - $modelUser->state = $_POST['card-state']; - } - if (strlen($_POST['card-zip']) > 1) { - $modelUser->zipcode = $_POST['card-zip']; - } - try { - $modelUser->save(); - } catch (Exception $e) { - // - } + if (strlen($_POST['card-address']) > 1) { + $modelUser->address = $_POST['card-address']; + } + if (strlen($_POST['card-city']) > 1) { + $modelUser->city = $_POST['card-city']; + } + if (strlen($_POST['card-state']) > 1) { + $modelUser->state = $_POST['card-state']; + } + if (strlen($_POST['card-zip']) > 1) { + $modelUser->zipcode = $_POST['card-zip']; + } + try { + $modelUser->save(); + } catch (Exception $e) { + // + } - $fields = array( - 'ssl_merchant_id' => $modelMethodPay->username, - 'ssl_user_id' => $modelMethodPay->client_id, - 'ssl_pin' => $modelMethodPay->client_secret, - 'ssl_show_form' => 'false', - 'ssl_result_format' => 'ASCII', - 'ssl_test_mode' => 'false', - 'ssl_transaction_type' => 'ccsale', - 'ssl_amount' => $_GET['amount'], - 'ssl_card_number' => urlencode($_POST['card-number']), - 'ssl_exp_date' => urlencode($_POST['card-exp_date']), - 'ssl_cvv2cvc2_indicator' => 1, - 'ssl_cvv2cvc2' => urlencode($_POST['card-cvc']), - 'ssl_customer_code' => urlencode(substr($reference, 8)), - 'ssl_avs_address' => urlencode($_POST['card-address']), - 'ssl_city' => urlencode($_POST['card-city']), - 'ssl_state' => urlencode($_POST['card-state']), - 'ssl_avs_zip' => urlencode($_POST['card-zip']), - 'ssl_country' => urlencode($_POST['card-country']), - ); + $fields = [ + 'ssl_merchant_id' => $modelMethodPay->username, + 'ssl_user_id' => $modelMethodPay->client_id, + 'ssl_pin' => $modelMethodPay->client_secret, + 'ssl_show_form' => 'false', + 'ssl_result_format' => 'ASCII', + 'ssl_test_mode' => 'false', + 'ssl_transaction_type' => 'ccsale', + 'ssl_amount' => $_GET['amount'], + 'ssl_card_number' => urlencode($_POST['card-number']), + 'ssl_exp_date' => urlencode($_POST['card-exp_date']), + 'ssl_cvv2cvc2_indicator' => 1, + 'ssl_cvv2cvc2' => urlencode($_POST['card-cvc']), + 'ssl_customer_code' => urlencode(substr($reference, 8)), + 'ssl_avs_address' => urlencode($_POST['card-address']), + 'ssl_city' => urlencode($_POST['card-city']), + 'ssl_state' => urlencode($_POST['card-state']), + 'ssl_avs_zip' => urlencode($_POST['card-zip']), + 'ssl_country' => urlencode($_POST['card-country']), + ]; - $fields_string = ''; + $fields_string = ''; - foreach ($fields as $key => $value) {$fields_string .= $key . '=' . $value . '&';} - rtrim($fields_string, "&"); + foreach ($fields as $key => $value) {$fields_string .= $key . '=' . $value . '&';} + rtrim($fields_string, "&"); - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - $result = curl_exec($ch); + $result = curl_exec($ch); - curl_close($ch); + curl_close($ch); - if (preg_match('/ssl_result_message=APPROV/', $result)) { - $success = 'Your payment was successful.'; - UserCreditManager::releaseUserCredit($modelUser->id, $_GET['amount'] * 0.97, 'Payment via Elevon', 1, $reference); + if (preg_match('/ssl_result_message=APPROV/', $result)) { + $success = 'Your payment was successful.'; + UserCreditManager::releaseUserCredit($modelUser->id, $_GET['amount'] * 0.97, 'Payment via Elevon', 1, $reference); - } else { - //$result = explode('errorMessage=', $result); - $error = print_r($result, true); - } + } else { + //$result = explode('errorMessage=', $result); + $error = print_r($result, true); + } -} + } ?> @@ -139,7 +139,7 @@
El sistema descontara el 3% del total de la transaccion por el pago con tarjeta de credito.
-

Payment Information : Amount

+

Payment Information : Amount

diff --git a/protected/views/buyCredit/icepay.php b/protected/views/buyCredit/icepay.php index 221792202..1973c7e91 100755 --- a/protected/views/buyCredit/icepay.php +++ b/protected/views/buyCredit/icepay.php @@ -1,57 +1,57 @@ - * - */ - -require_once "lib/icepay/icepay.php"; - -if (preg_match("/ /", $modelMethodPay->show_name)) { - $type = explode(" ", $modelMethodPay->show_name); - $typePayment = 'ICEPAY_' . $type[0]; -} else { - $typePayment = 'ICEPAY_' . $modelMethodPay->show_name; -} - -if (isset($_GET['sussess'])) { - - $order = Yii::app()->session['id_user'] . '_' . date('his'); + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ + + require_once "lib/icepay/icepay.php"; + + if (preg_match("/ /", $modelMethodPay->show_name)) { + $type = explode(" ", $modelMethodPay->show_name); + $typePayment = 'ICEPAY_' . $type[0]; + } else { + $typePayment = 'ICEPAY_' . $modelMethodPay->show_name; + } - $method = new $typePayment($modelMethodPay->username, $modelMethodPay->pagseguro_TOKEN); + if (isset($_GET['sussess'])) { - if (!$method->OnSuccess()) { - exit('error'); - } + $order = Yii::app()->session['id_user'] . '_' . date('his'); - $data = $method->GetData(); + $method = new $typePayment($modelMethodPay->username, $modelMethodPay->pagseguro_TOKEN); - if ($data->status == "OK") { - echo '

Thank You! You have successfully completed the payment!

'; - } + if ( ! $method->OnSuccess()) { + exit('error'); + } - exit('error'); -} + $data = $method->GetData(); + + if ($data->status == "OK") { + echo '

Thank You! You have successfully completed the payment!

'; + } + + exit('error'); + } ?> - +
@@ -59,17 +59,17 @@
- 'ABN AMRO Bank', - 'ASNBANK' => 'ASN Bank', - 'FRIESLAND' => 'Friesland Bank', - 'RABOBANK' => 'Rabobank', - 'ING' => 'ING Bank', - 'SNSBANK' => 'SNS Bank', - 'SNSREGIOBANK' => 'SNS Regio Bank', - 'TRIODOSBANK' => 'Triodos Bank', - 'VANLANSCHOT' => 'Van Lanschot Bankiers', -)); ?> + 'ABN AMRO Bank', + 'ASNBANK' => 'ASN Bank', + 'FRIESLAND' => 'Friesland Bank', + 'RABOBANK' => 'Rabobank', + 'ING' => 'ING Bank', + 'SNSBANK' => 'SNS Bank', + 'SNSREGIOBANK' => 'SNS Regio Bank', + 'TRIODOSBANK' => 'Triodos Bank', + 'VANLANSCHOT' => 'Van Lanschot Bankiers', + ]); ?>
@@ -82,24 +82,24 @@ username, $modelMethodPay->pagseguro_TOKEN); + $method = new $typePayment($modelMethodPay->username, $modelMethodPay->pagseguro_TOKEN); -if (isset($_GET['amount'])) { + if (isset($_GET['amount'])) { - if ($typePayment == 'ICEPAY_iDEAL') { + if ($typePayment == 'ICEPAY_iDEAL') { - $sql = "INSERT INTO pkg_refill_icepay (id_user, credit) VALUES (:id_user, :amount)"; - $command = Yii::app()->db->createCommand($sql); - $command->bindValue(":id_user", $_SESSION["id_user"], PDO::PARAM_STR); - $command->bindValue(":amount", $_GET['amount'], PDO::PARAM_STR); - $command->execute(); + $sql = "INSERT INTO pkg_refill_icepay (id_user, credit) VALUES (:id_user, :amount)"; + $command = Yii::app()->db->createCommand($sql); + $command->bindValue(":id_user", $_SESSION["id_user"], PDO::PARAM_STR); + $command->bindValue(":amount", $_GET['amount'], PDO::PARAM_STR); + $command->execute(); - $OrderID = Yii::app()->db->lastInsertID; + $OrderID = Yii::app()->db->lastInsertID; - $method->SetOrderID($OrderID); - $url = $method->Pay($_POST['bank'], $_GET['amount'] . '00', "Credit payment " . $_SESSION["username"]); + $method->SetOrderID($OrderID); + $url = $method->Pay($_POST['bank'], $_GET['amount'] . '00', "Credit payment " . $_SESSION["username"]); + } + header("location: " . $url); } - header("location: " . $url); -} ?> diff --git a/protected/views/buyCredit/mercadopago.php b/protected/views/buyCredit/mercadopago.php index c26025885..d80f517c8 100755 --- a/protected/views/buyCredit/mercadopago.php +++ b/protected/views/buyCredit/mercadopago.php @@ -1,55 +1,55 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ ?>
session['currency'] == 'U$S') { - $currency = 'USD'; -} else if (Yii::app()->session['currency'] == 'R$') { - $currency = 'BRL'; -} elseif (Yii::app()->session['currency'] == '€') { - $currency = 'EUR'; -} else { - $currency = 'USD'; -} + if (Yii::app()->session['currency'] == 'U$S') { + $currency = 'USD'; + } else if (Yii::app()->session['currency'] == 'R$') { + $currency = 'BRL'; + } elseif (Yii::app()->session['currency'] == '€') { + $currency = 'EUR'; + } else { + $currency = 'USD'; + } ?> username, $modelMethodPay->pagseguro_TOKEN); + $mp = new MP($modelMethodPay->username, $modelMethodPay->pagseguro_TOKEN); -$preference_data = array( - "items" => array( - array( - "title" => $reference, - "quantity" => 1, - "currency_id" => $currency, - "unit_price" => floatval($_GET['amount']), - ), - ), -); + $preference_data = [ + "items" => [ + [ + "title" => $reference, + "quantity" => 1, + "currency_id" => $currency, + "unit_price" => floatval($_GET['amount']), + ], + ], + ]; -$preference = $mp->create_preference($preference_data); + $preference = $mp->create_preference($preference_data); ?> diff --git a/protected/views/buyCredit/molpay.php b/protected/views/buyCredit/molpay.php index 5fd8f4e47..4622a890b 100755 --- a/protected/views/buyCredit/molpay.php +++ b/protected/views/buyCredit/molpay.php @@ -1,22 +1,22 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ ?>
username; // "teztelcom"; -$orderid = $reference; -$verifykey = $modelMethodPay->pagseguro_TOKEN; -$vcode = md5($amount . $merchantID . $orderid . $verifykey); + $merchantID = $modelMethodPay->username; // "teztelcom"; + $orderid = $reference; + $verifykey = $modelMethodPay->pagseguro_TOKEN; + $vcode = md5($amount . $merchantID . $orderid . $verifykey); ?> @@ -42,7 +42,7 @@ - + diff --git a/protected/views/buyCredit/pagseguro.php b/protected/views/buyCredit/pagseguro.php index d887d9989..162e322f0 100755 --- a/protected/views/buyCredit/pagseguro.php +++ b/protected/views/buyCredit/pagseguro.php @@ -6,7 +6,7 @@ * * @package MagnusBilling * @author Adilson Leffa Magnus. - * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. * ################################### * * This software is released under the terms of the GNU Lesser General Public License v2.1 diff --git a/protected/views/buyCredit/paypal.php b/protected/views/buyCredit/paypal.php index 9d6b05dad..1e2d4fc78 100755 --- a/protected/views/buyCredit/paypal.php +++ b/protected/views/buyCredit/paypal.php @@ -1,22 +1,22 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ ?>
@@ -27,25 +27,25 @@ }; session['currency'] == 'U$S' || Yii::app()->session['currency'] == 'U$' || Yii::app()->session['currency'] == '$') { - $currency = 'USD'; -} else if (Yii::app()->session['currency'] == 'R$') { - $currency = 'BRL'; -} elseif (Yii::app()->session['currency'] == '€') { - $currency = 'EUR'; -} elseif (Yii::app()->session['currency'] == 'AUD$') { - $currency = 'AUD'; -} else { - $currency = Yii::app()->session['currency']; -} + if (Yii::app()->session['currency'] == 'U$S' || Yii::app()->session['currency'] == 'U$' || Yii::app()->session['currency'] == '$') { + $currency = 'USD'; + } else if (Yii::app()->session['currency'] == 'R$') { + $currency = 'BRL'; + } elseif (Yii::app()->session['currency'] == '€') { + $currency = 'EUR'; + } elseif (Yii::app()->session['currency'] == 'AUD$') { + $currency = 'AUD'; + } else { + $currency = Yii::app()->session['currency']; + } -$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'; + $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'; ?> - + diff --git a/protected/views/buyCredit/payulatam.php b/protected/views/buyCredit/payulatam.php index 525dc8e7c..52e33bcb7 100755 --- a/protected/views/buyCredit/payulatam.php +++ b/protected/views/buyCredit/payulatam.php @@ -1,22 +1,22 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ ?>
@@ -29,25 +29,25 @@ session['currency'] == 'U$S') { - $currency = 'USD'; -} else if (Yii::app()->session['currency'] == 'R$') { - $currency = 'BRL'; -} elseif (Yii::app()->session['currency'] == '€') { - $currency = 'EUR'; -} else { - $currency = Yii::app()->session['currency']; -} + if (Yii::app()->session['currency'] == 'U$S') { + $currency = 'USD'; + } else if (Yii::app()->session['currency'] == 'R$') { + $currency = 'BRL'; + } elseif (Yii::app()->session['currency'] == '€') { + $currency = 'EUR'; + } else { + $currency = Yii::app()->session['currency']; + } -if (Yii::app()->session['language'] == 'pt_BR') { - $language = 'pt'; -} + if (Yii::app()->session['language'] == 'pt_BR') { + $language = 'pt'; + } -if (Yii::app()->session['language'] == 'es') { - $language = 'es'; -} else { - $language = 'en'; -} + if (Yii::app()->session['language'] == 'es') { + $language = 'es'; + } else { + $language = 'en'; + } ?> diff --git a/protected/views/buyCredit/sagepay.php b/protected/views/buyCredit/sagepay.php index 04dfd530a..665dec299 100755 --- a/protected/views/buyCredit/sagepay.php +++ b/protected/views/buyCredit/sagepay.php @@ -1,22 +1,22 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ ?>
@@ -27,8 +27,8 @@ }; @@ -40,7 +40,7 @@ -lastname ?>'/> +lastname ?>'/> diff --git a/protected/views/buyCredit/stripe.php b/protected/views/buyCredit/stripe.php index 4d766a6e8..eca5e940f 100755 --- a/protected/views/buyCredit/stripe.php +++ b/protected/views/buyCredit/stripe.php @@ -1,51 +1,51 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ ?> client_id); - $error = ''; - $success = ''; + \Stripe\Stripe::setApiKey($modelMethodPay->client_id); + $error = ''; + $success = ''; - $amount = preg_replace("/\.|\,/", '', $_GET['amount']); + $amount = preg_replace("/\.|\,/", '', $_GET['amount']); - try { - if (!isset($_POST['stripeToken'])) { - throw new Exception("The Stripe Token was not generated correctly"); - } + try { + if ( ! isset($_POST['stripeToken'])) { + throw new Exception("The Stripe Token was not generated correctly"); + } - \Stripe\Charge::create(array("amount" => floatval($amount), - "currency" => "usd", - "card" => $_POST['stripeToken'])); - $success = 'Your payment was successful.'; - } catch (Exception $e) { - $error = $e->getMessage(); + \Stripe\Charge::create(["amount" => floatval($amount), + "currency" => "usd", + "card" => $_POST['stripeToken']]); + $success = 'Your payment was successful.'; + } catch (Exception $e) { + $error = $e->getMessage(); + } } -} ?> @@ -99,7 +99,7 @@ function stripeResponseHandler(status, response) {
-

Payment Information : Amount

+

Payment Information : Amount

diff --git a/protected/views/call0800Web/index.php b/protected/views/call0800Web/index.php index b2ccec64c..9dc6e030d 100755 --- a/protected/views/call0800Web/index.php +++ b/protected/views/call0800Web/index.php @@ -1,22 +1,22 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ ?> @@ -34,7 +34,7 @@
' . Yii::t('zii', '1+360+NUMBER') . ' ' ?>
- +
diff --git a/protected/views/signup/view.php b/protected/views/signup/view.php index 33aebd6fb..f76072848 100755 --- a/protected/views/signup/view.php +++ b/protected/views/signup/view.php @@ -1,22 +1,22 @@ - * - */ + /** + * ======================================= + * ################################### + * MagnusBilling + * + * @package MagnusBilling + * @author Adilson Leffa Magnus. + * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved. + * ################################### + * + * This software is released under the terms of the GNU Lesser General Public License v2.1 + * A copy of which is available from http://www.gnu.org/copyleft/lesser.html + * + * Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues + * ======================================= + * Magnusbilling.com + * + */ ?>
@@ -24,18 +24,18 @@

db->createCommand($sql); - $command->bindValue(":id_user", $_GET['id_user'], PDO::PARAM_STR); - $smtpResult = $command->queryAll(); -} + if (isset($_GET['id_user'])) { + $sql = "SELECT id FROM pkg_smtp WHERE id_user = :id_user"; + $command = Yii::app()->db->createCommand($sql); + $command->bindValue(":id_user", $_GET['id_user'], PDO::PARAM_STR); + $smtpResult = $command->queryAll(); + } -if (!isset($_GET['loginkey']) && (isset($smtpResult) && count($smtpResult) > 0)): - echo '' . Yii::t('zii', 'Please check your email') . ''; - echo '
'; -else: -?> + if ( ! isset($_GET['loginkey']) && (isset($smtpResult) && count($smtpResult) > 0)): + echo '' . Yii::t('zii', 'Please check your email') . ''; + echo ''; + else: + ?>