<?php
  include("stilos/config.inc.php");
  include("../clases/BDConexion.php");
  include("../clases/clsPer.php");
  include("Funciones.php");
  include("funcion/funciones.php");
  session_start();
  session_register('empresas');
  $objPer=new clsPer;
  $rs = $objPer->DevolverEmpresas();
  while ($emp=$objPer->NextRow($rs)){
     $empresas[]=array("$emp[0]",$emp[1]);
	 }
   $objPer->Liberar($rs);
   
   $fech = $objPer->DevolverRangoFecha();
   if ($filas=$objPer->NextRow($fech)){
       $fecha_ini = extraerfechanormal($filas[0]);
	   $fecha_fin = extraerfechanormal($filas[1]);
       }
	   /*echo "<br>Fecha Ini ".$fechamin;
	   
	   $fechamin = '01/10/2007';
	   $fechamax = date("d/m/Y")*/
?>

<!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="stilos/Estilos.css" rel="stylesheet" type="text/css">
<SCRIPT language=JavaScript src="js/calendario.js"></SCRIPT>
<script language="JavaScript"> 
<!--
//sURL,x,y
function Abrir_Ventanapopup1(sURL,x,y) { 
/*var especificaciones="top=0, left=0, toolbar=no,location=no, status=yes,menubar=no,scrollbars=no, resizable=no, width=1,height=1" 
var titulo="Titulo"
window.open(el_url,titulo,especificaciones);*/ 

if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=no"
			par = par + "menubar=no,toolbar=no,status=yes"
			var ventana = window.open(sURL,"Ver",par)
			ventana.focus();
}
//-->

function Abrir_Ventanapopup2(sURL,x,y) { 
/*var especificaciones="top=0, left=0, toolbar=no,location=no, status=yes,menubar=no,scrollbars=no, resizable=no, width=1,height=1" 
var titulo="Titulo"
window.open(el_url,titulo,especificaciones);*/ 

if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=no"
			par = par + "menubar=no,toolbar=no,status=yes"
			var ventana = window.open(sURL,"Ver",par)
			ventana.focus();
} 
</script>
<? 
$envia="fondo.php?k=$k&razonsocial=$razonsocial&distrito=$distrito";
$envia1="cvp_personal.php";
?>
<script>
function volverB(form)
{
location.reload('<? echo $envia1 ?>');
}
function volver(form)
{
location.reload('<? echo $envia ?>');
}
var vent = null;
function foco() {
   if (vent != null)
       vent.focus();
}
function cerrar() {
   vent = null;
}

</script>
<script language="JavaScript">
function selecciona(form)
{
 if(form.botones1.value)
  {
   form.zonasi.disabled=true;
  }
}

function cierra(form)
{
location.reload('../ventana.php');
}
function activainter(form)
{
   form.pais2.disabled=false;
   form.ciudad2.disabled=false;
   form.nacionalidad2.disabled=false;
   form.btn_ver2.disabled=false;
   form.btn_nuevo2.disabled=false;
   
   form.pais.value="";
   form.pais.disabled=true;
   form.ciudad.value="";
   form.ciudad.disabled=true;
   form.nacionalidad.value="";
   form.nacionalidad.disabled=true;
   form.idciudad1.value="";
   form.btn_ver1.disabled=true;
   form.btn_nuevo1.disabled=true;
}
</script>
<SCRIPT LANGUAGE=javascript>
function fn(form,field)
{
var next=0, found=false
var f=form
if(event.keyCode!=13) return;
for(var i=0;i<f.length;i++) {
if(field.name==f.item(i).name){
next=i+1;
found=true
break;
}
}
while(found){
if( f.item(next).disabled==false && f.item(next).type!='hidden'){
f.item(next).focus();
break;
}
else{
if(next<f.length-1)
next=next+1;
else
break;
}
}
}
</SCRIPT>
<script>
 function Enviarse(){

if(form1.opt.checked == true || form1.opt2.checked == true || form1.opt3.checked == true ){
       
	   if (form1.opt2.checked == true && form1.opt3.checked == true){
	             alert('No puede Elegir Los Dos Check.! \n Puede Elegir Una o Toda Empresa');
				 form1.opt2.checked = false;
				 form1.opt3.checked = false;
	    		 return;
		  }
		  
		  else       
            {form1.submit();}
		 
		 }
else
     {
        alert('Debe Elegir al menos un Parametro de Consulta..!');
		form1.opt.focus();
	    return;
	}
}
</script>

<script language="javascript" type="text/javascript">
  function DarFecha(){
    if (form1.opt.checked==true){
	     window.document.form1.fecha_ini.value='<?=$fecha_ini?>';
		 window.document.form1.fecha_fin.value='<?=$fecha_fin?>';
	
	      }
   else
         {
		 
		 window.document.form1.fecha_ini.value="";
		 window.document.form1.fecha_fin.value="";	 
		 
		 }
  }
  
</script> 
<script>
function poner_imagen()
{
imagen1=new Image;
imagen1.src=document.form1.foto.value;
document.imagenes['foto'].src=imagen1.src;
}
</script>
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<style type="text/css">
<!--
.Estilo1 {color: #0000FF}
-->
</style>
</head>

<body bgcolor="<?=$c_fondo['fondo']?>" onfocus="foco()" background="../imagenes/fondo.jpg">
<link href="stilos/Estilos.css" rel="stylesheet" type="text/css">
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr valign="top" >
    <td height="25" colspan="4">
    <div align="left" ></div></td>
  </tr>
  <tr class="lblCampo" >
    <td colspan="4"><div align="center">
        <form name="form1" method="post" action="cvp_reporte_charla_totales.php" enctype="multipart/form-data">
          <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="600" background="../estilo_tabla/parte_sup_cen.gif" valign="bottom">
                <div align="left" class="lblTitulo" > <strong>CONSULTAR -  </strong> CURSO DE INDUCCI&Oacute;N - TOTALES </div></td>
              <td width="25"><img src="../estilo_tabla/parte_sup_der.gif" width="25" height="25" border="0" usemap="#Map"></td>
            </tr>
            <tr>
              <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
              <td  height="86" background="../estilo_tabla/parte_med_cen.gif"><div align="center">
                  <table width="600" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="600">
					    <div align="center">
					      <table width="570" border="0" cellpadding="0" cellspacing="0">
                              <tr>
                                <td colspan="6"><div align="center"><span class="lblSubTitulo">ESTABLER PAR&Aacute;METRO DE LA CONSULTA </span></div></td>
                              </tr>
                              <tr>
                                <td colspan="6"><hr size="1"></td>
                              </tr>
                              <tr>
                                <td width="23">&nbsp;</td>
                                <td width="180">&nbsp;</td>
                                <td width="84" class="rdoBanners">Fecha Inicial</td>
                                <td width="77" class="rdoBanners"><div align="center">Fecha Final </div></td>
                                <td width="64" class="rdoBanners">&nbsp;</td>
                                <td width="142">&nbsp;</td>
                              </tr>
                              <tr>
                                <td width="23" rowspan="2" bordercolor="#006633">&nbsp;</td>
                                <td bordercolor="#006633"><div align="left"><span class="lblParrafo">
                                  <input name="opt" type="checkbox" class="in" onClick="DarFecha()" value="1" checked <?php if(isset($opt)){echo "checked";}?>>
                                  Por Fecha</span><br>
                                </div></td>
                                <td colspan="4" bordercolor="#006633"><div align="left">
                                    <input name="fecha_ini" type="text" class="lblForm1" id="fecha_char2" onKeyUp=fn(this.form,this) value="<?=$fecha_ini?>" size="12" >
                                    <a href="javascript:show_calendar('form1.fecha_ini');"><img src="../imagenes/calendar.jpg" width="16" height="15" border="0"></a>
                                    <input name="fecha_fin" type="text" class="lblForm1" id="fecha_char" onKeyUp=fn(this.form,this) value="<?=$fecha_fin?>" size="12">
                                    <a href="javascript:show_calendar('form1.fecha_fin');"><img src="../imagenes/calendar.jpg" width="16" height="15" border="0"></a></div>                                  <div align="left"></div>                                <div align="left"><a href="javascript:show_calendar('form1.fecha_ini');"></a></div>                                <div align="left"></div>                                <div align="left"><a href="javascript:show_calendar('form1.fecha_fin');"></a></div></td>
                              </tr>
                              
                            <tr>
                              <td><div align="left"><span class="lblParrafo">
                                <input name="opt2" type="checkbox" class="in" id="opt2" value="1" <?php if(isset($opt)){echo "checked";}?>>
                              Elegir Empresa</span></div></td>
                              <td colspan="4"><div align="left">
                                <select name="cod_emp" class="lblForm1" id="select2" onkeyup=fn(this.form,this)>
                                  <option value="0">Varios</option>
                                  <? 
							echo $objPer->getCboEmp($cod_emp);
							?>
                                </select>
                              </div></td>
                            </tr>
                            <tr>
                              <td bordercolor="#006633">&nbsp;</td>
                              <td><div align="left"><span class="lblParrafo">
                                <input name="opt3" type="checkbox" class="in" id="opt3" value="1" <?php if(isset($opt)){echo "checked";}?>>
                              Todas Empresa</span></div></td>
                              <td colspan="4">&nbsp;</td>
                            </tr>
                            <tr>
                              <td bordercolor="#006633">&nbsp;</td>
                              <td><div align="left"><span class="lblParrafo">
                                <input name="opt4" type="checkbox" class="in" id="opt4" value="1" <?php if(isset($opt)){echo "checked";}?>>
                                Detallado
                              </span></div></td>
                              <td colspan="4">&nbsp;</td>
                            </tr>
                            <tr>
                              <td bordercolor="#006633">&nbsp;</td>
                              <td>&nbsp;</td>
                              <td colspan="4">&nbsp;</td>
                            </tr>
                            <tr>
                              <td colspan="6" bordercolor="#006633"><div align="center">
                                <input name="btn_buscar" type="button" style="<?=$stylo['st2']?>" class="botira" value=".:   EJECUTAR CONSULTA   :." onClick="Enviarse()">
                              </div></td>
                            </tr>
                            <tr>
                              <td colspan="6"><hr align="left" size="1" color="#000000"></td>
                            </tr>
                          </table>
			          </div></td>
                    </tr>
                </table>
              </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>
        </form>
    </div></td>
  </tr>
  <tr valign="top" class="lblCampo" >
    <td colspan="4">
    <div align="center"> </div></td>
  </tr>
<map name="Map">
  <area shape="rect" coords="3,4,23,21" href="fondo.php">
</map>
</body>
</html>