From 264b7b43f6e014de9a05eabbba341b0a8086958c Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 23 Jul 2024 14:48:15 +0700 Subject: [PATCH] add Bills info to comment --- system/devices/MikrotikHotspot.php | 16 ++++++++-------- system/devices/MikrotikPppoe.php | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/system/devices/MikrotikHotspot.php b/system/devices/MikrotikHotspot.php index e1ade421..726d6b00 100644 --- a/system/devices/MikrotikHotspot.php +++ b/system/devices/MikrotikHotspot.php @@ -88,8 +88,8 @@ class MikrotikHotspot $unitup = 'M'; } $rate = $bw['rate_up'] . $unitup . "/" . $bw['rate_down'] . $unitdown; - if(!empty(trim($bw['burst']))){ - $rate .= ' '.$bw['burst']; + if (!empty(trim($bw['burst']))) { + $rate .= ' ' . $bw['burst']; } $addRequest = new RouterOS\Request('/ip/hotspot/user/profile/add'); $client->sendSync( @@ -167,8 +167,8 @@ class MikrotikHotspot $unitup = 'M'; } $rate = $bw['rate_up'] . $unitup . "/" . $bw['rate_down'] . $unitdown; - if(!empty(trim($bw['burst']))){ - $rate .= ' '.$bw['burst']; + if (!empty(trim($bw['burst']))) { + $rate .= ' ' . $bw['burst']; } $setRequest = new RouterOS\Request('/ip/hotspot/user/profile/set'); $client->sendSync( @@ -250,7 +250,7 @@ class MikrotikHotspot ->setArgument('name', $customer['username']) ->setArgument('profile', $plan['name_plan']) ->setArgument('password', $customer['password']) - ->setArgument('comment', $customer['fullname']) + ->setArgument('comment', $customer['fullname'] . ' | ' . implode(', ', User::getBillNames($customer['id']))) ->setArgument('email', $customer['email']) ->setArgument('limit-uptime', $timelimit) ); @@ -264,7 +264,7 @@ class MikrotikHotspot ->setArgument('name', $customer['username']) ->setArgument('profile', $plan['name_plan']) ->setArgument('password', $customer['password']) - ->setArgument('comment', $customer['fullname']) + ->setArgument('comment', $customer['fullname'] . ' | ' . implode(', ', User::getBillNames($customer['id']))) ->setArgument('email', $customer['email']) ->setArgument('limit-bytes-total', $datalimit) ); @@ -282,7 +282,7 @@ class MikrotikHotspot ->setArgument('name', $customer['username']) ->setArgument('profile', $plan['name_plan']) ->setArgument('password', $customer['password']) - ->setArgument('comment', $customer['fullname']) + ->setArgument('comment', $customer['fullname'] . ' | ' . implode(', ', User::getBillNames($customer['id']))) ->setArgument('email', $customer['email']) ->setArgument('limit-uptime', $timelimit) ->setArgument('limit-bytes-total', $datalimit) @@ -293,7 +293,7 @@ class MikrotikHotspot $addRequest ->setArgument('name', $customer['username']) ->setArgument('profile', $plan['name_plan']) - ->setArgument('comment', $customer['fullname']) + ->setArgument('comment', $customer['fullname'] . ' | ' . implode(', ', User::getBillNames($customer['id']))) ->setArgument('email', $customer['email']) ->setArgument('password', $customer['password']) ); diff --git a/system/devices/MikrotikPppoe.php b/system/devices/MikrotikPppoe.php index ad7adc47..70c55152 100644 --- a/system/devices/MikrotikPppoe.php +++ b/system/devices/MikrotikPppoe.php @@ -47,7 +47,7 @@ class MikrotikPppoe $setRequest = new RouterOS\Request('/ppp/secret/set'); $setRequest->setArgument('numbers', $cid); $setRequest->setArgument('profile', $plan['name_plan']); - $setRequest->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email']); + $setRequest->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email'] . ' | ' . implode(', ', User::getBillNames($customer['id']))); $setRequest->setArgument('password', $pass); $client->sendSync($setRequest); //disconnect then @@ -294,7 +294,7 @@ class MikrotikPppoe ->setArgument('name', $customer['username']) ->setArgument('service', 'pppoe') ->setArgument('profile', $plan['name_plan']) - ->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email']) + ->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email'] . ' | ' . implode(', ', User::getBillNames($customer['id']))) ->setArgument('password', $pass) ); }