<?
ini_set('error_reporting',1);
session_start();
if ($_SESSION['estado'] != "ON")
		{
		?>
		<script>
			parent.location.href = '../index.php';
		</script>
		<? 
		exit();
		}
$id_empresa = $_SESSION['ss_empresa'];
$id_user = $_SESSION['ss_user'];
$id_autoriza=25;

/*Sesiones*/
include("../conex.php");
include("../autoriza.php");

if ($txtfecha=='') $txtfecha = date(d)."/".date(m)."/".date(Y);
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<script language="JavaScript" src="../css/cal.js" type="text/JavaScript"></script>
<style type="text/css">
<!--
body {
	background-color: #CCCCCC;
	margin-left: 0px;
	margin-top: 3px;
	margin-right: 0px;
	margin-bottom: 0px;
}
select {
	clear: right;
	float: left;
	height: auto;
	width: 267px;
}
-->
</style></head>
</head>
<body>
<div align="center">

<form id="form1" name="form1" method="post" action="muestra.php" target="mainFrame">
<div align="center">

<table width="546" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td width="100%" align="center">Seleccione mes del libro</td>
	
		<td width="100%" align="center">
			<input name="txtfecha" id="txtfecha" type="text" style="border-width:0; background-color:#CCCCCC; text-align:right" align="right" value="<?=$txtfecha?>" size="10" readonly="1">
			<a  href="javascript:show_calendar('form1.txtfecha');"><img name="foto2" id="foto2" align="top" border="0" src="../Images/CALENDAR.gif" style="cursor:pointer" title="Presione aqui y seleccione la fecha" />
		</a></td>

	
	<tr>
		<td width="100%" align="right">
			<select name="tdcto" id="tdcto" style="background-color:#CCCCCC;width:100%;" onChange="javascript:form1.submit();">
			<option value="0" selected>SELECCIONE TIPO DOCUMENTO
			<option value="0">TODOS
			<option value="1">BOLETAS HONORARIOS
			<option value="2">GUIAS
            <option value="3">FACTURAS, NC, ND y Electronicas
			</select>
		</td>
	
		<td width="65%" align="right">
			<input type="button" name="Submit" value="Ver Libro"  onClick="fun_ver_libro()"/>
		</td>
		<td width="35%" align="left"><input type="submit" name="libro_legal" value="Ver Libro Legal"/></td>
         <td width="65%" align="right"><input type="button" name="Submit2" value="Salida Excel" onClick="fun_excel()"/></td>
			<input name="Submit3" type="submit" id="Submit3" onClick="fun_salir();" value="Salir"/>
		</td>
	</tr>
</table>
</form>
<div id="div1">
<form action="lee_libro_xml_compra.php" method="post" name="form2" enctype="multipart/form-data"  target="mainFrame">

<table border="0" align="center">
		     <td>Captura Libro Compra XML SII</td>
               <td><input type="submit" name="Submit2" value="Subir DTE" /></td>
             <td><span class="combos"> 
           <input name="reserva" type="file" id="reserva" size="40" onBlur="LimitAttach(this,7);">   </span></td>
</table>
</form>
</div>


  </div>
</body>
</html>

<script language="javascript">
function fun_salir()
	{
	window.top.open('','_parent','');window.top.close();
	}

function fun_ver_libro()
	{
	document.form1.action='muestra.php';
	document.form1.submit();
	}
	
function fun_excel()
	{
	document.form1.action='muestra_sii.php';
	document.form1.submit();
	}
function LimitAttach(tField,iType) 
{
file=tField.value;
if (iType==1) { 
extArray = new Array(".gif",".jpg",".png",".bmp");
}
if (iType==2) {
extArray = new Array(".swf");
}
if (iType==3) {
extArray = new Array(".exe",".sit",".zip",".tar",".swf",".mov",".hqx",".ra",".wmf",".mp3",".qt",".med",".et");
}
if (iType==4) {
extArray = new Array(".mov",".ra",".wmf",".mp3",".qt",".med",".et",".wav");
}
if (iType==5) {
extArray = new Array(".html",".htm",".shtml");
}
if (iType==6) {
extArray = new Array(".doc",".xls",".ppt");
}
if (iType==7) {
extArray = new Array(".xml");
}

allowSubmit = false;
if (!file) return;

while (file.indexOf("\\") != -1) file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++) {
if (extArray[i] == ext) {
allowSubmit = true;
break;
}
} 

if (!allowSubmit) 
{
alert("Usted sólo puede subir archivos con extensiones " + (extArray.join(" ")) + "\nPor favor seleccione un nuevo archivo");
}
} 
	
		
</script>
			
