<link href="modules/addons/xtreamuionedashboard/templates/css/swiftmodders.css?v=787878" rel="stylesheet">
<link href="modules/addons/xtreamuionedashboard/templates/css/mystyle.css" rel="stylesheet"> 
<link href="modules/addons/xtreamuionedashboard/templates/css/bootstrap-social.css" rel="stylesheet">
<script type="text/javascript">
    var alreadyReady = false; // The ready function is being called twice on page load.
    jQuery(document).ready(function () {
        var table = jQuery("#xtreamservices").DataTable({
            "dom": '<"listtable"fit>pl', "responsive": true,
            "oLanguage": {
                "sEmptyTable": "No Records Found",
                "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
                "sInfoEmpty": "Showing 0 to 0 of 0 entries",
                "sInfoFiltered": "(filtered from _MAX_ total entries)",
                "sInfoPostFix": "",
                "sInfoThousands": ",",
                "sLengthMenu": "Show _MENU_ entries",
                "sLoadingRecords": "Loading...",
                "sProcessing": "Processing...",
                "sSearch": "",
                "sZeroRecords": "No Records Found",
                "oPaginate": {
                    "sFirst": "First",
                    "sLast": "Last",
                    "sNext": "Next",
                    "sPrevious": "Previous"
                }
            },
            "pageLength": 10,
            "order": [
                [0, "asc"]
            ],
            "lengthMenu": [
                [10, 25, 50, -1],
                [10, 25, 50, "All"]
            ], "stateSave": true
        });
        jQuery(".dataTables_filter input").attr("placeholder", "Enter search term...");

        // highlight remembered filter on page re-load
        var rememberedFilterTerm = table.state().columns[3].search.search;
        if (rememberedFilterTerm && !alreadyReady) {
            // This should only run on the first "ready" event.
            jQuery(".view-filter-btns a span").each(function (index) {
                if (jQuery(this).text().trim() == rememberedFilterTerm.replace(/\\|s\*/g, '')) {
                    jQuery(this).parent('a').addClass('active');
                    jQuery(this).parent('a').find('i').switchClass('fa-circle-o', 'fa-dot-circle-o', 0);
                }
            });
        }
        alreadyReady = true;
    });
</script> 
<div class="container"  style="width: 100%;margin-top: 40px;"> 
    {include file='modules/addons/xtreamuionedashboard/templates/nav_header.tpl'}
    <div class="sm-content-container">
        <div class="sm-content">
            <div class="sm-page-heading">
                <h1>Services</h1>
                <ol class="breadcrumb">
                    <li>
                        <a href="index.php"> Portal Home
                        </a>        </li>
                    <li class="active">
                        Dashboard
                    </li>
                </ol>
            </div> 
            {if $result!=''}
                <div class="alert alert-{$result} alert-dismissable">
                    <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                    {$message}
                </div>
            {/if}
            <div class="listtable" style="overflow-x: scroll;"> 
                <table id="xtreamservices" class="table table-list dataTable no-footer dtr-inline" aria-describedby="xtreamservices_info" role="grid">
                    <thead>
                        <tr role="row">
                            <th class="sorting_asc" tabindex="0" aria-controls="xtreamservices" rowspan="1" colspan="1" style="width: 0px;" aria-sort="ascending">Product/Service</th>
                            <th class="sorting_asc" tabindex="0" aria-controls="xtreamservices" rowspan="1" colspan="1" style="width: 0px;" aria-sort="ascending">Name</th>
                            <th class="sorting" tabindex="0" aria-controls="xtreamservices" rowspan="1" colspan="1"  style="width: 0px;">User Name</th>  
                                {if $response.configoption eq ''}
                                    {if $resellermag eq ''}  
                                    <th class="sorting_asc" tabindex="0" aria-controls="xtreamservices" rowspan="1" colspan="1" style="width: 0px;">MAG Device</th>  
                                    <th class="sorting_asc" tabindex="0" aria-controls="xtreamservices" rowspan="1" colspan="1" style="width: 0px;">ENG Device</th>  
                                    {/if}
                                {/if}
                            <th class="sorting_asc" tabindex="0" aria-controls="xtreamservices" rowspan="1" colspan="1" style="width: 0px;">Status</th>
                            <th class="sorting_asc" tabindex="0" aria-controls="xtreamservices" rowspan="1" colspan="1" style="width: 0px;" aria-sort="ascending">Watching Channel</th> 
                            <th class="sorting_asc" tabindex="0" aria-controls="xtreamservices" rowspan="1" colspan="1" style="width: 0px;">Next Due Date</th>
                            <th class="sorting_asc" tabindex="0" aria-controls="xtreamservices" rowspan="1" colspan="1" style="width: 0px;"></th>
                        {if $resellermag eq ''} {if $action eq 'enable'} <th class="sorting_asc" tabindex="0" aria-controls="xtreamservices" rowspan="1" colspan="1" style="width: 0px;">  </th>{/if}{/if}
                    </tr>
                </thead>
                <tbody>  

                    {foreach from=$services['products']['product'] item=service} 
                        <tr> 
                            <td class="text-center">{$service.name} </td>
                            <td class="text-center">{$service.clientDetails['firstname']} {$service.clientDetails['lastname']}</td>
                            <td class="text-center"> {$service.xtreamusername}</td>  
                            {if $response.configoption eq ''}{if $resellermag eq ''}
                                    {if $service.engma neq ''}
                                        {if $service.engma eq 'both'}
                                            <td class="text-center">
                                                {if $service.mag_device eq '-'}
                                                    {if $service.status eq 'Active'}
                                                        <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#magdevice{$service.id}">
                                                            <i class="fa fa-plus" aria-hidden="true"></i>
                                                            Add Device
                                                        </button>
                                                    {else}-{/if}
                                                {else}
                                                    {$service.mag_device} {if $service.status eq 'Active'}<a href="javascript:;" data-toggle="modal" data-target="#magdevice{$service.id}">Update</a>
                                                    {/if}
                                                {/if}
                                            </td>
                                            <td class="text-center">
                                                {if $service.eng_device eq '-'}
                                                    {if $service.status eq 'Active'}
                                                        <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#engdevice{$service.id}">
                                                            <i class="fa fa-plus" aria-hidden="true"></i>
                                                            Add Device
                                                        </button>
                                            {else}-{/if}{else}{$service.eng_device} {if $service.status eq 'Active'}<a href="javascript:;" data-toggle="modal" data-target="#engdevice{$service.id}">Update</a>{/if}{/if}</td>
                                        {elseif  $service.engma eq 'no'}
                                        <td class="text-center">
                                            {if $service.mag_device eq '-'}{if $service.status eq 'Active'}
                                                    <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#magdevice{$service.id}">
                                                        <i class="fa fa-plus" aria-hidden="true"></i>
                                                        Add Device
                                                    </button>
                                                {else}-{/if}
                                            {else}
                                            {$service.mag_device} {if $service.status eq 'Active'}<a href="javascript:;" data-toggle="modal" data-target="#magdevice{$service.id}">Update</a>{/if}{/if}</td>
                                        <td class="text-center">-</td>
                                        {elseif  $service.engma eq 'yes'}
                                        <td class="text-center">-</td><td class="text-center">
                                                {if $service.eng_device eq '-'}
                                                    {if $service.status eq 'Active'}
                                                        <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#engdevice{$service.id}">
                                                            <i class="fa fa-plus" aria-hidden="true"></i>
                                                            Add Device
                                                        </button>
                                            {else}-{/if}{else}{$service.eng_device} {if $service.status eq 'Active'}<a href="javascript:;" data-toggle="modal" data-target="#engdevice{$service.id}">Update</a>{/if}{/if}</td>
                                         {/if}
                                {else}
                                    <td class="text-center">-</td>
                                    <td class="text-center">-</td>
                                {/if}
                            {/if}
                        {/if}
                        <td class="text-center"><span class="label status-{$service.status|strtolower}">{$service.status}</span></td>
                        <td class="text-center">{$service.watchingchannel}</td>
                        <td class="text-center">{if $service.nextduedate neq '0000-00-00'}{$service.nextduedate}{else}{$service.exp_date|date_format:'%D %I:%M %p'}{/if}</span></td>
                            {if $resellermag eq ''} 
                                {if $service.iptvdetails eq 'show'}
                                    <td class="text-center">
                                        {if $service.showm3ulink eq 'on' || $service.showautoscript eq 'on' || $service.showotherdevice eq 'on'}
                                                <button type="button" id="product1-order-button" class="btn btn-success btn-sm" data-toggle="modal" data-target="#iptvdetails{$service.id}">
                                                    <i class="fa fa-eye" aria-hidden="true"></i>&nbsp;IPTV details
                                             </button> 
                                        {else}
                                            -
                                        {/if}
                                    </td>
                                {else}
                                  <td class="text-center"> - </td>
                                {/if}
                            {if $action eq 'enable'} 
                                {if $service.status eq 'Active'}<td class="text-center text-center1"><div class="btn-group btn-group-sm" style="width:60px;">
                                            {* <a href="javascript:;" class="btn btn-default"><i class="fa fa-wrench"></i></a> *}
                                            <button type="button" class="btn btn-default dropdown-toggle btn_new" data-toggle="dropdown" aria-expanded="true">Action
                                                <span class="caret"></span>
                                                <span class="sr-only">Toggle Dropdown</span>
                                            </button>
                                            <ul class="dropdown-menu text-left action_clr" role="menu">
                                                {if $service.upgrade eq 'yes'}
                                                    <li class="action_clr1">
                                                        <a  style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;white-space: nowrap;" href="?m=xtreamuionedashboard&action=xtreamupgrade&service={$service.id}">
                                                            <i class="fa fa-upload" aria-hidden="true"></i> Upgrade
                                                        </a>    
                                                    </li>
                                                {/if}
                                                {if $checked eq 'Disable'} 
                                                            {if $service.showrenew eq 'yes'}                                                
                                                                <li class="action_clr1">
                                                                    <form method="post"  style="margin-bottom: 0px;" id="ModuleRenew{$service.id}"> 
                                                                        <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                        <input type="hidden" name="customAction" value="ModuleRenew" />
                                                                        <a href="javascript:;" style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                                           white-space: nowrap;" onclick="ModuleRenew({$service.id});"><i class="fa fa-refresh" aria-hidden="true"></i> Renew</a> 
                                                                    </form> 
                                                                </li>
                                                            {/if}
                                                        {/if}
                                                {if $lang.reseller_susp eq 'on'}<li class="action_clr2">
                                                        <form method="post"  style="margin-bottom: 0px;"  id="ModuleSuspend{$service.id}"> 
                                                            <input type="hidden" name="serviceid"  value="{$service.id}">
                                                            <input type="hidden" name="customAction" value="ModuleSuspend" />
                                                            <a href="javascript:;" style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                               white-space: nowrap;" onclick="ModuleSuspend({$service.id});"><i class="fa fa-power-off" aria-hidden="true"></i> Suspend</a> 
                                                        </form> 
                                                    </li>
                                                {/if}  
                                                {if $lang.reseller_term eq 'on'}<li class="action_clr3">
                                                        <form method="post"  style="margin-bottom: 0px;"  id="ModuleTerminate{$service.id}"> 
                                                            <input type="hidden" name="serviceid"  value="{$service.id}">
                                                            <input type="hidden" name="customAction" value="ModuleTerminate" />
                                                            <a href="javascript:;"  style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                               white-space: nowrap;" onclick="ModuleTerminate({$service.id});"><i class="fa fa-ban" aria-hidden="true"></i> Terminate</a> 
                                                        </form>
                                                    </li>
                                                {/if} 
                                                {if $lang.reseller_remove eq 'on'}<li class="action_clr3"> 
                                                        <form method="post" style="margin-bottom: 0px;"  id="ModuleRemove{$service.id}"> 
                                                            <input type="hidden" name="serviceid"  value="{$service.id}">
                                                            <input type="hidden" name="customAction" value="ModuleRemove" />
                                                            <a href="javascript:;"  style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                               white-space: nowrap;" onclick="ModuleRemove({$service.id});"><i class="fa fa-trash" aria-hidden="true"></i> Remove</a> 
                                                        </form>
                                                    </li>
                                                {/if} 
                                            </ul>
                                        </div></td>{elseif $service.status eq 'Suspended'}
                                    <td class="text-center text-center1"><div class="btn-group btn-group-sm" style="width:60px;">
                                            {* <a href="javascript:;" class="btn btn-default"><i class="fa fa-wrench"></i></a> *}
                                            <button type="button" class="btn btn-default dropdown-toggle btn_new" data-toggle="dropdown" aria-expanded="true">Action
                                                <span class="caret"></span>
                                                <span class="sr-only">Toggle Dropdown</span>
                                            </button>
                                            <ul class="dropdown-menu text-left action_clr" role="menu">
                                                {if $checked eq 'Disable'} 
                                                            {if $service.showrenew eq 'yes'}                                                
                                                                <li class="action_clr1">
                                                                    <form method="post"  style="margin-bottom: 0px;" id="ModuleRenew{$service.id}"> 
                                                                        <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                        <input type="hidden" name="customAction" value="ModuleRenew" />
                                                                        <a href="javascript:;" style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                                           white-space: nowrap;" onclick="ModuleRenew({$service.id});"><i class="fa fa-refresh" aria-hidden="true"></i> Renew</a> 
                                                                    </form> 
                                                                </li>
                                                            {/if}
                                                        {/if}
                                                         {if $lang.reseller_unsusp eq 'on'}
                                                    <li class="action_clr2">
                                                        <form method="post" style="margin-bottom: 0px;" id="ModuleUnsuspend{$service.id}"> 
                                                            <input type="hidden" name="serviceid"  value="{$service.id}">
                                                            <input type="hidden" name="customAction" value="ModuleUnsuspend" />
                                                            <a href="javascript:;" style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                               white-space: nowrap;" onclick="ModuleUnsuspend({$service.id});"><i class="fa fa-toggle-on" aria-hidden="true"></i> Unsuspend</a> 
                                                        </form> 
                                                    </li>
                                                {/if}
                                                {if $lang.reseller_term eq 'on'}<li class="action_clr3"> <form method="post" style="margin-bottom: 0px;" id="ModuleTerminate{$service.id}"> 
                                                            <input type="hidden" name="serviceid"  value="{$service.id}">
                                                            <input type="hidden" name="customAction" value="ModuleTerminate" />
                                                            <a href="javascript:;"  style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                               white-space: nowrap;" onclick="ModuleTerminate({$service.id});"><i class="fa fa-ban" aria-hidden="true"></i> Terminate</a> 
                                                        </form></li>{/if} 
                                                    {if $lang.reseller_remove eq 'on'}<li class="action_clr3"> <form method="post" style="margin-bottom: 0px;" id="ModuleRemove{$service.id}"> 
                                                                <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                <input type="hidden" name="customAction" value="ModuleRemove" />
                                                                <a href="javascript:;"  style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                                   white-space: nowrap;" onclick="ModuleRemove({$service.id});"><i class="fa fa-trash" aria-hidden="true"></i> Remove</a> 
                                                            </form></li>{/if} 
                                                    </ul>
                                                </div></td>
                                            {elseif $service.status eq 'Unsuspended'}
                                            <td class="text-center text-center1"><div class="btn-group btn-group-sm" style="width:60px;">
                                                    {* <a href="javascript:;" class="btn btn-default"><i class="fa fa-wrench"></i></a> *}
                                                    <button type="button" class="btn btn-default dropdown-toggle btn_new" data-toggle="dropdown" aria-expanded="true">Action
                                                        <span class="caret"></span>
                                                        <span class="sr-only">Toggle Dropdown</span>
                                                    </button>
                                                    <ul class="dropdown-menu text-left action_clr" role="menu">
                                                        {if $checked eq 'Disable'} 
                                                            {if $service.showrenew eq 'yes'}                                                
                                                                <li class="action_clr1">
                                                                    <form method="post"  style="margin-bottom: 0px;" id="ModuleRenew{$service.id}"> 
                                                                        <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                        <input type="hidden" name="customAction" value="ModuleRenew" />
                                                                        <a href="javascript:;" style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                                           white-space: nowrap;" onclick="ModuleRenew({$service.id});"><i class="fa fa-refresh" aria-hidden="true"></i> Renew</a> 
                                                                    </form> 
                                                                </li>
                                                            {/if}
                                                        {/if}
                                                         {if $lang.reseller_unsusp eq 'on'}
                                                            <li class="action_clr2">
                                                                <form method="post" style="margin-bottom: 0px;"  id="ModuleUnsuspend{$service.id}"> 
                                                                    <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                    <input type="hidden" name="customAction" value="ModuleUnsuspend" />
                                                                    <a href="javascript:;" style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                                       white-space: nowrap;" onclick="ModuleUnsuspend({$service.id});"><i class="fa fa-toggle-on" aria-hidden="true"></i> Unsuspend</a> 
                                                                </form> 
                                                            </li>
                                                        {/if}
                                                        {if $lang.reseller_term eq 'on'}<li class="action_clr3"> <form style="margin-bottom: 0px;"  method="post" id="ModuleTerminate{$service.id}"> 
                                                                    <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                    <input type="hidden" name="customAction" value="ModuleTerminate" />
                                                                    <a href="javascript:;"  style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                                       white-space: nowrap;" onclick="ModuleTerminate({$service.id});"><i class="fa fa-ban" aria-hidden="true"></i> Terminate</a> 
                                                                </form></li>{/if} 
                                                            {if $lang.reseller_remove eq 'on'}<li class="action_clr3"> <form  style="margin-bottom: 0px;"  method="post" id="ModuleRemove{$service.id}"> 
                                                                        <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                        <input type="hidden" name="customAction" value="ModuleRemove" />
                                                                        <a href="javascript:;"  style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #333;
                                                                           white-space: nowrap;" onclick="ModuleRemove({$service.id});"><i class="fa fa-trash" aria-hidden="true"></i> Remove</a> 
                                                                    </form></li>{/if} 
                                                            </ul>
                                                        </div></td>
                                                {else}<td class="text-center">  {if $lang.reseller_remove eq 'on'}  <form  style="margin-bottom: 0px;"  method="post" id="ModuleRemove{$service.id}"> 
                                                                <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                <input type="hidden" name="customAction" value="ModuleRemove" />
                                                                <a href="javascript:;" class="action_clr3"  style="display: block;text-decoration: none !important;padding: 3px 20px;clear: both;font-weight: normal;line-height: 1.42857;color: #f80808;
                                                                   white-space: nowrap;" onclick="ModuleRemove({$service.id});"><i class="fa fa-trash" aria-hidden="true"></i> Remove</a> 
                                                            </form> {/if} </td>{/if}{/if}{/if}
                                                    </tr> 
                                                    {/foreach} 
                                                    </tbody>
                                                </table> 
                                            </div>  
                                        </div>
                                    </div> 
                                </div>   
                                {foreach from=$services['products']['product'] item=service} 
                                    {if $service.engma eq 'both'}
                                        <div id="magdevice{$service.id}" class="modal fade" role="dialog">
                                            <div class="modal-dialog"> 
                                                <!-- Modal content-->
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                                                        <h4 class="modal-title">
                                                            <i class="fa fa-info"></i>&nbsp;{$lang.mag_desc} 
                                                        </h4>
                                                    </div>
                                                    <div class="modal-body">  
                                                        {if $service.mag_device neq '-'}
                                                            <div class="list-group">
                                                                <div class="list-group-item">
                                                                    {$lang.current_mag}&nbsp;{$lang.mag_desc}: <strong class="text-domain"> {$service.mag_device}</strong>
                                                                </div>  
                                                                <div class="list-group-item">
                                                                    <div width="100%"> <div style="width: 24%;float: left;margin-top: 8px;font-size: 14px;">{$lang.new_mag}&nbsp;{$lang.mag_desc}: </div>  <div><strong class="text-domain"> 
                                                                                <form method="post"  class="macaddress"> 
                                                                                    <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                                    <input type="hidden" name="username"  value="{$service.xtreamusername}">
                                                                                    <input type="hidden" name="password"  value="{$service.xtreampassword}">
                                                                                    <input type="hidden" name='pid' value="{$service.pid}">
                                                                                    <input type="hidden" name='userid' value="{$service.clientid}">  
                                                                                    <input class="form-control" style="width: 38%;float: left;margin-right: 15px;" maxlength="17" size="17" type="text" id="newMAC" name="newMAC" value="{$service.mag_device}" />
                                                                                    <input type="hidden" name="customAction" value="changeMAG" />
                                                                                    <button style="width: 35%;" type="submit" class="btn btn-success btn-block"> 
                                                                                        {$lang.change_mag_button}
                                                                                    </button>
                                                                                </form></strong></div>
                                                                    </div>  
                                                                </div>
                                                            </div> 
                                                        {else}
                                                            <div class="list-group">
                                                                <div class="list-group-item">
                                                                    {$lang.current_mag}&nbsp;{$lang.mag_desc}<strong class="text-domain"> None </strong>
                                                                </div>  
                                                                <div class="list-group-item">
                                                                    <div width="100%"> <div style="width: 24%;float: left;margin-top: 8px;font-size: 14px;">{$lang.new_mag}&nbsp;{$lang.mag_desc}: </div>  <div><strong class="text-domain"> 
                                                                                <form method="post"  class="macaddress"> 
                                                                                    <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                                    <input type="hidden" name="username"  value="{$service.xtreamusername}">
                                                                                    <input type="hidden" name="password"  value="{$service.xtreampassword}">
                                                                                    <input type="hidden" name='pid' value="{$service.pid}">
                                                                                    <input type="hidden" name='userid' value="{$service.clientid}">  
                                                                                    <input class="form-control" style="width: 38%;float: left;margin-right: 15px;" maxlength="17" size="17" type="text" id="newMAC" name="newMAC" value="00:1A:79:xx:xx:xx" />
                                                                                    <input type="hidden" name="customAction" value="addMAG" />
                                                                                    <button style="width: 35%;" type="submit" class="btn btn-success btn-block"> 
                                                                                        {$lang.add_mag_button} 
                                                                                    </button>
                                                                                </form></strong></div>
                                                                    </div>  
                                                                </div>
                                                            </div>
                                                        {/if} 
                                                    </div>
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                                    </div>
                                                </div> 
                                            </div>
                                        </div>    
                                        <div id="engdevice{$service.id}" class="modal fade" role="dialog">
                                            <div class="modal-dialog"> 
                                                <!-- Modal content-->
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                                                        <h4 class="modal-title">
                                                            <i class="fa fa-info"></i>&nbsp;{$lang.enigma2_devices}
                                                        </h4>
                                                    </div>
                                                    <div class="modal-body">  
                                                        {if $service.eng_device neq '-'}
                                                            <div class="list-group">
                                                                <div class="list-group-item">
                                                                    {$lang.current_mag}&nbsp;{$lang.enigma2_devices}: <strong class="text-domain"> {$service.eng_device}</strong>
                                                                </div>  
                                                                <div class="list-group-item">
                                                                    <div width="100%"> <div style="width: 24%;float: left;margin-top: 8px;font-size: 14px;">{$lang.new_mag}&nbsp;{$lang.enigma2_devices}: </div>  <div><strong class="text-domain"> 
                                                                                <form method="post"  class="macaddress"> 
                                                                                    <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                                    <input type="hidden" name="username"  value="{$service.xtreamusername}">
                                                                                    <input type="hidden" name="password"  value="{$service.xtreampassword}">
                                                                                    <input type="hidden" name='pid' value="{$service.pid}">
                                                                                    <input type="hidden" name='userid' value="{$service.clientid}">  
                                                                                    <input class="form-control" style="width: 38%;float: left;margin-right: 15px;" maxlength="17" size="17" type="text" id="newMAC" name="newMAC" value="00:1A:79:xx:xx:xx" />
                                                                                    <input type="hidden" name="customAction" value="changeENG" />
                                                                                    <button style="width: 35%;" type="submit" class="btn btn-success btn-block"> 
                                                                                        {$lang.change_mag_button}
                                                                                    </button>
                                                                                </form></strong></div>
                                                                    </div>  
                                                                </div>
                                                            </div> 
                                                        {else}
                                                            <div class="list-group">
                                                                <div class="list-group-item">
                                                                    {$lang.current_mag}&nbsp;{$lang.enigma2_devices}:<strong class="text-domain"> None </strong>
                                                                </div>  
                                                                <div class="list-group-item">
                                                                    <div width="100%"> <div style="width: 24%;float: left;margin-top: 8px;font-size: 14px;">{$lang.new_mag}&nbsp;{$lang.enigma2_devices}: </div>  <div><strong class="text-domain"> 
                                                                                <form method="post"  class="macaddress"> 
                                                                                    <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                                    <input type="hidden" name="username"  value="{$service.xtreamusername}">
                                                                                    <input type="hidden" name="password"  value="{$service.xtreampassword}">
                                                                                    <input type="hidden" name='pid' value="{$service.pid}">
                                                                                    <input type="hidden" name='userid' value="{$service.clientid}">  
                                                                                    <input class="form-control" style="width: 38%;float: left;margin-right: 15px;" maxlength="17" size="17" type="text" id="newMAC" name="newMAC" value="00:1A:79:xx:xx:xx" />
                                                                                    <input type="hidden" name="customAction" value="addENG" />
                                                                                    <button style="width: 35%;" type="submit" class="btn btn-success btn-block"> 
                                                                                        {$lang.add_mag_button} 
                                                                                    </button>
                                                                                </form></strong></div>
                                                                    </div>  
                                                                </div>
                                                            </div>
                                                        {/if} 
                                                    </div>
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                                    </div>
                                                </div> 
                                            </div>
                                        </div>

                                    {else}
                                        <div id="magdevice{$service.id}" class="modal fade  000" role="dialog">
                                            <div class="modal-dialog"> 
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                                                        <h4 class="modal-title">
                                                            <i class="fa fa-info"></i>{if $service.engma eq 'yes'}&nbsp;{$lang.enigma2_devices}{else}&nbsp;{$lang.mag_desc} {/if}
                                                        </h4>
                                                    </div>
                                                    <div class="modal-body">  
                                                        {if $service.mag_device neq '-'}

                                                            <div class="list-group">
                                                                <div class="list-group-item">
                                                                    {$lang.current_mag}&nbsp;
                                                                    {if $service.engma eq 'yes'}
                                                                    {$lang.enigma2_devices}{else}{$lang.mag_desc}
                                                                    {/if}: 
                                                                    <strong class="text-domain"> 
                                                                        {$service.mag_device}
                                                                    </strong>
                                                                </div>  
                                                                <div class="list-group-item">
                                                                    <div width="100%"> 
                                                                        <div style="width: 24%;float: left;margin-top: 8px;font-size: 14px;">
                                                                            {$lang.new_mag}&nbsp;
                                                                            {if $service.engma eq 'yes'}
                                                                                {$lang.enigma2_devices}
                                                                            {else}
                                                                                {$lang.mag_desc}
                                                                            {/if}: 
                                                                        </div>
                                                                        <div>
                                                                            <strong class="text-domain"> 
                                                                                <form method="post"  class="macaddress"> 
                                                                                    <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                                    <input type="hidden" name="username"  value="{$service.xtreamusername}">
                                                                                    <input type="hidden" name="password"  value="{$service.xtreampassword}">
                                                                                    <input type="hidden" name='pid' value="{$service.pid}">
                                                                                    <input type="hidden" name='userid' value="{$service.clientid}">  
                                                                                    <input class="form-control" style="width: 38%;float: left;margin-right: 15px;" maxlength="17" size="17" type="text" id="newMAC" name="newMAC" value="{if $service.engma eq 'yes'}{$service.enigma2_devices}{else}{$service.mag_device}{/if}" />
                                                                                    <input type="hidden" name="customAction" value="{if $service.engma eq 'yes'}changeENG{else}changeMAG{/if}" />
                                                                                    <button style="width: 35%;" type="submit" class="btn btn-success btn-block"> 
                                                                                        {$lang.change_mag_button}
                                                                                    </button>
                                                                                </form>
                                                                            </strong>
                                                                        </div>
                                                                    </div>  
                                                                </div>
                                                            </div> 


                                                        {else}    

                                                            <!------------------------------------>



                                                            <div class="list-group">
                                                                <div class="list-group-item">
                                                                    {$lang.current_mag}&nbsp;
                                                                    {if $service.engma eq 'yes'}
                                                                        {$lang.enigma2_devices}
                                                                    {else}
                                                                        {$lang.mag_desc}
                                                                    {/if}:
                                                                    <strong class="text-domain">
                                                                        None 
                                                                    </strong>
                                                                </div>  
                                                                <div class="list-group-item">
                                                                    <div width="100%">
                                                                        <div style="width: 24%;float: left;margin-top: 8px;font-size: 14px;">
                                                                            {$lang.new_mag}&nbsp;
                                                                            {if $service.engma eq 'yes'}
                                                                                {$lang.enigma2_devices}
                                                                            {else}
                                                                                {$lang.mag_desc}
                                                                            {/if}: 
                                                                        </div>  
                                                                        <div>
                                                                            <strong class="text-domain"> 
                                                                                <form method="post"  class="macaddress"> 
                                                                                    <input type="hidden" name="serviceid"  value="{$service.id}">
                                                                                    <input type="hidden" name="username"  value="{$service.xtreamusername}">
                                                                                    <input type="hidden" name="password"  value="{$service.xtreampassword}">
                                                                                    <input type="hidden" name='pid' value="{$service.pid}">
                                                                                    <input type="hidden" name='userid' value="{$service.clientid}">  
                                                                                    <input class="form-control" style="width: 38%;float: left;margin-right: 15px;" maxlength="17" size="17" type="text" id="newMAC" name="newMAC" value="00:1A:79:xx:xx:xx" />
                                                                                    <input type="hidden" name="customAction" value="{if $service.engma eq 'yes'}addENG{else}addMAG{/if}" />
                                                                                    <button style="width: 35%;" type="submit" class="btn btn-success btn-block"> 
                                                                                        {$lang.add_mag_button} 
                                                                                    </button>
                                                                                </form>
                                                                            </strong>
                                                                        </div>
                                                                    </div>  
                                                                </div>
                                                            </div>



                                                            <!-------------------------------->
                                                        {/if}

                                                    </div> 
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                                    </div>   
                                                </div>   
                                            </div>    
                                        </div> 
                                    {/if}



                                    <!------------------------------------------------------------------------------------------------>
                                    <!------------------------------------------------------------------------------------------------>
                                    <!------------------------------------------------------------------------------------------------>

                                    <div id="iptvdetails{$service.id}" class="modal fade" role="dialog">
                                        <div class="modal-dialog"  style="width: 65%;"> 
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                                                    <h4 class="modal-title">
                                                        <i class="fa fa-info"></i>&nbsp;IPTV Service Info
                                                    </h4>
                                                </div>
                                                <div class="modal-body">
                                                    {if $service.showm3ulink eq 'on'}
                                                        <div width="100%"> 
                                                            <div class="m3u-file-type" style="width: 14%;float: left;margin-top: 8px;font-size: 14px;">
                                                                <b>
                                                                    M3U File Type :
                                                                </b>
                                                            </div>
                                                            <div> 
                                                                <label style="margin-right: 12px;margin-top: 6px;">
                                                                    <input class="RadioClick" data-modSection="{$service.id}" type="radio" style="margin-right: 6px;" name="m3u_output{$service.id}"   value="m3u_plus" checked="checked">
                                                                    M3U Plus
                                                                </label>
                                                                <label style="margin-right: 12px;margin-top: 6px;">
                                                                    <input class="RadioClick" data-modSection="{$service.id}" type="radio" style="margin-right: 6px;" name="m3u_output{$service.id}"  value="m3u">
                                                                    M3U
                                                                </label> 
                                                            </div>
                                                        </div>

                                                        <div  width="100%" style="clear: both;margin-top: 12px;"> 
                                                            <div class="m3u-playlist" style="width: 14%;float: left;margin-top: 8px;font-size: 14px;">
                                                                <b>
                                                                    {$lang.playlist} :
                                                                </b>
                                                            </div>  
                                                            <div> 
                                                                <input style="width: 68%;float: left;margin-right: 15px;"  readonly class="form-control m3ulinks" type="text" id="m3ulinks{$service.id}" value="{$service.serverhostname}/playlist/{$service.xtreamusername}/{$service.xtreampassword}/m3u_plus">
                                                                <a id="m3u_output{$service.id}" data-url="{$service.serverhostname}/playlist/{$service.xtreamusername}/{$service.xtreampassword}/" href='{$service.serverhostname}/playlist/{$service.xtreamusername}/{$service.xtreampassword}/m3u_plus' class=" m3u_output{$service.id} btn btn-default btn-primary" >
                                                                    <i class="fa fa-download" aria-hidden="true"></i>
                                                                    &nbsp;Download
                                                                </a>
                                                            </div>
                                                        </div>
                                                    {/if}  

                                                      



                                                    <div class="panel panel-default" style="margin-top: 10px;">
                                                        <!-- Default panel contents --> 

                                                        {if $service.showautoscript == "on"} 
                                                            <div class="panel-heading panel-custom-heading" style="text-align: center;padding: 8px;">
                                                                <b style="font-size:14px">
                                                                    {$lang.autoscripts}
                                                                </b>
                                                            </div>
                                                            <div class="panel-body panel_no_padding">  
                                                                <div class="panel-body" style="padding:0px">
                                                                    {foreach from=$autoscript key=scriptname item=scriptvalue}
                                                                        {assign "find" array('{$serverhostname}', '{$iptv_username}', '{$iptv_password}','{$outputfirst}')}
                                                                        {assign "repl" array({$service.serverhostname}, {$service.xtreamusername},{$service.xtreampassword},{$m3ulinkoutput})}  
                                                                        <div class="list-group-item">
                                                                            <div width="100%"> 
                                                                                <div class="panel_sub_custom" style="width: 18%;float: left;margin-top: 8px;font-size: 14px;">
                                                                                    {$scriptname} : 
                                                                                </div>
                                                                                <div>
                                                                                    <input style="width: 70%;float: left;margin-right: 15px;"  class="form-control btn_set_width" type="text" id="{{$scriptname|replace:' ':''}|replace:'.':'_'}{$service.id}" value="{$scriptvalue|replace:$find:$repl}">
                                                                                    <button class="btn btnclipboard" style="width: 10%;" id="enigma{{$scriptname|replace:' ':''}|replace:'.':'_'}{$service.id}" data-clipboard-target="#{{$scriptname|replace:' ':''}|replace:'.':'_'}{$service.id}">
                                                                                        <img src="modules/servers/XtreamUIOne/templates/image/copy-button.png" />
                                                                                    </button>
                                                                                </div>
                                                                            </div> 
                                                                        </div>  
                                                                    {/foreach} 
                                                                </div>
                                                            </div> 
                                                        {/if}
                                                    </div>


                                                    {if $service.showotherdevice == "on"} 
                                                        <div class="panel panel-default" style="margin-top: 40px;">
                                                            <!-- Default panel contents -->
                                                            <div class="panel-heading panel-custom-heading" style="text-align: center;padding: 8px; margin-bottom: 10px;"><b style="font-size:14px;">{$lang.other_devices}</b></div>

                                                            <div class="panel-body" style="padding:0px"> 
                                                                <div class="list-group-item">
                                                                    <div width="100%"> 
                                                                        <div class="stream-output" style="width: 14%;float: left;font-size: 16px;">{$lang.stream_output} </div>  <div>
                                                                            {foreach from=$accessoutput item=output}
                                                                                <label style="margin-right: 12px;"> <input type="radio" style="margin-right: 6px;" name="stream_output" {if $m3ulinkoutput eq {$output.device_key}} checked="checked"{/if} value="{$output.device_key}">{$output.device_name}</label>
                                                                            {/foreach}</div>
                                                                    </div> 
                                                                </div> 

                                                                <div class="list-group-item" class="form-inline"> 
                                                                    <div width="100%"> 
                                                                        <div class="mydropdown" style="font-size: 15px;">
                                                                            {$lang.dropdown_name}
                                                                            <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{$lang.dropdown_action}
                                                                                <span class="caret"></span></button>
                                                                            <ul class="dropdown-menu mydropdown ">
                                                                                <li>
                                                                                    <a target="_blank"
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=enigma16&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=enigma16&output=">Enigma2 OE 1.6
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=dreambox&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=dreambox&output=">Enigma2 OE 2.0
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=gigablue&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=gigablue&output=">Gigablue
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=simple&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=simple&output=">Simple List
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank"
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=octagon&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=octagon&output=">Octagon
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=starlivev3&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=starlivev3&output=">Starlive/Starsat
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=mediastart&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=mediastart&output=">Mediastart/Geant/Tiger
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=starlivev5&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=starlivev5&output=">Starlive v5
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=webtvlist&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=webtvlist&output=">WebTV List
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=ariva&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=ariva&output=">Ariva
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=fps&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=fps&output=">Fortec999/Prifix9400/Starport
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=spark&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=spark&output=">Spark
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=revosun&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=revosun&output=">Revolution6060/Sunplus
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=starsat7000&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=starsat7000&output=">Starsat7000
                                                                                    </a>
                                                                                </li>
                                                                                <li>
                                                                                    <a target="_blank" 
                                                                                       data-url="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=zorro&output="
                                                                                       href="{$service.serverhostname}/get.php?username={$service.xtreamusername}&password={$service.xtreampassword}&type=zorro&output=">Zorro
                                                                                    </a>
                                                                                </li>
                                                                            </ul>
                                                                        </div>
                                                                    </div> 
                                                                </div>  

                                                            </div>
                                                        </div>  
                                                    {/if}
                                                    <h3></h3> 
                                                    <b style='font-size:14px'></b>
                                                    <div class="radio">
                                                    </div>
                                                </div>    
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                                </div>
                                            </div>
                                        </div>    
                                    </div>    


                                {/foreach} 
                                {literal}
                                    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.css">
                                    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js"></script>
                                    <script src="https://clipboardjs.com/dist/clipboard.min.js"></script>
                                    <script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.js"></script> 
                                    <script>
                                                                       $(document).ready(function () {
                                                                         $(".btnclipboard").click(function () {
                           
                                                                                var id = this.id;
                                                                                
                                                                                var clipboard = new ClipboardJS("#"+id);
                                                                                clipboard.on('success', function (e) {
                                                                                    $('.btnclipboard').html('<img src="modules/servers/XtreamUIOne/templates/image/copy-button.png" />');
                                                                                    
                                                                                    $('#' + id).html('Copied!');
                                                                                });
                                                                                clipboard.on('error', function (e) {
                                                                                    console.log(e);
                                                                                });
                                                                            });
                                                                           $.validator.addMethod("newMAC", function (value, element) {
                                                                               return this.optional(element) || /([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})/.test(value);
                                                                           }, "Please enter a valid MAC address.");
                                                                           // Validate signup form
                                                                           $(".macaddress").validate({
                                                                               rules: {
                                                                                   newMAC: "required newMAC",
                                                                               },
                                                                           });


                                                                           var myRadio = $('input[name=stream_output]');
                                                                           var mode = myRadio.filter(':checked').val();
                                                                           $('.dropdown-menu.mydropdown a').each(function () {
                                                                               $(this).attr('href', $(this).data('url') + mode);
                                                                           });
                                                                           myRadio.on('change', function () {
                                                                               var mode = myRadio.filter(':checked').val();
                                                                               //here change the urls
                                                                               $('.dropdown-menu.mydropdown a').each(function () {
                                                                                   $(this).attr('href', $(this).data('url') + mode);
                                                                               });
                                                                           });

                                                                          /*var mym3ulink = $('input[name=m3u_output]');
                                                                          var onloadGetValue = $('.DefaultSel');
                                                                          
                                                                           //var mode = onloadGetValue.filter(':checked').val();
                                                                           var mode = "m3u_plus";
                                                                           $('.m3u_output').attr('href', $('.m3u_output').data('url') + mode);
                                                                           $('.m3ulinks').attr('value', $('.m3u_output').data('url') + mode);
                                                                           mym3ulink.on('change', function () {
                                                                               
                                                                               var mode = mym3ulink.filter(':checked').val();
                                                                               $('.m3ulinks').attr('value', $('.m3u_output').data('url') + mode);
                                                                               $('.m3u_output').attr('href', $('.m3u_output').data('url') + mode);
                                                                           });
*/

                                                                           var RadioClick = $(".RadioClick");
                                                                           RadioClick.click(function(){
                                                                                var SectionID = $(this).data('modsection');
                                                                                var ExtensionLink = $(this).val();
                                                                                var AnchorLinkSelector = $("#m3u_output"+SectionID);
                                                                                var InputSelector = $("#m3ulinks"+SectionID);
                                                                                var DefaultUrl = AnchorLinkSelector.data('url');
                                                                                var FinalLink = DefaultUrl+ExtensionLink;
                                                                                InputSelector.attr('value', FinalLink);
                                                                                AnchorLinkSelector.attr('href', FinalLink);
                                                                                
                                                                       });
                                                                       });

                                                                       function btnclickxteram(id) {
                                                                           var clipboard = new Clipboard('#' + id);
                                                                           clipboard.on('success', function (e) {
                                                                               $(".btnclipboard").html('<i class="fa fa-clipboard" aria-hidden="true"> Copy</i>');
                                                                               $('#' + id).html('Copied!');
                                                                           });
                                                                           clipboard.on('error', function (e) {
                                                                               console.log(e);
                                                                           });
                                                                       }
                                                                       function ModuleRenew(service_id) {
                                                                           jQuery.confirm({
                                                                               title: 'Renew Service',
                                                                               content: 'It will renew the service and deduct the credit from your account<br><br>Are you sure want to proceed it?',
                                                                               type: 'orange',
                                                                               typeAnimated: true,
                                                                               boxWidth: '40%',
                                                                               useBootstrap: false,
                                                                               buttons: {
                                                                                   tryAgain: {
                                                                                       text: 'Continue',
                                                                                       btnClass: 'btn-blue',
                                                                                       action: function () {
                                                                                           jQuery('#ModuleRenew' + service_id).submit();
                                                                                       }
                                                                                   },
                                                                                   close: function () {
                                                                                   }
                                                                               }
                                                                           });
                                                                       }
                                                                       function ModuleSuspend(service_id) {
                                                                           jQuery.confirm({
                                                                               title: 'Suspend Service',
                                                                               content: 'It will disable the service and no longer in use until you unsuspend it again <br><br>Are you sure want to proceed it?',
                                                                               type: 'orange',
                                                                               typeAnimated: true,
                                                                               boxWidth: '40%',
                                                                               useBootstrap: false,
                                                                               buttons: {
                                                                                   tryAgain: {
                                                                                       text: 'Continue',
                                                                                       btnClass: 'btn-blue',
                                                                                       action: function () {
                                                                                           jQuery('#ModuleSuspend' + service_id).submit();
                                                                                       }
                                                                                   },
                                                                                   close: function () {
                                                                                   }
                                                                               }
                                                                           });
                                                                       }
                                                                       function ModuleUnsuspend(service_id) {
                                                                           jQuery.confirm({
                                                                               title: 'Unsuspend Service',
                                                                               content: 'It will activate service again if there is manually suspension <br> <br>Are you sure want to proceed it?',
                                                                               type: 'orange',
                                                                               typeAnimated: true,
                                                                               boxWidth: '40%',
                                                                               useBootstrap: false,
                                                                               buttons: {
                                                                                   tryAgain: {
                                                                                       text: 'Continue',
                                                                                       btnClass: 'btn-blue',
                                                                                       action: function () {
                                                                                           jQuery('#ModuleUnsuspend' + service_id).submit();
                                                                                       }
                                                                                   },
                                                                                   close: function () {
                                                                                   }
                                                                               }
                                                                           });
                                                                       }
                                                                       function ModuleTerminate(service_id) {
                                                                           jQuery.confirm({
                                                                               title: 'Terminate Service',
                                                                               content: 'It will remove the service and can\'t be reversed<br><br>Are you sure want to proceed it?',
                                                                               type: 'orange',
                                                                               typeAnimated: true,
                                                                               boxWidth: '40%',
                                                                               useBootstrap: false,
                                                                               buttons: {
                                                                                   tryAgain: {
                                                                                       text: 'Continue',
                                                                                       btnClass: 'btn-blue',
                                                                                       action: function () {
                                                                                           jQuery('#ModuleTerminate' + service_id).submit();
                                                                                       }
                                                                                   },
                                                                                   close: function () {
                                                                                   }
                                                                               }
                                                                           });
                                                                       }
                                                                       function ModuleRemove(service_id) {
                                                                           jQuery.confirm({
                                                                               title: 'Remove Service',
                                                                               content: 'It will remove the service and can\'t be reversed<br><br>Are you sure want to proceed it?',
                                                                               type: 'orange',
                                                                               typeAnimated: true,
                                                                               boxWidth: '40%',
                                                                               useBootstrap: false,
                                                                               buttons: {
                                                                                   tryAgain: {
                                                                                       text: 'Continue',
                                                                                       btnClass: 'btn-blue',
                                                                                       action: function () {
                                                                                           jQuery('#ModuleRemove' + service_id).submit();
                                                                                       }
                                                                                   },
                                                                                   close: function () {
                                                                                   }
                                                                               }
                                                                           });
                                                                       }
                                    </script>
                                {/literal}