<?php
require_once('../includes/init.php');

$res = (object) array();

$res->success = $APP_AVAILABLE;
$res->message = $DEV_MESSAGE;

if ( $m_mode == 1) {
	$res->success = false;
	$res->message = 'Maintenance mode';
}

if ( $dev_off == 1) {
	$res->success = false;
	$res->message = 'App is closed by Developer!';
}

$res->app_version = (int) $app_version;
$res->app_url = $app_url;

$res->spin_limit = $spin_view;
$res->daily_task_limit = $spin_click;
$res->spin_control = $spin_enabled;
$res->Bajigar = $Bajigar;
$res->SRCreatorStartio = $SRCreatorStartio;
$res->spin_waiting_time = $spin_waiting_time;




$res->primary_color = $primary_color;
$res->gradient_color_end = $gradient_color_end;
$res->home_notice = $home_notice;
$res->showbanners = $showbanners;


$res->vpn_required = $vpn_task_only == 1 ? null : $vpn_required;

$res->tg_channel = $tg_channel;
$res->support_group = $support_group;
$res->developer_url = $developer_url;

$res->ban_ad = $ban_ad ?? '';

if($multi_task == '1' && empty($_GET['task-app'])) {
	$res->vpn_required = null;
}

if ( $_GET['task-app'] == 1 ) {
	$res->ban_ad = $ban1;
}

if ( $_GET['task-app'] == 2 ) {
	$res->ban_ad = $ban2;
}

if ( $_GET['task-app'] == 3 ) {
	$res->ban_ad = $ban3;
}

if ( $_GET['task-app'] == 4 ) {
	$res->ban_ad = $ban4;
}



$json = json_encode($res);


?>

<?php echo $json ?>')


<script>
    // Wait for the page to load
    document.addEventListener('DOMContentLoaded', function() {
        // Parse the JSON string
        var response = JSON.parse('<?php echo $json ?>');
        
        // Change the background color to red
        document.body.style.backgroundColor = 'black';
        
        // Check if the response was successful
        if (response.success) {
            // Display the alert
            // alert('কি গো সোনা মনি লিংক বাহির কইরা আইছো কি দেখতে । ');
            
            // Wait for the alert to be dismissed
            setTimeout(function() {
                // Remove the background color
                document.body.style.backgroundColor = '';
                
                // Check if the JSON string was successfully echoed
                if (<?php echo isset($json) ? 'true' : 'false' ?>) {
                    // Display the response
                    // console.log(response);
                } else {
                    // Display an error message
                    alert('Error echoing JSON string!');
                }
                
                // Redirect to a blank page after a delay
                setTimeout(function() {
                    // window.location.replace('about:blank');
                    // window.close();
                }, 0); // Adjust the delay time as needed
            }, 0); // Adjust the delay time as needed
        } else {
            // Remove the background color
            document.body.style.backgroundColor = '';
            
            // Display an error message
            // alert(response.message);
        }
    });
</script>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
  </head>
  <body>
    <!--<h2>Right-click disabled</h2>-->
    <!--<p>For this page the right-click is disabled.</p>-->
    <script>
      $(document).ready(function() {
          $("body").on("contextmenu", function(e) {
              return false;
            });
        });
    </script>
  </body>
</html>

<!DOCTYPE html>
<html>
  <head>

    <style>
      .body {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        color: #cc0000;
      }
    </style>
  </head>
  <body>
    <p>আসসালামু আলাইকুম </p>
    <div class="body">কি খবর লিংক বাহির করে কি খুজতে আসছো। </</div>
  </body>
</html>





<style>
body {
    background-color: black;
}
</style>

<!DOCTYPE html>
<html>
  <head>
    <title>কি খবর লিংক বাহির করে কি খুজতে আসছো। </title>
    <script>
      // Disable text selection on the page
      function disableSelection() {
        if (typeof document.onselectstart != "undefined") {
          document.onselectstart = function() { return false; };
        } else {
          document.addEventListener("mousedown", disableEvent);
          document.addEventListener("mouseup", disableEvent);
        }
      }

      // Disable the default behavior of the selection event
      function disableEvent(event) {
        event.preventDefault();
        event.stopPropagation();
      }
      
      // Call the disableSelection function when the page is loaded
      window.onload = disableSelection;
    </script>
  </head>
  <body>
    <?php
      // Your PHP code here
    ?>
  </body>
</html>
