add sub sales

This commit is contained in:
Ibnu Maksum 2024-02-07 10:11:30 +07:00
parent ac84e4b235
commit 671154d146
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
7 changed files with 11 additions and 12 deletions

View File

@ -111,9 +111,9 @@ class Message
$textInvoice = str_replace('[[phone]]', $config['phone'], $textInvoice);
$textInvoice = str_replace('[[invoice]]', $trx['invoice'], $textInvoice);
$textInvoice = str_replace('[[date]]', Lang::dateAndTimeFormat($trx['recharged_on'], $trx['recharged_time']), $textInvoice);
$gc = explode(" - ", $trx['method']);
$textInvoice = str_replace('[[payment_gateway]]', $gc[0], $textInvoice);
$textInvoice = str_replace('[[payment_channel]]', $gc[1], $textInvoice);
$gc = explode("-", $trx['method']);
$textInvoice = str_replace('[[payment_gateway]]', trim($gc[0]), $textInvoice);
$textInvoice = str_replace('[[payment_channel]]', trim($gc[1]), $textInvoice);
$textInvoice = str_replace('[[type]]', $trx['type'], $textInvoice);
$textInvoice = str_replace('[[plan_name]]', $trx['plan_name'], $textInvoice);
$textInvoice = str_replace('[[plan_price]]', Lang::moneyFormat($trx['price']), $textInvoice);

View File

@ -59,8 +59,8 @@ class Package
$textInvoice = str_replace('[[phone]]', $_c['phone'], $textInvoice);
$textInvoice = str_replace('[[invoice]]', $inv, $textInvoice);
$textInvoice = str_replace('[[date]]', Lang::dateTimeFormat($date_now), $textInvoice);
$textInvoice = str_replace('[[payment_gateway]]', $_c['gateway'], $textInvoice);
$textInvoice = str_replace('[[payment_channel]]', $_c['channel'], $textInvoice);
$textInvoice = str_replace('[[payment_gateway]]', $gateway, $textInvoice);
$textInvoice = str_replace('[[payment_channel]]', $channel, $textInvoice);
$textInvoice = str_replace('[[type]]', 'Balance', $textInvoice);
$textInvoice = str_replace('[[plan_name]]', $p['name_plan'], $textInvoice);
$textInvoice = str_replace('[[plan_price]]', Lang::moneyFormat($p['price']), $textInvoice);
@ -316,8 +316,7 @@ class Package
"\nPrice: " . Lang::moneyFormat($p['price']));
}
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
Message::sendInvoice($c, $in);
Message::sendInvoice($c, $t);
return true;
}

View File

@ -92,7 +92,6 @@ try {
}
date_default_timezone_set($config['timezone']);
ORM::raw_execute("SET time_zone = '$config[timezone]';");
$_c = $config;
// check if proxy setup in database
@ -108,7 +107,6 @@ try {
ORM::configure('password', $radius_pass, 'radius');
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), 'radius');
ORM::configure('return_result_sets', true, 'radius');
ORM::raw_execute("SET time_zone = '$config[timezone]';",[],'radius');
}
} catch (Throwable $e) {
$ui = new Smarty();

View File

@ -452,6 +452,7 @@ switch ($action) {
$d->code = $prefix.$code;
$d->user = '0';
$d->status = '0';
$d->generated_by = $admin['id'];
$d->save();
}

View File

@ -82,7 +82,6 @@ foreach ($result as $value) {
$config[$value['setting']] = $value['value'];
}
date_default_timezone_set($config['timezone']);
ORM::raw_execute("SET time_zone = '$config[timezone]';");
if (!empty($radius_user) && $config['radius_enable']) {
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius');
@ -90,7 +89,6 @@ if (!empty($radius_user) && $config['radius_enable']) {
ORM::configure('password', $radius_pass, 'radius');
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), 'radius');
ORM::configure('return_result_sets', true, 'radius');
ORM::raw_execute("SET time_zone = '$config[timezone]';",[],'radius');
}
echo "PHP Time\t" . date('Y-m-d H:i:s') . "\n";

View File

@ -81,7 +81,6 @@ foreach ($result as $value) {
$config[$value['setting']] = $value['value'];
}
date_default_timezone_set($config['timezone']);
ORM::raw_execute("SET time_zone = '$config[timezone]';");
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many();

View File

@ -41,5 +41,9 @@
],
"2024.1.11": [
"ALTER TABLE `tbl_plans` ADD `allow_purchase` ENUM('yes','no') DEFAULT 'yes' COMMENT 'allow to show package in buy package page' AFTER `enabled`;"
],
"2024.2.7": [
"ALTER TABLE `tbl_voucher` ADD `generated_by` INT NOT NULL DEFAULT '0' COMMENT 'id admin' AFTER `status`;",
"ALTER TABLE `tbl_users` ADD `root` INT NOT NULL DEFAULT '0' COMMENT 'for sub account' AFTER `id`;"
]
}