<!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>Untitled Document</title>

<script>

function nuevo()

{window.open ('nvousuario.php');}

</script>

<script src="prototype.js" language="javascript"></script>

<script src="pacientes_ajax.js" language="javascript"></script>

<script type="text/javascript" src="acc_calendar/acc_calendar.js"></script>

<link href="ucaestilos.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
#apDiv1 {
	position:absolute;
	left:38px;
	top:132px;
	width:928px;
	height:22px;
	z-index:1;
}
-->
</style>
</head>



<body>
<table width="950" border="0" align="center">

  <tr>

    <td><p class="style10">PACIENTES</p></td>

  </tr>

  <tr>

    <td><table width="100%" height="0" border="0" cellpadding="0" cellspacing="5">

      <tr>

        <td width="13%" valign="top">

          <form id="form2" name="form2" method="post" action="main.php?a=4731">

            <input name="Submit" type="submit" class="boton2" value="Nuevo Paciente" />
          </form>          </td>

        <td width="55%" valign="top">&nbsp;</td>

        <td width="32%" valign="top">
          <div align="right" class="style7">
            <span class="style4">&Uacute;ltimo Expediente Ingresado:</span>
            <?php
		include ("conexion.php");
			$consul="SELECT max(CvePaciente) as maximo FROM pacientes";
			$resul=mysql_query($consul,$conex) or die ("No se realizo maximo");
			$maximo=mysql_result($resul,0,'maximo');
			echo $maximo;
        ?>
          </div></td>
      </tr>

    </table>
    <table width="100%" height="0" border="0" cellpadding="0" cellspacing="5">

      <tr>

        <td width="41%" class="style4">Listar por tipo: <span class="style9">
          <?php
					$cons="SELECT * FROM tipo_pacientes ORDER BY tipo";
					$res=mysql_query($cons,$conex) or die ("No se pudo consultar");
					  echo "<select name='tipo' id='tipo' class='cuadrotexto' onchange='javascript:filtrotipo(&quot;$tipo&quot;)'>";
						echo "<option value='0' selected>Selecciona</option>"; 
                      while ($campo=mysql_fetch_assoc($res)) 
	    				{
						  echo "<option value=".$campo['idTipo']." >".$campo['tipo']."</option>"; 
 						}
                      echo "</select>";
                    ?>
        </span></td>
        <td width="6%" valign="top">&nbsp;</td>

        <td width="53%" class="style4">Por fecha de &uacute;ltima visita: <span class="style1">Se registr&oacute; a partir de 29/Sep/2014</span></td>

      </tr>
      <tr>
        <td valign="top"><span class="style4">Por Nombre:</span>
          <input name="nompaciente" type="text" class="cuadrotexto" id="nompaciente" size="20" />
          <input name="button2" type="button" class="boton2" id="button2" value="Buscar" onclick="javascript:filtropaciente('<?php echo $tipo;?>')" /></td>
        <td align="center" valign="top">&nbsp;</td>
        <td><div align="left"><span class="style4">Del: </span>
                      <label for="fecha"><span class="fecha rang10"></span>

                <input name="fecha" type="text" class="fecha rang10 cuadrotexto" id="fecha" value="<?php echo date("Y-m-d"); ?>"Y-m-d");" size="10" maxlength="10" readonly>

              </label>

                        </span> <span class="style4"> &nbsp;al: </span>

                      <label for="fecha2"><span class="fecha rang10"></span>

                <input name="fecha2" type="text" class="fecha rang10 cuadrotexto" id="fecha2" value="<?php echo date("Y-m-d"); ?>" size="10" maxlength="10" readonly>
              </label>

                   &nbsp;

                    <input name="Submit22" type="button" class="boton2" value="Consultar" onclick="filtrofecha('<?php echo $tipo;?>')" />
</div>
          </td>
      </tr>
      <tr>
        <td valign="top"><span class="style4">Por Expediente:</span>
          <input name="expedi" type="text" class="cuadrotexto" id="expedi" size="10" />
          <input name="button" type="submit" class="boton2" id="button" value="Buscar" onclick="javascript:filtroexpediente('<?php echo $tipo;?>')" /></td>
        <td align="center" valign="top">&nbsp;</td>
        <td class="style4">Pacientes que no han regresado 
          <input name="button3" type="button" class="boton2" id="button3" value="Ver listado" onclick="filtrosinregistro('<?php echo $tipo;?>')" /></td>
      </tr>
      <tr>

        <td colspan="3" align="center" valign="top"><hr width="100%" size="1" noshade="noshade" color="#0D3356"></td>

        </tr>

    </table></td>

  </tr>

</table>

<table width="950" border="0" align="center" cellpadding="0" cellspacing="10">

  <tr>

    <td valign="top">

   		  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

            <tr>

              <td><p class="style4">
                <!-- <p class="linkabc"><a href="main.php?a=473&amp;letra=a" class="linkabc">A</a> <a href="main.php?a=473&amp;letra=b" class="linkabc">B</a> <a href="main.php?a=473&amp;letra=c" class="linkabc">C</a> <a href="main.php?a=473&amp;letra=d" class="linkabc">D</a> <a href="main.php?a=473&amp;letra=e" class="linkabc">E</a> <a href="main.php?a=473&amp;letra=f" class="linkabc">F</a> <a href="main.php?a=473&amp;letra=g" class="linkabc">G</a> <a href="main.php?a=473&amp;letra=h" class="linkabc">H</a> <a href="main.php?a=473&amp;letra=i" class="linkabc">I</a> <a href="main.php?a=473&amp;letra=j" class="linkabc">J</a> <a href="main.php?a=473&amp;letra=k" class="linkabc">K</a> <a href="main.php?a=473&amp;letra=l" class="linkabc">L</a> <a href="main.php?a=473&amp;letra=m" class="linkabc">M</a> <a href="main.php?a=473&amp;letra=n" class="linkabc">N</a> <a href="main.php?a=473&amp;letra=&ntilde;" class="linkabc">&Ntilde;</a> <a href="main.php?a=473&amp;letra=o" class="linkabc">O</a> <a href="main.php?a=473&amp;letra=p" class="linkabc">P</a> <a href="main.php?a=473&amp;letra=q" class="linkabc">Q</a> <a href="main.php?a=473&amp;letra=r" class="linkabc">R</a> <a href="main.php?a=473&amp;letra=s" class="linkabc">S</a> <a href="main.php?a=473&amp;letra=t" class="linkabc">T</a> <a href="main.php?a=473&amp;letra=u" class="linkabc">U</a> <a href="main.php?a=473&amp;letra=v" class="linkabc">V</a> <a href="main.php?a=473&amp;letra=w" class="linkabc">W</a> <a href="main.php?a=473&amp;letra=x" class="linkabc">X</a> <a href="main.php?a=473&amp;letra=y" class="linkabc">Y</a> <a href="main.php?a=473&amp;letra=z" class="linkabc">Z</a>

                 <!-- <select name="select" class="cuadrotexto" id="select">

                    <option value="A" selected="selected">A</option>

                    <option value="B">B</option>

                    <option value="C">C</option>

                    <option value="D">D</option>

                    <option value="E">E</option>

                    <option value="F">F</option>

                    <option value="G">G</option>

                    <option value="H">H</option>

                    <option value="I">I</option>

                    <option value="J">J</option>

                    <option value="K">K</option>

                    <option value="L">L</option>

                    <option value="M">M</option>

                    <option value="N">N</option>

                    <option value="&Ntilde;">&Ntilde;</option>

                    <option value="O">O</option>

                    <option value="P">P</option>

                    <option value="Q">Q</option>

                    <option value="R">R</option>

                    <option value="S">S</option>

                    <option value="T">T</option>

                    <option value="U">U</option>

                    <option value="V">V</option>

                    <option value="W">W</option>

                    <option value="X">X</option>

                    <option value="Y">Y</option>

                    <option value="Z">Z</option>

                  </select>

                  

                </p>-->
              </p>

              <div id="filtro">
                <?php

/*				  

echo "<table border=1>";

echo "<tr bgcolor='#4E5B7B' class='titulo' align='center'>";



echo "<td>";

echo "Expediente";

echo "</td>";



echo "<td>";

echo "Nombre";

echo "</td>";





echo "<td>";

echo "Tipo de paciente";

echo "</td>";



echo "<td>";

echo "Modificar";

echo "</td>";



echo "<td>";

echo "Eliminar";

echo "</td>";





echo "</tr>";

include ("conexion.php");



if (isset($_GET['letra']))

{	

	$letra=$_GET['letra'];

	$cons="SELECT CvePaciente,ApePatPaciente,ApeMatPaciente,NomPaciente,tipo FROM pacientes WHERE NomPaciente like '$letra%' ORDER BY NomPaciente" ;

}

else

{

	$cons="SELECT CvePaciente,ApePatPaciente,ApeMatPaciente,NomPaciente,tipo FROM pacientes ORDER BY NomPaciente" ;

}

$res=mysql_query($cons,$conex) or die ("No se realizo con exito la consulta de pacientes");

$numero_filas=mysql_num_rows($res);

$numero_campos= mysql_num_fields($res);

    while ($fila=mysql_fetch_row($res)){				  

         

echo "<tr>";



echo "<td class='style1' align='center'>";

echo $fila[0];

echo "</td>";



echo "<td class='style1'>";

echo $fila[3]." ".$fila[1]." ".$fila[2];

echo "</td>";



echo "<td class='style1'>";

echo $fila[4];

echo "</td>";



//Editar

echo "<td class='style4'align='center'>";

echo "<a href='main.php?a=4732&expediente="; echo $fila[0]; echo "'> <img src='img/icon_edit.jpg' border='0' ALT='Editar paciente'> </a>";

echo "</td>";





//Eliminar

echo "<td align='center'>";

echo "<a href='deletepaciente.php?expediente="; echo $fila[0]; echo "'> <img src='img/icon_delete.jpg' border='0' ALT='Eliminar paciente'> </a>";

echo "</td>";





echo "</tr>";

}

echo "</table>";

*/

?>
              </div></td>
            </tr>
    </table>		</td>

  </tr>

</table>

</body>

</html>

