Ver Mensaje Individual
  #3 (permalink)  
Antiguo 01/03/2005, 10:21
tattojk
 
Fecha de Ingreso: febrero-2005
Mensajes: 673
Antigüedad: 19 años, 2 meses
Puntos: 2
Este es el codigo:

Son 20 Campos no 8 como lo habia escrito.
"ConsultaAfiliados.php"
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form action="" method="post" name="form1">
<table width="75%" align="center">
<tr>
<td colspan="4"><div align="right">dfdfdf</div>
<div align="right"></div></td>
</tr>
<tr>
<td><div align="right">Factura</div></td>
<td><input name="Factura" type="text" id="Factura" onKeyPress="if(event.keyCode==13){"&<?php include "ValidaAfiliado.php";
if(isset($_REQUEST['Factura'])){
$VP_Factura = ValidaFactura($_REQUEST['Factura']);
$VL_TipIden = $VP_Factura[0];
$VL_NoIden = $VP_Factura[1];
$VL_PriApe = $VP_Factura[2];
$VL_SegApe = $VP_Factura[3];
$VL_PriNomb = $VP_Factura[4];
$VL_SegNomb = $VP_Factura[5];
}
?>&";}"
value="<?php echo $Factura;?>" size="10" maxlength="10"> </td>
<td><div align="right">Medico</div></td>
<td><input name="Medico" type="text" id="Medico" value="<?php echo $VL_Medico;?>" size="30" maxlength="30" onKeyPress="if(event.keyCode==13){document.forms.f orm1.txtCodConsul.focus();}"></td>
</tr>
<tr>
<td><div align="right">Tipo Identificaci&oacute;n</div></td>
<td><input name="txtTipIden" type="text" id="txtTipIden" value="<?php echo $VL_TipIden;?>" size="2" maxlength="2" readonly=""></td>
<td><div align="right">N&uacute;mero Identificaci&oacute;n</div></td>
<td><input name="txtNoIden" type="text" id="txtNoIden" value="<?php echo $VL_NoIden;?>" size="16" maxlength="16" readonly=""></td>
</tr>
<tr>
<td><div align="right">Primer Apellido</div></td>
<td><input name="txtPriApel" type="text" id="txtPriApel" value="<?php echo $VL_PriApe;?>" size="20" maxlength="20" readonly=""></td>
<td><div align="right">Segundo Apellido</div></td>
<td><input name="txtSegApel" type="text" id="txtSegApel" value="<?php echo $VL_SegApe;?>" size="20" maxlength="20" readonly=""></td>
</tr>
<tr>
<td><div align="right">Primer Nombre</div></td>
<td><input name="txtPriNombre" type="text" id="txtPriNombre" value="<?php echo $VL_PriNomb;?>" size="20" maxlength="20" readonly=""></td>
<td><div align="right">Segundo Nombre</div></td>
<td><input name="txtSegNombre" type="text" id="txtSegNombre" value="<?php echo $VL_SegNomb;?>" size="20" maxlength="20" readonly=""></td>
</tr>
<tr>
<td><div align="right">C&oacute;digo Consulta</div></td>
<td><input name="txtCodConsul" type="text" id="txtCodConsul" size="5" maxlength="5" onKeyPress="if(event.keyCode==13){document.form1.t xtFechaConsul.focus();}" value="<?php echo $VL_CodConsul;?>"></td>
<td><div align="right">Fecha Consulta</div></td>
<td><input name="txtFechaConsul" type="text" id="txtFechaConsul" onKeyPress="if(event.keyCode==13){document.form1.t xtFinaConsul.focus();}"></td>
</tr>
<tr>
<td><div align="right">Finalidad Consulta</div></td>
<td><input name="txtFinaConsul" type="text" id="txtFinaConsul" size="2" maxlength="2" onKeyPress="if(event.keyCode==13){document.form1.t xtCausaExte.focus();}" value="<?php echo $VL_FinConsul;?>"></td>
<td><div align="right">Causa Externa</div></td>
<td><input name="txtCausaExte" type="text" id="txtCausaExte" size="2" maxlength="2" onKeyPress="if(event.keyCode==13){document.form1.D iagnostico.focus();}"></td>
</tr>
<tr>
<td height="24">
<div align="right">Diagnostico</div></td>
<td><input name="Diagnostico" type="text" id="Diagnostico" onKeyPress="if(event.keyCode==13){"&<?php include "ValidaDiag.php";
if(isset($_REQUEST['Diagnostico'])){
$VP_NombDiag = ValidaDiagnos($_REQUEST['Diagnostico']);
$VL_NombDiag=$VP_NombDiag;}
?>&";}" value="<?php echo $Diagnostico;?>" size="4" maxlength="4"></td>
<td><div align="right">Nombre Diagnostico</div></td>
<td><input name="txtNombDiag" type="text" id="txtNombDiag" value="<?php echo $VL_NombDiag;?>" size="30" maxlength="30" readonly=""></td>
</tr>
<tr>
<td><div align="right">Diagnostico Relativo 1</div></td>
<td><input name="Diagnostico1" type="text" id="Diagnostico1" onKeyPress="if(event.keyCode==13){"&<?php include "ValidaDiag1.php";
if(isset($_REQUEST['Diagnostico1'])){
$VP_NombDiag1 = ValidaDiagnos1($_REQUEST['Diagnostico1']);
$VL_NombDiag1 = $VP_NombDiag1;}
?>&";}" value="<?php echo $Diagnostico1;?>" size="4" maxlength="4" ></td>
<td><div align="right">Nombre Diagnostico</div></td>
<td><input name="txtNombDiag1" type="text" id="txtNombDiag1" size="30" maxlength="30" value="<?php echo $VL_NombDiag1;?>" readonly=""></td>
</tr>
<tr>
<td><div align="right">Diagnostico Relativo 2</div></td>
<td><input name="Diagnostico2" type="text" id="Diagnostico2" onKeyPress="if(event.keyCode==13){"&<?php include "ValidaDiag2.php";
if(isset($_REQUEST['Diagnostico2'])){
$VP_NombDiag2 = ValidaDiagnos2($_REQUEST['Diagnostico2']);
$VL_NombDiag2=$VP_NombDiag2;}
?>&";}" value="<?php echo $Diagnostico2;?>" size="4" maxlength="4"></td>
<td><div align="right">Nombre Diagnostico</div></td>
<td><input name="txtNombDiag2" type="text" id="txtNombDiag2" onKeyPress="if(event.keyCode==13){document.form1.t xtTipoDiag.focus();}" value="<?php echo $VL_NombDiag2;?>" size="30" maxlength="30" readonly=""></td>
</tr>
<tr>
<td><div align="right">Tipo Diagnostico</div></td>
<td><input name="txtTipoDiag" type="text" id="txtTipoDiag" size="1" maxlength="1" onKeyPress="if(event.keyCode==13){document.form1.E mpresa.focus();}"></td>
<td><div align="right">Empresa</div></td>
<td><input name="Empresa" type="text" id="Empresa" value="<?php echo $VL_Empresa;?>" size="30" maxlength="30"></td>
</tr>
<tr>
<td><div align="right">
</div></td>
<td>&nbsp;</td>
<td><div align="right"></div></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
</body>
</html>

"ValidaAfiliado.php"
<?php
function ValidaFactura($Factura)
{
if($Factura!="")
{
include "conexion.php";
if(mssql_select_db ("BD", $conexion))
{
$VL_Mes = date("m");
$VL_Ano = date("Y");
$VL_FechaIni = $VL_Mes."/01/".$VL_Ano;
$VL_UltDia = mktime(0,0,0,$VL_Mes+1,0,$VL_Ano);
$VL_FechaFin = $VL_Mes."/".$VL_UltDia."/".$VL_Ano;
if($consul=mssql_query("Select * from Afiliados afi, Reserva res where afi.AfiNumCarne=$Factura and afi.AfiNumCarne=
res.Afinumcarne and res.ReCumplio='SI' and convert(varchar(10),
ReFechaReserva, 101) between '".$VL_FechaIni."' and '".$VL_FechaFin."'",$conexion))
{
$reg = mssql_fetch_object($consul);
$VP_Factura[0] = $reg->AfiTipoIdenti;
$VP_Factura[1] = $reg->AfiNumIdenti;
$VP_Factura[2] = $reg->AfiPriApellido;
$VP_Factura[3] = $reg->AfiSegApellido;
$VP_Factura[4] = $reg->AfiPriNombre;
$VP_Factura[5] = $reg->AfiSegNombre;
return $VP_Factura;
}
}
mssql_close();
}
}
?>

Espero que hayan podido entender mi código.

Agradezco la ayuda y sugerencias que me puedan brindar.