2022-09-06 10:31:33 +07:00
|
|
|
{include file="sections/header.tpl"}
|
|
|
|
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12 col-md-12">
|
|
|
|
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
2024-02-13 13:54:01 +07:00
|
|
|
<div class="panel-heading">{Lang::T('Add Service Plan')}</div>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="panel-body">
|
|
|
|
<form class="form-horizontal" method="post" role="form" action="{$_url}services/add-post">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-md-2 control-label">{Lang::T('Status')}</label>
|
|
|
|
<div class="col-md-10">
|
2024-01-11 15:56:43 +07:00
|
|
|
<input type="radio" name="enabled" value="1" checked> Enable
|
|
|
|
<input type="radio" name="enabled" value="0"> Disable
|
2023-10-02 17:18:18 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-11 01:00:34 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-md-2 control-label">{Lang::T('Client Can Purchase')}</label>
|
|
|
|
<div class="col-md-10">
|
2024-01-11 15:56:43 +07:00
|
|
|
<input type="radio" name="allow_purchase" value="yes" checked> Yes
|
|
|
|
<input type="radio" name="allow_purchase" value="no"> No
|
2024-01-11 01:00:34 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-10-03 15:46:55 +07:00
|
|
|
{if $_c['radius_enable']}
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-md-2 control-label">Radius</label>
|
2023-10-04 11:37:32 +07:00
|
|
|
<div class="col-md-6">
|
2023-10-02 17:18:18 +07:00
|
|
|
<label class="radio-inline">
|
|
|
|
<input type="checkbox" name="radius" onclick="isRadius(this)" value="1"> Radius Plan
|
|
|
|
</label>
|
2022-09-08 10:43:46 +07:00
|
|
|
</div>
|
2023-10-04 11:37:32 +07:00
|
|
|
<p class="help-block col-md-4">{Lang::T('Cannot be change after saved')}</p>
|
2023-10-02 17:18:18 +07:00
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
<div class="form-group">
|
2024-02-13 13:54:01 +07:00
|
|
|
<label class="col-md-2 control-label">{Lang::T('Plan Name')}</label>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-6">
|
|
|
|
<input type="text" class="form-control" id="name" name="name" maxlength="40">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2024-02-13 13:54:01 +07:00
|
|
|
<label class="col-md-2 control-label">{Lang::T('Plan Type')}</label>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-10">
|
|
|
|
<input type="radio" id="Unlimited" name="typebp" value="Unlimited" checked>
|
2024-02-13 13:54:01 +07:00
|
|
|
{Lang::T('Unlimited')}
|
|
|
|
<input type="radio" id="Limited" name="typebp" value="Limited"> {Lang::T('Limited')}
|
2023-10-02 17:18:18 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display:none;" id="Type">
|
|
|
|
<div class="form-group">
|
2024-02-13 13:54:01 +07:00
|
|
|
<label class="col-md-2 control-label">{Lang::T('Limit Type')}</label>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-10">
|
|
|
|
<input type="radio" id="Time_Limit" name="limit_type" value="Time_Limit" checked>
|
2024-02-13 13:54:01 +07:00
|
|
|
{Lang::T('Time Limit')}
|
2023-10-02 17:18:18 +07:00
|
|
|
<input type="radio" id="Data_Limit" name="limit_type" value="Data_Limit">
|
2024-02-13 13:54:01 +07:00
|
|
|
{Lang::T('Data Limit')}
|
2023-10-02 17:18:18 +07:00
|
|
|
<input type="radio" id="Both_Limit" name="limit_type" value="Both_Limit">
|
2024-02-13 13:54:01 +07:00
|
|
|
{Lang::T('Both Limit')}
|
2022-09-08 10:43:46 +07:00
|
|
|
</div>
|
2023-10-02 17:18:18 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display:none;" id="TimeLimit">
|
|
|
|
<div class="form-group">
|
2024-02-13 13:54:01 +07:00
|
|
|
<label class="col-md-2 control-label">{Lang::T('Time Limit')}</label>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-4">
|
|
|
|
<input type="text" class="form-control" id="time_limit" name="time_limit" value="0">
|
2022-09-08 10:43:46 +07:00
|
|
|
</div>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-2">
|
|
|
|
<select class="form-control" id="time_unit" name="time_unit">
|
2024-02-13 13:54:01 +07:00
|
|
|
<option value="Hrs">{Lang::T('Hrs')}</option>
|
|
|
|
<option value="Mins">{Lang::T('Mins')}</option>
|
2023-10-02 17:18:18 +07:00
|
|
|
</select>
|
2022-09-08 10:43:46 +07:00
|
|
|
</div>
|
2023-10-02 17:18:18 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display:none;" id="DataLimit">
|
|
|
|
<div class="form-group">
|
2024-02-13 13:54:01 +07:00
|
|
|
<label class="col-md-2 control-label">{Lang::T('Data Limit')}</label>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-4">
|
|
|
|
<input type="text" class="form-control" id="data_limit" name="data_limit" value="0">
|
2022-09-08 10:43:46 +07:00
|
|
|
</div>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-2">
|
|
|
|
<select class="form-control" id="data_unit" name="data_unit">
|
|
|
|
<option value="MB">MBs</option>
|
|
|
|
<option value="GB">GBs</option>
|
|
|
|
</select>
|
2022-09-08 10:43:46 +07:00
|
|
|
</div>
|
2023-10-02 17:18:18 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-md-2 control-label"><a
|
2024-02-13 13:54:01 +07:00
|
|
|
href="{$_url}bandwidth/add">{Lang::T('Bandwidth Name')}</a></label>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-6">
|
|
|
|
<select id="id_bw" name="id_bw" class="form-control select2">
|
2024-02-13 13:54:01 +07:00
|
|
|
<option value="">{Lang::T('Select Bandwidth')}...</option>
|
2023-10-02 17:18:18 +07:00
|
|
|
{foreach $d as $ds}
|
|
|
|
<option value="{$ds['id']}">{$ds['name_bw']}</option>
|
|
|
|
{/foreach}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2024-02-13 13:54:01 +07:00
|
|
|
<label class="col-md-2 control-label">{Lang::T('Plan Price')}</label>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="input-group">
|
|
|
|
<span class="input-group-addon">{$_c['currency_code']}</span>
|
|
|
|
<input type="number" class="form-control" name="price" required>
|
2022-09-08 10:43:46 +07:00
|
|
|
</div>
|
2023-10-02 17:18:18 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2024-02-13 13:54:01 +07:00
|
|
|
<label class="col-md-2 control-label">{Lang::T('Shared Users')}</label>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-6">
|
|
|
|
<input type="text" class="form-control" id="sharedusers" name="sharedusers" value="1">
|
|
|
|
<p class="help-block">{Lang::T('1 user can be used for many devices?')}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2024-02-13 13:54:01 +07:00
|
|
|
<label class="col-md-2 control-label">{Lang::T('Plan Validity')}</label>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-4">
|
|
|
|
<input type="text" class="form-control" id="validity" name="validity">
|
|
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
|
|
<select class="form-control" id="validity_unit" name="validity_unit">
|
2024-02-13 13:54:01 +07:00
|
|
|
<option value="Mins" {if $d['validity_unit'] eq 'Mins'} selected {/if}>{Lang::T('Mins')}
|
2023-10-02 17:18:18 +07:00
|
|
|
</option>
|
2024-02-13 13:54:01 +07:00
|
|
|
<option value="Hrs" {if $d['validity_unit'] eq 'Hrs'} selected {/if}>{Lang::T('Hrs')}
|
2023-10-02 17:18:18 +07:00
|
|
|
</option>
|
2024-02-13 13:54:01 +07:00
|
|
|
<option value="Days" {if $d['validity_unit'] eq 'Days'} selected {/if}>{Lang::T('Days')}
|
2023-10-02 17:18:18 +07:00
|
|
|
</option>
|
|
|
|
<option value="Months" {if $d['validity_unit'] eq 'Months'} selected {/if}>
|
2024-02-13 13:54:01 +07:00
|
|
|
{Lang::T('Months')}</option>
|
2023-10-02 17:18:18 +07:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span id="routerChoose" class="">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-md-2 control-label"><a
|
2024-02-13 13:54:01 +07:00
|
|
|
href="{$_url}routers/add">{Lang::T('Router Name')}</a></label>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="col-md-6">
|
|
|
|
<select id="routers" name="routers" required class="form-control select2">
|
2024-02-13 13:54:01 +07:00
|
|
|
<option value=''>{Lang::T('Select Routers')}</option>
|
2023-10-02 17:18:18 +07:00
|
|
|
{foreach $r as $rs}
|
|
|
|
<option value="{$rs['name']}">{$rs['name']}</option>
|
|
|
|
{/foreach}
|
|
|
|
</select>
|
|
|
|
<p class="help-block">{Lang::T('Cannot be change after saved')}</p>
|
2022-09-08 10:43:46 +07:00
|
|
|
</div>
|
2023-10-02 17:18:18 +07:00
|
|
|
</div>
|
|
|
|
</span>
|
2023-10-16 10:25:15 +07:00
|
|
|
<div class="form-group">
|
2024-02-19 18:03:40 +07:00
|
|
|
<label class="col-md-2 control-label">{Lang::T('Expired Action')}</label>
|
|
|
|
<div class="col-md-10">
|
|
|
|
<label><input type="radio" onclick="setExp(1)" checked name="exp_act" value="pool"> IP
|
|
|
|
Pool</label>
|
|
|
|
|
|
|
|
<label><input type="radio" onclick="setExp(2)" name="exp_act" value="list"> Address
|
|
|
|
List</label>
|
|
|
|
|
|
|
|
<label><input type="radio" onclick="setExp(0)" name="exp_act" value="none">
|
|
|
|
None</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group" id="ipPool">
|
2023-10-16 10:25:15 +07:00
|
|
|
<label class="col-md-2 control-label"><a
|
|
|
|
href="{$_url}pool/add">{Lang::T('Expired IP Pool')}</a></label>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<select id="pool_expired" name="pool_expired" class="form-control select2">
|
2024-02-13 13:54:01 +07:00
|
|
|
<option value=''>{Lang::T('Select Pool')}</option>
|
2023-10-16 10:25:15 +07:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-02-19 18:03:40 +07:00
|
|
|
<div class="form-group hidden" id="AddressList">
|
|
|
|
<label class="col-md-2 control-label">{Lang::T('Address List')}</label>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<input type="text" class="form-control" name="list_expired" id="list_expired">
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-10-02 17:18:18 +07:00
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-offset-2 col-md-10">
|
|
|
|
<button class="btn btn-success waves-effect waves-light"
|
2024-02-13 13:54:01 +07:00
|
|
|
type="submit">{Lang::T('Save Changes')}</button>
|
|
|
|
Or <a href="{$_url}services/hotspot">{Lang::T('Cancel')}</a>
|
2023-10-02 17:18:18 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-10-04 11:37:32 +07:00
|
|
|
{if $_c['radius_enable']}
|
|
|
|
{literal}
|
|
|
|
<script>
|
|
|
|
function isRadius(cek) {
|
|
|
|
if (cek.checked) {
|
|
|
|
$("#routerChoose").addClass('hidden');
|
|
|
|
document.getElementById("routers").required = false;
|
2024-01-16 09:39:20 +07:00
|
|
|
$("#pool_expired").html('');
|
|
|
|
$.ajax({
|
|
|
|
url: "index.php?_route=autoload/pool",
|
|
|
|
data: "routers=radius",
|
|
|
|
cache: false,
|
|
|
|
success: function(msg) {
|
|
|
|
$("#pool_expired").html(msg);
|
|
|
|
}
|
|
|
|
});
|
2023-10-04 11:37:32 +07:00
|
|
|
} else {
|
|
|
|
document.getElementById("routers").required = true;
|
|
|
|
$("#routerChoose").removeClass('hidden');
|
|
|
|
}
|
|
|
|
}
|
2024-02-19 18:03:40 +07:00
|
|
|
|
|
|
|
function setExp(vl) {
|
|
|
|
if (vl == 1) {
|
|
|
|
$('#list_expired').val('');
|
|
|
|
$('#ipPool').removeClass('hidden');
|
|
|
|
$('#AddressList').addClass('hidden');
|
|
|
|
} else if (vl == 2) {
|
|
|
|
$('#pool_expired').prop('selectedIndex', 0);
|
|
|
|
$('#ipPool').addClass('hidden');
|
|
|
|
$('#AddressList').removeClass('hidden');
|
|
|
|
} else {
|
|
|
|
$('#pool_expired').prop('selectedIndex', 0);
|
|
|
|
$('#list_expired').val('');
|
|
|
|
$('#ipPool').addClass('hidden');
|
|
|
|
$('#AddressList').addClass('hidden');
|
|
|
|
}
|
|
|
|
}
|
2023-10-04 11:37:32 +07:00
|
|
|
</script>
|
|
|
|
{/literal}
|
|
|
|
{/if}
|
2022-09-06 10:31:33 +07:00
|
|
|
|
2024-02-19 18:03:40 +07:00
|
|
|
{include file="sections/footer.tpl"}
|