<?php


ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(E_ALL);
include 'includes/header.php';

if (isset($_POST['message'])) {
	echo $_POST['message'];
}
$lurl = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] !== 'off') ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/api/';
$security_key = 'slcapksecretky';
$security_id = 'uniqueivslcapk';
$security_key2 = '222';
$security_id2 = '222';
$security_key3 = '333';
$security_id3 = '333';
echo "\n\t\t\t" . '<div class="card-body">' . "\n" . '                    <div class="card mb-4">' . "\n" . '                        <div class="card-header bg-primary py-3">' . "\n" . '                            <h4 align="center" class="m-0 text-white">' . "\n\t\t\t\t\t\t" . '<center>' . "\n\t\t\t\t\t\t\t" . '<i class="fas fa-fw fa-code"></i><span> Get Your Api Encoded URL' . "\n\t\t\t\t\t\t" . '</center></h4>' . "\n\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t" . '<div class="card-body">' . "\n\t\t\t\t\t\t\t";
echo '                            <form method="post">' . "\n";
echo '                            <div class="form-group ">' . "\n";
echo '                            <label class="control-label " for="admob_banner_id">' . "\n";
echo '                            <strong> Your actual panel url string below.</strong>' . "\n";
echo '                            </label>' . "\n";
echo '                            <div class="input-group">' . "\n";
echo '     <input type="text" class="form-control text-primary" name="txtCode" id="inny" value="';
echo $lurl;
echo '"  readonly/>' . "\n" . '                                   ' . "\n" . '<br>' . "\n";
echo '                            </div>' . "\n";
echo '                            </div>' . "\n";
echo '                            <div class="form-group ">' . "\n";
echo '                            <label class="control-label " for="admob_interstitial_id">' . "\n";
echo '                            <strong>String output converted to standard AES version</strong>' . "\n";
echo '                            </label>' . "\n";
echo '                            <div class="input-group">' . "\n";
echo "\n" . '     <input type="text" class="form-control text-primary" name="txtResult" id="output" value="';

if (isset($lurl)) {
	$txtCode = $lurl;
	$str = bin2hex(openssl_encrypt($txtCode, 'AES-128-CBC', $security_key, OPENSSL_RAW_DATA, $security_id));
	$new_str = str_replace(' ', '', $str);
	echo $new_str;
}

echo '"  readonly/><br>' . "\n";
echo '                            </div>' . "\n";
echo '                            </div>' . "\n";
echo "\t\t\t\t" . '  ' . "\n\t\t\t\t" . '  ' . "\n\t\t\t\t" . '  ' . "\n\t\t\t\t\t\t\t\t" . '<hr>' . "\n\t\t\t\t\t\t\t\t" . '<div class="form-group">' . "\n\t\t\t\t\t\t\t\t\t" . '<center>' . "\n\t\t\t\t\t\t\t\t\t" . '     <button class="btn btn-danger btn-icon-split submit_button" ' . "\n\t\t\t\t\t\t\t\t\t\t" . ' type="button" id="button1" onClick="changeText(\'copy1\', \' Copied Standard Version Output!\', \' Copy Standard Version Output\')" >' . "\n\t\t\t\t\t\t\t\t\t\t" . ' <span class="icon text-white-50"><i class="fas fa-copy"></i></span>' . "\n\t\t\t\t\t\t\t\t\t\t" . ' <span  id="copy1" class="text1 text"> Copy Standard Version Output</span></button> ' . "\n";
echo "\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t" . '</center>' . "\n\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t" . '</form>' . "\t" . ' ' . "\n\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t" . '</div>' . "\n\t\t\t\t" . '</div>' . "\n\n";
echo '    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>' . "\n";
echo '    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>' . "\n";
echo ' <script> ' . "\n";
echo '$(document).ready(function () {' . "\n";
echo '    $(\'#flash-msg\').delay(3000).fadeOut(\'slow\');' . "\n";
echo '});' . "\n";
echo '  </script>' . "\n";
echo ' <script>' . "\n";
echo '$(\'#confirm-delete\').on(\'show.bs.modal\', function(e) {' . "\n";
echo '    $(this).find(\'.btn-ok\').attr(\'href\', $(e.relatedTarget).data(\'href\'));' . "\n";
echo '});' . "\n";
echo '    </script>' . "\n";
echo ' <script> ' . "\n";
echo ' function clearContents() {' . "\n";
echo '     document.getElementById("inny").value = \'\';' . "\n";
echo '     document.getElementById("output").value = \'\';' . "\n";
echo '     document.getElementById("output2").value = \'\';' . "\n";
echo '     document.getElementById("output3").value = \'\';' . "\n";
echo '   }' . "\n";
echo '   function changeText(button, text, textToChangeBackTo) {' . "\n";
echo '     document.getElementById(button).innerHTML = text;' . "\n";
echo '     setTimeout(function() { document.getElementById(button).innerHTML = textToChangeBackTo; }, 3000);' . "\n";
echo '   }' . "\n";
echo '   $(function() { ' . "\n";
echo '    $("#copy1").click(function() { ' . "\n";
echo '     var copyText = document.getElementById("output");' . "\n";
echo '     copyText.select();' . "\n";
echo '     document.execCommand("copy");' . "\n";
echo '   });' . "\n";
echo '   });' . "\n";
echo '   $(function() { ' . "\n";
echo '    $("#copy2").click(function() { ' . "\n";
echo '     var copyText2 = document.getElementById("output2");' . "\n";
echo '     copyText2.select();' . "\n";
echo '     document.execCommand("copy");' . "\n";
echo '   });' . "\n";
echo '   });' . "\n";
echo '   $(function() { ' . "\n";
echo '    $("#copy3").click(function() { ' . "\n";
echo '     var copyText3 = document.getElementById("output3");' . "\n";
echo '     copyText3.select();' . "\n";
echo '     document.execCommand("copy");' . "\n";
echo '   });' . "\n";
echo '   });' . "\n";
echo '    </script>' . "\n";
include 'includes/footer.php';
echo "\n" . '</body>';

?>