<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2
 * @ Decoder version: 1.0.4
 * @ Release: 01/09/2021
 */

session_start();
if (isset($_SESSION["loggedin"])) {
    header("location:dns.php");
}
$db = new SQLite3("./api/data/.bet_tmdb.db");
$db->exec("CREATE TABLE IF NOT EXISTS USERS(ID INT PRIMARY KEY,USERNAME TEXT ,PASSWORD TEXT)");
$db->exec("CREATE TABLE IF NOT EXISTS messages(id INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL, message VARCHAR(100), userid TEXT,status TEXT,expire TEXT)");
$rows = $db->query("SELECT COUNT(*) as count FROM USERS");
$row = $rows->fetchArray();
$numRows = $row["count"];
if ($numRows == 0) {
    $db->exec("INSERT INTO USERS(ID ,USERNAME, PASSWORD) VALUES('1' ,'admin', 'admin')");
}
if (isset($_POST["login"])) {
    if (!$db) {
        echo $db->lastErrorMsg();
    }
    $sql = "SELECT * from USERS where USERNAME=\"" . $_POST["username"] . "\";";
    $ret = $db->query($sql);
    while ($row = $ret->fetchArray()) {
        $id = $row["ID"];
        $username = $row["USERNAME"];
        $password = $row["PASSWORD"];
    }
    if ($id != "") {
        if ($password == $_POST["password"]) {
            session_regenerate_id();
            $_SESSION["loggedin"] = true;
            $_SESSION["N"] = $_POST["username"];
            header("Location: dns.php");
        } else {
            echo "Wrong Password";
        }
    } else {
        echo "User Does Not Exist, Please Try Again!";
    }
    $db->close();
}
$date = date("d-m-Y H:i:s");
$IPADDRESS = real_ip();
$db1 = new SQLite3("./api/data/.bet_tmdb.db");
$db1->exec("CREATE TABLE IF NOT EXISTS logs(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, date datetime, ipaddress TEXT)");
$db1->exec("INSERT INTO logs(date,ipaddress) VALUES('" . $date . "','" . $IPADDRESS . "')");
echo "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n  <head>\r\n    <!-- Required meta tags -->\r\n    <meta charset=\"utf-8\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\r\n    <title>Bet3 Smarters Manager</title>\r\n    <!-- plugins:css -->\r\n    <link rel=\"stylesheet\" href=\"assets/vendors/mdi/css/materialdesignicons.min.css\">\r\n    <link rel=\"stylesheet\" href=\"assets/vendors/css/vendor.bundle.base.css\">\r\n    <!-- endinject -->\r\n    <!-- Plugin css for this page -->\r\n    <!-- End plugin css for this page -->\r\n    <!-- inject:css -->\r\n    <!-- endinject -->\r\n    <!-- Layout styles -->\r\n    <link rel=\"stylesheet\" href=\"assets/css/style2.css\">\r\n    \r\n    <link rel=\"shortcut icon\" href=\"assets/images/favicon.ico\" />\r\n    \r\n<!-- Logint styles -->    \r\n<style>\r\nhtml {\r\n  height: 100%;\r\n}\r\n\r\n.login-box {\r\n   background: rgba(0,0,0,.5);\r\n  box-sizing: border-box;\r\n  box-shadow: 0 15px 25px rgba(0,0,0,.6);\r\n  border-radius: 10px;\r\n}\r\n\r\n.login-box h2 {\r\n  margin: 0 0 30px;\r\n  padding: 0;\r\n  color: #fff;\r\n  text-align: center;\r\n}\r\n.login-box .user-box {\r\n  position: relative;\r\n}\r\n\r\n.login-box .user-box input {\r\n  width: 100%;\r\n  padding: 10px 0;\r\n  font-size: 16px;\r\n  color: #fff;\r\n  margin-bottom: 30px;\r\n  border: none;\r\n  border-bottom: 1px solid #fff;\r\n  outline: none;\r\n  background: transparent;\r\n}\r\n.login-box .user-box label {\r\n  position: absolute;\r\n  top:0;\r\n  left: 0;\r\n  padding: 10px 0;\r\n  font-size: 16px;\r\n  color: #fff;\r\n  pointer-events: none;\r\n  transition: .5s;\r\n}\r\n\r\n.login-box .user-box input:focus ~ label,\r\n.login-box .user-box input:valid ~ label {\r\n  top: -20px;\r\n  left: 0;\r\n  color: #03e9f4;\r\n  font-size: 12px;\r\n}\r\n\r\n.login-box form a {\r\n  position: relative;\r\n  display: inline-block;\r\n  padding: 10px 20px;\r\n  color: #03e9f4;\r\n  font-size: 14px;\r\n  text-decoration: none;\r\n  text-transform: uppercase;\r\n  overflow: hidden;\r\n  transition: 0.5s;\r\n  letter-spacing: 4px\r\n}\r\n\r\n.login-box a:hover {\r\n  background: #02700ff;\r\n  color: #fff;\r\n  border-radius: 5px;\r\n  box-shadow: 0 0 5px #0072ff,\r\n              0 0 25px #03e9f4,\r\n              0 0 50px #03e9f4,\r\n              0 0 100px #03e9f4;\r\n}\r\n\r\n.login-box a span {\r\n  position: absolute;\r\n  display: block;\r\n}\r\n\r\n.login-box a span:nth-child(1) {\r\n  top: 0;\r\n  left: -100%;\r\n  width: 100%;\r\n  height: 2px;\r\n  background: linear-gradient(90deg, transparent, #03e9f4);\r\n  animation: btn-anim1 1s linear infinite;\r\n}\r\n\r\n@keyframes btn-anim1 {\r\n  0% {\r\n    left: -100%;\r\n  }\r\n  50%,100% {\r\n    left: 100%;\r\n  }\r\n}\r\n\r\n.login-box a span:nth-child(2) {\r\n  top: -100%;\r\n  right: 0;\r\n  width: 2px;\r\n  height: 100%;\r\n  background: linear-gradient(180deg, transparent, #03e9f4);\r\n  animation: btn-anim2 1s linear infinite;\r\n  animation-delay: .25s\r\n}\r\n\r\n@keyframes btn-anim2 {\r\n  0% {\r\n    top: -100%;\r\n  }\r\n  50%,100% {\r\n    top: 100%;\r\n  }\r\n}\r\n\r\n.login-box a span:nth-child(3) {\r\n  bottom: 0;\r\n  right: -100%;\r\n  width: 100%;\r\n  height: 2px;\r\n  background: linear-gradient(270deg, transparent, #03e9f4);\r\n  animation: btn-anim3 1s linear infinite;\r\n  animation-delay: .5s\r\n}\r\n\r\n@keyframes btn-anim3 {\r\n  0% {\r\n    right: -100%;\r\n  }\r\n  50%,100% {\r\n    right: 100%;\r\n  }\r\n}\r\n\r\n.login-box a span:nth-child(4) {\r\n  bottom: -100%;\r\n  left: 0;\r\n  width: 2px;\r\n  height: 100%;\r\n  background: linear-gradient(360deg, transparent, #03e9f4);\r\n  animation: btn-anim4 1s linear infinite;\r\n  animation-delay: .75s\r\n}\r\n\r\n@keyframes btn-anim4 {\r\n  0% {\r\n    bottom: -100%;\r\n  }\r\n  50%,100% {\r\n    bottom: 100%;\r\n  }\r\n}\r\n  table{table-layout: fixed;}\r\n  td{word-wrap:break-word}\r\n  .main{padding-top: 25px;}\r\n</style>\r\n  </head>\r\n  <body>\r\n    <div class=\"container-scroller\">\r\n      <div class=\"container-fluid page-body-wrapper full-page-wrapper\">\r\n          <div class=\"content-wrapper full-page-wrapper d-flex aalign-items-center auth login-bg\">\r\n            <div class=\"col-lg-4 mx-auto\">\r\n              <div align=\"center\" class=\"login-box card-body px-5 py-5\">\r\n                <h4>\r\n                  <img src=\"assets/images/login.png\" width=\"150\" height=\"150 \" class=\"logo\"></h4>\r\n\t\t\t\t  \r\n\t\t\t\t  <h4>Smarters<sup>v3++</sup> Manager</h4>\r\n\t\t\t\t  <br>\r\n      <form  method=\"post\" name=\"bet3_form\" id=\"bet3_form\">\r\n              <input type=\"hidden\" name=\"login\"/><br>\r\n    <div class=\"user-box\">\r\n      <input type=\"text\" name=\"username\" required=\"\">\r\n      <label>Username</label>\r\n    </div>\r\n    <br>\r\n    <div class=\"user-box\">\r\n      <input type=\"password\" name=\"password\" required=\"\">\r\n      <label>Password</label>\r\n    </div> <br>\r\n    \r\n     <a href=\"#\" class=\"btn btn-lg btn-block\" onClick=\"document.getElementById('bet3_form').submit();\">\r\n      <span></span>\r\n      <span></span>\r\n      <span></span>\r\n      <span></span>\r\n      ENTER PANEL\r\n    </a>\r\n  </form>\r\n\t\t\t\t\r\n               \r\n                <center> <br>\r\n\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t<p>Time Of Arrival: \"<i>";
echo date("Y-m-d H:i:s");
echo "</i>\"<br>\r\n\t\t\t\tIP Address: \"<i>";
echo real_ip();
echo "</i>\"</p>\r\n\t\t\t\t</div>\r\n                   <h3 class=\"card-title mb-3\"><a href=\"https://t.me/apkrebrandec\" class=\"btn btn-lg btn-block\" onClick=\"document.getElementById('bet3_form').submit();\">\r\n    <strong>REBRANDING EC</strong>\r\n    </a></h> </center>\r\n          </div>\r\n          </div>\r\n          <!-- content-wrapper ends -->\r\n        </div>\r\n        <!-- row ends -->\r\n      </div>\r\n      <!-- page-body-wrapper ends -->\r\n    </div>\r\n    <!-- container-scroller -->\r\n    <!-- plugins:js -->\r\n    <script src=\"assets/vendors/js/vendor.bundle.base.js\"></script>\r\n    <!-- endinject -->\r\n    <!-- Plugin js for this page -->\r\n    <!-- End plugin js for this page -->\r\n    <!-- inject:js -->\r\n    <script src=\"assets/js/off-canvas.js\"></script>\r\n    <script src=\"assets/js/hoverable-collapse.js\"></script>\r\n    <script src=\"assets/js/misc.js\"></script>\r\n    <script src=\"assets/js/settings.js\"></script>\r\n    <script src=\"assets/js/todolist.js\"></script>\r\n    <!-- endinject -->\r\n  </body>\r\n</html>";
function real_ip()
{
    $ip = "undefined";
    if (isset($_SERVER)) {
        $ip = $_SERVER["REMOTE_ADDR"];
        if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
            $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
        } else {
            if (isset($_SERVER["HTTP_CLIENT_IP"])) {
                $ip = $_SERVER["HTTP_CLIENT_IP"];
            }
        }
    } else {
        $ip = getenv("REMOTE_ADDR");
        if (getenv("HTTP_X_FORWARDED_FOR")) {
            $ip = getenv("HTTP_X_FORWARDED_FOR");
        } else {
            if (getenv("HTTP_CLIENT_IP")) {
                $ip = getenv("HTTP_CLIENT_IP");
            }
        }
    }
    $ip = htmlspecialchars($ip, ENT_QUOTES, "UTF-8");
    return $ip;
}

?>