diff --git a/system/controllers/prepaid.php b/system/controllers/prepaid.php index 7efc6353..f08f8d33 100644 --- a/system/controllers/prepaid.php +++ b/system/controllers/prepaid.php @@ -393,6 +393,8 @@ switch ($action) { case 'voucher-post': $type = _post('type'); $plan = _post('plan'); + $voucher_format = _post('voucher_format'); + $prefix = _post('prefix'); $server = _post('server'); $numbervoucher = _post('numbervoucher'); $lengthcode = _post('lengthcode'); @@ -411,16 +413,16 @@ switch ($action) { run_hook('create_voucher'); #HOOK for ($i = 0; $i < $numbervoucher; $i++) { $code = strtoupper(substr(md5(time() . rand(10000, 99999)), 0, $lengthcode)); - if ($config['voucher_format'] == 'low') { + if ($voucher_format == 'low') { $code = strtolower($code); - } else if ($config['voucher_format'] == 'rand') { + } else if ($voucher_format == 'rand') { $code = Lang::randomUpLowCase($code); } $d = ORM::for_table('tbl_voucher')->create(); $d->type = $type; $d->routers = $server; $d->id_plan = $plan; - $d->code = $code; + $d->code = $prefix.$code; $d->user = '0'; $d->status = '0'; $d->save(); diff --git a/system/lan/english/common.lan.php b/system/lan/english/common.lan.php index 99ca4f10..fbe44906 100644 --- a/system/lan/english/common.lan.php +++ b/system/lan/english/common.lan.php @@ -417,3 +417,4 @@ $_L['Disable_Registration'] = 'Disable Registration'; $_L['Customer_just_Login_with_Phone_number_and_Voucher_Code_Voucher_will_be_password'] = 'Customer just Login with Phone number and Voucher Code, Voucher will be password'; $_L['Login__Activate_Voucher'] = 'Login / Activate Voucher'; $_L['After_Customer_activate_voucher_or_login_customer_will_be_redirected_to_this_url'] = 'After Customer activate voucher or login, customer will be redirected to this url'; +$_L['Voucher_Prefix'] = 'Voucher Prefix'; diff --git a/ui/ui/voucher-add.tpl b/ui/ui/voucher-add.tpl index 44798171..ca1caac3 100644 --- a/ui/ui/voucher-add.tpl +++ b/ui/ui/voucher-add.tpl @@ -31,21 +31,41 @@ -
- +
+ +
+ +
+

UPPERCASE lowercase RaNdoM

+
+
+ +
+ +
+

NUX-VoUCHeRCOdE

+
-