<?php
/* Smarty version 4.3.1, created on 2025-12-18 17:05:31
  from '/var/www/html/yatmack/ui/ui/hotspot-add.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.3.1',
  'unifunc' => 'content_69440a2ba78338_84984863',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'a6ac35c35881c7f09f450f4134deff1cb44e420d' => 
    array (
      0 => '/var/www/html/yatmack/ui/ui/hotspot-add.tpl',
      1 => 1757933545,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:sections/header.tpl' => 1,
    'file:sections/footer.tpl' => 1,
  ),
),false)) {
function content_69440a2ba78338_84984863 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_subTemplateRender("file:sections/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12 col-md-12">
                        <div class="card card-primary card-hovered card-stacked mb30">
                            <div class="card-header"><?php echo Lang::T('Add Service Plan');?>
</div>
                            <div class="card-body">
                                <form class="form-horizontal" method="post" role="form" action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
services/add-post">
                                    <div class="form-group row">
                                        <label class="col-md-2 control-label"><?php echo Lang::T('Status');?>
</label>
                                        <div class="col-md-10">
                                            <input type="radio" name="enabled" value="1" checked> Enable
                                            <input type="radio" name="enabled" value="0"> Disable
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-2 control-label"><?php echo Lang::T('Type');?>
</label>
                                        <div class="col-md-10">
                                            <input type="radio" name="prepaid" onclick="prePaid()" value="yes" checked> Prepaid
                                            <input type="radio" name="prepaid" onclick="postPaid()" value="no"> Postpaid
                                        </div>
                                    </div>
                
                                    <div class="form-group row">
                                        <label class="col-md-2 control-label"><?php echo Lang::T('Plan Type');?>
</label>
                                        <div class="col-md-10">
                                            <input type="radio" name="plan_type"  value="Personal" checked> Personal
                                            <input type="radio" name="plan_type"   value="Business"> Business
                                        </div>
                                    </div>
                                    <?php if ($_smarty_tpl->tpl_vars['_c']->value['radius_enable']) {?>
                                        <div class="form-group row">
                                            <label class="col-md-2 control-label">Radius</label>
                                            <div class="col-md-6">
                                                <label class="radio-inline">
                                                    <input type="checkbox" name="radius" onclick="isRadius(this)" value="1"> Radius Plan
                                                </label>
                                            </div>
                                            <p class="help-block col-md-4"><?php echo Lang::T('Cannot be change after saved');?>
</p>
                                        </div>
                                    <?php }?>
                                    <div class="form-group row">
                                        <label class="col-md-2 control-label"><?php echo Lang::T('Plan Name');?>
</label>
                                        <div class="col-md-6">
                                            <input type="text" class="form-control" id="name" name="name" maxlength="40">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-2 control-label"><?php echo Lang::T('Plan Type');?>
</label>
                                        <div class="col-md-10">
                                            <input type="radio" id="Unlimited" name="typebp" value="Unlimited" checked>
                                            <?php echo Lang::T('Unlimited');?>

                                            <input type="radio" id="Limited" name="typebp" value="Limited"> <?php echo Lang::T('Limited');?>

                                        </div>
                                    </div>
                                    <div style="display:none;" id="Type">
                                        <div class="form-group row">
                                            <label class="col-md-2 control-label"><?php echo Lang::T('Limit Type');?>
</label>
                                            <div class="col-md-10">
                                                <input type="radio" id="Time_Limit" name="limit_type" value="Time_Limit" checked>
                                                <?php echo Lang::T('Time Limit');?>

                                                <input type="radio" id="Data_Limit" name="limit_type" value="Data_Limit">
                                                <?php echo Lang::T('Data Limit');?>

                                                <input type="radio" id="Both_Limit" name="limit_type" value="Both_Limit">
                                                <?php echo Lang::T('Both Limit');?>

                                            </div>
                                        </div>
                                    </div>
                                    <div style="display:none;" id="TimeLimit">
                                        <div class="form-group row">
                                            <label class="col-md-2 control-label"><?php echo Lang::T('Time Limit');?>
</label>
                                            <div class="col-md-4">
                                                <input type="text" class="form-control" id="time_limit" name="time_limit" value="0">
                                            </div>
                                            <div class="col-md-2">
                                                <select class="form-select select2" id="time_unit" name="time_unit">
                                                    <option value="Hrs"><?php echo Lang::T('Hrs');?>
</option>
                                                    <option value="Mins"><?php echo Lang::T('Mins');?>
</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div style="display:none;" id="DataLimit">
                                        <div class="form-group row">
                                            <label class="col-md-2 control-label"><?php echo Lang::T('Data Limit');?>
</label>
                                            <div class="col-md-4">
                                                <input type="text" class="form-control" id="data_limit" name="data_limit" value="0">
                                            </div>
                                            <div class="col-md-2">
                                                <select class="form-select" style="height: 52px; background-color: white;" id="data_unit" name="data_unit">
                                                    <option value="MB">MBs</option>
                                                    <option value="GB">GBs</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-2 control-label"><a
                                                href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
bandwidth/add"><?php echo Lang::T('Bandwidth Name');?>
</a></label>
                                        <div class="col-md-6">
                                            <select id="id_bw" name="id_bw" class="form-select select2">
                                                <option value=""><?php echo Lang::T('Select Bandwidth');?>
...</option>
                                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['d']->value, 'ds');
$_smarty_tpl->tpl_vars['ds']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['ds']->value) {
$_smarty_tpl->tpl_vars['ds']->do_else = false;
?>
                                                    <option value="<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
"><?php echo $_smarty_tpl->tpl_vars['ds']->value['name_bw'];?>
</option>
                                                <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-2 control-label"><?php echo Lang::T('Plan Price');?>
</label>
                                        <div class="col-md-6">
                                            <div class="input-group">
                                                <span class="input-group-text" id="basic-addon1"><?php echo $_smarty_tpl->tpl_vars['_c']->value['currency_code'];?>
</span>
                                                <input type="number" class="form-control" name="price" required>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-2 control-label"><?php echo Lang::T('Shared Users');?>
</label>
                                        <div class="col-md-6">
                                            <input type="text" class="form-control" id="sharedusers" name="sharedusers" value="1">
                                            <p class="help-block"><?php echo Lang::T('1 user can be used for many devices?');?>
</p>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-md-2 control-label"><?php echo Lang::T('Plan Validity');?>
</label>
                                        <div class="col-md-4">
                                            <input type="text" class="form-control" id="validity" name="validity">
                                        </div>
                                        <div class="col-md-2">
                                            <select class="form-select select2" id="validity_unit" name="validity_unit">
                                            </select>
                                        </div>
                                        <p class="help-block col-md-4"><?php echo Lang::T('1 Period = 1 Month, Expires the 20th of each month');?>
</p>
                                    </div>
                                    <span id="routerChoose" class="">
                                        <div class="form-group row">
                                            <label class="col-md-2 control-label"><a
                                                    href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
routers/add"><?php echo Lang::T('Router Name');?>
</a></label>
                                            <div class="col-md-6">
                                                <select id="routers" name="routers" required class="form-select select2">
                                                    <option value=''><?php echo Lang::T('Select Routers');?>
</option>
                                                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['r']->value, 'rs');
$_smarty_tpl->tpl_vars['rs']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['rs']->value) {
$_smarty_tpl->tpl_vars['rs']->do_else = false;
?>
                                                        <option value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['name'];?>
"><?php echo $_smarty_tpl->tpl_vars['rs']->value['name'];?>
</option>
                                                    <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                                </select>
                                                <p class="help-block"><?php echo Lang::T('Cannot be change after saved');?>
</p>
                                            </div>
                                        </div>
                                    </span>
                                    <legend><?php echo Lang::T('Expired Action');?>
</legend>
                                    <div class="form-group row" id="ipPool">
                                        <label class="col-md-2 control-label"><a
                                                href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
pool/add"><?php echo Lang::T('Expired IP Pool');?>
</a></label>
                                        <div class="col-md-6">
                                            <select id="pool_expired" name="pool_expired" class="form-select select2">
                                                <option value=''><?php echo Lang::T('Select Pool');?>
</option>
                                            </select>
                                        </div>
                                    </div>
                                                                        <center>
                                    <div class="form-group row">
                                        <div class="col-md-offset-2 col-md-10">
                                            <button class="btn btn-success" type="submit"><?php echo Lang::T('Save Changes');?>
</button>
                                            Or <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
services/hotspot"><?php echo Lang::T('Cancel');?>
</a>
                                        </div>
                                    </div>
                                    </center>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <?php echo '<script'; ?>
>
                    var preOpt = `<option value="Mins"><?php echo Lang::T('Mins');?>
</option>
                <option value="Hrs"><?php echo Lang::T('Hrs');?>
</option>
                <option value="Days"><?php echo Lang::T('Days');?>
</option>
                <option value="Months"><?php echo Lang::T('Months');?>
</option>`;
                    var postOpt = `<option value="Period"><?php echo Lang::T('Period');?>
</option>`;
                    function prePaid() {
                        $("#validity_unit").html(preOpt);
                    }
                
                    function postPaid() {
                        $("#validity_unit").html(postOpt);
                    }
                    document.addEventListener("DOMContentLoaded", function(event) {
                        prePaid()
                    })
                <?php echo '</script'; ?>
>
                <?php if ($_smarty_tpl->tpl_vars['_c']->value['radius_enable']) {?>
                    
                        <?php echo '<script'; ?>
>
                            function isRadius(cek) {
                                if (cek.checked) {
                                    $("#routerChoose").addClass('hidden');
                                    document.getElementById("routers").required = false;
                                    $("#pool_expired").html('');
                                    $.ajax({
                                        url: "index.php?_route=autoload/pool",
                                        data: "routers=radius",
                                        cache: false,
                                        success: function(msg) {
                                            $("#pool_expired").html(msg);
                                        }
                                    });
                                } else {
                                    document.getElementById("routers").required = true;
                                    $("#routerChoose").removeClass('hidden');
                                }
                            }
                        <?php echo '</script'; ?>
>
                    
                <?php }?>
            </div>
<?php $_smarty_tpl->_subTemplateRender("file:sections/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
}
}
