<?php require_once('../Connections/netboxManagerMitru.php'); ?>
<?
function tokenize($sext)
	{
	$hash=md5($sext."-JDA_MITRU:PBX");
	$hash=md5(substr($hash, 16, 10)."JHSDUY83JSDF873QDKMG83".substr($hash, 0, 10));
	$hash=md5("JDA".$hash);
	return $hash;
	}


mysql_select_db($database_netboxManagerMitru, $netboxManagerMitru);
$hab=$_GET["hab"];
$token=tokenize($hab);
$updHuesped="UPDATE hab_check SET hab_activo=0 WHERE hab_nrohab=$hab";
$xupdHuesped=mysql_query($updHuesped);
$delradcheck="DELETE FROM radcheck WHERE UserName like '$hab%'";
$xdelradcheck=mysql_query($delradcheck);
$delradreply="DELETE FROM radreply WHERE UserName like '$hab%'";
$xdelradreply=mysql_query($delradreply);
$DelNewExt=file_get_contents("http://192.168.22.2/jda_scripts/Pre_CheckoutTelHab.php?hab=$hab&token=$token");
?>