Refill Balance From admin
This commit is contained in:
parent
d682d20035
commit
0dd4e39c8f
@ -72,8 +72,6 @@ switch ($action) {
|
||||
$type = _post('type');
|
||||
$server = _post('server');
|
||||
$plan = _post('plan');
|
||||
|
||||
$date_now = date("Y-m-d H:i:s");
|
||||
$date_only = date("Y-m-d");
|
||||
$time = date("H:i:s");
|
||||
|
||||
@ -83,212 +81,27 @@ switch ($action) {
|
||||
}
|
||||
|
||||
if ($msg == '') {
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $plan)->where('enabled', '1')->find_one();
|
||||
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
|
||||
|
||||
$mikrotik = Mikrotik::info($server);
|
||||
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(Package::rechargeUser($id_customer, $server, $plan, "Recharge", $admin['fullname'])){
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
||||
$ui->assign('in', $in);
|
||||
$ui->assign('date', date("Y-m-d H:i:s"));
|
||||
$ui->display('invoice.tpl');
|
||||
}else{
|
||||
r2(U . 'prepaid/recharge', 'e', "Failed to recharge account");
|
||||
}
|
||||
run_hook('recharge_customer'); #HOOK
|
||||
if ($type == 'Hotspot') {
|
||||
if ($b) {
|
||||
if(!$config['radius_mode']){
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::removeHotspotUser($client,$c['username']);
|
||||
Mikrotik::addHotspotUser($client,$p,$c);
|
||||
}
|
||||
|
||||
$b->customer_id = $id_customer;
|
||||
$b->username = $c['username'];
|
||||
$b->plan_id = $plan;
|
||||
$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 = $server;
|
||||
$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 = $server;
|
||||
$t->type = "Hotspot";
|
||||
$t->save();
|
||||
} else {
|
||||
if(!$config['radius_mode']){
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::addHotspotUser($client,$p,$c);
|
||||
}
|
||||
|
||||
$d = ORM::for_table('tbl_user_recharges')->create();
|
||||
$d->customer_id = $id_customer;
|
||||
$d->username = $c['username'];
|
||||
$d->plan_id = $plan;
|
||||
$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 = $server;
|
||||
$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 = $server;
|
||||
$t->type = "Hotspot";
|
||||
$t->save();
|
||||
}
|
||||
Message::sendTelegram( "$admin[fullname] #Recharge Voucher #Hotspot for #u$c[username]\n".$p['name_plan'].
|
||||
"\nRouter: ".$server.
|
||||
"\nPrice: ".$p['price']);
|
||||
} else {
|
||||
|
||||
if ($b) {
|
||||
if(!$config['radius_mode']){
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::removePpoeUser($client,$c['username']);
|
||||
Mikrotik::addPpoeUser($client,$p,$c);
|
||||
}
|
||||
|
||||
$b->customer_id = $id_customer;
|
||||
$b->username = $c['username'];
|
||||
$b->plan_id = $plan;
|
||||
$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 = $server;
|
||||
$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 = $server;
|
||||
$t->type = "PPPOE";
|
||||
$t->save();
|
||||
} else {
|
||||
if(!$config['radius_mode']){
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::addPpoeUser($client,$p,$c);
|
||||
}
|
||||
|
||||
$d = ORM::for_table('tbl_user_recharges')->create();
|
||||
$d->customer_id = $id_customer;
|
||||
$d->username = $c['username'];
|
||||
$d->plan_id = $plan;
|
||||
$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 = $server;
|
||||
$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 = $server;
|
||||
$t->type = "PPPOE";
|
||||
$t->save();
|
||||
}
|
||||
Message::sendTelegram( "$admin[fullname] #Recharge Voucher #PPPOE for #u$c[username]\n".$p['name_plan'].
|
||||
"\nRouter: ".$server.
|
||||
"\nPrice: ".$p['price']);
|
||||
}
|
||||
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
||||
$ui->assign('in', $in);
|
||||
|
||||
$msg = "*$config[CompanyName]*\n".
|
||||
"$config[address]\n".
|
||||
"$config[phone]\n".
|
||||
"\n\n".
|
||||
"INVOICE: *$in[invoice]*\n".
|
||||
"$_L[Date] : $date_now\n".
|
||||
"$_L[Sales] : $admin[fullname]\n".
|
||||
"\n\n".
|
||||
"$_L[Type] : *$in[type]*\n".
|
||||
"$_L[Plan_Name] : *$in[plan_name]*\n".
|
||||
"$_L[Plan_Price] : *$config[currency_code] ".number_format($in['price'],2,$config['dec_point'],$config['thousands_sep'])."*\n\n".
|
||||
"$_L[Username] : *$in[username]*\n".
|
||||
"$_L[Password] : **********\n\n".
|
||||
"$_L[Created_On] :\n*".date($config['date_format'], strtotime($in['recharged_on']))."*\n".
|
||||
"$_L[Expires_On] :\n*".date($config['date_format'], strtotime($in['expiration']))." $in[time]*\n".
|
||||
"\n\n".
|
||||
"$config[note]";
|
||||
|
||||
if ($_c['user_notification_payment'] == 'sms') {
|
||||
Message::sendSMS($c['phonenumber'], $msg);
|
||||
} else if ($_c['user_notification_payment'] == 'wa') {
|
||||
Message::sendWhatsapp($c['phonenumber'], $msg);
|
||||
}
|
||||
|
||||
$ui->assign('date', $date_now);
|
||||
$ui->display('invoice.tpl');
|
||||
} else {
|
||||
r2(U . 'prepaid/recharge', 'e', $msg);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'print':
|
||||
$date_now = date("Y-m-d H:i:s");
|
||||
$id = _post('id');
|
||||
|
||||
$d = ORM::for_table('tbl_transactions')->where('id', $id)->find_one();
|
||||
$ui->assign('d', $d);
|
||||
|
||||
$ui->assign('date', $date_now);
|
||||
$ui->assign('date', date("Y-m-d H:i:s"));
|
||||
run_hook('print_invoice'); #HOOK
|
||||
$ui->display('invoice-print.tpl');
|
||||
break;
|
||||
@ -526,7 +339,7 @@ switch ($action) {
|
||||
|
||||
case 'refill':
|
||||
$ui->assign('xfooter', '<script type="text/javascript" src="ui/ui/scripts/form-elements.init.js"></script>');
|
||||
|
||||
$ui->assign('_title', $_L['Refill_Account']);
|
||||
$c = ORM::for_table('tbl_customers')->find_many();
|
||||
$ui->assign('c', $c);
|
||||
run_hook('view_refill'); #HOOK
|
||||
@ -540,221 +353,50 @@ switch ($action) {
|
||||
|
||||
$v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one();
|
||||
|
||||
$c = ORM::for_table('tbl_customers')->find_one($user);
|
||||
$p = ORM::for_table('tbl_plans')->find_one($v1['id_plan']);
|
||||
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $user)->find_one();
|
||||
|
||||
$date_now = date("Y-m-d H:i:s");
|
||||
$date_only = date("Y-m-d");
|
||||
$time = date("H:i:s");
|
||||
|
||||
$mikrotik = Mikrotik::info($v1['routers']);
|
||||
|
||||
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];
|
||||
}
|
||||
run_hook('refill_customer'); #HOOK
|
||||
if ($v1) {
|
||||
if ($v1['type'] == 'Hotspot') {
|
||||
if ($b) {
|
||||
if(!$config['radius_mode']){
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::removeHotspotUser($client,$c['username']);
|
||||
Mikrotik::addHotspotUser($client,$p,$c);
|
||||
}
|
||||
|
||||
$b->customer_id = $user;
|
||||
$b->username = $c['username'];
|
||||
$b->plan_id = $v1['id_plan'];
|
||||
$b->namebp = $p['name_plan'];
|
||||
$b->recharged_on = $date_only;
|
||||
$b->expiration = $date_exp;
|
||||
$b->time = $time;
|
||||
$b->status = "on";
|
||||
$b->method = "voucher";
|
||||
$b->routers = $v1['routers'];
|
||||
$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 = "voucher";
|
||||
$t->routers = $v1['routers'];
|
||||
$t->type = "Hotspot";
|
||||
$t->save();
|
||||
} else {
|
||||
if(!$config['radius_mode']){
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::addHotspotUser($client,$p,$c);
|
||||
}
|
||||
|
||||
$d = ORM::for_table('tbl_user_recharges')->create();
|
||||
$d->customer_id = $user;
|
||||
$d->username = $c['username'];
|
||||
$d->plan_id = $v1['id_plan'];
|
||||
$d->namebp = $p['name_plan'];
|
||||
$d->recharged_on = $date_only;
|
||||
$d->expiration = $date_exp;
|
||||
$d->time = $time;
|
||||
$d->status = "on";
|
||||
$d->method = "voucher";
|
||||
$d->routers = $v1['routers'];
|
||||
$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 = "voucher";
|
||||
$t->routers = $v1['routers'];
|
||||
$t->type = "Hotspot";
|
||||
$t->save();
|
||||
}
|
||||
|
||||
if(Package::rechargeUser($user, $v1['routers'], $v1['id_plan'], "Refill", "Voucher")){
|
||||
$v1->status = "1";
|
||||
$v1->user = $c['username'];
|
||||
$v1->save();
|
||||
|
||||
Message::sendTelegram( "$admin[fullname] #Refill #Voucher #Hotspot for #u$c[username]\n".$p['name_plan'].
|
||||
"\nCode: ".$code.
|
||||
"\nRouter: ".$v1['routers'].
|
||||
"\nPrice: ".$p['price']);
|
||||
} else {
|
||||
if ($b) {
|
||||
if(!$config['radius_mode']){
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::removePpoeUser($client,$c['username']);
|
||||
Mikrotik::addPpoeUser($client,$p,$c);
|
||||
}
|
||||
|
||||
$b->customer_id = $user;
|
||||
$b->username = $c['username'];
|
||||
$b->plan_id = $v1['id_plan'];
|
||||
$b->namebp = $p['name_plan'];
|
||||
$b->recharged_on = $date_only;
|
||||
$b->expiration = $date_exp;
|
||||
$b->time = $time;
|
||||
$b->status = "on";
|
||||
$b->method = "voucher";
|
||||
$b->routers = $v1['routers'];
|
||||
$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 = "voucher";
|
||||
$t->routers = $v1['routers'];
|
||||
$t->type = "PPPOE";
|
||||
$t->save();
|
||||
} else {
|
||||
if(!$config['radius_mode']){
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::addPpoeUser($client,$p,$c);
|
||||
}
|
||||
|
||||
$d = ORM::for_table('tbl_user_recharges')->create();
|
||||
$d->customer_id = $user;
|
||||
$d->username = $c['username'];
|
||||
$d->plan_id = $v1['id_plan'];
|
||||
$d->namebp = $p['name_plan'];
|
||||
$d->recharged_on = $date_only;
|
||||
$d->expiration = $date_exp;
|
||||
$d->time = $time;
|
||||
$d->status = "on";
|
||||
$d->method = "voucher";
|
||||
$d->routers = $v1['routers'];
|
||||
$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 = "voucher";
|
||||
$t->routers = $v1['routers'];
|
||||
$t->type = "PPPOE";
|
||||
$t->save();
|
||||
}
|
||||
|
||||
$v1->status = "1";
|
||||
$v1->user = $c['username'];
|
||||
$v1->save();
|
||||
|
||||
|
||||
Message::sendTelegram( "$admin[fullname] Refill #Voucher #PPPOE for #u$c[username]\n".$p['name_plan'].
|
||||
"\nCode: ".$code.
|
||||
"\nRouter: ".$v1['routers'].
|
||||
"\nPrice: ".$p['price']);
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
||||
$ui->assign('in', $in);
|
||||
$ui->assign('date', date("Y-m-d H:i:s"));
|
||||
$ui->display('invoice.tpl');
|
||||
}else{
|
||||
r2(U . 'prepaid/refill', 'e', "Failed to refill account");
|
||||
}
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
||||
$ui->assign('in', $in);
|
||||
|
||||
|
||||
$msg = "*$config[CompanyName]*\n".
|
||||
"$config[address]\n".
|
||||
"$config[phone]\n".
|
||||
"\n\n".
|
||||
"INVOICE: *$in[invoice]*\n".
|
||||
"$_L[Date] : $date_now\n".
|
||||
"$_L[Sales] : $admin[fullname]\n".
|
||||
"\n\n".
|
||||
"$_L[Type] : *$in[type]*\n".
|
||||
"$_L[Plan_Name] : *$in[plan_name]*\n".
|
||||
"$_L[Plan_Price] : *$config[currency_code] ".number_format($in['price'],2,$config['dec_point'],$config['thousands_sep'])."*\n\n".
|
||||
"$_L[Username] : *$in[username]*\n".
|
||||
"$_L[Password] : **********\n\n".
|
||||
"$_L[Created_On] :\n*".date($config['date_format'], strtotime($in['recharged_on']))."*\n".
|
||||
"$_L[Expires_On] :\n*".date($config['date_format'], strtotime($in['expiration']))." $in[time]*\n".
|
||||
"\n\n".
|
||||
"$config[note]";
|
||||
|
||||
if ($_c['user_notification_payment'] == 'sms') {
|
||||
Message::sendSMS($c['phonenumber'], $msg);
|
||||
} else if ($_c['user_notification_payment'] == 'wa') {
|
||||
Message::sendWhatsapp($c['phonenumber'], $msg);
|
||||
}
|
||||
$ui->assign('date', $date_now);
|
||||
$ui->display('invoice.tpl');
|
||||
} else {
|
||||
r2(U . 'prepaid/refill', 'e', $_L['Voucher_Not_Valid']);
|
||||
}
|
||||
break;
|
||||
case 'deposit':
|
||||
$ui->assign('_title', Lang::T('Refill Balance'));
|
||||
$ui->assign('c', ORM::for_table('tbl_customers')->find_many());
|
||||
$ui->assign('p', ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->find_many());
|
||||
run_hook('view_deposit'); #HOOK
|
||||
$ui->display('deposit.tpl');
|
||||
break;
|
||||
case 'deposit-post':
|
||||
$user = _post('id_customer');
|
||||
$plan = _post('id_plan');
|
||||
|
||||
run_hook('deposit_customer'); #HOOK
|
||||
if (!empty($user) && !empty($plan)) {
|
||||
if(Package::rechargeUser($user, 'balance', $plan, "Deposit", $admin['fullname'])){
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $user)->find_one();
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
||||
$ui->assign('in', $in);
|
||||
$ui->assign('date', date("Y-m-d H:i:s"));
|
||||
$ui->display('invoice.tpl');
|
||||
}else{
|
||||
r2(U . 'prepaid/refill', 'e', "Failed to refill account");
|
||||
}
|
||||
} else {
|
||||
r2(U . 'prepaid/refill', 'e', "All field is required");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo 'action not defined';
|
||||
}
|
||||
|
@ -363,3 +363,4 @@ $_L['Disable_auto_renewal'] = 'Disable auto renewal?';
|
||||
$_L['Auto_Renewal_On'] = 'Auto Renewal On';
|
||||
$_L['Enable_auto_renewal'] = 'Enable auto renewal?';
|
||||
$_L['Auto_Renewal_Off'] = 'Auto Renewal Off';
|
||||
$_L['Refill_Balance'] = 'Refill Balance';
|
||||
|
47
ui/ui/deposit.tpl
Normal file
47
ui/ui/deposit.tpl
Normal file
@ -0,0 +1,47 @@
|
||||
{include file="sections/header.tpl"}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Refill Balance')}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}prepaid/deposit-post">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{$_L['Select_Account']}</label>
|
||||
<div class="col-md-6">
|
||||
<select id="personSelect" class="form-control" name="id_customer" style="width: 100%"
|
||||
data-placeholder="{$_L['Select_Customer']}...">
|
||||
<option></option>
|
||||
{foreach $c as $cs}
|
||||
<option value="{$cs['id']}">{$cs['username']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{$_L['Service_Plan']}</label>
|
||||
<div class="col-md-6">
|
||||
<select id="planSelect" class="form-control" name="id_plan" style="width: 100%"
|
||||
data-placeholder="{$_L['Select_Plans']}...">
|
||||
<option></option>
|
||||
{foreach $p as $pl}
|
||||
<option value="{$pl['id']}">{$pl['name_plan']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-success waves-effect waves-light"
|
||||
type="submit">{$_L['Recharge']}</button>
|
||||
Or <a href="{$_url}customers/list">{$_L['Cancel']}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file="sections/footer.tpl"}
|
@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>{$_title}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@ -7,52 +8,55 @@
|
||||
<link href="ui/ui/styles/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="ui/ui/images/favicon.ico">
|
||||
|
||||
<script type="text/javascript">
|
||||
function printpage() {
|
||||
window.print();
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function printpage() {
|
||||
window.print();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body topmargin="0" leftmargin="0" onload="printpage()">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table width="200">
|
||||
<tr>
|
||||
<td>
|
||||
<fieldset>
|
||||
<center>
|
||||
<b>{$_c['CompanyName']}</b><br>
|
||||
{$_c['address']}<br>
|
||||
{$_c['phone']}<br>
|
||||
</center>
|
||||
============================================<br>
|
||||
INVOICE: <b>{$d['invoice']}</b> - {$_L['Date']} : {$date}<br>
|
||||
{$_L['Sales']} : {$_admin['fullname']}<br>
|
||||
============================================<br>
|
||||
{$_L['Type']} : <b>{$d['type']}</b><br>
|
||||
{$_L['Plan_Name']} : <b>{$d['plan_name']}</b><br>
|
||||
{$_L['Plan_Price']} : <b>{$_c['currency_code']} {number_format($d['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</b><br>
|
||||
<br>
|
||||
{$_L['Username']} : <b>{$d['username']}</b><br>
|
||||
{$_L['Password']} : **********<br>
|
||||
<br>
|
||||
{$_L['Created_On']} : <b>{date($_c['date_format'], strtotime($d['recharged_on']))}</b><br>
|
||||
{$_L['Expires_On']} : <b>{date($_c['date_format'], strtotime($d['expiration']))} {$d['time']}</b><br>
|
||||
============================================<br>
|
||||
<center>{$_c['note']}</center>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table width="200">
|
||||
<tr>
|
||||
<td>
|
||||
<fieldset>
|
||||
<center>
|
||||
<b>{$_c['CompanyName']}</b><br>
|
||||
{$_c['address']}<br>
|
||||
{$_c['phone']}<br>
|
||||
</center>
|
||||
============================================<br>
|
||||
INVOICE: <b>{$d['invoice']}</b> - {$_L['Date']} : {$date}<br>
|
||||
{$_L['Sales']} : {$_admin['fullname']}<br>
|
||||
============================================<br>
|
||||
{$_L['Type']} : <b>{$d['type']}</b><br>
|
||||
{$_L['Plan_Name']} : <b>{$d['plan_name']}</b><br>
|
||||
{$_L['Plan_Price']} : <b>{Lang::moneyFormat($in['price'])}</b><br>
|
||||
<br>
|
||||
{$_L['Username']} : <b>{$d['username']}</b><br>
|
||||
{$_L['Password']} : **********<br>
|
||||
{if $in['type'] != 'Balance'}
|
||||
<br>
|
||||
{$_L['Created_On']} : <b>{date($_c['date_format'], strtotime($d['recharged_on']))}</b><br>
|
||||
{$_L['Expires_On']} : <b>{date($_c['date_format'], strtotime($d['expiration']))}
|
||||
{$d['time']}</b><br>
|
||||
{/if}
|
||||
============================================
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="ui/ui/scripts/jquery-1.10.2.js"></script>
|
||||
<script src="ui/ui/scripts/bootstrap.min.js"></script>
|
||||
{if isset($xfooter)}
|
||||
{$xfooter}
|
||||
{/if}
|
||||
<script src="ui/ui/scripts/jquery-1.10.2.js"></script>
|
||||
<script src="ui/ui/scripts/bootstrap.min.js"></script>
|
||||
{if isset($xfooter)}
|
||||
{$xfooter}
|
||||
{/if}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
@ -1,48 +1,56 @@
|
||||
{include file="sections/header.tpl"}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="panel panel-hovered panel-primary panel-stacked mb30">
|
||||
<div class="panel-heading">PRINT INVOICE</div>
|
||||
<div class="panel-body">
|
||||
<div class="well">
|
||||
<fieldset>
|
||||
<center>
|
||||
<b>{$_c['CompanyName']}</b><br>
|
||||
{$_c['address']}<br>
|
||||
{$_c['phone']}<br>
|
||||
</center>
|
||||
====================================================<br>
|
||||
INVOICE: <b>{$in['invoice']}</b> - {$_L['Date']} : {$date}<br>
|
||||
{$_L['Sales']} : {$_admin['fullname']}<br>
|
||||
====================================================<br>
|
||||
{$_L['Type']} : <b>{$in['type']}</b><br>
|
||||
{$_L['Plan_Name']} : <b>{$in['plan_name']}</b><br>
|
||||
{$_L['Plan_Price']} : <b>{$_c['currency_code']} {number_format($in['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</b><br>
|
||||
<br>
|
||||
{$_L['Username']} : <b>{$in['username']}</b><br>
|
||||
{$_L['Password']} : **********<br>
|
||||
<br>
|
||||
{$_L['Created_On']} : <b>{date($_c['date_format'], strtotime($in['recharged_on']))}</b><br>
|
||||
{$_L['Expires_On']} : <b>{date($_c['date_format'], strtotime($in['expiration']))} {$in['time']}</b><br>
|
||||
=====================================================<br>
|
||||
<center>{$_c['note']}</center>
|
||||
</fieldset>
|
||||
</div>
|
||||
<form class="form-horizontal" method="post" action="{$_url}prepaid/print" target="_blank">
|
||||
<input type="hidden" name="id" value="{$in['id']}">
|
||||
<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-print"></i> {$_L['Click_Here_to_Print']}</button>
|
||||
<a href="{$_url}prepaid/list" class="btn btn-primary"><i class="ion-reply-all"></i>{$_L['Finish']}</a>
|
||||
</form>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="panel panel-hovered panel-primary panel-stacked mb30">
|
||||
<div class="panel-heading">PRINT INVOICE</div>
|
||||
<div class="panel-body">
|
||||
<div class="well">
|
||||
<fieldset>
|
||||
<center>
|
||||
<b>{$_c['CompanyName']}</b><br>
|
||||
{$_c['address']}<br>
|
||||
{$_c['phone']}<br>
|
||||
</center>
|
||||
====================================================<br>
|
||||
INVOICE: <b>{$in['invoice']}</b> - {$_L['Date']} : {$date}<br>
|
||||
{$_L['Sales']} : {$_admin['fullname']}<br>
|
||||
====================================================<br>
|
||||
{$_L['Type']} : <b>{$in['type']}</b><br>
|
||||
{$_L['Plan_Name']} : <b>{$in['plan_name']}</b><br>
|
||||
{$_L['Plan_Price']} : <b>{Lang::moneyFormat($in['price'])}</b><br>
|
||||
<br>
|
||||
{$_L['Username']} : <b>{$in['username']}</b><br>
|
||||
{$_L['Password']} : **********<br>
|
||||
{if $in['type'] != 'Balance'}
|
||||
<br>
|
||||
{$_L['Created_On']} : <b>{date($_c['date_format'], strtotime($in['recharged_on']))}</b><br>
|
||||
{$_L['Expires_On']} : <b>{date($_c['date_format'], strtotime($in['expiration']))}
|
||||
{$in['time']}</b><br>
|
||||
{/if}
|
||||
=====================================================
|
||||
</fieldset>
|
||||
</div>
|
||||
<form class="form-horizontal" method="post" action="{$_url}prepaid/print" target="_blank">
|
||||
<input type="hidden" name="id" value="{$in['id']}">
|
||||
<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-print"></i>
|
||||
{$_L['Click_Here_to_Print']}</button>
|
||||
<a href="{$_url}prepaid/list" class="btn btn-primary"><i
|
||||
class="ion-reply-all"></i>{$_L['Finish']}</a>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var s5_taf_parent = window.location;
|
||||
function popup_print() {
|
||||
window.open('print.php?page=<?php echo $_GET['act'];?>','page','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600,left=50,top=50,titlebar=yes')
|
||||
}
|
||||
var s5_taf_parent = window.location;
|
||||
|
||||
function popup_print() {
|
||||
window.open('print.php?page=<?php echo $_GET['
|
||||
act '];?>', 'page',
|
||||
'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600,left=50,top=50,titlebar=yes'
|
||||
)
|
||||
}
|
||||
</script>
|
||||
{include file="sections/footer.tpl"}
|
||||
{include file="sections/footer.tpl"}
|
@ -3,7 +3,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{$_L['Recharge_Account']}</div>
|
||||
<div class="panel-heading">{$_L['Refill_Account']}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}prepaid/refill-post">
|
||||
<div class="form-group">
|
||||
|
@ -139,6 +139,8 @@
|
||||
{/if}
|
||||
<li {if $_routes[1] eq 'recharge'}class="active" {/if}><a
|
||||
href="{$_url}prepaid/recharge">{$_L['Recharge_Account']}</a></li>
|
||||
<li {if $_routes[1] eq 'deposit'}class="active" {/if}><a
|
||||
href="{$_url}prepaid/deposit">{Lang::T('Refill Balance')}</a></li>
|
||||
{$_MENU_PREPAID}
|
||||
</ul>
|
||||
</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user