<?php	
  include("../clases/BDConexion.php");
  include("../clases/clsPer.php");
  include("Funciones.php");
  include("stilos/config.inc.php");
  include("funcion/funciones.php");
  session_start();
  $objPer=new clsPer; 
  
  
 if($_SESSION['usuarea']==""){
 echo "La session caduco por favor termine esta session cerrando el sistema y vuelva a entrar";
 }else{ 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><MMString:LoadString id="insertbar/formsHidden" /></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">

<link href="Estilos.css" rel="stylesheet" type="text/css">
<link href="estilitos.css" rel="stylesheet" type="text/css" />
<link href="stilos/Estilos.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="javascript/prototype.js"></script>
	<script type="text/javascript" src="javascript/effects.js"></script>
	<script type="text/javascript" src="javascript/accordion.js"></script>
	<script type="text/javascript" src="javascript/code_highlighter.js"></script>
	<script type="text/javascript" src="javascript/javascript.js"></script>
	<script type="text/javascript" src="javascript/html.js"></script>
<SCRIPT language=JavaScript src="js/calendario.js"></SCRIPT>
<script type="text/javascript">
			
		//
		//  In my case I want to load them onload, this is how you do it!
		// 
		Event.observe(window, 'load', loadAccordions, false);
	
		//
		//	Set up all accordions
		//
		function loadAccordions() {			
			var bottomAccordion = new accordion('vertical_container');			
			// Open first one
			bottomAccordion.activate($$('#vertical_container .accordion_toggle')[0]);
			
			// Open second one
			//topAccordion.activate($$('#horizontal_container .horizontal_accordion_toggle')[2]);
		}
		
	</script>
<? $url="per_send_doc.php"?>
<script>
function volver(form)
{
location.reload('<? echo $url ?>');
}
</script>
<script type="text/javascript" src="js/ajax.js"></script>
<script language="JavaScript" type="text/javascript">
var sel = true
function selecciona(){
if(sel == true){
	for(m=0; m < document.forms[0].length; m++){
		if(document.forms[0].elements[m].type == "checkbox"){
			document.forms[0].elements[m].checked = true
			}
		}
		sel = false
	}
else{
	for(m=0; m < document.forms[0].length; m++){
		if(document.forms[0].elements[m].type == "checkbox"){
			document.forms[0].elements[m].checked = false
			}
		}
	sel = true
	}

}
</script>
<script language="JavaScript" type="text/javascript">
var sel = true
function deselecciona(){
if(sel == true){
	for(m=0; m < document.forms[0].length; m++){
		if(document.forms[0].elements[m].type == "checkbox"){
			document.forms[0].elements[m].disabled = true
			}
		}
	sel = false
	}
else{
	for(m=0; m < document.forms[0].length; m++){
		if(document.forms[0].elements[m].type == "checkbox"){
			document.forms[0].elements[m].disabled = false
			}
		}
	sel = true
	}
}
</script>
</head>

<body bgcolor="<?=$c_fondo['fondo']?>" onfocus="foco()" background="../imagenes/fondo.jpg">
<table width="650" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div align="center">
      <table width="600" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="25"><img src="../estilo_tabla/parte_sup_izq.gif" width="25" height="25"></td>
          <td width="680" background="../estilo_tabla/parte_sup_cen.gif" valign="bottom"><div align="left" class="lblTitulo" >Crear Documento Area : <? echo $_SESSION['usuarea']?></div></td>
          <td width="25"><img src="../estilo_tabla/parte_sup_der.gif" width="25" height="25" border="0" usemap="#MapMapMap"></td>
        </tr>
        <tr>
          <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
          <form name="form1" method="post" action="procesos/per_send_grabar.php">
            <td background="../estilo_tabla/parte_med_cen.gif"><div align="center">
                <table width="365" border="0" cellspacing="0" cellpadding="0">
                  <tr class="lblCampo">
                    <td colspan="3">&nbsp;</td>
                  </tr>
                  <tr class="lblCampo">
                    <td width="85" bgcolor="<?=$c_fondo_tr["fondo tr"]?>" class="lblCampoBlanco"><div align="left">Documento</div></td>
                    <td width="8"><div align="left"></div></td>
                    <td width="272"><div align="left">
                        <select name="tdoc" id="tdoc" onChange="enviar1(this.options[this.options.selectedIndex].value)">
                          <option value="0">Seleccione</option>
                          <? 
					echo $objPer->getCboTDoc();
				  ?>
                        </select>
                        <input name="textfield" type="hidden" size="5"><? echo date(dm);?>
                    </div></td>
                  </tr>
                  <tr class="lblCampo">
                    <td colspan="3"><div id="Cuerpo" align="left"></div></td>
                  </tr>
                  <tr class="lblCampo">
                    <td colspan="3"><div align="left">
					<div id="container">
	
	<div id="vertical_container" >
	
<? 				   
$resultado=$objPer->getAreasss();
while($filas=$objPer->NextRow($resultado))
{ 
?>

		<h1 align="left" class="accordion_toggle"><?php echo $filas['Vnomarea']; ?></h1>

		<div class="accordion_content"> 
		<table width="384" height="28" border="0">  
<?
$resultados=$objPer->getAreaUsu($filas['Vidarea']);			
while($row=$objPer->NextRow1($resultados))
{ 				   
?> 
<tr>
<td width="329"><div align="left"><? echo $row['apellidos']." ".$row['nombres'];?></div></td>
<td width="45"><div align="right"><input type="checkbox" name="selec[]" value="<?=$row['login']?>"/></div></td>
</tr>		  
<?
}
$objPer->Liberar1($resultados);
?>
</table>
		</div>		
<? 
 }
$objPer->Liberar($resultado);   
?>	
</div>
</div>
					</div></td>
                    </tr>
                  <tr class="lblCampo">
                    <td><div align="center"></div></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr class="lblCampo">
                    <td colspan="3"><div align="center">
                      <table width="336" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="169"><?
			if(($_SESSION['usuarea']=="LEG" and $_POST['tipodoc']=="CTO") or ($_SESSION['usuarea']=="RH" and $_POST['tipodoc']=="FOR") or ($_SESSION['usuarea']=="RH" and $_POST['tipodoc']=="PRO") or ($_POST['tipodoc']=="CAR") or ($_POST['tipodoc']=="MEM") or ($_POST['tipodoc']=="PAG")){
			$tipocampo="submit";
			$tipocampo1="button";
			}else{
			$tipocampo="hidden";
			$tipocampo1="hidden";
			}
			?>
                              <input type="submit" name="Submit" value="Crear Doc"></td>
                          <td width="167"><input type="button" name="Submit2" value="Nuevo Doc" onClick="volver(this.form);"></td>
                        </tr>
                      </table>
</div></td>
                  </tr>
                </table>
            </div></td>
          </form>
          <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
        </tr>
        <tr>
          <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
          <td background="../estilo_tabla/parte_med_cen.gif"><div align="center">
		  
		  </div></td>
          <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
        </tr>
        <tr>
          <td><img src="../estilo_tabla/parte_inf_izq.gif" width="25" height="25"></td>
          <td background="../estilo_tabla/parte_inf_cen.gif">&nbsp;</td>
          <td><img src="../estilo_tabla/parte_inf_der.gif" width="25" height="25"></td>
        </tr>
      </table>
      <map name="MapMapMap">
        <area shape="rect" coords="3,4,23,21" href="fondo.php">
      </map>
    </div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<map name="MapMap">
  <area shape="rect" coords="3,4,23,21" href="fondo.php">
</map>



</body>
</html>
<? }?>