Mister Spy Say ="Hello Kids ... :D"
___ ____ _ _____
| \/ (_) | | / ___|
| . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _
| |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | |
| | | | \__ \ || __/ | /\__/ / |_) | |_| |
\_| |_/_|___/\__\___|_| \____/| .__/ \__, |
| | __/ |
|_| |___/
Bot Mister Spy V3
Mister Spy
Mister Spy
<?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 = intval($_REQUEST['PageGaleriaSize']);
$Imagen = $_FILES['Imagen'];
$Action = strval($_REQUEST['MainAction']);
$Id = intval($_REQUEST['Id']);
$IdCategoria = intval($_REQUEST['IdCategoria']);
$IdGaleria = intval($_REQUEST['IdGaleria']);
$url = strval($_REQUEST['url']);
/* declaramos e instanciamos variables necesarias */
$err = 0;
$errUpload = 0;
$arrData = array();
$oCategorias = new Categorias();
$oGaleriaImagen = new GaleriaImagen();
$oGaleriaImagenes = new GaleriaImagenes();
$oPage = new Page($Page, $PageSize);
$oCategoria = $oCategorias->GetById($IdCategoria, ContenidoTipos::Galeria);
/* arma cadena de parametros */
$strParams = (strlen($_SERVER['QUERY_STRING']) > 0) ? '?' . $_SERVER['QUERY_STRING'] : '';
/* Armamos el filtro */
$filter = array();
$filter['IdCategoria'] = $IdCategoria;
$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->Aprobado = 1;
$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 href="css/cropper.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) ?> - Subir imágenes</h4>
<ol class="breadcrumb">
<li>
<a href="index.php">Home</a>
</li>
<li>
<a href="imagegallery.php?IdCategoria=<?= $IdCategoria ?>"><?= ($oCategoria->Nombre) ?></a>
</li>
<li class="active">
Subir imágenes
</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="row">
<div class="col-xs-12">
<div class="row">
<?php
for ($j = 1; $j <= 12; $j++)
{
?>
<div id="img-container-<?= $j ?>" class="col-lg-3 col-md-4 col-sm-6 col-ms-12">
<div class=" panel panel-default panel-border">
<div class="img-container panel-body">
<div class="file-selector">
<img class="img-upl" id="image-<?= $j ?>" src="images/upload-icon.png" data-id="<?= $j ?>" alt="Picture">
<input type="file" class="img-upload" data-id="<?= $j ?>" name="Image[]" id="img-<?= $j ?>" accept="image/*" />
</div>
<textarea id="epigrafe-<?= $j ?>" class="form-control" maxlength="250" rows="2" placeholder="Descripción Breve."></textarea>
<div class="m-t-10">
<button id="btn-rm-<?= $j ?>" type="button" class="btn btn-danger waves-effect waves-light" disabled="disabled" onclick="RemoveImage('<?=$j ?>');"><span class="btn-label"><i class="fa fa-times"></i></span> Eliminar imágen</button>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
<form id="uploadImageForm" action="imagen_add.php" method="post" enctype="multipart/form-data">
<input type="hidden" id="IdCategoria" name="IdCategoria" value="<?= $IdCategoria ?>" />
<input type="hidden" id="IdGaleria" name="IdGaleria" value="<?= $IdGaleria ?>" />
<input type="hidden" id="Submitted" name="Submitted" value="1" />
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<div class="hidden-print">
<div class="pull-right">
<button id="btn-submit" class="btn btn-success waves-effect waves-light"><i class="ion-upload m-r-5"></i> Subir Imágenes</button>
<a id="btn-back" href="imagegallery.php?IdCategoria=<?= $IdCategoria ?>" class="btn btn-primary waves-effect waves-light">Volver a <?= ($oCategoria->Nombre) ?></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<input type="hidden" id="imgId" name="imgId" value="">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Cerrar</span></button>
<img src="" class="imagepreview" style="width: 100%;" >
<div class="m-t-20 text-right">
<button class="btn btn-default" onclick="RotateRight();"><i class="fa fa-rotate-right"></i></button>
<button class="btn btn-default" onclick="RotateLeft();"><i class="fa fa-rotate-left"></i></button>
<a class="btn btn-primary" id="btn-img-save">Recortar imágen</a>
</div>
</div>
</div>
</div>
</div>
<?php include("ssi_scripts.php"); ?>
<script type="text/javascript" src="js/resize_img.js"></script>
<script src="js/cropper.js"></script><!-- Cropper.js is required -->
<script src="js/jquery-cropper.min.js"></script>
<script src="js/modal_crop.js"></script>
</body>
</html>
Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat