<?php
if(isset($_GET['dni'])){
require_once("class/class.conectar.php");
require_once("class/class.paciente.php");

  $dni = $_GET['dni'];
  $id = $_GET['id'];
  
    $Objcon = new Conectar();
    $con = $Objcon->con();
  
    $Objp = new Paciente();
    $res_pac = array();
    $res_pac = $Objp->buscar_paciente($con,$dni);
    if(count($res_pac)==0){
      
      echo "<input type='text' size='30' id='pnom".$id."' name='pnom".$id."' >";
      //echo "<td><input type='text' size='10' id='pdni".$id."' name='pdni".$id."' value='".$dni."' disabled='disabled'></td><td><input type='text size='30' id='pnom".$id."' name='pnom".$id."'></td>";
      
    }else{
      $nom = $res_pac[0]['nom'];
      echo "<input type='text' size='30' id='pnom".$id."' name='pnom".$id."' value='".$nom."' disabled='disabled'>";
      
      //echo "<td><input type='text' size='10' id='pdni".$id."' name='pdni".$id."' value='".$dni."'></td>          <td><input type='text size='30' id='pnom".$id."' name='pnom".$id."' value='".$nom."' disabled='disabled'></td> ";
    }
  
}

?>