예제 #1
0
<?php

include '../clases/clase_noticia.php';
$lobjNoticia = new clsNoticia();
$id = isset($_GET['id']) ? $_GET['id'] : "";
$lobjNoticia->set_Noticia($id);
$Datos_Noticia = $lobjNoticia->consultar_noticia_bitacora();
if ($Datos_Noticia) {
    $operacion = 'editar_noticia';
    $titulo = 'Consultar Noticia';
} else {
    $operacion = 'registrar_noticia';
    $titulo = 'Registrar Noticia';
    $Datos_Noticia['fechanot'] = date('d/m/Y');
}
?>
       
<script type="text/javascript" src="../libreria/tinymce/tinymce.min.js"></script> <!-- TinyMCE -->
<script type="text/javascript">
tinymce.init({
    selector: "textarea",
    language : 'es'
 });
</script>
<div style="float: left" class="col-lg-8 span8 pull-left">
    <h3><?php 
print $titulo;
?>
</h3>
    <div class="alert alert-info">
        <ul>
예제 #2
0
파일: noticia.php 프로젝트: josemazzei/Upel
<?php

require_once '../clases/clase_noticia.php';
$lobjNoticia = new clsNoticia();
$idnoticia = isset($_GET['id']) ? $_GET['id'] : "";
$lobjNoticia->set_Noticia($idnoticia);
$Datos_Noticia = $lobjNoticia->consultar_noticia_post();
?>
	<section class="content">
		<section class="main single">
			<article>
				<h1><?php 
print $Datos_Noticia[1];
?>
</h1>
				<p class="post-meta">Fecha: <?php 
print $Datos_Noticia[4];
?>
</p>
				<p><img src="../media/img/noticia/<?php 
print $Datos_Noticia[3];
?>
" alt=""></p>
				<?php 
print $Datos_Noticia[2];
?>
			</article>
			

		</section>
	</section>
예제 #3
0
<?php

require_once '../clases/clase_noticia.php';
$lobjNoticia = new clsNoticia();
$laNoticias = $lobjNoticia->consultar_noticias_activas();
?>

		<section class="columns">
			<?php 
if (count($laNoticias) != 0) {
    ?>
			<h2><span class="text-green">CAIDV ACARIGUA</span> NOTICIAS</h2>
			<?php 
} else {
    ?>
				<h2>NO EXISTEN NOTICIAS REGISTRADAS</h2>
			<?php 
}
for ($i = 0; $i < count($laNoticias); $i++) {
    $Texto = substr($laNoticias[$i][2], 0, 500);
    ?>
			<article class="col3 post">
				<div class="img"><a href="?vista=noticia&id=<?php 
    print $laNoticias[$i][0];
    ?>
"><span class="img-border"><img src="../media/img/noticia/<?php 
    print $laNoticias[$i][3];
    ?>
" alt=""></span></a></div>
				<h2><a href="?vista=noticia&id=<?php 
    print $laNoticias[$i][0];
예제 #4
0
<?php

session_start();
require_once "../clases/clase_noticia.php";
require_once "../clases/clase_bitacora.php";
require_once '../libreria/utilidades.php';
$lobjNoticia = new clsNoticia();
$lobjBitacora = new clsBitacora();
$lobjUtil = new clsUtil();
$Texto = addslashes($_POST['textonot']);
//Funcion que permite cambiar las comillas simples o dobles.
$lobjNoticia->set_Noticia($_POST['idnoticia']);
$lobjNoticia->set_Titulo($_POST['titulonot']);
$lobjNoticia->set_Texto($Texto);
$nombreimagen = basename($_FILES['imagennot']['name']) ? basename($_FILES['imagennot']['name']) : "default.jpg";
$lobjNoticia->set_Imagen($nombreimagen);
$lobjNoticia->set_Fechanot($_POST['fechanot']);
$lobjNoticia->set_Estatus($_POST['estatusnot']);
$lcReal_ip = $lobjUtil->get_real_ip();
$ldFecha = date('Y-m-d h:m');
$operacion = $_POST['operacion'];
switch ($operacion) {
    case 'registrar_noticia':
        $hecho = $lobjNoticia->registrar_noticia();
        if ($hecho) {
            $target_path = "../media/img/noticia/";
            $target_path = $target_path . basename($_FILES['imagennot']['name']);
            move_uploaded_file($_FILES['imagennot']['tmp_name'], $target_path);
            $lobjBitacora->set_Datos($_SERVER['HTTP_REFERER'], $ldFecha, $lcReal_ip, 'Registrar', 'Cargar datos', '*', 'tnoticia', '', '', $_SESSION['usuario'], $operacion);
            //envia los datos a la clase bitacora
            $lobjBitacora->registrar_bitacora();