_decodeProperties($_smarty_tpl, array ( 'version' => '4.3.1', 'unifunc' => 'content_68caef1d3f6014_06229700', 'has_nocache_code' => false, 'file_dependency' => array ( '2bd39c1d1b89c07b30366b9c2bcf3a17bed31a9a' => array ( 0 => '/var/www/html/yatmack/ui/ui/recharge.tpl', 1 => 1757857798, 2 => 'file', ), ), 'includes' => array ( 'file:sections/header.tpl' => 1, 'file:sections/footer.tpl' => 1, ), ),false)) { function content_68caef1d3f6014_06229700 (Smarty_Internal_Template $_smarty_tpl) { $_smarty_tpl->_subTemplateRender("file:sections/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false); ?>

Postpaid Recharge for the first time use tpl_vars['_c']->value['currency_code'];?> 0

_subTemplateRender("file:sections/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false); ?> > $(document).ready(function() { console.log('Recharge form loaded'); console.log('jQuery version:', $.fn.jquery); console.log('Select2 available:', typeof $.fn.select2); // Initialize customer select2 with AJAX (if not pre-selected) if ($('#personSelect').length > 0) { console.log('Initializing customer select2 with AJAX'); setTimeout(function() { try { // Destroy existing select2 if it exists if ($('#personSelect').hasClass('select2-hidden-accessible')) { $('#personSelect').select2('destroy'); console.log('Destroyed existing customer select2'); } $('#personSelect').select2({ theme: "bootstrap", width: '100%', ajax: { url: function(params) { var url = './index.php?_route=autoload/customer_select2'; if(params.term != undefined){ url += '&s=' + encodeURIComponent(params.term); } console.log('Customer AJAX URL:', url); return url; }, dataType: 'json', delay: 250, data: function (params) { return { s: params.term || '', page: params.page || 1 }; }, processResults: function (data, params) { console.log('Customer AJAX response:', data); return { results: data.results || [] }; }, cache: true, error: function(xhr, status, error) { console.error('Customer AJAX error:', error); console.error('Response:', xhr.responseText); } }, minimumInputLength: 0, placeholder: ' ...', allowClear: true }); console.log('Customer select2 initialized with AJAX'); } catch (error) { console.error('Error initializing customer select2:', error); } }, 200); // Add customer dropdown event handlers $('#personSelect').on('select2:open', function() { console.log('Customer dropdown opened'); }); $('#personSelect').on('select2:select', function(e) { console.log('Customer selected:', e.params.data); }); } // Load servers when type changes $('input[type=radio][name="type"]').change(function(){ console.log('Type changed:', $('input[name="type"]:checked').val()); $("#server").html(''); $("#plan").html(''); $("#server-help").text('Loading routers...'); $("#plan-help").text('Select a router first to load available plans'); if ($('#Hot').is(':checked')) { $.ajax({ type: "POST", dataType: "html", url: "index.php?_route=autoload/server", success: function(msg){ console.log('Servers loaded successfully'); console.log('Servers HTML:', msg); $("#server").html(msg); $("#server").prop('disabled', false); // Update help text var serverCount = $("#server option").length - 1; if (serverCount > 0) { $("#server-help").text('Found ' + serverCount + ' router(s) available'); } else { $("#server-help").text('No routers found. Please add routers first.'); } }, error: function(xhr, status, error) { console.error('Error loading servers:', error); $("#server-help").text('Error loading routers. Please check console for details.'); alert('Error loading servers. Please check console for details.'); } }); } else if ($('#POE').is(':checked')) { $.ajax({ type: "POST", dataType: "html", url: "index.php?_route=autoload/server", success: function(msg){ console.log('Servers loaded successfully'); console.log('Servers HTML:', msg); $("#server").html(msg); $("#server").prop('disabled', false); // Update help text var serverCount = $("#server option").length - 1; if (serverCount > 0) { $("#server-help").text('Found ' + serverCount + ' router(s) available'); } else { $("#server-help").text('No routers found. Please add routers first.'); } }, error: function(xhr, status, error) { console.error('Error loading servers:', error); $("#server-help").text('Error loading routers. Please check console for details.'); alert('Error loading servers. Please check console for details.'); } }); } }); // Load plans when server changes $("#server").change(function(){ var server = $("#server").val(); var jenis = $('input[name="type"]:checked').val(); console.log('Server changed:', server, 'Type:', jenis); if (server && jenis) { $("#plan-help").text('Loading plans...'); $.ajax({ type: "POST", dataType: "html", url: "index.php?_route=autoload/plan", data: "jenis=" + jenis + "&server=" + server, success: function(msg){ console.log('Plans loaded successfully'); console.log('Plans HTML:', msg); $("#plan").html(msg); // Ensure the dropdown is enabled and clickable $("#plan").prop('disabled', false); $("#plan").removeClass('disabled'); // Update help text var planCount = $("#plan option").length - 1; if (planCount > 0) { $("#plan-help").text('Found ' + planCount + ' plan(s) available'); } else { $("#plan-help").text('No plans found for this router and type. Please create plans first.'); } }, error: function(xhr, status, error) { console.error('Error loading plans:', error); $("#plan-help").text('Error loading plans. Please check console for details.'); alert('Error loading plans. Please check console for details.'); } }); } else { $("#plan").html(''); $("#plan-help").text('Select a router and type first to load available plans'); } }); // Add click handlers for debugging $("#server").click(function(){ console.log('Server dropdown clicked'); console.log('Server dropdown disabled:', $(this).prop('disabled')); console.log('Server dropdown options:', $(this).find('option').length); }); $("#plan").click(function(){ console.log('Plan dropdown clicked'); console.log('Plan dropdown disabled:', $(this).prop('disabled')); console.log('Plan dropdown options:', $(this).find('option').length); }); // Test AJAX endpoints directly $.ajax({ url: './index.php?_route=autoload/customer_select2', dataType: 'json', success: function(data) { console.log('Customer AJAX test successful:', data); }, error: function(xhr, status, error) { console.error('Customer AJAX test failed:', error); console.error('Response:', xhr.responseText); } }); $.ajax({ url: './index.php?_route=autoload/server', type: 'POST', dataType: 'html', success: function(data) { console.log('Server AJAX test successful:', data); }, error: function(xhr, status, error) { console.error('Server AJAX test failed:', error); console.error('Response:', xhr.responseText); } }); }); >