<?php
/* Smarty version 3.1.29, created on 2025-12-29 05:10:45
  from "/home/smtunnel/pakhi.xyz/templates/js/page/download_js.tpl" */

if ($_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.29',
  'unifunc' => 'content_6951e325debed4_08150102',
  'file_dependency' => 
  array (
    '94880d0e4e6f6ebac0214f240bd19921fcca0ecb' => 
    array (
      0 => '/home/smtunnel/pakhi.xyz/templates/js/page/download_js.tpl',
      1 => 1752583782,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_6951e325debed4_08150102 ($_smarty_tpl) {
echo '<script'; ?>
>
function normal_modalize(title, body)
	{
	    $(".normal-modalize").modal({
            backdrop: 'static',
            keyboard: false  // to prevent closing with Esc button (if you want this too)
        })
        $(".normal-modalize").modal('show');
		$(".normal-modal-title").text(title);
		$(".normal-modal-error").html('');
		$(".normal-modal-html").html(body);
	}

function normalMessage(type,title,message)
	{
		$(".normal-modal-body > .normal-modal-error").html('').append('<div class="alert alert-'+type+' alert-has-icon"><div class="alert-icon"><i class="far fa-lightbulb"></i></div><div class="alert-body"><div class="alert-title">'+title+'</div>'+message+'</div></div>').slideDown();
	}

function downbold(url) {
  const a = document.createElement('a')
  a.href = url
  a.download = url.split('/').pop()
  document.body.appendChild(a)
  a.click()
  document.body.removeChild(a)
  $(".normal-modalize").modal('hide');
  setTimeout(function () {
        history.go(0);
      }, 3000);
}
	
function view_app(u) {
	$.ajax({
        url: "<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
serverside/data/get_appinf.php",
        data: "id="+u,
        type: "GET",
        dataType: "JSON",
		cache: false,
        success: function(data)
        {
            var template_html =  `<div class="card-body" id="xxapp">
                                    <div class="text-center">
                                      `+data.app_image+`
                                      <div class="clearfix"></div>
                                    </div>
                                    <div class="author-box-details mt-3">
                                      <div class="author-box-name text-center">
                                        <a href="#"><h4>`+data.app_title+`</h4></a>
                                      </div>
                                      <div class="author-box-job text-center">Downloads: `+data.app_downloads+`</div><hr>
                                      <div class="author-box-description" style="text-align: justify;">
                                        <p>`+data.app_description+`</p>
                                      </div>
                                      
                                      <hr>
                                      <div class="text-center">
                                      <button type="button" onclick="downbold('<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
dl?id=`+data.app_id+`')" class="btn btn-primary btn-download mr-1" id="btn-download">
                                        <i class="fa fa-download" aria-hidden="true"></i> Download
                                      </button>
                                      <button type="button" class="btn btn-primary btn-xcopy" data-clipboard-text="<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
dl?id=`+data.app_id+`">
                                        <i class="far fa-copy"></i> Copy
                                      </button>
                                      </div>
                                      <div class="w-100 d-sm-none"></div>
                                    </div>
                                  </div>`;
			normal_modalize('Details', template_html);
        },
        error: function (jqXHR, textStatus, errorThrown)
        {
            Swal.fire({
                        title: "Error",
                        icon: "error",
                        html: "Failed getting data from ajax.<br><b></b>",
                        allowOutsideClick: false,
                        allowEscapeKey: false,
                        customClass: {
                            confirmButton: 'btn-primary'
                        },
                        timer: 3000,
                        timerProgressBar: true,
                        didOpen: () => {
                            Swal.showLoading();
                            const timer = Swal.getPopup().querySelector("b");
                            timerInterval = setInterval(() => {
                                timer.textContent = `${
                                    Swal.getTimerLeft()
                                }`;
                            }, 100);
                        },
                        willClose: () => {
                            clearInterval(timerInterval);
                        }
                    }).then((result) => {
                        if (result.dismiss === Swal.DismissReason.timer) {
                            location.reload()
                        }
                    });
        },
        complete: function(){

		}
    });
}
<?php echo '</script'; ?>
><?php }
}
