Compare commits

..

8 Commits

Author SHA1 Message Date
4de849fe34 2023.8.30 2023-08-30 10:06:04 +07:00
18d68d68c8 fix time, using text 2023-08-30 10:02:58 +07:00
1b15da5c04 Upload Logo For PDF Reports 2023-08-30 09:55:39 +07:00
51416626fb Fix Print Invoice 2023-08-30 09:01:37 +07:00
5a10c19853 PHP NuxBill -> PHPNuxBill 2023-08-28 15:46:25 +07:00
44cdd8f594 info about PHPNuxBill 2023-08-28 15:45:47 +07:00
00cf90e6ea auto rename pages_example 2023-08-28 15:23:23 +07:00
341e26f4d6 rename pages 2023-08-28 15:21:57 +07:00
16 changed files with 180 additions and 101 deletions

View File

@ -2,6 +2,12 @@
# CHANGELOG # CHANGELOG
## 2023.8.30
- Upload Logo from settings
- Fix Print value
- Fix Time when editing prepaid
## 2023.8.28 ## 2023.8.28
- Extend expiration if buy same package - Extend expiration if buy same package

View File

@ -16,11 +16,8 @@
<body style='background-color: #FBFBFB;'> <body style='background-color: #FBFBFB;'>
<div id='main-container'> <div id='main-container'>
<div class='header'> <img src="img/logo.png" class="img-responsive" alt="Logo" />
<div class="header-box wrapper"> <hr>
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo" /></a></div>
</div>
</div>
<!-- contents area start --> <!-- contents area start -->
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">

View File

@ -16,11 +16,8 @@
<body style='background-color: #FBFBFB;'> <body style='background-color: #FBFBFB;'>
<div id='main-container'> <div id='main-container'>
<div class='header'> <img src="img/logo.png" class="img-responsive" alt="Logo" />
<div class="header-box wrapper"> <hr>
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo" /></a></div>
</div>
</div>
<div class="span12"> <div class="span12">
<h4> PHPNuxBill Installer </h4> <h4> PHPNuxBill Installer </h4>

View File

@ -15,11 +15,8 @@
<body style='background-color: #FBFBFB;'> <body style='background-color: #FBFBFB;'>
<div id='main-container'> <div id='main-container'>
<div class='header'> <img src="img/logo.png" class="img-responsive" alt="Logo" />
<div class="header-box wrapper"> <hr>
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<div class="span12"> <div class="span12">
<h4> PHPNuxBill Installer </h4> <h4> PHPNuxBill Installer </h4>

View File

@ -82,11 +82,8 @@ $wConfig = "../config.php";
<body style='background-color: #FBFBFB;'> <body style='background-color: #FBFBFB;'>
<div id='main-container'> <div id='main-container'>
<div class='header'> <img src="img/logo.png" class="img-responsive" alt="Logo" />
<div class="header-box wrapper"> <hr>
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<div class="span12"> <div class="span12">
<h4> PHPNuxBill Installer </h4> <h4> PHPNuxBill Installer </h4>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>PHPNuxBill Installer</title> <title>PHPNuxBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
@ -12,20 +13,27 @@
<link type='text/css' href='css/style.css' rel='stylesheet' /> <link type='text/css' href='css/style.css' rel='stylesheet' />
<link type='text/css' href="css/bootstrap.min.css" rel="stylesheet"> <link type='text/css' href="css/bootstrap.min.css" rel="stylesheet">
</head> </head>
<?php if (!file_exists('../pages')) rename('../pages_template', '../pages'); ?>
<body style='background-color: #FBFBFB;'> <body style='background-color: #FBFBFB;'>
<div id='main-container'> <div id='main-container'>
<div class='header'> <img src="img/logo.png" class="img-responsive" alt="Logo" />
<div class="header-box wrapper"> <hr>
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<div class="span12"> <div class="span12">
<h4> PHPNuxBill Installer </h4> <h4> PHPNuxBill Installer </h4>
<p> <p>
<strong>Congratulations!</strong><br> <strong>Congratulations!</strong><br>
You have just install PHPNuxBill !<br> You have just install PHPNuxBill !<br><br>
<span class="text-danger">But wait!!<br>
<ol>
<li>Don't forget to rename folder <b>pages_example</b> to <b>pages</b>.<br>
if it not yet renamed</li>
<li>Activate <a href="https://github.com/hotspotbilling/phpnuxbill/wiki/Cron-Jobs" target="_blank">Cronjob</a> for Expired and Reminder.</li>
<li>Check <a href="https://github.com/hotspotbilling/phpnuxbill/wiki/How-It-Works---Cara-kerja" target="_blank">how PHPNuxbill Works</a></li>
<li><a href="https://github.com/hotspotbilling/phpnuxbill/wiki#login-page-mikrotik" target="_blank">how to link Mikrotik Login to PHPNuxBill</a></li>
<li>or use <a href="https://github.com/hotspotbilling/phpnuxbill-mikrotik-login-template" target="_blank">Mikrotik Login Template for PHPNuxBill</a></li>
</ol>
</span><br><br>
To Login Admin Portal:<br> To Login Admin Portal:<br>
Use this link - Use this link -
<?php <?php
@ -43,4 +51,5 @@
</div> </div>
<div class="footer">Copyright &copy; 2021 PHPNuxBill. All Rights Reserved<br /><br /></div> <div class="footer">Copyright &copy; 2021 PHPNuxBill. All Rights Reserved<br /><br /></div>
</body> </body>
</html> </html>

View File

@ -16,11 +16,8 @@
<body style='background-color: #FBFBFB;'> <body style='background-color: #FBFBFB;'>
<div id='main-container'> <div id='main-container'>
<div class='header'> <img src="img/logo.png" class="img-responsive" alt="Logo" />
<div class="header-box wrapper"> <hr>
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo" /></a></div>
</div>
</div>
<div class="span12"> <div class="span12">
<h4> PHPNuxBill Updater </h4> <h4> PHPNuxBill Updater </h4>

View File

@ -33,6 +33,63 @@ class File
rmdir($path); rmdir($path);
} }
public static function resizeCropImage($source_file, $dst_dir, $max_width, $max_height, $quality = 80)
{
$imgsize = getimagesize($source_file);
$width = $imgsize[0];
$height = $imgsize[1];
$mime = $imgsize['mime'];
switch ($mime) {
case 'image/gif':
$image_create = "imagecreatefromgif";
$image = "imagegif";
break;
case 'image/png':
$image_create = "imagecreatefrompng";
$image = "imagepng";
$quality = 7;
break;
case 'image/jpeg':
$image_create = "imagecreatefromjpeg";
$image = "imagejpeg";
$quality = 80;
break;
default:
return false;
break;
}
if ($max_width == 0) {
$max_width = $width;
}
if ($max_height == 0) {
$max_height = $height;
}
$widthRatio = $max_width / $width;
$heightRatio = $max_height / $height;
$ratio = min($widthRatio, $heightRatio);
$nwidth = (int)$width * $ratio;
$nheight = (int)$height * $ratio;
$dst_img = imagecreatetruecolor($nwidth, $nheight);
$white = imagecolorallocate($dst_img, 255, 255, 255);
imagefill($dst_img, 0, 0, $white);
$src_img = $image_create($source_file);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $nwidth, $nheight, $width, $height);
$image($dst_img, $dst_dir, $quality);
if ($dst_img) imagedestroy($dst_img);
if ($src_img) imagedestroy($src_img);
return file_exists($dst_dir);
}
/** /**
* file path fixer * file path fixer

View File

@ -114,7 +114,6 @@ switch ($action) {
case 'print': case 'print':
$id = _post('id'); $id = _post('id');
$d = ORM::for_table('tbl_transactions')->where('id', $id)->find_one(); $d = ORM::for_table('tbl_transactions')->where('id', $id)->find_one();
$ui->assign('d', $d); $ui->assign('d', $d);
@ -367,19 +366,17 @@ switch ($action) {
break; break;
case 'refill-post': case 'refill-post':
$user = _post('id_customer');
$code = _post('code'); $code = _post('code');
$user = ORM::for_table('tbl_customers')->where('id', _post('id_customer'))->find_one();
$v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one(); $v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one();
run_hook('refill_customer'); #HOOK run_hook('refill_customer'); #HOOK
if ($v1) { if ($v1) {
if (Package::rechargeUser($user, $v1['routers'], $v1['id_plan'], "Refill", "Voucher")) { if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Refill", "Voucher")) {
$v1->status = "1"; $v1->status = "1";
$v1->user = $c['username']; $v1->user = $user['username'];
$v1->save(); $v1->save();
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one(); $in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->order_by_desc('id')->find_one();
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
$ui->assign('in', $in); $ui->assign('in', $in);
$ui->assign('date', date("Y-m-d H:i:s")); $ui->assign('date', date("Y-m-d H:i:s"));
$ui->display('invoice.tpl'); $ui->display('invoice.tpl');

View File

@ -17,6 +17,12 @@ switch ($action) {
if ($admin['user_type'] != 'Admin') { if ($admin['user_type'] != 'Admin') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']); r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
} }
if (file_exists('system/uploads/logo.png')) {
$logo = 'system/uploads/logo.png?' . time();
} else {
$logo = 'system/uploads/logo.default.png';
}
$ui->assign('logo', $logo);
run_hook('view_app_settings'); #HOOK run_hook('view_app_settings'); #HOOK
$ui->display('app-settings.tpl'); $ui->display('app-settings.tpl');
break; break;
@ -221,6 +227,15 @@ switch ($action) {
$tawkto = _post('tawkto'); $tawkto = _post('tawkto');
$radius_mode = _post('radius_mode') * 1; $radius_mode = _post('radius_mode') * 1;
run_hook('save_settings'); #HOOK run_hook('save_settings'); #HOOK
if ($_FILES['logo']['error'] > 0) {
r2(U . 'settings/app', 'e', 'Failed to process logo');
}
if (!empty($_FILES['logo']['name'])) {
if (file_exists('system/uploads/logo.png')) unlink('system/uploads/logo.png');
File::resizeCropImage($_FILES['logo']['tmp_name'], 'system/uploads/logo.png', 1078, 200, 100);
}
if ($company == '') { if ($company == '') {
r2(U . 'settings/app', 'e', $_L['All_field_is_required']); r2(U . 'settings/app', 'e', $_L['All_field_is_required']);
} else { } else {

View File

@ -384,3 +384,4 @@ $_L['Send_Balance'] = 'Send Balance';
$_L['Received_Balance'] = 'Received Balance'; $_L['Received_Balance'] = 'Received Balance';
$_L['Minimum_Balance_Transfer'] = 'Minimum Balance Transfer'; $_L['Minimum_Balance_Transfer'] = 'Minimum Balance Transfer';
$_L['Minimum_Transfer'] = 'Minimum Transfer'; $_L['Minimum_Transfer'] = 'Minimum Transfer';
$_L['Company_Logo'] = 'Company Logo';

View File

@ -1,6 +1,6 @@
{include file="sections/header.tpl"} {include file="sections/header.tpl"}
<form class="form-horizontal" method="post" role="form" action="{$_url}settings/app-post"> <form class="form-horizontal" method="post" role="form" action="{$_url}settings/app-post" enctype="multipart/form-data">
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12 col-md-12">
<div class="panel panel-primary panel-hovered panel-stacked mb30"> <div class="panel panel-primary panel-hovered panel-stacked mb30">
@ -17,10 +17,19 @@
<div class="col-md-6"> <div class="col-md-6">
<input type="text" required class="form-control" id="company" name="company" <input type="text" required class="form-control" id="company" name="company"
value="{$_c['CompanyName']}"> value="{$_c['CompanyName']}">
</div> </div>
<span class="help-block col-md-4">{$_L['App_Name_Help_Text']}</span> <span class="help-block col-md-4">{$_L['App_Name_Help_Text']}</span>
</div> </div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Company Logo')}</label>
<div class="col-md-6">
<input type="file" class="form-control" id="logo" name="logo" accept="image/*">
<span class="help-block">For PDF Reports | Beset size 1078 x 200 | uploaded image will be autosize</span>
</div>
<span class="help-block col-md-4">
<a href="./{$logo}" target="_blank"><img src="./{$logo}" height="48" alt="logo for PDF"></a>
</span>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Company Footer')}</label> <label class="col-md-2 control-label">{Lang::T('Company Footer')}</label>
<div class="col-md-6"> <div class="col-md-6">

View File

@ -33,7 +33,7 @@
============================================<br> ============================================<br>
{$_L['Type']} : <b>{$d['type']}</b><br> {$_L['Type']} : <b>{$d['type']}</b><br>
{$_L['Plan_Name']} : <b>{$d['plan_name']}</b><br> {$_L['Plan_Name']} : <b>{$d['plan_name']}</b><br>
{$_L['Plan_Price']} : <b>{Lang::moneyFormat($in['price'])}</b><br> {$_L['Plan_Price']} : <b>{Lang::moneyFormat($d['price'])}</b><br>
<br> <br>
{$_L['Username']} : <b>{$d['username']}</b><br> {$_L['Username']} : <b>{$d['username']}</b><br>
{$_L['Password']} : **********<br> {$_L['Password']} : **********<br>

View File

@ -43,7 +43,7 @@
value="{$d['expiration']}"> value="{$d['expiration']}">
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<input type="time" class="form-control" id="time" name="time" <input type="text" class="form-control" id="time" name="time" placeholder="00:00:00"
value="{$d['time']}"> value="{$d['time']}">
</div> </div>
</div> </div>

View File

@ -1,3 +1,3 @@
{ {
"version": "2023.8.28" "version": "2023.8.30"
} }