예제 #1
0
 public function addNoticia(Noticia $n)
 {
     if ($n->getId() != '' && $this->getId() != '') {
         $con = BDConexao::__Abrir();
         $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "relacionamento_noticias_categorias(categoria, noticia) VALUES('" . $this->getId() . "','" . $n->getId() . "')");
     }
 }
예제 #2
0
			<div class="tituloNoticia"><input type="text" id="tituN" name="tituN" placeholder="Título de la noticia" maxlength="30"></div>
			<div class="descNoticia"><textarea id="descN" name="descN" placeholder="Descripción de la noticia" maxlength="140"></textarea></div>
			<a href="#" class="boton" id="publicarN">Publicar</a>
		</div>
	</div>
</form>

<?php 
$q = mysql_query("SELECT id_n FROM noticia ORDER BY id_n DESC");
if (mysql_num_rows($q) > 0) {
    while ($row = mysql_fetch_array($q)) {
        $noticia = new Noticia($row['id_n']);
        ?>
			
			<div class="noticia" id="<?php 
        echo $noticia->getId();
        ?>
">
				<img src="img/delete.png" class="eliminarNoti tool"><div class="tooltip">Eliminar noticia</div>
				<div class="fotoNoticia" style="background-image:url(<?php 
        echo substr($noticia->getFoto(), 3);
        ?>
);background-repeat:no-repeat;"></div>
				<div class="contNoticia">
					<div class="tituloNoticia"><?php 
        echo $noticia->getTitulo();
        ?>
</div>
					<div class="descNoticia"><textarea disabled="disabled"><?php 
        echo $noticia->getDescripcion();
        ?>