<?php 
if ($_REQUEST['historia'] != '' or $_REQUEST['nombres'] != '' or $_REQUEST['apellidos'] != '') {
    $rs = $paciente->paciente_buscar($_REQUEST['historia'], $_REQUEST['nombres'], $_REQUEST['apellidos']);
}
if ($rs) {
    $j = 1;
    while ($campo = mysql_fetch_array($rs)) {
        ?>
              <tr bgcolor="#FFFFFF" style="cursor: hand" onMouseOver="bgColor='#F3E212'" onMouseOut ="bgColor='#FFFFFF'">
                <td width="15%" align="center"><?php 
        echo $campo['pac_historia'];
        ?>
</td>
                <td width="19%" align="center"><?php 
        echo strtoupper($paciente->devuelve_tipo_paciente($campo['pac_tipo']));
        ?>
</td>
                <td width="21%" align="center"><?php 
        echo strtoupper($campo['pac_nombres']);
        ?>
</td>
                <td width="19%" align="center"><?php 
        echo strtoupper($campo['pac_apellidos']);
        ?>
</td>
                <td width="6%" align="center">
				
				<a href='#' onClick="window.open('consulta_historial.php?cod_paciente=<?php 
        echo $campo['pac_id'];
        ?>
$paging->agregarConsulta($rs);
$paging->ejecutar();
if ($rs) {
    $j = 1;
    $particulares = '0';
    $seguro = '0';
    //while($campo =mysql_fetch_array($rs)) {
    while ($campo = $paging->fetchResultado()) {
        ?>
<tr bgcolor="#FFFFFF" style="cursor: hand" onMouseOver="bgColor='#F3E212'" onMouseOut ="bgColor='#FFFFFF'">
                    <td width="44%" align="center"><?php 
        echo strtoupper($campo['pac_apellidos'] . ', ' . $campo['pac_nombres']);
        ?>
</td>
                    <td width="28%" align="center"><?php 
        echo $paciente->devuelve_tipo_paciente($campo['pac_tipo']);
        ?>
</td>
                    <td width="19%" align="center" ><?php 
        echo $campo['pac_historia'];
        ?>
</td>
                    <td width="9%" align="center"><a href="#" onClick="borrar(<?php 
        echo $campo['pac_id'];
        ?>
)"><img src="../imagenes/icono_eliminar.gif" alt="Eliminar registro" width="14" height="14" border="0" /></a></td>
                    </tr> 
                  
  <?php 
        $j = $j + 1;
        if ($campo['pac_tipo'] === '1') {