<?php require_once '../../class/Conectar.class.php'; $objCon = new Conectar(); require_once '../../class/Institucion.class.php'; $objIns = new Institucion(); require_once '../../class/Util.class.php'; $objUtil = new Util(); switch ($_POST['op']) { case "editar": $objIns->setInstitucion($_POST['txtIdCon'], $objUtil->eliminaEspacios($_POST['txtConvenio'])); $objCon->db_connect(); $institucion = $objIns->buscaInstitucion($objCon, 2); if ($institucion == "Existe con id") { $bandera = 0; } else { if ($institucion == "Existe sin id") { $bandera = 1; } else { $bandera = 0; } } if ($bandera == 0) { try { $objCon->beginTransaction(); $objIns->modificarConvenio($objCon); $objCon->commit(); } catch (PDOException $e) { $objCon->rollBack(); $e->getMessage(); }