<?php
session_name('portal_absa');
session_start();
require_once("conexion/conectar.php");

if($_SESSION["multiempresa"] == "SI"){
	?><script>window.location.href="<?=$_SESSION["default_index"]?>"</script><?exit;
}

$query = "select tema_general,tema_menu,color_fondo,fondo_img,color_fondo_2,fondo_img_2,login_img,fondo_img_check,fondo_img_2_check,slide_superior_check,
slide_centro_check,fondo_img_3,fondo_img_4,alineacion_slide_superior,banner_centro_check
 from configpagina where id='1'";

conectar();
$resultConfig = mysql_query($query);
desconectar();

$temp=mysql_fetch_array($resultConfig);

$_SESSION['tema_general'] = $temp['tema_general'];
$_SESSION['tema_menu'] = $temp['tema_menu'];
$_SESSION['color_fondo'] = $temp['color_fondo'];
$_SESSION['fondo_img'] = $temp['fondo_img'];
$_SESSION['color_fondo_2'] = $temp['color_fondo_2'];
$_SESSION['fondo_img_2'] = $temp['fondo_img_2'];
$_SESSION['login_img'] = $temp['login_img'];
$_SESSION['fondo_img_check'] = $temp['fondo_img_check'];  //Fondo de Login Check
$_SESSION['fondo_img_2_check'] = $temp['fondo_img_2_check'];  //Fondo General Check
$_SESSION['slide_superior_check'] = $temp['slide_superior_check'];
$_SESSION['slide_centro_check'] = $temp['slide_centro_check'];
$_SESSION['banner_centro_check'] = $temp['banner_centro_check'];
$_SESSION['fondo_img_3'] = $temp['fondo_img_3'];  //Fondo banner superior
$_SESSION['fondo_img_4'] = $temp['fondo_img_4'];  //Fondo banner centro
$_SESSION['alineacion_slide_superior'] = $temp['alineacion_slide_superior'];

if(file_exists("config.ini")){
	$vlineas = file("config.ini");
	
	foreach ($vlineas as $sLinea) {
			if(substr($sLinea,0,17) == "AVISO_PRIVACIDAD=" && trim($sLinea) == "AVISO_PRIVACIDAD=SI"){
				$_SESSION["aviso"]="SI";
				break;
			}else{
				$_SESSION["aviso"]="NO";
			}
	}
}else{
$_SESSION["aviso"]=="NO";
}

?>

<html>
<head>
<title>Login - Recibe CFD</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script language="javascript" src="libs/js/jquery.min1-3-2.js"></script>
<script>
var $j_3 = $.noConflict();
</script>
<script language="javascript" src="libs/js/jquery.form.js"></script>
<script language="javascript" src="libs/js/jquery.min1.6.2.js"></script>
<script>
var $j_6 = $.noConflict();
</script>
<link rel="stylesheet" href="libs/jQueryValidation/css/validationEngine.jquery.css" type="text/css"/>
<link rel="stylesheet" href="libs/jQueryValidation/css/template.css" type="text/css"/>
<script src="libs/jQueryValidation/js/languages/jquery.validationEngine-es.js" charset="utf-8" type="text/javascript"></script>
<script src="libs/jQueryValidation/js/jquery.validationEngine.js" charset="utf-8" type="text/javascript"></script>
<script src="grids/funcionesJQGrid.js" type="text/javascript"></script>

<!-- Jquery easy ui -->
<link rel="stylesheet" type="text/css" href="libs/jquery-easyui-1.2.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="libs/jquery-easyui-1.2.4/themes/icon.css">
<script type="text/javascript" src="libs/jquery-easyui-1.2.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="libs/js/funciones.js"></script>
<script>
$j_6(document).ready(function(){
	
	$j_6("#Login").validationEngine();
	$j_6("#tbl_1").width($j_6(window).width());
	$j_6("#tbl_1").height($j_6(window).height());
	$j_6("#td_1").width($j_6(window).width());
	$j_6("#td_1").height($j_6(window).height());
	
	if(!$j_3.browser.msie){
		$j_6("#navegadores").hide();
	}
	
	$j_6('#loading').hide();
    $j_6().ajaxStart(function() {
        $j_6('#loading').show();
        $j_6('#resultLogin').hide();
    }).ajaxStop(function() {
        $j_6('#loading').hide();
        $j_6('#resultLogin').fadeIn('slow');
    });
	
	$j_6('#form, #fat, #Login').submit(function() {
        $j_6.ajax({
            type: 'POST',
            url: $j_6(this).attr('action'),
            data: $j_6(this).serialize(),
            success: function(data) {
					$j_6('#resultLogin').html(data);
            }
        })
        
        return false;
    });
		
		$j_6("#closeModal").live('click',function () {
					window.location.reload();
					$j_6('#loadModal').html('');
					$j_6('#loadModal-content').hide();
					$j_6('#ventanaModal').hide();
					$j_6('#loading').hide();
					
		});
		
});
</script>
<link href="CSS/super_css.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen" href="grids/jqgrid/src/css/<?=$_SESSION['tema_general']?>/jquery-ui-1.9.1.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="grids/jqgrid/src/css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="grids/jqgrid/src/css/ui.multiselect.css" />

<style type="text/css">
body{font: .75em Arial,sans-serif; background: <?=$_SESSION['color_fondo']?>; color: #333333; 
<?if($_SESSION['fondo_img_check'] != 0 && trim($_SESSION['fondo_img']) != ""){?>background-image: url(Imagenes/imgFondo/<?=$_SESSION['fondo_img']?>);<?}?>  background-size: cover;
        -moz-background-size: cover;
        -webkit-background-size: cover;
        
    background-attachment: fixed;
}

.sombra{
behavior: url('CSS/ie-css3.htc');
box-shadow: -20px 20px 20px #333333;
-webkit-box-shadow: -20px 20px 20px #333333;
-moz-box-shadow: -20px 20px 20px #333333;

-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
padding-left : 5px; padding-right : 5px;
background-color: #FFFFFF
}
.headDiv{
behavior: url('CSS/ie-css3.htc');
box-shadow: -3px 3px 20px #333333;
-webkit-box-shadow: -3px 3px 20px #333333;
-moz-box-shadow: -3px 3px 20px #333333;
width:100%;
height: 30px;
border:0px;
background-color: #00263C;
font-size: 16px;
color: #CCCCCC;
z-index:200;
position:fixed;
}

.bannerDiv{
width:100%;
height: 150px;
border:0px;
position:fixed;
z-index: 199;
}

.sombraModal{
behavior: url('CSS/ie-css3.htc');
box-shadow: -10px 10px 20px #333333;
-webkit-box-shadow: -10px 10px 20px #333333;
-moz-box-shadow: -10px 10px 20px #333333;

-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
padding-left : 5px; padding-right : 5px;
background-color: #FFFFFF
}

.ventanaModal_{
background-color: #000000;
z-index:500;
position:fixed;
opacity:0.7;
filter: alpha(opacity=70);
}

.loadModal_{
background-color: #FFFFFF;
z-index:501;
position: absolute;
width: 500px;
height: 500px;
}

.close-window{
    padding: 5px 5px 5px 5px;
    margin-top:-15px;
}
</style>
<!--
<!--[if IE]>
<style type="text/css">
.headDiv{
behavior: url('CSS/ie-css3.htc');
box-shadow: -3px 3px 20px #333333;
width:100%;
height: 30px;
border:0px;
background-color: #00263C;
font-size: 16px;
color: #CCCCCC;
z-index:200;
position: absolute;
left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}

.bannerDiv{
width:100%;
height: 150px;
border:0px;
position: absolute;
left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
z-index: 199;
}

.ventanaModal_{
background-color: #000000;
z-index:500;
opacity:0.7;
filter: alpha(opacity=70);
position: absolute;
left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}

</style>
<![EndIf]-->
<!--
<!--[if IE]>
<style>
.ventanaModal_{
background-color: #000000;
z-index:500;
opacity:0.7;
filter: alpha(opacity=70);
position: absolute;
left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}

</style>
<![EndIf]-->

</head>

<body>
<div class="headDiv">
Facturaci&oacute;n Electr&oacute;nica - Recibe CFD
</div>

<div id="ventanaModal"></div>
    <div id="loadModal-content" style="position: fixed">
            <div id="closeModal-content" class="close-window" align="right"><img src="Imagenes/closeWindow.png" id="closeModal" style="cursor: pointer" title="Cerrar" width="20" height="20"/></div>
            <div id="loadModal" align="center" style="overflow:auto"></div>
    </div>
<?if($_SESSION['fondo_img_check'] != 0 && trim($_SESSION['fondo_img']) != ""){?>
<div style="z-index: 1; position:absolute; width: 100%; height: 100%; margin-left: -10px">
<img style="left: 0px; top: 0px" src="Imagenes/imgFondo/<?=$_SESSION['fondo_img']?>" width="105%" height="100%"/>
</div>
<?}?>
<div style="z-index: 2; position:absolute; width: 100%; height: 100%">
<center>
<div id="resultLogin"></div>
<form name="Login" id="Login" method="post" action="login.php">
<table width="100%" height="100%">
    <tr>
        <td valign="center">
      <center>
	  <br/><br/>
	  <table width="536" height="274" border="0" style="background-image:url(Imagenes/imgLogin/<?=$_SESSION['login_img']?>); background-repeat: no-repeat;">
                    <tr><td height="100px"></td>
                    </tr>
                    <tr>
                            <td class="txt_logindat_17" align="right">
                                    &nbsp;Usuario:
                            </td>
                            <td>
                                    <input type="text" name="user" style="font-size:14px" id="user" size="30" class="validate[required] text-input" data-prompt-position="topRight:-70"/>
                            </td>
                    </tr>
                    <tr>
                            <td class="txt_logindat_17" align="right">
                                    &nbsp;Contrase&ntilde;a:
                            </td>
                            <td>
                                    <input type="password" name="pass" style="font-size:14px" id="pass" size="30" class="validate[required] text-input" data-prompt-position="topRight:-30"/>
                            </td>
                    </tr>
                    <tr>
                            <td></td>
                            <td><input type="submit" value="Entrar"/></td>
                    </tr>
                    
                    <tr>
                            <td align="center" colspan="2">
                                <a style="color: #000000; font-weight: bold" href="admin.php?modulo=REGUSUARIOS" target="_self">Registrarse</a>&nbsp;&nbsp;&nbsp;
                                <a style="color: #000000; font-weight: bold" href="admin.php?modulo=RECUERDAPASS" target="_self">&iquest;Olvid&oacute; su contrase&ntilde;a?</a>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="pie" href="http://www.disxii.com" target="_blank"><img src="Imagenes/poweredby.png" width="42" height="28"></a><br/>
								<?if($_SESSION["aviso"]=="SI"){include "aviso.php";}?>
                            </td>
                    </tr>
            </table>
            </center>
        </td>
    </tr>
</table>		
</form>
      
</center>
</div>
</body>
</html>
