Esempio n. 1
0
         $objCon->beginTransaction();
         $objPac->eliminarPaciente($objCon, $_POST['pac_id']);
         $objCon->commit();
         echo "<b>Paciente eliminado con exito</b>";
     } catch (PDOException $e) {
         $objCon->rollBack();
         $e->getMessage();
     }
     break;
 case "restaurarPaciente":
     $objCon = new Conectar();
     $objPac = new Paciente();
     $objCon->db_connect();
     try {
         $objCon->beginTransaction();
         $objPac->restaurarPaciente($objCon, $_POST['pac_id']);
         $objCon->commit();
         echo "<b>Paciente restaurado con exito</b>";
     } catch (PDOException $e) {
         $objCon->rollBack();
         $e->getMessage();
     }
     break;
 case "buscarPersona":
     $objCon = new Conectar();
     $objPac = new Paciente();
     $objUti = new Util();
     $objCon->db_connect();
     $txtRut = $_POST['txtRut'];
     $per_id = $objUti->valida_rut($txtRut);
     echo $res = $objPac->buscarPersona($objCon, $per_id);