Beispiel #1
0
 public static function mantenimientoBanner(EntidadBannerInterior $objBannerEntidad, array $param)
 {
     $query = NULL;
     $error = NULL;
     $objMysql = new Mysql();
     try {
         $query = "CALL sp_mnt_bannerinterno('" . $param[0] . "',\n                                           '" . $objBannerEntidad->getIdbannerinterior() . "',\n                                           '" . $objBannerEntidad->getDescripcion() . "',\n                                           '" . $objBannerEntidad->getFoto() . "',    \n                                           '" . $objBannerEntidad->getFotochico() . "',        \n                                           '" . $objBannerEntidad->getEliminado() . "',\n                                           '" . $objBannerEntidad->getUrl() . "');";
         $rs = $objMysql->ejecutar($query);
         $error = 1;
     } catch (PDOException $exc) {
         $error = 0;
     }
     return $error;
 }
     $nId = "";
 }
 if (isset($_POST["txtnombre"])) {
     $sNombre = $_POST["txtnombre"];
 } else {
     $sNombre = "";
 }
 if (isset($_POST["cmbEnlace"])) {
     $sEnlace = $_POST["cmbEnlace"];
 } else {
     $sEnlace = "";
 }
 $dirses = new Sesion();
 $dir = $dirses->getVariableSession("dir");
 include "DAOBannerInterno.php";
 $objCategoriaBanner = new EntidadBannerInterior();
 $objCategoriaBanner->setIdbannerinterior($nId);
 $objCategoriaBanner->setUrl($sEnlace);
 $objCategoriaBanner->setDescripcion($sNombre);
 if ($dir == "") {
     $objMysql = new Mysql();
     $query = "select foto from cms_bannerinterior where idbannerinterior=" . $nId;
     $rs = $objMysql->ejecutar($query);
     $res = $rs->fetch(PDO::FETCH_ASSOC);
     $dir = $res["foto"];
     $objCategoriaBanner->setFoto($dir);
 } else {
     $objCategoriaBanner->setFoto('imgs_banner_/' . $dir);
 }
 $objCategoriaBanner->setFotochico("");
 $objCategoriaBanner->setEliminado(0);