<script type="text/javascript" language="JavaScript">
//<![CDATA[
function adv_enab() {
    var checkbox = document.getElementById("adv");
    var i = document.getElementById("cos");
    i.disabled = !checkbox.checked;
}

function validateAndSubmitForm(form)
{
if (!checkString(form.elements["tariff_name"], "{TXT_TITLE}") ||
!checkFloat(form.elements["credit"], "{TXT_CREDIT}", true) ||
!checkFloat(form.elements["deposit"], "{TXT_DEPOSIT}", true) ||
!checkFloat(form.elements["fixed_sum"], "{TXT_FIXED_SUM}", true) ||
!checkFloat(form.elements["total_money_limit"], "{TXT_MONEY_L}", true) ||
!checkFloat(form.elements["month_money_limit"], "{TXT_MONEY_L}", true) ||
!checkFloat(form.elements["week_money_limit"], "{TXT_MONEY_L}", true) ||
!checkFloat(form.elements["day_money_limit"], "{TXT_MONEY_L}", true) ||
!checkNumbers(form.elements["activation_time"], "{TXT_ACTIVATION}", true) ||
!checkNumbers(form.elements["total_traffic_limit"], "{TXT_TRAFFIC_L}", true) ||
!checkNumbers(form.elements["month_traffic_limit"], "{TXT_TRAFFIC_L}", true) ||
!checkNumbers(form.elements["week_traffic_limit"], "{TXT_TRAFFIC_L}", true) ||
!checkNumbers(form.elements["day_traffic_limit"], "{TXT_TRAFFIC_L}", true) ||
!checkNumbers(form.elements["total_time_limit"], "{TXT_TIME_L}", true) ||
!checkNumbers(form.elements["month_time_limit"], "{TXT_TIME_L}", true) ||
!checkNumbers(form.elements["week_time_limit"], "{TXT_TIME_L}", true) ||
!checkNumbers(form.elements["day_time_limit"], "{TXT_TIME_L}", true) ||
!checkNumbers(form.elements["simultaneous_use"], "{TXT_SIMUL_USE}", true) ||
!checkNumbers(form.elements["port_limit"], "{TXT_SIMUL_PORT}", true) ||
!checkNumbers(form.elements["session_timeout"], "{TXT_TIME_SESSION}", true) ||
!checkNumbers(form.elements["up"], "{TXT_UP_SPEED}", true) ||
!checkNumbers(form.elements["down"], "{TXT_DOWN_SPEED}", true) ||
!checkNumbers(form.elements["idle_timeout"], "{TXT_TIME_IDLE}", true)

)
return false;
return form.submit();
}
//]]>
</script>
<form action="{VAL_FORMACTION}" method="post" name="calform">
 {HIDDEN_VARS}
<div class="card">
<div class="card-header">
</div>
<div class="card-body">
<div class="form-group">
  <div id="tabbed_form" class="simpleTabs" align="left">
    <ul class="simpleTabsNavigation">
      <li><a href="#">{TXT_GINFO}</a></li>
      <li><a href="#">{TXT_CINFO}</a></li>
      <li><a href="#">{TXT_AINFO}</a></li>
    </ul>
  <div class="simpleTabsContent"> 

<label class="form-label" for="tariff_name">
{TXT_TITLE}&nbsp;*
</label>
<input class="form-input" type="text" name="tariff_name" id="tariff_name" value="{VAL_TARIFF_NAME}" required placeholder="{TXT_TITLE}" />
<label class="form-label">
{TXT_SSID}
</label>
{VAL_SSID_COMBO}
<label class="form-label">
{TXT_BILL_FOR}
</label>
{TXT_TOS}
<label class="form-label">
{TXT_BILL_TRAF}
</label>
{TXT_DIR}
<label class="form-label">
{TXT_BILL_MONEY}
</label>
{TXT_DO_WITH_TOS}
<label class="form-label">
{TXT_BILL_FIXED}
</label>
{TXT_FIXED_ACT}
<label class="form-label" for="fixed_cost">
{TXT_FIXED_SUM}
</label>
<input class="form-input" type="text" name="fixed_cost" id="fixed_cost" value="{VAL_FIXED_COST}" placeholder="{TXT_FIXED_SUM}" />
<label class="form-label" for="deposit">
{TXT_DEPOSIT}
</label>
<input class="form-input" type="text" name="deposit" id="deposit" value="{VAL_DEPOSIT}" placeholder="{TXT_DEPOSIT}" />
<label class="form-label" for="credit">
{TXT_CREDIT}
</label>
<input class="form-input" type="text" name="credit" id="credit" value="{VAL_CREDIT}" placeholder="{TXT_CREDIT}" />
<label class="form-label" for="activation_time">
{TXT_ACTIVATION}
</label>
<input class="form-input" type="number" name="activation_time" id="activation_time" value="{VAL_ACTIVATION_TIME}" min="0" placeholder="{TXT_ACTIVATION}" />
<br />
<label class="form-switch">
{TXT_ADV}
<input type="checkbox" id="adv" name="adv" {VAL_ADV_BLOCK} value="0" onclick="adv_enab();" />
<i class="form-icon"></i>
</label>
<label class="form-label" for="cos">
{TXT_ADV_TIMEOUT}
</label>
<input class="form-input" type="number" name="cos" id="cos" value="{VAL_COS}" min="30" placeholder="{TXT_ADV_TIMEOUT}" />
  </div>
  <div class="simpleTabsContent">
<label class="form-label">
{TXT_SIMUL}
</label>
<label class="form-label" for="simultaneous_use">
{TXT_SIMUL_USE}
</label>
<input class="form-input" type="number" name="simultaneous_use" id="simultaneous_use" value="{VAL_SIMUL_USE}" min="0" placeholder="{TXT_SIMUL_USE}" />
<label class="form-label" for="port_limit">
{TXT_SIMUL_PORT}
</label>
<input class="form-input" type="number" name="port_limit" id="port_limit" value="{VAL_PORT_LIMIT}" min="0" placeholder="{TXT_SIMUL_PORT}" />
<br />
{TXT_TIME}
</label>
<label class="form-label" for="session_timeout">
{TXT_TIME_SESSION}
</label>
<input class="form-input" type="number" name="session_timeout" id="session_timeout" value="{VAL_SESSION_TIMEOUT}" min="0" placeholder="{TXT_TIME_SESSION}" />
<label class="form-label" for="idle_timeout">
{TXT_TIME_IDLE}
</label>
<input class="form-input" type="number" name="idle_timeout" id="idle_timeout" value="{VAL_IDLE_TIMEOUT}" min="0" placeholder="{TXT_TIME_IDLE}" />
<br />
<label class="form-label">
{TXT_ASSIGNED}
</label>
<label class="form-label" for="framed_ip">
IP
</label>
<input class="form-input" type="text" name="framed_ip" id="framed_ip" value="{VAL_FRAMED_IP}" placeholder="IP" />
<label class="form-label" for="framed_mask">
{TXT_MASK}
</label>
<input class="form-input" type="text" name="framed_mask" id="framed_mask" value="{VAL_FRAMED_MASK}" placeholder="{TXT_MASK}" />
<label class="form-label" for="framed_route">
{TXT_FRAMED_ROUTE}
</label>
<input class="form-input" type="text" name="framed_route" id="framed_route" value="{VAL_FRAMED_ROUTE}" placeholder="{TXT_FRAMED_ROUTE}" />
<label class="form-label" for="down">
{TXT_DOWN_SPEED}
</label>
<input class="form-input" type="number" name="down" id="down" value="{VAL_DOWN}" min="0" placeholder="{TXT_DOWN_SPEED}" />
<label class="form-label" for="up">
{TXT_UP_SPEED}
</label>
<input class="form-input" type="number" name="up" id="up" value="{VAL_UP}" min="0" placeholder="{TXT_UP_SPEED}" />
<br />
<label class="form-label">
{TXT_ENABLED}
</label>
<label class="form-label" for="login_time">
{TXT_ACCESS_TIME}
</label>
<input class="form-input" type="text" name="login_time" id="login_time" value="{VAL_LOGIN_TIME}" placeholder="{TXT_ACCESS_TIME}" />
<label class="form-label" for="huntgroup_name">
{TXT_HUNTGROUP}
</label>
<input class="form-input" type="text" name="huntgroup_name" id="huntgroup_name" value="{VAL_HUNTGROUP_NAME}" placeholder="{TXT_HUNTGROUP}" />
<label class="form-label" for="allowed_servers">
NAS
</label>
<input class="form-input" type="text" name="allowed_servers" id="allowed_servers" value="{VAL_SERVERS}" placeholder="NAS" />
<label class="form-label" for="other_params">
RADIUS reply
</label>
<input class="form-input" type="text" name="other_params" id="other_params" value="{VAL_RAD_REPLY}" placeholder="RADIUS reply" />
<br />
<label class="form-switch">
{TXT_BLOCKED}
<input type="checkbox" name="blocked" {VAL_STAT_BLOCK} value="{VAL_BLOCK}" />
<i class="form-icon"></i>
</label>
<label class="form-switch">
{TXT_ACTIVATED}
<input type="checkbox" name="activated" {VAL_STAT_ACT} value="{VAL_ACTED}" />
<i class="form-icon"></i>
</label>
<label class="form-switch">
{TXT_NO_PASS}
<input type="checkbox" name="no_pass" {VAL_STAT_PASS} value="{VAL_PASS}" />
<i class="form-icon"></i>
</label>
<label class="form-switch">
{TXT_NO_STAT}
<input type="checkbox" name="no_acct" {VAL_STAT_STAT} value="{VAL_STAT}" />
<i class="form-icon"></i>
</label>
<label class="form-switch">
{TXT_CALLBACK}
<input type="checkbox" name="allow_callback" {VAL_STAT_CALLBACK} value="{VAL_CALLBACK}" />
<i class="form-icon"></i>
</label>
  </div>
  <div class="simpleTabsContent">
<div class="columns">
<div class="col-4 col-sm-12">
<label class="form-label">
{TXT_LIMITS}
</label>
</div>
<div class="col-2 col-sm-12">
<label class="form-label">
{TXT_DAILY}
</label>
</div>
<div class="col-2 col-sm-12">
<label class="form-label">
{TXT_WEEKLY}
</label>
</div>
<div class="col-2 col-sm-12">
<label class="form-label">
{TXT_MONTHLY}
</label>
</div>
<div class="col-2 col-sm-12">
<label class="form-label">
{TXT_TOTAL_L}
</label>
</div>
</div>
<div class="columns">
<div class="col-4 col-sm-12">
<label class="form-label">
{TXT_TIME_L}
</label>
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="number" name="day_time_limit" id="day_time_limit" value="{VAL_DAY_TIME_LIMIT}" min="0" />
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="number" name="week_time_limit" id="week_time_limit" value="{VAL_WEEK_TIME_LIMIT}" min="0" />
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="number" name="month_time_limit" id="month_time_limit" value="{VAL_MONTH_TIME_LIMIT}" min="0" />
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="number" name="total_time_limit" id="total_time_limit" value="{VAL_TOTAL_TIME_LIMIT}" min="0" />
</div>
</div>
<div class="columns">
<div class="col-4 col-sm-12">
<label class="form-label">
{TXT_TRAF_L}
</label>
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="number" name="day_traffic_limit" id="day_traffic_limit" value="{VAL_DAY_TRAFFIC_LIMIT}" min="0" />
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="number" name="week_traffic_limit" id="week_traffic_limit" value="{VAL_WEEK_TRAFFIC_LIMIT}" min="0" />
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="number" name="month_traffic_limit" id="month_traffic_limit" value="{VAL_MONTH_TRAFFIC_LIMIT}" min="0" />
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="number" name="total_traffic_limit" id="total_traffic_limit" value="{VAL_TOTAL_TRAFFIC_LIMIT}" min="0" />
</div>
</div>
<div class="columns">
<div class="col-4 col-sm-12">
<label class="form-label">
{TXT_MONEY_L}
</label>
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="text" name="day_money_limit" id="day_money_limit" value="{VAL_DAY_MONEY_LIMIT}" />
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="text" name="week_money_limit" id="week_money_limit" value="{VAL_WEEK_MONEY_LIMIT}" />
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="text" name="month_money_limit" id="month_money_limit" value="{VAL_MONTH_MONEY_LIMIT}" />
</div>
<div class="col-2 col-sm-12">
<input class="form-input" type="text" name="total_money_limit" id="total_money_limit" value="{VAL_TOTAL_MONEY_LIMIT}" />
</div>
</div>
</div>
  </div>
 </div>
</div>
</div>
<div class="card-footer">
<div class="btn-group btn-group-block">
<button class="btn btn-primary" onclick="javascript: return validateAndSubmitForm(this.form);" >{BTN_SAVE}</button>
</div>
</div>
</div>
</form>
<script type="text/javascript">  
//<![CDATA[
    adv_enab();
//]]>
</script>
