<?php
  include("../stilos/config.inc.php");
  include("../clases/BDConexion.php");
  include("../clases/clsReq.php");
  include("Funciones.php");
  include("funcion/funciones.php");
  $objPer=new clsReq;
  session_start();

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Registro de Examenes Clinicos - BARRET RESOURCES(PERU) LLC</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stilos/Estilos.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Estilo2 {color: #000000}
.Estilo3 {color: #000000; font-size: 10px; }
.Estilo4 {color: #FFFFFF}
-->
</style>
<SCRIPT language=JavaScript src="js/calendario.js"></SCRIPT>
<script>
function enviar_url(form,url){
		if(form1.grabar.value)
		{
			form1.submit();
		}
	}
</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 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();
}
//--> 
</script>

<script language="JavaScript" type="text/JavaScript">
function MensajeEditar(m){
if (m==1){window.alert("Se Guardo el Examen satisfactoriamente")}
}
</script>
<script>
var vent = null;
function foco() {
   if (vent != null)
       vent.focus();
}
function cerrar() {
   vent = null;
}


function volver(form){
  location.reload('cvp_evalua_coti.php');
  }
  
</script>
<link href="../stilos/Estilos.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Estilo5 {color: #FFFFFF; font-size: 10px; }
-->
</style>
</head>
<body  background="../imagenes/fondo.jpg" onLoad="">
<table width="460" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr class="lblCampo" >
    <td colspan="4"><div align="center">
        <table width="319" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
            <td valign="bottom">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td width="25"><img src="../estilo_tabla/parte_sup_izq.gif" width="25" height="25"></td>
            <td width="409" background="../estilo_tabla/parte_sup_cen.gif" valign="bottom">
              <div align="left" class="lblTitulo Estilo4" >Buscar Pedidos de Requisici&oacute;n Pendiente </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 width="25" background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
            <td width="409" height="86" background="../estilo_tabla/parte_med_cen.gif"><div align="center">
              <table width="731" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="5" >&nbsp;</td>
                  <td width="9" height="19">&nbsp; </td>
                  <td width="606">&nbsp;</td>
                  <td width="101">&nbsp;</td>
                  <td width="10">&nbsp;</td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td colspan="3" valign="top"><table width="701" border="0" align="center" cellpadding="0" cellspacing="0" >
                      <tr>
                        <td valign="top"><form name="form1" method="post" action="cvp_evalua_cotizaciones_buscar.php?tipo=<? echo $tipo?>&des=<? echo $des?>">
                            <table width="683" border="0" align="center" cellpadding="0" cellspacing="0" id="apell_nom">
                                <tr bgcolor="#2F8523">
                                  <td><div align="right">
                                    <input name="opt" type="radio" id="radio4" value="3" checked <?php if ($opt==3){echo "checked";}?>>
                                  </div></td>
                                  <td ><div align="left"><span class="Estilo4">Todas</span></div></td>
                                  <td><input name="opt" type="radio" id="radio5" value="1" <?php if ($opt==1){echo "checked";}?>></td>
                                  <td align="right"><div align="left"><span class="Estilo4">Elige N&ordm; de Evaluaci&oacute;n</span></div></td>
                                  <td align="left">&nbsp;</td>
                                  <td align="left"><? if(isset($n_evaCotiza)){$valor=$n_evaCotiza;}$objPer->NEvaluaCoti("n_evaCotiza",$valor)?>
</td>
                                  <td width="163"><div align="left"><span class="Estilo4"><span class="lblForm">                                        </span></span></div>                                                                      <span class="Estilo4"><span class="lblForm">
                                    <input name="opt" type="radio" id="radio6" value="2" <?php if ($opt==2){echo "checked";}?>>
</span></span><span class="Estilo4">Fechas</span>
                                      <input name="fecha_req1" type="text" class="lblForm" id="fecha_req13" title="FORMATO dd/mm/AA" onKeyUp=fn(this.form,this) value="<? echo $fecha_req1?>" size="12" maxlength="10">
                                  <a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.fecha_req1');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"></a></td>
                                  <td width="128"><span class="Estilo4">Hasta
                                      <input name="fecha_req2" type="text" class="lblForm" id="fecha_req23" title="FORMATO dd/mm/AA" onKeyUp=fn(this.form,this) value="<? echo $fecha_req2?>" size="12" maxlength="10">
                                      <a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.fecha_req2');"><img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"></a> </span></td>
                                </tr>
                                <tr bgcolor="#2F8523">
                                <td width="52">                                  <div align="right">
                                </div></td>
                                <td width="91" ><div align="left" class="Estilo4"></div></td>
                                <td width="20">&nbsp;</td>
                                <td width="122" align="left">&nbsp;</td>
                                <td width="3" align="left">&nbsp;</td>
                                <td width="104">&nbsp;</td>
                                <td colspan="2">&nbsp;</td>
                                </tr>
                              <tr bgcolor="#2F8523">
                                <td><div align="right">
                                </div></td>
                                <td ><div align="left"><a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.fecha_req1');"> </a></div></td>
                                <td>&nbsp;</td>
                                <td colspan="2"><div align="left"><span class="Estilo4"><span class="lblForm">
                                </span></span></div></td>
                                <td><span class="Estilo4"><span class="lblForm">
                                  <input type="submit" name="Submit" value="Buscar" style="<?=$stylo['st2']?>" class="botira">
                                </span></span></td>
                                <td colspan="2"><span class="Estilo4"><span class="lblForm">
                                </span></span></td>
                              </tr>
                            </table>
                        </form></td>
                      </tr>
                      <tr>
                        <td><div align="center">
                            <table width="587" border="0" align="center" cellpadding="0" cellspacing="0">
                              <tr>
                                <td><div align="center">
                                    <table width="683" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="<?=$bordetabla?>" bgcolor="<?=$c_fondo['fondo tabla']?>" style="<?=$stylo['tabla']?>">
                                      <tr valign="top" bordercolor="#00CC00" bgcolor="#2F8523">
                                        <td width="63">
                                          <div align="left" class="Estilo3 Estilo4">N&ordm; De Formato </div></td>
                                        <td width="70" bgcolor="#2F8523"><div align="left" class="Estilo5"> 
                                          <div align="center">Feccha</div>
                                        </div></td>
                                        <td width="169" bgcolor="#2F8523" ><div align="left" class="Estilo3 Estilo4">Comentarios</div></td>
                                        <td width="146" bgcolor="#2F8523" class="Estilo3 Estilo4" ><div align="center">Preparado Por </div></td>
                                        <td width="181">
                                          <div align="center" class="Estilo3 Estilo4">Aprobado Por <span class="Estilo3 Estilo4"></span></div>                                          </td>
                                        <td width="40" class="Estilo3 Estilo4"><div align="center">Elegir</div></td>
                                      </tr>
									<?php 
									    if (!isset($opt)){
										     $result = $objPer->DevolverEvaluacionCotiza();
										}
									    else{
													if (isset($n_evaCotiza) || $opt==1){$result = $objPer->DevolverEvaluacionCotizaxform($n_evaCotiza);}
													if ($opt==2){
															  $fecha_req1 = extraerfechamysql($fecha_req1); 
															  $fecha_req2 = extraerfechamysql($fecha_req2);
															  $result = $objPer->DevolverEvaluacionCotizaxfechas($fecha_req1,$fecha_req2);
															  }
												   if ($opt==3){$result = $objPer->DevolverEvaluacionCotiza();}
											}
										while ($filas=$objPer->NextRow($result)){
									?>
                                      <tr valign="top">
                                        <td>
                                          <div align="center"> <? echo $filas['id_formato']; ?> </div></td>
                                        <td><div align="left"><? echo extraerfechanormal($filas['fecha']); ?></div></td>
                                        <td><div align="left"><? echo $filas['comentarios']; ?> </div></td>
                                        <td><? echo $filas['preparadopor']; ?></td>
                                        <td><div align="center">
                                            <?php  echo $filas['aprobadopor'];?>
</div>                                          </td>
                                        <td align="center" valign="middle"><a href="cvp_edi_cotiza.php?Numcotiza=<? echo $filas['id_formato']; ?>&opt=<?=$opt?>&n_evaCotiza=<?=$n_evaCotiza?>&fecha_req1=<?=extraerfechanormal($fecha_req1)?>&fecha_req2=<?=extraerfechanormal($fecha_req2)?>"><img src="../imagenes/btn_aceptar.gif" width="17" height="15" border="0" alt="Mostar Formato"></a></td>
                                      </tr>
									  <?php 
									  }
									  $objPer->Liberar($result);
									  ?>
                                     </table>
                                </div></td>
                              </tr>
                              <tr>
                                <td>
                                  <table width="683" border="0" cellspacing="0" cellpadding="0">
                                   
                                    <tr>
                                      <td width="301"><div align="left"><span class="lblForm">Pagina <? echo ($pagina+1);?> de <? echo $ntotpag;?> </span></div></td>
                                    </tr>
                                    <tr>
                                      <td><div align="center" class="lblForm">
                                          <div align="center">
                                            </div>
                                      </div></td>
                                    </tr>
                  
                                    <tr>
                                      <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                      <form name="form2" method="post" action="reporte_exaclinico.php">
                                        <td>                                          <div align="center">
                                            <input type="button" name="Submit2" value="Imprimir" style="<?=$stylo['st2']?>" class="botira" onClick="javascript:Abrir_Ventanapopup1('reporte_exaclinico.php?tipo=<? echo $tipo?>&des=<? echo $des?>',780,510)">
                                            <input name="tipo2" type="hidden" size="5" id="tipo22" value="<? echo $tipo?>">
                                            <input name="des2" type="hidden" size="5" id="des22" value="<? echo $des?>">
                                        </div></td>
                                        <td width="30">&nbsp;</td>
                                        <td width="83"><input name="Regresar" type="button" style="<?=$stylo['st2']?>" class="botira" id="Regresar" value=".:   Regresar  :." onClick="volver(this.form);"></td>
                                        <td width="171">&nbsp;</td>
                                      </form>
                                    </tr>
                                </table></td>
                              </tr>
                            </table>
                        </div></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                      </tr>
                  </table></td>
                  <td>&nbsp;</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="20"></td>
            <td background="../estilo_tabla/parte_inf_cen.gif">&nbsp;</td>
            <td><img src="../estilo_tabla/parte_inf_der.gif" width="25" height="20"></td>
          </tr>
        </table>
    </div></td>
  </tr>
  <tr valign="top" class="lblCampo" >
    <td colspan="4">
      <div align="center"> </div></td>
  </tr>
</table>
<map name="Map">
  <area shape="circle" coords="12,11,9" href="fondo.php">
</map>
</body>
</html>
