Exemplo n.º 1
0
    //$user = new User($article->prepareId_user());
    $status = $banner->getStatus();
    $status = $status == true || $status == "Yes" || $status == 1 ? "Publicado" : "No publicado";
    echo '<tr>
								<td> <input type="checkbox" class="check" value="' . $id . '" name="args[]" /> </td>
						';
    $image = Banner::getImage($id, 1);
    if (!empty($image)) {
        echo '
							<td> <img width="200" height="80" src="../uploads/banner/thumbs/' . $image . '"/> </td>';
    } else {
        echo '<td> - </td>';
    }
    echo '
								<td> ' . $banner->prepareLink() . ' </td>
								<td> ' . BannerSection::findName($banner->prepareId_section()) . ' </td>
						';
    echo ' <td> <center> ' . $banner->getOrder() . ' </center> </td>
						<td> ' . $status . ' </td>
								<td> <center>' . $date1->format('d-m-Y') . '</center> </td>';
    if ($canEdit) {
        echo '<td><center><a href="edit.php?id=' . $id . '"><img src="' . ICON . 'edit.png" /></a> </center></td>';
    }
    if ($canDelete) {
        echo '<td><center><a id="' . $id . '" class="eliminar" href="javascript:deleteIt(' . $id . ')"><img src="' . ICON . 'delete.png" /> </a> </center> </td>';
    }
    echo '</tr>';
}
?>
				
				
Exemplo n.º 2
0
fSession::open();
$idUser = fSession::get(SESSION_ID_USER);
if (empty($idUser)) {
    header('Location: ' . SITE);
    exit("No se ha podido acceder a esta secci&oacite;n");
}
$id_bannersection = fRequest::encode('id', 'integer');
if (!fAuthorization::checkAuthLevel('super')) {
    $isOwner = fRecordSet::build('BannerSection', array('id_bannersection=' => $id_bannersection));
    $count = $isOwner->count() > 0;
    if (!$count) {
        header("Location: " . SITE);
    }
}
try {
    $bannersection = new BannerSection($id_bannersection);
} catch (Exception $e) {
    header("Location: " . SITE);
}
require_once INCLUDES . 'header.php';
?>
			<!-- MAIN CONTAINER -->
			<link rel="stylesheet" href="<?php 
echo JS;
?>
jwysiwyg/jquery.wysiwyg.css" type="text/css" />
			<link rel="stylesheet" href="<?php 
echo CSS;
?>
ui-lightness/jquery-ui-1.8.16.custom.css">
			<script type="text/javascript" src="<?php 
<?php

fSession::open();
$idUser = fSession::get(SESSION_ID_USER);
if (empty($idUser)) {
    header('Location: ' . SITE);
    exit("No se ha podido acceder a esta secci&oacute;n");
}
$id = fRequest::encode('id_bannersection', 'integer');
if (!fAuthorization::checkAuthLevel('super')) {
    $isOwner = fRecordSet::build('BannerSection', array('id_bannersection=' => $id_bannersection));
    $count = $isOwner->count() > 0;
    if (!$count) {
        exit("0");
    }
}
try {
    $bannersection = new BannerSection($id);
    $bannersection->setName(fRequest::encode('name', 'string'));
    $bannersection->store();
} catch (Exception $e) {
    die('Ha ocurrido un error. ' . $e->getMessage());
}
die('1');
<?php

fSession::open();
$idUser = fSession::get(SESSION_ID_USER);
if (empty($idUser)) {
    header('Location: ' . SITE);
    exit("No se ha podido acceder a esta secci&oacite;n");
}
$id = fRequest::encode('id', 'string');
if (strstr($id, ",")) {
    fORMDatabase::retrieve()->query("DELETE FROM bannersection WHERE id_bannersection IN ({$id})");
} else {
    $bannersection = new BannerSection($id);
    $bannersection->delete();
}
Exemplo n.º 5
0
<?php

fSession::open();
$idUser = fSession::get(SESSION_ID_USER);
if (empty($idUser)) {
    header('Location: ' . SITE);
    exit("No se ha podido acceder a esta secci&oacute;n");
}
try {
    $bannersection = new BannerSection();
    if (fRequest::encode('zone', 'integer') == 1) {
        $bannersection->setIdParent(fRequest::encode('id_section', 'integer'));
    } else {
        $bannersection->setIdParent(0);
    }
    $bannersection->setName(fRequest::encode('name', 'string'));
    $bannersection->store();
} catch (Exception $e) {
    die('Ha ocurrido un error. ' . $e->getMessage());
}
die('1');