<?
////////////////////////////////////////////////////
// Conciliación: gestión de conciliación de activos
// Version: 1.0
//
// Copyright (C) 2014  Eustotem Multimedia, S.L.
//
// License: MIT, see LICENSE
////////////////////////////////////////////////////


include("../conf/preferences.php");
session_name(SYS_APP_SESSNAME);
session_start();
if(isset($_SESSION['userlang'])){
	$lol=$_SESSION['userlang'];
}else if(isset($_GET['lang'])){
	$lol=$_GET['lang'];
}else{
	$lol=0;
}
include("../conf/langs/".$langs[$lol][0]."/MAIN.php");
include("../conf/connections.php");

$lang=$_SESSION['userlang'];
$titulo=$_SESSION['application']['title'];
if(!isset($_GET['a'])){
	$mensaje=APP_LOGOUT_MESSAGE;
}else{
	if($_GET['a']=='1'){
		$mensaje=APP_NOT_AUTHORIZED;
	}else if($_GET['a']=='2'){
		$mensaje=APP_SESSION_EXPIRED;
	}
}

$cadena="DELETE FROM " . SYS_SESSION_TABLE . " WHERE sessid='" . session_id() . "'";
$q=mysql_query($cadena);


foreach($_SESSION as $item){
	unset($item);
}
if (isset($_COOKIE[session_name()])) {
   setcookie(session_name(), '', time()-42000, '/');
}
session_destroy();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://www.w3.org/2005/10/profile">
<title><? echo $titulo ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../resources/themes/default/styles_top.css" rel="stylesheet" type="text/css" />
<link href="../resources/themes/default/form_screen.css" rel="stylesheet" type="text/css" />
<link rel="icon" type="image/png" href="../resources/themes/default/favicon.png">

<link type="text/css" href="../jslib/jq/ui/css/<? echo UI_THEME ?>/jquery-ui.custom.css" rel="stylesheet" />
<link type="text/css" href="../jslib/jq/ui/css/<? echo UI_THEME ?>/jquery-ui.ekain.css" rel="stylesheet" />
<script type="text/javascript" src = "../jslib/jq/jquery-1.7.2.min.js" ></script>
<script type="text/javascript" src = "../jslib/jq/jquery.blockUI.js" ></script>
<script type="text/javascript" src = "../jslib/jq/ui/js/jquery-ui-1.8.21.custom.min.js" ></script>
<script type="text/javascript" src = "../jslib/jq/ui/jquery.ui.selectmenu.js" ></script>
<link type="text/css" href="../jslib/jq/ui/css/<? echo UI_THEME ?>/jquery.ui.selectmenu.css" rel="stylesheet" />
<script type="text/javascript" src = "../jslib/jq/fancybox/jquery.fancybox-1.3.4.pack.js" ></script>
<link rel="stylesheet" href="../jslib/jq/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />

<script type="text/javascript" src="../jslib/utils.js"></script>

<script type="text/javascript">
$(document).ready(function(){
	$('select').selectmenu();
	$('button, input:submit, input:button, input:reset, .button, .link_button').button();
});

function prelogout(){
	document.getElementById('cancel').focus();
	var loc=top.location.href;
	if(loc.indexOf("logout.php")==-1){
		top.location.href=location.href;
	}else{
		document.getElementById('cancel').focus()
	}
}
</script>
</head>

<body id="cuerpo" onload="prelogout()" class="bkg-detail-1">
<table width="100%" cellspacing="0" cellpadding="0" border="0" id="outer_table">
<tr>
	<td height="80" class="gradient_sanmarko" style="border-bottom:1px solid #666">
		<div id="logo">
		<a href="#" target="mainFrame" title="logo"><img src="../<? echo SYS_USER_STYLES_PATH . SYS_APP_LOGO ?>" alt="logo" align="middle" style="border:0" class="sombra" /></a></div>
		<div id="title">
			<h1><? echo APP_TITLE ?></h1>
		</div>
	</td>
</tr>
<tr>
	<td class="pageBar" height="1" ><h1><? echo $titulo ?></h1></td>
</tr>
<tr>
	<td id="contenedor_cell" valign="bottom" align="center">
		<form action="#" method="post" name="dataform" id="dataform" style="margin-top:50px;" class="ui-form">
		<table width="300" border="0" align="center" cellspacing="0" cellpadding="0" id="tabla"  class="sombra tablaformulario ui-corner-top">
		
		<thead>
		<tr>
			<td class="header_caption header_caption_bkg ui-corner-top"><? echo APP_LOGOUT_TITLE ?></td>
		</tr>
		</thead>
		
		<tbody class="innertbody">
			<tr class="row1">
				<td valign="top"><? echo $mensaje ?></td>
			</tr>
		</tbody>
		
		<tfoot>
		<tr>
			<td class="ui-state-default  footer">
				<input type="button" id="cancel" name="Cancel" value="<? echo BUTTON_OK ?>" class="but_medium" onclick="javascript:top.location.href='index.php?lang=<? echo $lol ?>'" />
			</td>
		</tr>
		</tfoot>
		</table>
		</form>
	</td>
</tr>
</table>

</body>

</html>