forked from kevinowino869/mitrobill
adjust language selector
This commit is contained in:
@ -241,25 +241,24 @@ switch ($action) {
|
|||||||
|
|
||||||
case 'language-update-post':
|
case 'language-update-post':
|
||||||
global $root_path;
|
global $root_path;
|
||||||
if (!empty($_POST['language'])) {
|
$selected_language = _req('lang', 'english');
|
||||||
$selected_language = $_POST['language'];
|
|
||||||
|
|
||||||
$_SESSION['user_language'] = $selected_language;
|
$_SESSION['user_language'] = $selected_language;
|
||||||
|
|
||||||
$lan_file = $root_path . File::pathFixer('system/lan/' . $selected_language . '.json');
|
$lan_file = $root_path . File::pathFixer('system/lan/' . $selected_language . '.json');
|
||||||
|
|
||||||
if (file_exists($lan_file)) {
|
if (file_exists($lan_file)) {
|
||||||
$_L = json_decode(file_get_contents($lan_file), true);
|
$_L = json_decode(file_get_contents($lan_file), true);
|
||||||
$_SESSION['Lang'] = $_L;
|
$_SESSION['Lang'] = $_L;
|
||||||
} else {
|
} else {
|
||||||
$_L['author'] = 'Auto Generated by iBNuX Script';
|
$_L['author'] = 'Auto Generated by iBNuX Script';
|
||||||
$_SESSION['Lang'] = $_L;
|
$_SESSION['Lang'] = $_L;
|
||||||
file_put_contents($lan_file, json_encode($_L));
|
file_put_contents($lan_file, json_encode($_L));
|
||||||
}
|
|
||||||
|
|
||||||
r2($_SERVER['HTTP_REFERER'], 's', Lang::T('Languge set to ' . $selected_language));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r2($_SERVER['HTTP_REFERER'], 's', ucwords($selected_language));
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -21,7 +21,7 @@ switch ($action) {
|
|||||||
$p = ORM::for_table('tbl_plans')->find_one($bill['plan_id']);
|
$p = ORM::for_table('tbl_plans')->find_one($bill['plan_id']);
|
||||||
$dvc = Package::getDevice($p);
|
$dvc = Package::getDevice($p);
|
||||||
if ($_app_stage != 'demo') {
|
if ($_app_stage != 'demo') {
|
||||||
try{
|
try {
|
||||||
if (file_exists($dvc)) {
|
if (file_exists($dvc)) {
|
||||||
require_once $dvc;
|
require_once $dvc;
|
||||||
if ((new $p['device'])->online_customer($user, $bill['routers'])) {
|
if ((new $p['device'])->online_customer($user, $bill['routers'])) {
|
||||||
@ -36,7 +36,7 @@ switch ($action) {
|
|||||||
} else {
|
} else {
|
||||||
die(Lang::T('-'));
|
die(Lang::T('-'));
|
||||||
}
|
}
|
||||||
}catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
die(Lang::T('Failed to connect to device'));
|
die(Lang::T('Failed to connect to device'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,14 +47,31 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
case 'inbox_unread':
|
case 'inbox_unread':
|
||||||
$count = ORM::for_table('tbl_customers_inbox')->where('customer_id', $user['id'])->whereRaw('date_read is null')->count('id');
|
$count = ORM::for_table('tbl_customers_inbox')->where('customer_id', $user['id'])->whereRaw('date_read is null')->count('id');
|
||||||
if($count>0){
|
if ($count > 0) {
|
||||||
echo $count;
|
echo $count;
|
||||||
}
|
}
|
||||||
die();
|
die();
|
||||||
case 'inbox':
|
case 'inbox':
|
||||||
$inboxs = ORM::for_table('tbl_customers_inbox')->selects(['id', 'subject', 'date_created'])->where('customer_id', $user['id'])->whereRaw('date_read is null')->order_by_desc('date_created')->limit(10)->find_many();
|
$inboxs = ORM::for_table('tbl_customers_inbox')->selects(['id', 'subject', 'date_created'])->where('customer_id', $user['id'])->whereRaw('date_read is null')->order_by_desc('date_created')->limit(10)->find_many();
|
||||||
foreach($inboxs as $inbox){
|
foreach ($inboxs as $inbox) {
|
||||||
echo '<li><a href="'.U.'mail/view/'.$inbox['id'].'">'.$inbox['subject'].'<br><sub class="text-muted">'.Lang::dateTimeFormat($inbox['date_created']).'</sub></a></li>';
|
echo '<li><a href="' . U . 'mail/view/' . $inbox['id'] . '">' . $inbox['subject'] . '<br><sub class="text-muted">' . Lang::dateTimeFormat($inbox['date_created']) . '</sub></a></li>';
|
||||||
|
}
|
||||||
|
die();
|
||||||
|
case 'language':
|
||||||
|
$select = _get('select');
|
||||||
|
$folders = [];
|
||||||
|
$files = scandir('system/lan/');
|
||||||
|
foreach ($files as $file) {
|
||||||
|
if (is_file('system/lan/' . $file) && !in_array($file, ['index.html', 'country.json', '.DS_Store'])) {
|
||||||
|
$file = str_replace(".json", "", $file);
|
||||||
|
if(!empty($file)){
|
||||||
|
echo '<li><a href="' . U . 'accounts/language-update-post&lang=' . $file. '">';
|
||||||
|
if($select == $file){
|
||||||
|
echo '<span class="glyphicon glyphicon-ok"></span> ';
|
||||||
|
}
|
||||||
|
echo ucwords($file) . '</a></li>';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
die();
|
die();
|
||||||
default:
|
default:
|
||||||
|
@ -723,5 +723,6 @@
|
|||||||
"Empty_this_to_use_internal_mail___PHP": "Empty this to use internal mail() PHP",
|
"Empty_this_to_use_internal_mail___PHP": "Empty this to use internal mail() PHP",
|
||||||
"Mail_Reply_To": "Mail Reply To",
|
"Mail_Reply_To": "Mail Reply To",
|
||||||
"Customer_will_reply_email_to_this_address__empty_if_you_want_to_use_From_Address": "Customer will reply email to this address, empty if you want to use From Address",
|
"Customer_will_reply_email_to_this_address__empty_if_you_want_to_use_From_Address": "Customer will reply email to this address, empty if you want to use From Address",
|
||||||
"You_will_get_Payment_and_Error_notification": "You will get Payment and Error notification"
|
"You_will_get_Payment_and_Error_notification": "You will get Payment and Error notification",
|
||||||
|
"Languge_set_to_english": "Bahasa diatur ke bahasa Inggris"
|
||||||
}
|
}
|
@ -567,5 +567,6 @@
|
|||||||
"Hotspot_Auth_Method": "Metode Otentikasi Hotspot",
|
"Hotspot_Auth_Method": "Metode Otentikasi Hotspot",
|
||||||
"Api": "Api",
|
"Api": "Api",
|
||||||
"Http_Chap": "Http-Bab",
|
"Http_Chap": "Http-Bab",
|
||||||
"Hotspot_Authentication_Method__Make_sure_you_have_changed_your_hotspot_login_page_": "Metode Otentikasi Hotspot. Pastikan Anda telah mengubah halaman login hotspot Anda."
|
"Hotspot_Authentication_Method__Make_sure_you_have_changed_your_hotspot_login_page_": "Metode Otentikasi Hotspot. Pastikan Anda telah mengubah halaman login hotspot Anda.",
|
||||||
|
"Languge_set_to_indonesia": "Language set to indonesia"
|
||||||
}
|
}
|
@ -373,5 +373,6 @@
|
|||||||
"Hotspot": "Hotspot",
|
"Hotspot": "Hotspot",
|
||||||
"Monthly_Registered_Customers": "Monthly Registered Customers",
|
"Monthly_Registered_Customers": "Monthly Registered Customers",
|
||||||
"Total_Monthly_Sales": "Total Monthly Sales",
|
"Total_Monthly_Sales": "Total Monthly Sales",
|
||||||
"Active_Users": "Active Users"
|
"Active_Users": "Active Users",
|
||||||
|
"Languge_set_to_spanish": "Bahasa disetel ke bahasa Spanyol"
|
||||||
}
|
}
|
@ -98,52 +98,20 @@
|
|||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="dropdown tasks-menu">
|
<li class="dropdown tasks-menu">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
|
||||||
<i class="fa fa-flag-o"></i> <span class="d-none d-sm-inline">Language</span>
|
<i class="fa fa-flag-o"></i> <span class="d-none d-sm-inline">{ucwords($user_language)}</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<form method="post" action="{$app_url}accounts/language-update-post">
|
<li>
|
||||||
<li
|
<!-- inner menu: contains the actual data -->
|
||||||
class="dropdown-item">
|
<ul class="menu" api-get-text="{$_url}autoload_user/language&select={$user_language}"></ul>
|
||||||
<button class="btn btn-block btn-{if $user_language == 'english'}success {else}primary{/if} btn-xs" type="submit" name="language"
|
</li>
|
||||||
value="english">
|
|
||||||
{Lang::T('English')}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
<li
|
|
||||||
class="dropdown-item">
|
|
||||||
<button class="btn btn-block btn-{if $user_language == 'indonesia'}success {else}primary{/if} btn-xs" type="submit" name="language"
|
|
||||||
value="indonesia">
|
|
||||||
{Lang::T('Indonesian')}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
<li
|
|
||||||
class="dropdown-item">
|
|
||||||
<button class="btn btn-block btn-{if $user_language == 'spanish'}success {else}primary{/if} btn-xs" type="submit" name="language"
|
|
||||||
value="spanish">
|
|
||||||
{Lang::T('Spanish')}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
<li
|
|
||||||
class="dropdown-item">
|
|
||||||
<button class="btn btn-block btn-{if $user_language == 'arabic'}success {else}primary{/if} btn-xs" type="submit" name="language"
|
|
||||||
value="arabic">
|
|
||||||
{Lang::T('Arabic')}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
<li
|
|
||||||
class="dropdown-item">
|
|
||||||
<button class="btn btn-block btn-{if $user_language == 'turkish'}success {else}primary{/if} btn-xs" type="submit" name="language"
|
|
||||||
value="turkish">
|
|
||||||
{Lang::T('Turkish')}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
</form>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown notifications-menu">
|
<li class="dropdown notifications-menu">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
||||||
<i class="fa fa-envelope-o"></i>
|
<i class="fa fa-envelope-o"></i>
|
||||||
<span class="label label-warning" api-get-text="{$_url}autoload_user/inbox_unread"></span>
|
<span class="label label-warning"
|
||||||
|
api-get-text="{$_url}autoload_user/inbox_unread"></span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li>
|
<li>
|
||||||
|
Reference in New Issue
Block a user