Payment Gateway Tripay done

This commit is contained in:
Ibnu Maksum 2022-09-10 16:01:51 +07:00
parent 5ce70b972b
commit 4a6ea093c1
No known key found for this signature in database
GPG key ID: 7FC82848810579E5
22 changed files with 1069 additions and 923 deletions

43
system/autoload/Http.php Normal file
View file

@ -0,0 +1,43 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
class Http
{
public static function getData($url, $headers)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close($ch);
return $server_output;
}
public static function postJsonData($url, $array_post, $headers = [], $basic = null)
{
$headers[] = 'Content-Type: application/json';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_VERBOSE, false);
curl_setopt($ch, CURLINFO_HEADER_OUT, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($array_post));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if (!empty($basic)) {
curl_setopt($ch, CURLOPT_USERPWD, $basic);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close($ch);
return $server_output;
}
}

View file

@ -0,0 +1,123 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
*
* Payment Gateway Tripay
**/
class PGTripay
{
protected $user;
protected $trx;
public function __construct($trx, $user)
{
$this->user = $user;
$this->trx = $trx;
}
function getSignature()
{
global $_c;
return hash_hmac('sha256', $_c['tripay_merchant'] . $this->trx['id'] . $this->trx['price'], $_c['tripay_secret_key']);
}
function createTransaction($channel) //$trxID, $channel, $amount, $user, $description)
{
global $_c;
$json = [
'method' => $channel,
'amount' => $this->trx['price'],
'merchant_ref' => $this->trx['id'],
'customer_name' => $this->user['fullname'],
'customer_email' => (empty($this->user['email'])) ? $this->user['username'] . '@' . $_SERVER['HTTP_HOST'] : $this->user['email'],
'customer_phone' => $this->user['phonenumber'],
'order_items' => [
[
'name' => $this->trx['plan_name'],
'price' => $this->trx['price'],
'quantity' => 1
]
],
'return_url' => U . 'order/view/' . $this->trx['id'] . '/check',
'signature' => $this->getSignature()
];
return json_decode(Http::postJsonData($this->getServer() . 'transaction/create', $json, ['Authorization: Bearer ' . $_c['tripay_api_key']]), true);
/*
{
"success": true,
"message": "",
"data": {
"reference": "T0001000000000000006",
"merchant_ref": "INV345675",
"payment_selection_type": "static",
"payment_method": "BRIVA",
"payment_name": "BRI Virtual Account",
"customer_name": "Nama Pelanggan",
"customer_email": "emailpelanggan@domain.com",
"customer_phone": "081234567890",
"callback_url": "https://domainanda.com/callback",
"return_url": "https://domainanda.com/redirect",
"amount": 1000000,
"fee_merchant": 1500,
"fee_customer": 0,
"total_fee": 1500,
"amount_received": 998500,
"pay_code": "57585748548596587",
"pay_url": null,
"checkout_url": "https://tripay.co.id/checkout/T0001000000000000006",
"status": "UNPAID",
"expired_time": 1582855837,
}
}
*/
}
function getStatus($trxID)
{
global $_c;
return json_decode(Http::getData($this->getServer() . 'transaction/detail?'.http_build_query(['reference'=>$trxID]), [
'Authorization: Bearer ' . $_c['tripay_api_key']
]), true);
/*
{
"success": true,
"message": "",
"data": {
"reference": "T0001000000000000006",
"merchant_ref": "INV345675",
"payment_selection_type": "static",
"payment_method": "BRIVA",
"payment_name": "BRI Virtual Account",
"customer_name": "Nama Pelanggan",
"customer_email": "emailpelanggan@domain.com",
"customer_phone": "081234567890",
"callback_url": "https://domainanda.com/callback",
"return_url": "https://domainanda.com/redirect",
"amount": 1000000,
"fee_merchant": 1500,
"fee_customer": 0,
"total_fee": 1500,
"amount_received": 998500,
"pay_code": "57585748548596587",
"pay_url": null,
"checkout_url": "https://tripay.co.id/checkout/T0001000000000000006",
"status": "PAID",
"expired_time": 1582855837,
}
}
*/
}
private function getServer()
{
global $_app_stage;
if ($_app_stage == 'Live') {
return 'https://tripay.co.id/api/';
} else {
return 'https://tripay.co.id/api-sandbox/';
}
}
}

View file

@ -0,0 +1,93 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
*
* Payment Gateway Xendit
**/
class PGTripay {
protected $user;
protected $trx;
protected $channel;
public function __construct($trx,$user) {
$this->user = $user;
$this->trx = $trx;
return $this;
}
function createInvoice()
{
global $_c;
$json = [
'external_id' => $this->trx['id'],
'amount' => $this->trx['price'],
'description' => $this->trx['plan_name'],
'customer' => [
'mobile_number' => $this->user['phonenumber'],
],
'customer_notification_preference' => [
'invoice_created' => ['whatsapp', 'sms'],
'invoice_reminder' => ['whatsapp', 'sms'],
'invoice_paid' => ['whatsapp', 'sms'],
'invoice_expired' => ['whatsapp', 'sms']
],
'payment_methods ' => explode(',', $_c['xendit_channel']),
'success_redirect_url' => U . 'order/view/' . $this->trx['id'] . '/check',
'failure_redirect_url' => U . 'order/view/' . $this->trx['id'] . '/check'
];
return json_decode(Http::postJsonData($this->getServer() . 'invoices', $json, ['Authorization: Basic ' . base64_encode($_c['xendit_secret_key'] . ':')]), true);
/*
{
"id": "631597513897510bace2459d", #gateway_trx_id
"external_id": "test-va-success-1662359375",
"user_id": "599bd7f1ccab55b020bb1147",
"status": "PENDING",
"merchant_name": "Xendit",
"merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1538466380522_868.png",
"amount": 3000000,
"description": "Test - VA Successful invoice payment",
"expiry_date": "2022-09-06T06:29:37.251Z",
"invoice_url": "https://checkout-staging.xendit.co/web/631597513897510bace2459d"
"created": "2022-09-05T06:29:37.954Z",
"updated": "2022-09-05T06:29:37.954Z"
}
*/
}
function getInvoice($xendittrxID)
{
global $_c;
return json_decode(Http::getData($this->getServer() . 'invoices/' . $xendittrxID, [
'Authorization: Basic ' . base64_encode($_c['xendit_secret_key'] . ':')
]), true);
/*
{
"id": "631597513897510bace2459d", #gateway_trx_id
"external_id": "test-va-success-1662359375",
"user_id": "599bd7f1ccab55b020bb1147",
"status": "PENDING", // CHECK THIS
"merchant_name": "Xendit",
"merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1538466380522_868.png",
"amount": 3000000,
"description": "Test - VA Successful invoice payment",
"expiry_date": "2022-09-06T06:29:37.251Z",
"invoice_url": "https://checkout-staging.xendit.co/web/631597513897510bace2459d"
"created": "2022-09-05T06:29:37.954Z",
"updated": "2022-09-05T06:29:37.954Z"
}
*/
}
private function getServer(){
global $_app_stage;
if ($_app_stage == 'Live') {
return 'https://api.xendit.co/v2/';
} else {
return 'https://api.xendit.co/v2/';
}
}
}

378
system/autoload/Package.php Normal file
View file

@ -0,0 +1,378 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
use PEAR2\Net\RouterOS;
class Package
{
public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel)
{
global $_c, $_L;
$date_now = date("Y-m-d H:i:s");
$date_only = date("Y-m-d");
$time = date("H:i:s");
if ($id_customer == '' or $router_name == '' or $plan_id == '') {
return false;
}
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one();
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
$mikrotik = Router::_info($router_name);
if ($p['validity_unit'] == 'Months') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month'));
} else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' day'));
} else if ($p['validity_unit'] == 'Hrs') {
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime('+' . $p['validity'] . ' hour')));
$date_exp = $datetime[0];
$time = $datetime[1];
} else if ($p['validity_unit'] == 'Mins') {
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime('+' . $p['validity'] . ' minute')));
$date_exp = $datetime[0];
$time = $datetime[1];
}
if ($p['type'] == 'Hotspot') {
if ($b) {
if (!$_c['radius_mode']) {
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>" . $e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ip hotspot user print .proplist=name',
RouterOS\Query::where('name', $c['username'])
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/hotspot/user/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if ($p['typebp'] == "Limited") {
if ($p['limit_type'] == "Time_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
} else if ($p['limit_type'] == "Data_Limit") {
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
} else if ($p['limit_type'] == "Both_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
} else {
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
}
$b->customer_id = $id_customer;
$b->username = $c['username'];
$b->plan_id = $plan_id;
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "$gateway - $channel";
$b->routers = $router_name;
$b->type = "Hotspot";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
$t->routers = $router_name;
$t->type = "Hotspot";
$t->save();
} else {
if (!$_c['radius_mode']) {
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>" . $e->getMessage());
}
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if ($p['typebp'] == "Limited") {
if ($p['limit_type'] == "Time_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
} else if ($p['limit_type'] == "Data_Limit") {
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
} else if ($p['limit_type'] == "Both_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
} else {
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $id_customer;
$d->username = $c['username'];
$d->plan_id = $plan_id;
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "$gateway - $channel";
$d->routers = $router_name;
$d->type = "Hotspot";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
$t->routers = $router_name;
$t->type = "Hotspot";
$t->save();
}
sendTelegram("#u$c[username] #buy #Hotspot \n" . $p['name_plan'] .
"\nRouter: " . $router_name .
"\nGateway: " . $gateway .
"\nChannel: " . $channel .
"\nPrice: " . $p['price']);
} else {
if ($b) {
if (!$_c['radius_mode']) {
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>" . $e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ppp secret print .proplist=name',
RouterOS\Query::where('name', $c['username'])
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ppp/secret/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$b->customer_id = $id_customer;
$b->username = $c['username'];
$b->plan_id = $plan_id;
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "$gateway - $channel";
$b->routers = $router_name;
$b->type = "PPPOE";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
$t->routers = $router_name;
$t->type = "PPPOE";
$t->save();
} else {
if (!$_c['radius_mode']) {
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>" . $e->getMessage());
}
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $id_customer;
$d->username = $c['username'];
$d->plan_id = $plan_id;
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "$gateway - $channel";
$d->routers = $router_name;
$d->type = "PPPOE";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
$t->routers = $router_name;
$t->type = "PPPOE";
$t->save();
}
sendTelegram("#u$c[username] #buy #PPPOE \n" . $p['name_plan'] .
"\nRouter: " . $router_name .
"\nGateway: " . $gateway .
"\nChannel: " . $channel .
"\nPrice: " . $p['price']);
}
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
sendWhatsapp($c['username'], "*$_c[CompanyName]*\n" .
"$_c[address]\n" .
"$_c[phone]\n" .
"\n\n" .
"INVOICE: *$in[invoice]*\n" .
"$_L[Date] : $date_now\n" .
"$gateway $channel\n" .
"\n\n" .
"$_L[Type] : *$in[type]*\n" .
"$_L[Plan_Name] : *$in[plan_name]*\n" .
"$_L[Plan_Price] : *$_c[currency_code] " . number_format($in['price'], 2, $_c['dec_point'], $_c['thousands_sep']) . "*\n\n" .
"$_L[Username] : *$in[username]*\n" .
"$_L[Password] : **********\n\n" .
"$_L[Created_On] :\n*" . date($_c['date_format'], strtotime($in['recharged_on'])) . " $in[time]*\n" .
"$_L[Expires_On] :\n*" . date($_c['date_format'], strtotime($in['expiration'])) . " $in[time]*\n" .
"\n\n" .
"$_c[note]");
return true;
}
}

View file

@ -1,189 +0,0 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
// Payment Gateway Server
if ($_app_stage == 'Live') {
$xendit_server = 'https://api.xendit.co/v2/';
$midtrans_server = 'https://api.midtrans.com/';
$tripay_server = 'https://tripay.co.id/api/';
} else {
$xendit_server = 'https://api.xendit.co/v2/';
$midtrans_server = 'https://api.sandbox.midtrans.com/';
$tripay_server = 'https://tripay.co.id/api-sandbox/';
}
function xendit_create_invoice($trxID, $amount, $phone, $description)
{
global $xendit_server, $_c;
$json = [
'external_id' => $trxID,
'amount' => $amount,
'description' => $description,
'customer' => [
'mobile_number' => $phone,
],
'customer_notification_preference' => [
'invoice_created' => ['whatsapp', 'sms'],
'invoice_reminder' => ['whatsapp', 'sms'],
'invoice_paid' => ['whatsapp', 'sms'],
'invoice_expired' => ['whatsapp', 'sms']
],
'payment_methods ' => explode(',', $_c['xendit_channel']),
'success_redirect_url' => U . 'order/view/' . $trxID . '/check',
'failure_redirect_url' => U . 'order/view/' . $trxID . '/check'
];
return json_decode(postJsonData($xendit_server . 'invoices', $json, ['Authorization: Basic ' . base64_encode($_c['xendit_secret_key'] . ':')]), true);
/*
{
"id": "631597513897510bace2459d", #gateway_trx_id
"external_id": "test-va-success-1662359375",
"user_id": "599bd7f1ccab55b020bb1147",
"status": "PENDING",
"merchant_name": "Xendit",
"merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1538466380522_868.png",
"amount": 3000000,
"description": "Test - VA Successful invoice payment",
"expiry_date": "2022-09-06T06:29:37.251Z",
"invoice_url": "https://checkout-staging.xendit.co/web/631597513897510bace2459d"
"created": "2022-09-05T06:29:37.954Z",
"updated": "2022-09-05T06:29:37.954Z"
}
*/
}
function xendit_get_invoice($xendittrxID)
{
global $xendit_server, $_c;
return json_decode(getData($xendit_server . 'invoices/' . $xendittrxID, [
'Authorization: Basic ' . base64_encode($_c['xendit_secret_key'] . ':')
]), true);
/*
{
"id": "631597513897510bace2459d", #gateway_trx_id
"external_id": "test-va-success-1662359375",
"user_id": "599bd7f1ccab55b020bb1147",
"status": "PENDING", // CHECK THIS
"merchant_name": "Xendit",
"merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1538466380522_868.png",
"amount": 3000000,
"description": "Test - VA Successful invoice payment",
"expiry_date": "2022-09-06T06:29:37.251Z",
"invoice_url": "https://checkout-staging.xendit.co/web/631597513897510bace2459d"
"created": "2022-09-05T06:29:37.954Z",
"updated": "2022-09-05T06:29:37.954Z"
}
*/
}
/** MIDTRANS */
function midtrans_create_payment($trxID, $invoiceID, $amount, $description)
{
global $midtrans_server, $_c;
$json = [
'transaction_details' => [
'order_id' => $trxID,
'gross_amount' => intval($amount),
"payment_link_id" => $invoiceID
],
"item_details" => [
[
"name" => $description,
"price" => intval($amount),
"quantity" => 1
]
],
'enabled_payments' => explode(',', $_c['midtrans_channel']),
"usage_limit" => 4,
"expiry" => [
"duration" => 24,
"unit" => "hours"
]
];
$data = postJsonData($midtrans_server . 'v1/payment-links', $json, ['Authorization: Basic ' . base64_encode($_c['midtrans_server_key'] . ':')]);
$json = json_decode($data, true);
if (!empty($json['error_messages'])) {
sendTelegram(json_encode("Midtrans create Payment error:\n" . alphanumeric($_c['CompanyName']) . "_" . crc32($_c['CompanyName']) . "_" . $trxID . "\n" . $json['error_messages']));
}
return $json;
/*
{
"order_id": "concert-ticket-05", //traxid
"payment_url": "https://app.sandbox.midtrans.com/payment-links/amazing-ticket-payment-123"
}
*/
}
function midtrans_check_payment($midtranstrxID)
{
global $midtrans_server, $_c;
echo $midtrans_server . 'v2/' . $midtranstrxID . '/status';
return json_decode(getData($midtrans_server . 'v2/' . $midtranstrxID . '/status', [
'Authorization: Basic ' . base64_encode($_c['midtrans_server_key'] . ':')
]), true);
/*
{
"masked_card": "41111111-1111",
"approval_code": "1599493766402",
"bank": "bni",
"channel_response_code": "00",
"channel_response_message": "Approved",
"transaction_time": "2020-09-07 22:49:26",
"gross_amount": "10000.00",
"currency": "IDR",
"order_id": "SANDBOX-G710367688-806",
"payment_type": "credit_card",
"signature_key": "4d4abc70f5a88b09f48f3ab5cb91245feb0b3d89181117a677767b42f8cbe477f5a0d38af078487071311f97da646c1eb9542c1bbf0b19fa9f12e64605ac405e",
"status_code": "200",
"transaction_id": "3853c491-ca9b-4bcc-ac20-3512ff72a5d0",
"transaction_status": "cancel",
"fraud_status": "challenge",
"status_message": "Success, transaction is found",
"merchant_id": "G710367688",
"card_type": "credit"
}
*/
}
function getData($url, $headers)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close($ch);
return $server_output;
}
function postJsonData($url, $array_post, $headers = [], $basic = null)
{
$headers[] = 'Content-Type: application/json';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_VERBOSE, false);
curl_setopt($ch, CURLINFO_HEADER_OUT, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($array_post));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if (!empty($basic)) {
curl_setopt($ch, CURLOPT_USERPWD, $basic);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close($ch);
return $server_output;
}

View file

@ -1,374 +0,0 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
use PEAR2\Net\RouterOS;
function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel){
global $_c,$_L;
$date_now = date("Y-m-d H:i:s");
$date_only = date("Y-m-d");
$time = date("H:i:s");
if ($id_customer == '' or $router_name == '' or $plan_id == '') {
return false;
}
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one();
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
$mikrotik = Router::_info($router_name);
if($p['validity_unit']=='Months'){
$date_exp = date("Y-m-d", strtotime('+'.$p['validity'].' month'));
}else if($p['validity_unit']=='Days'){
$date_exp = date("Y-m-d", strtotime('+'.$p['validity'].' day'));
}else if($p['validity_unit']=='Hrs'){
$datetime = explode(' ',date("Y-m-d H:i:s", strtotime('+'.$p['validity'].' hour')));
$date_exp = $datetime[0];
$time = $datetime[1];
}else if($p['validity_unit']=='Mins'){
$datetime = explode(' ',date("Y-m-d H:i:s", strtotime('+'.$p['validity'].' minute')));
$date_exp = $datetime[0];
$time = $datetime[1];
}
if ($p['type'] == 'Hotspot') {
if ($b) {
if(!$_c['radius_mode']){
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ip hotspot user print .proplist=name',
RouterOS\Query::where('name', $c['username'])
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/hotspot/user/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if ($p['typebp'] == "Limited") {
if ($p['limit_type'] == "Time_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
} else if ($p['limit_type'] == "Data_Limit") {
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
} else if ($p['limit_type'] == "Both_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
} else {
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
}
$b->customer_id = $id_customer;
$b->username = $c['username'];
$b->plan_id = $plan_id;
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "admin";
$b->routers = $router_name;
$b->type = "Hotspot";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "admin";
$t->routers = $router_name;
$t->type = "Hotspot";
$t->save();
} else {
if(!$_c['radius_mode']){
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>".$e->getMessage());
}
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if ($p['typebp'] == "Limited") {
if ($p['limit_type'] == "Time_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
} else if ($p['limit_type'] == "Data_Limit") {
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
} else if ($p['limit_type'] == "Both_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
} else {
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $id_customer;
$d->username = $c['username'];
$d->plan_id = $plan_id;
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "admin";
$d->routers = $router_name;
$d->type = "Hotspot";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "admin";
$t->routers = $router_name;
$t->type = "Hotspot";
$t->save();
}
sendTelegram( "#$c[username] #buy #Hotspot \n".$p['name_plan'].
"\nRouter: ".$router_name.
"\nGateway: ".$gateway.
"\nChannel: ".$channel.
"\nPrice: ".$p['price']);
} else {
if ($b) {
if(!$_c['radius_mode']){
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ppp secret print .proplist=name',
RouterOS\Query::where('name', $c['username'])
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ppp/secret/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$b->customer_id = $id_customer;
$b->username = $c['username'];
$b->plan_id = $plan_id;
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "admin";
$b->routers = $router_name;
$b->type = "PPPOE";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "admin";
$t->routers = $router_name;
$t->type = "PPPOE";
$t->save();
} else {
if(!$_c['radius_mode']){
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>".$e->getMessage());
}
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $id_customer;
$d->username = $c['username'];
$d->plan_id = $plan_id;
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "admin";
$d->routers = $router_name;
$d->type = "PPPOE";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "admin";
$t->routers = $router_name;
$t->type = "PPPOE";
$t->save();
}
sendTelegram( "#$c[username] #buy #PPPOE \n".$p['name_plan'].
"\nRouter: ".$router_name.
"\nGateway: ".$gateway.
"\nChannel: ".$channel.
"\nPrice: ".$p['price']);
}
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
sendWhatsapp($c['username'], "*$_c[CompanyName]*\n".
"$_c[address]\n".
"$_c[phone]\n".
"\n\n".
"INVOICE: *$in[invoice]*\n".
"$_L[Date] : $date_now\n".
"$gateway $channel\n".
"\n\n".
"$_L[Type] : *$in[type]*\n".
"$_L[Plan_Name] : *$in[plan_name]*\n".
"$_L[Plan_Price] : *$_c[currency_code] ".number_format($in['price'],2,$_c['dec_point'],$_c['thousands_sep'])."*\n\n".
"$_L[Username] : *$in[username]*\n".
"$_L[Password] : **********\n\n".
"$_L[Created_On] :\n*".date($_c['date_format'], strtotime($in['recharged_on']))." $in[time]*\n".
"$_L[Expires_On] :\n*".date($_c['date_format'], strtotime($in['expiration']))." $in[time]*\n".
"\n\n".
"$_c[note]");
return true;
}

View file

@ -21,7 +21,7 @@ switch ($action) {
echo "done";
break;
case 'tripay':
echo "done";
echo '{"success": true}';
break;
default:
echo "not found";

View file

@ -9,10 +9,6 @@ $action = $routes['1'];
$user = User::_info();
$ui->assign('_user', $user);
require('system/autoload/Paymentgateway.php');
require('system/autoload/Recharge.php');
switch ($action) {
case 'voucher':
$ui->assign('_title', $_L['Order_Voucher'] . ' - ' . $config['CompanyName']);
@ -51,12 +47,12 @@ switch ($action) {
}
if ($routes['3'] == 'check') {
if ($trx['gateway'] == 'xendit') {
$result = xendit_get_invoice($trx['gateway_trx_id']);
$pg = new PGXendit($trx,$user);
$result = $pg->getInvoice($trx['gateway_trx_id']);
if ($result['status'] == 'PENDING') {
r2(U . "order/view/" . $trxid, 'w', Lang::T("Transaction still unpaid."));
} else if (in_array($result['status'],['PAID','SETTLED']) && $trx['status'] != 2) {
if (!rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], 'xendit', $result['payment_method'] . ' ' . $result['payment_channel'])) {
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $result['payment_method'] . ' ' . $result['payment_channel'])) {
r2(U . "order/view/" . $trxid, 'd', Lang::T("Failed to activate your Package, try again later."));
}
@ -76,13 +72,40 @@ switch ($action) {
}else if($trx['status'] == 2){
r2(U . "order/view/" . $trxid, 'd', Lang::T("Transaction has been paid.."));
}
print_r($result);
die();
r2(U . "order/view/" . $trxid, 'd', Lang::T("Unknown Command."));
} else if ($trx['gateway'] == 'midtrans') {
$result = midtrans_check_payment($trx['gateway_trx_id']);
print_r($result);
} else if ($trx['gateway'] == 'tripay') {
$pg = new PGTripay($trx,$user);
$result = $pg->getStatus($trx['gateway_trx_id']);
if ($result['success']!=1) {
print_r($result);
die();
sendTelegram("Tripay payment status failed\n\n".json_encode($result, JSON_PRETTY_PRINT));
r2(U . "order/view/" . $trxid, 'w', Lang::T("Payment check failed."));
}
$result = $result['data'];
if ($result['status'] == 'UNPAID') {
r2(U . "order/view/" . $trxid, 'w', Lang::T("Transaction still unpaid."));
} else if (in_array($result['status'],['PAID','SETTLED']) && $trx['status'] != 2) {
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $result['payment_method'] . ' ' . $result['payment_channel'])) {
r2(U . "order/view/" . $trxid, 'd', Lang::T("Failed to activate your Package, try again later."));
}
$trx->pg_paid_response = json_encode($result);
$trx->payment_method = $result['payment_method'];
$trx->payment_channel = $result['payment_name'];
$trx->paid_date = date('Y-m-d H:i:s', $result['paid_at']);
$trx->status = 2;
$trx->save();
r2(U . "order/view/" . $trxid, 's', Lang::T("Transaction has been paid."));
} else if (in_array($result['status'],['EXPIRED','FAILED','REFUND'])) {
$trx->pg_paid_response = json_encode($result);
$trx->status = 3;
$trx->save();
r2(U . "order/view/" . $trxid, 'd', Lang::T("Transaction expired."));
}else if($trx['status'] == 2){
r2(U . "order/view/" . $trxid, 'd', Lang::T("Transaction has been paid.."));
}
}
} else if ($routes['3'] == 'cancel') {
$trx->pg_paid_response = '{}';
@ -110,6 +133,9 @@ switch ($action) {
$ui->display('user-orderView.tpl');
break;
case 'buy':
if ($_c['payment_gateway'] == 'none') {
r2(U . 'home', 'e', Lang::T("No Payment Gateway Available"));
}
$back = "order/package";
$router = ORM::for_table('tbl_routers')->where('enabled', '1')->find_one($routes['2'] * 1);
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3'] * 1);
@ -152,7 +178,8 @@ switch ($action) {
r2(U . $back, 'e', Lang::T("Admin has not yet setup Xendit payment gateway, please tell admin"));
}
if ($id) {
$result = xendit_create_invoice($id, $plan['price'], $user['username'], $plan['name_plan']);
$pg = new PGXendit($d,$user);
$result = $pg->createInvoice($id, $plan['price'], $user['username'], $plan['name_plan']);
if (!$result['id']) {
r2(U . $back, 'e', Lang::T("Failed to create transaction."));
}
@ -170,37 +197,40 @@ switch ($action) {
} else {
r2(U . "order/view/" . $d['id'], 'w', Lang::T("Failed to create Transaction.."));
}
} else if ($_c['payment_gateway'] == 'midtrans') {
if (empty($_c['midtrans_server_key'])) {
sendTelegram("Midtrans payment gateway not configured");
r2(U . $back, 'e', Lang::T("Admin has not yet setup Midtrans payment gateway, please tell admin"));
} else if ($_c['payment_gateway'] == 'tripay') {
if (empty($_c['tripay_secret_key'])) {
sendTelegram("Tripay payment gateway not configured");
r2(U . $back, 'e', Lang::T("Admin has not yet setup Tripay payment gateway, please tell admin"));
}
if(!in_array($routes['4'],explode(",",$_c['tripay_channel']))){
$ui->assign('_title', 'Tripay Channel - ' . $config['CompanyName']);
$ui->assign('channels', json_decode(file_get_contents('system/paymentgateway/channel_tripay.json'), true));
$ui->assign('tripay_channels', explode(",",$_c['tripay_channel']));
$ui->assign('path', $routes['2'].'/'.$routes['3']);
$ui->display('tripay_channel.tpl');
break;
}
if ($id) {
$invoiceID = alphanumeric(strtolower($_c['CompanyName'])) . "-" . crc32($_c['CompanyName'] . $id) . "-" . $id;
$result = midtrans_create_payment($id, $invoiceID, $plan['price'],$plan['name_plan']);
if (!$result['payment_url']) {
sendTelegram("Midtrans payment failed\n\n".json_encode($result, JSON_PRETTY_PRINT));
$pg = new PGTripay($d,$user);
$result = $pg->createTransaction($routes['4']);
if ($result['success']!=1) {
sendTelegram("Tripay payment failed\n\n".json_encode($result, JSON_PRETTY_PRINT));
r2(U . $back, 'e', Lang::T("Failed to create transaction."));
}
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
$d->gateway_trx_id = $invoiceID;
$d->pg_url_payment = $result['payment_url'];
$d->gateway_trx_id = $result['data']['reference'];
$d->pg_url_payment = $result['data']['checkout_url'];
$d->pg_request = json_encode($result);
$d->expired_date = date('Y-m-d H:i:s', strtotime("+1 days"));
$d->expired_date = date('Y-m-d H:i:s', $result['data']['expired_time']);
$d->save();
r2(U . "order/view/" . $id, 'w', Lang::T("Create Transaction Success"));
exit();
} else {
r2(U . "order/view/" . $d['id'], 'w', Lang::T("Failed to create Transaction.."));
}
} else if ($_c['payment_gateway'] == 'tripay') {
if (empty($_c['tripay_secret_key'])) {
sendTelegram("Tripay payment gateway not configured");
r2(U . $back, 'e', Lang::T("Admin has not yet setup Tripay payment gateway, please tell admin"));
}
}
break;
default:

View file

@ -282,3 +282,6 @@ $_L['Checking_payment'] = 'Checking payment';
$_L['Create_Transaction_Success'] = 'Create Transaction Success';
$_L['You_have_unpaid_transaction'] = 'You have unpaid transaction';
$_L['CANCELED'] = 'CANCELED';
$_L['TripayPayment_Channel'] = 'TripayPayment Channel';
$_L['Payment_Channel'] = 'Payment Channel';
$_L['Payment_check_failed'] = 'Payment check failed.';

View file

@ -25,7 +25,7 @@
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Callback URL</label>
<label class="col-md-2 control-label">Notification URL</label>
<div class="col-md-6">
<input type="text" readonly class="form-control" onclick="this.select()" value="{$_url}callback/tripay">
</div>

View file

@ -23,30 +23,31 @@
<a href="{$_url}bandwidth/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['New_Bandwidth']}</a>
</div>&nbsp;
</div>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['BW_Name']}</th>
<th>{$_L['Rate_Download']}</th>
<th>{$_L['Rate_Upload']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['name_bw']}</td>
<td>{$ds['rate_down']} {$ds['rate_down_unit']}</td>
<td>{$ds['rate_up']} {$ds['rate_up_unit']}</td>
<td>
<a href="{$_url}bandwidth/edit/{$ds['id']}" class="btn btn-sm btn-warning">{$_L['Edit']}</a>
<a href="{$_url}bandwidth/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['BW_Name']}</th>
<th>{$_L['Rate_Download']}</th>
<th>{$_L['Rate_Upload']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['name_bw']}</td>
<td>{$ds['rate_down']} {$ds['rate_down_unit']}</td>
<td>{$ds['rate_up']} {$ds['rate_up_unit']}</td>
<td>
<a href="{$_url}bandwidth/edit/{$ds['id']}" class="btn btn-sm btn-warning">{$_L['Edit']}</a>
<a href="{$_url}bandwidth/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{$paginator['contents']}
</div>
</div>

View file

@ -23,34 +23,35 @@
<a href="{$_url}customers/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['Add_Contact']}</a>
</div>&nbsp;
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Full_Name']}</th>
<th>{$_L['Phone_Number']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Recharge']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['fullname']}</td>
<td>{$ds['phonenumber']}</td>
<td>{$ds['created_at']}</td>
<td align="center"><a href="{$_url}prepaid/recharge-user/{$ds['id']}" id="{$ds['id']}" class="btn btn-primary btn-sm">{$_L['Recharge']}</a></td>
<td align="center">
<a href="{$_url}customers/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}customers/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Full_Name']}</th>
<th>{$_L['Phone_Number']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Recharge']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['fullname']}</td>
<td>{$ds['phonenumber']}</td>
<td>{$ds['created_at']}</td>
<td align="center"><a href="{$_url}prepaid/recharge-user/{$ds['id']}" id="{$ds['id']}" class="btn btn-primary btn-sm">{$_L['Recharge']}</a></td>
<td align="center">
<a href="{$_url}customers/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}customers/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{$paginator['contents']}
</div>
</div>

View file

@ -85,60 +85,67 @@
<div class="panel panel-default mb20 panel-hovered project-stats table-responsive">
<div class="panel-heading">Vouchers Stock</div>
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>{$_L['Plan_Name']}</th>
<th>unused</th>
<th>used</th>
</tr>
</thead>
<tbody>
{foreach $plans as $stok}
<tr>
<td>{$stok['name_plan']}</td>
<td>{$stok['unused']}</td>
<td>{$stok['used']}</td>
</tr>
</tbody>
{/foreach}
<tr>
<td>Total</td>
<td>{$stocks['unused']}</td>
<td>{$stocks['used']}</td>
</tr>
</table>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>{$_L['Plan_Name']}</th>
<th>unused</th>
<th>used</th>
</tr>
</thead>
<tbody>
{foreach $plans as $stok}
<tr>
<td>{$stok['name_plan']}</td>
<td>{$stok['unused']}</td>
<td>{$stok['used']}</td>
</tr>
</tbody>
{/foreach}
<tr>
<td>Total</td>
<td>{$stocks['unused']}</td>
<td>{$stocks['used']}</td>
</tr>
</table>
</div>
</div>
</div>
<div class="panel panel-default mb20 panel-hovered project-stats table-responsive">
<div class="panel-heading">{$_L['User_Expired_Today']}</div>
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>{$_L['Username']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
</tr>
</thead>
<tbody>
{$no = 1}
{foreach $expire as $expired}
<tr>
<td>{$no++}</td>
<td>{$expired['username']}</td>
<td>{date($_c['date_format'], strtotime($expired['recharged_on']))} {$expired['time']}</td>
<td>{date($_c['date_format'], strtotime($expired['expiration']))} {$expired['time']}</td>
</tr>
</tbody>
{/foreach}
</table>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>{$_L['Username']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
</tr>
</thead>
<tbody>
{$no = 1}
{foreach $expire as $expired}
<tr>
<td>{$no++}</td>
<td>{$expired['username']}</td>
<td>{date($_c['date_format'], strtotime($expired['recharged_on']))} {$expired['time']}</td>
<td>{date($_c['date_format'], strtotime($expired['expiration']))} {$expired['time']}</td>
</tr>
</tbody>
{/foreach}
</table>
</div>
</div>
</div>
</div>
<div class="col-md-5">
<div class="panel panel-default panel-hovered mb20 activities">
<div class="panel-heading">{Lang::T('Payment Gateway')}: {$_c['payment_gateway']}</div>
</div>
<div class="panel panel-default panel-hovered mb20 activities">
<div class="panel-heading">{$_L['Activity_Log']}</div>
<div class="panel-body">
@ -181,22 +188,22 @@
<div class="panel-heading">{$_L['Account_Information']}</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-3">
<p class="small text-success text-uppercase text-normal">{$_L['Username']}</p>
<p class="small mb15">{$_bill['username']}</p>
</div>
<div class="col-sm-3">
<p class="small text-primary text-uppercase text-normal">{$_L['Plan_Name']}</p>
<p class="small mb15">{$_bill['namebp']}</p>
</div>
<div class="col-sm-3">
<p class="small text-info text-uppercase text-normal">{$_L['Created_On']}</p>
<p class="small mb15">{date($_c['date_format'], strtotime($_bill['recharged_on']))} {$_bill['time']}</p>
</div>
<div class="col-sm-3">
<p class="small text-danger text-uppercase text-normal">{$_L['Expires_On']}</p>
<p class="small mb15">{date($_c['date_format'], strtotime($_bill['expiration']))} {$_bill['time']}</p>
</div>
<div class="col-sm-3">
<p class="small text-success text-uppercase text-normal">{$_L['Username']}</p>
<p class="small mb15">{$_bill['username']}</p>
</div>
<div class="col-sm-3">
<p class="small text-primary text-uppercase text-normal">{$_L['Plan_Name']}</p>
<p class="small mb15">{$_bill['namebp']}</p>
</div>
<div class="col-sm-3">
<p class="small text-info text-uppercase text-normal">{$_L['Created_On']}</p>
<p class="small mb15">{date($_c['date_format'], strtotime($_bill['recharged_on']))} {$_bill['time']}</p>
</div>
<div class="col-sm-3">
<p class="small text-danger text-uppercase text-normal">{$_L['Expires_On']}</p>
<p class="small mb15">{date($_c['date_format'], strtotime($_bill['expiration']))} {$_bill['time']}</p>
</div>
</div>
</div>

View file

@ -7,7 +7,6 @@
<div class="panel-body">
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
<div class="col-md-8">
<form id="site-search" method="post" action="{$_url}pool/list/">
<div class="input-group">
<div class="input-group-addon">
@ -24,32 +23,34 @@
<a href="{$_url}pool/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['New_Pool']}</a>
</div>&nbsp;
</div>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>{$_L['Pool_Name']}</th>
<th>{$_L['Range_IP']}</th>
<th>{$_L['Routers']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{$no = 1}
{foreach $d as $ds}
<tr>
<td align="center">{$no++}</td>
<td>{$ds['pool_name']}</td>
<td>{$ds['range_ip']}</td>
<td>{$ds['routers']}</td>
<td align="center">
<a href="{$_url}pool/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}pool/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>{$_L['Pool_Name']}</th>
<th>{$_L['Range_IP']}</th>
<th>{$_L['Routers']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{$no = 1}
{foreach $d as $ds}
<tr>
<td align="center">{$no++}</td>
<td>{$ds['pool_name']}</td>
<td>{$ds['range_ip']}</td>
<td>{$ds['routers']}</td>
<td align="center">
<a href="{$_url}pool/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}pool/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{$paginator['contents']}
</div>
</div>

View file

@ -23,39 +23,40 @@
<a href="{$_url}prepaid/recharge" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['Recharge_Account']}</a>
</div>&nbsp;
</div>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
<th>{$_L['Routers']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['namebp']}</td>
<td>{$ds['type']}</td>
<td>{$ds['recharged_on']} {$ds['time']}</td>
<td>{$ds['expiration']} {$ds['time']}</td>
<td>{$ds['method']}</td>
<td>{$ds['routers']}</td>
<td>
<a href="{$_url}prepaid/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}prepaid/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{$paginator['contents']}
<div class="table-responsive">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
<th>{$_L['Routers']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['namebp']}</td>
<td>{$ds['type']}</td>
<td>{$ds['recharged_on']} {$ds['time']}</td>
<td>{$ds['expiration']} {$ds['time']}</td>
<td>{$ds['method']}</td>
<td>{$ds['routers']}</td>
<td>
<a href="{$_url}prepaid/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}prepaid/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{$paginator['contents']}
</div>
</div>
</div>

View file

@ -23,28 +23,30 @@
<div class="col-md-12">
<div id="printable">
<h4>{$_L['All_Transactions_at_Date']}: {date($_c['date_format'], strtotime($mdate))}</h4>
<table class="table table-condensed table-bordered" style="background: #ffffff">
<th class="text-center">{$_L['Username']}</th>
<th class="text-center">{$_L['Plan_Name']}</th>
<th class="text-center">{$_L['Type']}</th>
<th class="text-center">{$_L['Plan_Price']}</th>
<th class="text-center">{$_L['Created_On']}</th>
<th class="text-center">{$_L['Expires_On']}</th>
<th class="text-center">{$_L['Method']}</th>
<th class="text-center">{$_L['Routers']}</th>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td class="text-center">{$ds['plan_name']}</td>
<td class="text-center">{$ds['type']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td class="text-center">{$ds['method']}</td>
<td class="text-center">{$ds['routers']}</td>
</tr>
{/foreach}
</table>
<div class="table-responsive">
<table class="table table-condensed table-bordered" style="background: #ffffff">
<th class="text-center">{$_L['Username']}</th>
<th class="text-center">{$_L['Plan_Name']}</th>
<th class="text-center">{$_L['Type']}</th>
<th class="text-center">{$_L['Plan_Price']}</th>
<th class="text-center">{$_L['Created_On']}</th>
<th class="text-center">{$_L['Expires_On']}</th>
<th class="text-center">{$_L['Method']}</th>
<th class="text-center">{$_L['Routers']}</th>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td class="text-center">{$ds['plan_name']}</td>
<td class="text-center">{$ds['type']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td class="text-center">{$ds['method']}</td>
<td class="text-center">{$ds['routers']}</td>
</tr>
{/foreach}
</table>
</div>
<div class="clearfix text-right total-sum mb10">
<h4 class="text-uppercase text-bold">{$_L['Total_Income']}:</h4>
<h3 class="sum">{$_c['currency_code']} {number_format($dr,2,$_c['dec_point'],$_c['thousands_sep'])}</h3>

View file

@ -23,28 +23,30 @@
<div class="col-md-12">
<div id="printable">
<h4>{$_L['All_Transactions_at_Date']}: {date( $_c['date_format'], strtotime($fdate))} - {date( $_c['date_format'], strtotime($tdate))}</h4>
<table class="table table-condensed table-bordered" style="background: #ffffff">
<th class="text-center">{$_L['Username']}</th>
<th class="text-center">{$_L['Plan_Name']}</th>
<th class="text-center">{$_L['Type']}</th>
<th class="text-center">{$_L['Plan_Price']}</th>
<th class="text-center">{$_L['Created_On']}</th>
<th class="text-center">{$_L['Expires_On']}</th>
<th class="text-center">{$_L['Method']}</th>
<th class="text-center">{$_L['Routers']}</th>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td class="text-center">{$ds['plan_name']}</td>
<td class="text-center">{$ds['type']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td class="text-center">{$ds['method']}</td>
<td class="text-center">{$ds['routers']}</td>
</tr>
{/foreach}
</table>
<div class="table-responsive">
<table class="table table-condensed table-bordered" style="background: #ffffff">
<th class="text-center">{$_L['Username']}</th>
<th class="text-center">{$_L['Plan_Name']}</th>
<th class="text-center">{$_L['Type']}</th>
<th class="text-center">{$_L['Plan_Price']}</th>
<th class="text-center">{$_L['Created_On']}</th>
<th class="text-center">{$_L['Expires_On']}</th>
<th class="text-center">{$_L['Method']}</th>
<th class="text-center">{$_L['Routers']}</th>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td class="text-center">{$ds['plan_name']}</td>
<td class="text-center">{$ds['type']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td class="text-center">{$ds['method']}</td>
<td class="text-center">{$ds['routers']}</td>
</tr>
{/foreach}
</table>
</div>
<div class="clearfix text-right total-sum mb10">
<h4 class="text-uppercase text-bold">{$_L['Total_Income']}:</h4>
<h3 class="sum">{$_c['currency_code']} {number_format($dr,2,$_c['dec_point'],$_c['thousands_sep'])}</h3>

View file

@ -18,37 +18,38 @@
<a href="{$_url}export/pdf-by-date" class="btn btn-default"><i class="fa fa-file-pdf-o"></i>{$_L['Export_to_PDF']}</a>
</div>
</div>
<table class="table table-bordered invoice-table mb10">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Plan_Price']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
<th>{$_L['Routers']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['type']}</td>
<td>{$ds['plan_name']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td>{$ds['method']}</td>
<td>{$ds['routers']}</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="table-responsive">
<table class="table table-bordered invoice-table mb10">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Plan_Price']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
<th>{$_L['Routers']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['type']}</td>
<td>{$ds['plan_name']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td>{$ds['method']}</td>
<td>{$ds['routers']}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{$paginator['contents']}
<div class="clearfix text-right total-sum mb10">
<h4 class="text-uppercase text-bold">{$_L['Total_Income']}:</h4>
<h3 class="sum">{$_c['currency_code']} {number_format($dr,2,$_c['dec_point'],$_c['thousands_sep'])}</h3>

View file

@ -28,35 +28,36 @@
</form>
</div>
</div>
<table class="table table-bordered invoice-table mb10">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Plan_Price']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
<th>{$_L['Routers']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['type']}</td>
<td>{$ds['plan_name']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],0,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td>{$ds['method']}</td>
<td>{$ds['routers']}</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="table-responsive">
<table class="table table-bordered invoice-table mb10">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Plan_Price']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
<th>{$_L['Routers']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['type']}</td>
<td>{$ds['plan_name']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],0,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td>{$ds['method']}</td>
<td>{$ds['routers']}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<div class="clearfix text-right total-sum mb10">
<h4 class="text-uppercase text-bold">{$_L['Total_Income']}:</h4>
<h3 class="sum">{$_c['currency_code']} {number_format($dr,2,$_c['dec_point'],$_c['thousands_sep'])}</h3>

View file

@ -24,35 +24,35 @@
<a href="{$_url}routers/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['New_Router']}</a>
</div>&nbsp;
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['Router_Name']}</th>
<th>{$_L['IP_Address']}</th>
<th>{$_L['Username']}</th>
<th>{$_L['Description']}</th>
<th>{Lang::T('Status')}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['enabled'] != 1}class="danger" title="disabled"{/if}>
<td>{$ds['name']}</td>
<td>{$ds['ip_address']}</td>
<td>{$ds['username']}</td>
<td>{$ds['description']}</td>
<td>{if $ds['enabled'] == 1}Enabled{else}Disabled{/if}</td>
<td>
<a href="{$_url}routers/edit/{$ds['id']}" class="btn btn-info btn-sm btn-block">{$_L['Edit']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{$paginator['contents']}
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['Router_Name']}</th>
<th>{$_L['IP_Address']}</th>
<th>{$_L['Username']}</th>
<th>{$_L['Description']}</th>
<th>{Lang::T('Status')}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['enabled'] != 1}class="danger" title="disabled"{/if}>
<td>{$ds['name']}</td>
<td>{$ds['ip_address']}</td>
<td>{$ds['username']}</td>
<td>{$ds['description']}</td>
<td>{if $ds['enabled'] == 1}Enabled{else}Disabled{/if}</td>
<td>
<a href="{$_url}routers/edit/{$ds['id']}" class="btn btn-info btn-sm btn-block">{$_L['Edit']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{$paginator['contents']}
</div>
</div>
</div>

19
ui/ui/tripay_channel.tpl Normal file
View file

@ -0,0 +1,19 @@
{include file="sections/user-header.tpl"}
<div class="row">
<div class="col-sm-12">
<div class="panel panel-info panel-hovered">
<div class="panel-heading">Tripay {Lang::T('Payment Channel')}</div>
<div class="panel-body row">
{foreach $channels as $channel}
{if in_array($channel['id'], $tripay_channels)}
<div class="col-sm-4 mb20">
<a href="{$_url}order/buy/{$path}/{$channel['id']}"
onclick="return confirm('{$channel['name']}')"
class="btn btn-block btn-default">{$channel['name']}</a>
</div>
{/if}
{/foreach}
</div>
</div>
</div>
{include file="sections/user-footer.tpl"}

View file

@ -5,31 +5,34 @@
<div class="panel mb20 panel-hovered panel-default">
<div class="panel-heading">{$_L['List_Activated_Voucher']}</div>
<div class="panel-body">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['plan_name']}</td>
<td>{$ds['type']}</td>
<td class="text-success">{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td class="text-danger">{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td>{$ds['method']}</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="table-responsive">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Plan_Price']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['plan_name']}</td>
<td>{$ds['price']}</td>
<td>{$ds['type']}</td>
<td class="text-success">{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td class="text-danger">{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td>{$ds['method']}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{$paginator['contents']}
</div>
</div>