<?php require_once 'libs.php'; $novedades = new Novedades(); $novCollection = $novedades->getNewsIndex(); ?> <!doctype html> <!--[if lt IE 7]> <html lang="" class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html lang="" class="no-js lt-ie10 lt-ie9 lt-ie8 ie7"> <![endif]--> <!--[if IE 8]> <html lang="" class="no-js lt-ie10 lt-ie9 ie8"> <![endif]--> <!--[if IE 9]> <html lang="" class="no-js lt-ie10 ie9"> <![endif]--> <!--[if gt IE 9]><!--> <html lang="" class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8" /> <title>Muy simple</title> <meta name="description" content="" /> <link rel="shortcut icon" href="favicon.ico" /> <link rel="apple-touch-icon-precomposed" href="" /> <!--SIZES 57x57--> <link rel="apple-touch-icon-precomposed" href="" sizes="72x72" /> <link rel="apple-touch-icon-precomposed" href="" sizes="114x114" />
$smarty->assign("des", ""); } else { $smarty->assign("act", ""); $smarty->assign("des", "selected"); } $smarty->assign("error", "Archivo no valido !!!"); } } // BORRAR if ($_REQUEST["accion"] == "Borrar") { $novedad = new Novedad($_REQUEST["id_novedad"]); $novedad->Eliminar(); header("Location: " . $_SERVER['PHP_SELF']); } } $oNovedades = new Novedades(); $rs = $oNovedades->GetAll(); $row = $rs->_array; if (count($row) >= 1) { foreach ($row as $key => $value) { $fields = $value; $aDatos[] = array("id_novedad" => $fields['ID_NOVEDAD'], "seccion" => $fields['SECCION'], "titulo" => $fields['TITULO'], "texto" => substr($fields['TEXTO'], 0, 50) . "...", "foto" => $fields['FOTO'], "activo" => $fields['ACTIVO'] == 1 ? "SI" : "NO"); } } $smarty->assign("novedades", $aDatos); // Render del template $smarty->display('novedades.tpl'); function nombreValido($sFile) { $charInvalidos = array("á", "é", "í", "ó", "ú", "ñ", "Ñ", "!", "@", "·", "#", "\$", "%", "&", "/", "(", ")", "=", "?", "¿"); for ($i = 0; $i < count($charInvalidos) - 1; $i++) {
<?php include "config.php"; Session::start(); $tm = new Novedades(); $novedades = $tm->getAll(); $titulo = "Novedades"; $contenido = ""; ?> <?php ob_start(); ?> <h2>Foro de Novedades</h2><br> <p><a href="formulario.php"class="btn btn-default btn-sm" role="button">Nuevo Tema</a></p><br> <div class='row'> <table class='table table-hover table-striped'> <thead> <tr> <th> </th> <th>Tema</th> <th>Autor</th> <th>Fecha</th> <th>Respuestas</th> <?php if (Session::isSuperAdmin()) { ?> <th>Acciones</th> <?php }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = Novedades::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'El enlace o direccion solicitado no existe'); } return $model; }
$concatenador = "&"; } else { $concatenador = "?"; } */ $rnd = $concatenador . rand(1000, 9999) . "=" . rand(1000, 9999); // End Quick /*if(substr($fields['LINK'],-1,1) == "/"){$rnd="";} if ( (!strstr($fields['LINK'],"&")) and (!strstr($fields['LINK'],"?"))){$rnd="";} if(strlen($fields['LINK'])<1){$rnd="";} */ $contenido .= $fields['ID_MENU2'] . "#" . $fields['NOMBRE'] . "#" . str_replace("&", "_xx_", $fields['LINK']) . $rnd . "#" . $fields['ICONO'] . "¶"; } } //*************************************************************************************************** // PARA LAS NOVEDADES if ($tabla == "novedades") { $novedades = new Novedades(); $rs = $novedades->GETActivos(); //$rs = $novedades->GetAll(); $row = $rs->_array; $contenido = ''; foreach ($row as $key => $value) { $fields = $value; $contenido .= $fields['ID_NOVEDADES'] . "#" . $fields['SECCION'] . "#" . $fields['TITULO'] . "#" . $fields['TEXTO'] . "#" . $fields['FOTO'] . "#" . $fields['ACTIVO'] . "#" . $fields['ANCHO'] . "¶"; } } //*************************************************************************************************** // Para los mails if ($tabla == "mails") { $oMails = new Mails(); $rs = $oMails->GetAll(); $row = $rs->_array;
<?php //require "resources/db.php"; require_once "libs.php"; require "functions/novedades-tienda.inc.php"; require 'functions/novedades.inc.php'; $novedades = new Novedades(); $collection = $novedades->getAll(); ?> <!doctype html> <!--[if lt IE 7]> <html lang="" class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html lang="" class="no-js lt-ie10 lt-ie9 lt-ie8 ie7"> <![endif]--> <!--[if IE 8]> <html lang="" class="no-js lt-ie10 lt-ie9 ie8"> <![endif]--> <!--[if IE 9]> <html lang="" class="no-js lt-ie10 ie9"> <![endif]--> <!--[if gt IE 9]><!--> <html lang="" class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8" /> <title>Novedades</title> <meta name="description" content="" /> <link rel="shortcut icon" href="favicon.ico" />
<?php if (isset($_REQUEST['titulo'])) { $tema = trim($_REQUEST['titulo']); if (!empty($tema)) { $temaDB = new Novedades(); $t = $temaDB->getByTema($tema); if ($t != NULL) { if ($temaDB->delByTema($tema) == 1) { Session::addMensajeOk("Se Elimino el Tema Correctamente"); } else { Session::addMensajeError("Error al eliminar el Tema"); } } else { Session::addMensajeError("El Tema no Existe"); } } //if(!empty()){ } //if(isset header("location:novedades.php"); exit;
public function cargaNovedad($id) { $model = Novedades::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'NO se encontro la novedad indicada.'); } return $model; }