forked from kevinowino869/mitrobill
Merge branch 'Development' of https://github.com/hotspotbilling/phpnuxbill into Development
This commit is contained in:
@ -308,7 +308,7 @@ class Message
|
||||
|
||||
public static function sendInvoice($cust, $trx)
|
||||
{
|
||||
global $config;
|
||||
global $config, $db_pass;
|
||||
$textInvoice = Lang::getNotifText('invoice_paid');
|
||||
$textInvoice = str_replace('[[company_name]]', $config['CompanyName'], $textInvoice);
|
||||
$textInvoice = str_replace('[[address]]', $config['address'], $textInvoice);
|
||||
@ -333,6 +333,10 @@ class Message
|
||||
$textInvoice = str_replace('[[password]]', $cust['password'], $textInvoice);
|
||||
$textInvoice = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($trx['expiration'], $trx['time']), $textInvoice);
|
||||
$textInvoice = str_replace('[[footer]]', $config['note'], $textInvoice);
|
||||
|
||||
$inv_url = "?_route=voucher/invoice/$trx[id]/" . md5($trx['id'] . $db_pass);
|
||||
$textInvoice = str_replace('[[invoice_link]]', $inv_url, $textInvoice);
|
||||
|
||||
// Calculate bills and additional costs
|
||||
list($bills, $add_cost) = User::getBills($cust['id']);
|
||||
|
||||
|
@ -279,6 +279,8 @@ switch ($action) {
|
||||
$ui->assign('wlogo', $width);
|
||||
$ui->assign('hlogo', $height);
|
||||
}
|
||||
|
||||
$ui->assign('public_url', getUrl("voucher/invoice/$id/".md5($id. $db_pass)));
|
||||
$ui->assign('logo', $logo);
|
||||
$ui->assign('_title', 'View Invoice');
|
||||
$ui->display('admin/plan/invoice.tpl');
|
||||
|
@ -4,11 +4,47 @@
|
||||
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
|
||||
* by https://t.me/ibnux
|
||||
**/
|
||||
_auth();
|
||||
|
||||
$ui->assign('_title', Lang::T('Voucher'));
|
||||
$ui->assign('_system_menu', 'voucher');
|
||||
|
||||
$action = $routes['1'];
|
||||
if(!_auth(false)){
|
||||
if($action== 'invoice'){
|
||||
$id = $routes[2];
|
||||
$sign = $routes[3];
|
||||
if($sign != md5($id. $db_pass)) {
|
||||
die("beda");
|
||||
}
|
||||
if (empty($id)) {
|
||||
$in = ORM::for_table('tbl_transactions')->order_by_desc('id')->find_one();
|
||||
} else {
|
||||
$in = ORM::for_table('tbl_transactions')->where('id', $id)->find_one();
|
||||
}
|
||||
if ($in) {
|
||||
Package::createInvoice($in);
|
||||
$UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH);
|
||||
$logo = '';
|
||||
if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png')) {
|
||||
$logo = $UPLOAD_URL_PATH . DIRECTORY_SEPARATOR . 'logo.png';
|
||||
$imgsize = getimagesize($logo);
|
||||
$width = $imgsize[0];
|
||||
$height = $imgsize[1];
|
||||
$ui->assign('wlogo', $width);
|
||||
$ui->assign('hlogo', $height);
|
||||
}
|
||||
$ui->assign('public_url', getUrl("voucher/invoice/$id/".md5($id. $db_pass)));
|
||||
$ui->assign('logo', $logo);
|
||||
$ui->display('customer/invoice-customer.tpl');
|
||||
die();
|
||||
} else {
|
||||
r2(getUrl('voucher/list-activated'), 'e', Lang::T('Not Found'));
|
||||
}
|
||||
}else{
|
||||
r2(getUrl('login'));
|
||||
}
|
||||
}
|
||||
|
||||
$user = User::_info();
|
||||
$ui->assign('_user', $user);
|
||||
|
||||
@ -74,6 +110,7 @@ switch ($action) {
|
||||
$ui->assign('wlogo', $width);
|
||||
$ui->assign('hlogo', $height);
|
||||
}
|
||||
$ui->assign('public_url', getUrl("voucher/invoice/$id/".md5($id. $db_pass)));
|
||||
$ui->assign('logo', $logo);
|
||||
$ui->display('customer/invoice-customer.tpl');
|
||||
} else {
|
||||
|
@ -75,13 +75,7 @@ foreach ($d as $ds) {
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
try {
|
||||
(new $p['device'])->remove_customer($c, $p);
|
||||
} catch (Throwable $e) {
|
||||
_log($e->getMessage());
|
||||
sendTelegram($e->getMessage());
|
||||
echo "Error: " . $e->getMessage() . "\n";
|
||||
}
|
||||
(new $p['device'])->remove_customer($c, $p);
|
||||
} else {
|
||||
throw new Exception("Cron error: Devices " . $p['device'] . "not found, cannot disconnect ".$c['username']."\n");
|
||||
}
|
||||
|
@ -1149,5 +1149,9 @@
|
||||
"Yours_Balances": "Yours Balances",
|
||||
"Friend_username": "Friend username",
|
||||
"This_will_sync_dan_send_Customer_active_package_to_Mikrotik": "This will sync dan send Customer active package to Mikrotik",
|
||||
<<<<<<< HEAD
|
||||
"Email_not_sent__Mailer_Error__": "Email not sent, Mailer Error: "
|
||||
=======
|
||||
"Payment_History": "Payment History"
|
||||
>>>>>>> 20916b44f0a88d7df2366b0d36d81f7ab249af1d
|
||||
}
|
Reference in New Issue
Block a user