Mister Spy Say ="Hello Kids ... :D"
___ ____ _ _____
| \/ (_) | | / ___|
| . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _
| |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | |
| | | | \__ \ || __/ | /\__/ / |_) | |_| |
\_| |_/_|___/\__\___|_| \____/| .__/ \__, |
| | __/ |
|_| |___/
Bot Mister Spy V3
Mister Spy
Mister Spy
<?php
require_once('class.dbaccess.php');
function GetRequestParam($index) {
$value = null;
if (array_key_exists($index, $_REQUEST))
$value = $_REQUEST[$index];
return $value;
}
function ParseDate($date)
{
if (($ret = _parseDate($date, '%d-%m-%Y')) != false)
return $ret;
if (($ret = _parseDate($date, '%d/%m/%Y %H:%M:%s')) != false)
return $ret;
if (($ret = _parseDate($date, '%d/%m/%Y %H:%M')) != false)
return $ret;
if (($ret = _parseDate($date, '%d/%m/%Y %H')) != false)
return $ret;
if (($ret = _parseDate($date, '%d/%m/%Y')) != false)
return $ret;
if (($ret = _parseDate($date, '%d-%m-%Y %H:%M:%s')) != false)
return $ret;
if (($ret = _parseDate($date, '%d-%m-%Y %H:%M')) != false)
return $ret;
if (($ret = _parseDate($date, '%d-%m-%Y %H')) != false)
return $ret;
if (($ret = _parseDate($date, '%Y-%m-%d %H:%M:%s')) != false)
return $ret;
if (($ret = _parseDate($date, '%Y-%m-%d %H:%M:%s')) != false)
return $ret;
if (($ret = _parseDate($date, '%Y-%m-%d %H:%M')) != false)
return $ret;
if (($ret = _parseDate($date, '%Y-%m-%d %H')) != false)
return $ret;
if (($ret = _parseDate($date, '%Y-%m-%d')) != false)
return $ret;
return false;
}
function _parseDate($date, $format)
{
// Builds up date pattern from the given $format, keeping delimiters in place.
if( !preg_match_all( "/%([YmdHMsu])([^%])*/", $format, $formatTokens, PREG_SET_ORDER ) )
return false;
foreach( $formatTokens as $formatToken )
{
$delimiter = preg_quote( $formatToken[2], "/" );
if($formatToken[1] == 'Y')
{
$datePattern .= '(.{1,4})'.$delimiter;
}
elseif($formatToken[1] == 'u')
{
$datePattern .= '(.{1,5})'.$delimiter;
}
else
{
$datePattern .= '(.{1,2})'.$delimiter;
}
}
// Splits up the given $date
if( !preg_match( "/^".$datePattern."/", $date, $dateTokens) )
{
return false;
}
$dateSegments = array();
for($i = 0; $i < count($formatTokens); $i++)
{
$dateSegments[$formatTokens[$i][1]] = $dateTokens[$i+1];
}
// Reformats the given $date into rfc3339
if( $dateSegments["Y"] && $dateSegments["m"] && $dateSegments["d"] )
{
if( ! checkdate ( $dateSegments["m"], $dateSegments["d"], $dateSegments["Y"] ))
{
return false;
}
$dateReformated =
str_pad($dateSegments["Y"], 4, '0', STR_PAD_LEFT)
."-".str_pad($dateSegments["m"], 2, '0', STR_PAD_LEFT)
."-".str_pad($dateSegments["d"], 2, '0', STR_PAD_LEFT);
}
else
{
return false;
}
if( $dateSegments["H"] && $dateSegments["M"] )
{
$dateReformated .=
" ".str_pad($dateSegments["H"], 2, '0', STR_PAD_LEFT)
.':'.str_pad($dateSegments["M"], 2, '0', STR_PAD_LEFT);
if( $dateSegments["s"] )
{
$dateReformated .=
":".str_pad($dateSegments["s"], 2, '0', STR_PAD_LEFT);
if( $dateSegments["u"] )
{
$dateReformated .=
'.'.str_pad($dateSegments["u"], 5, '0', STR_PAD_RIGHT);
}
}
}
return $dateReformated;
}
function IsDni($Dni)
{
$Dni = trim($Dni);
if (!is_numeric($Dni) || $Dni < 1 || $Dni != round($Dni))
return false;
if (strlen($Dni) < 5 || strlen($Dni) > 8)
return false;
return true;
}
function IsTelephone($Tel)
{
$Tel = trim($Tel);
return preg_match('(^\(?\+?[0-9]{2,7}\)?\-?\s?[0-9]{3,4}\-?\s?[0-9]{4})', $Tel);
}
function IsEmail($Email)
{
$Email = trim($Email);
if (strlen($Email) <= 6)
return false;
if (substr_count($Email, "@") != 1)
return false;
if (substr($Email, 0, 1) == "@")
return false;
if (substr($Email, strlen($Email) - 1, 1) == "@")
return false;
if (strstr($Email, "'"))
return false;
if (strstr($Email, "\""))
return false;
if (strstr($Email, "\\"))
return false;
if (strstr($Email, "\$"))
return false;
if (strstr($Email, " "))
return false;
if (strstr($Email, "?"))
return false;
if (strstr($Email, "�"))
return false;
if (strstr($Email, "�"))
return false;
if (strstr($Email, "&"))
return false;
if (strstr($Email, "!"))
return false;
if (strstr($Email, "�"))
return false;
if (substr_count($Email, ".") < 1)
return false;
/* verifica el dominio */
$Dominio = substr(strrchr($Email, "."), 1);
if (strlen($Dominio) < 1 || strlen($Dominio) > 5 || strstr($Dominio, "@"))
return false;
/* verifica el cuerpo */
$Cuerpo = substr($Email, 0, strlen($Email) - strlen($Dominio) - 1);
$UltimoCaracter = substr($Cuerpo, strlen($Cuerpo)-1, 1);
if ($UltimoCaracter == "@" || $UltimoCaracter == ".")
return false;
return true;;
}
function FormatMoney($Money, $Number, $Cotizacion)
{
$Value = '';
switch ($Money)
{
case MonedaTipos::Pesos:
$Value.= '$ ';
if ($Number != 0) $Value.= number_format($Number, 2);
else $Value.= '0.00';
break;
case MonedaTipos::Dolar:
$Value.= 'u$s ';
if ($Number != 0) $Value.= number_format($Number / $Cotizacion, 2);
else $Value.= '0.00';
break;
case MonedaTipos::Euro:
$Value.= '€ ';
if ($Number != 0) $Value.= number_format($Number / $Cotizacion, 2);
else $Value.= '0.00';
break;
}
return $Value;
}
function ConstructGallery($arr)
{
?>
<link rel="stylesheet" href="../css/lightbox.css" type="text/css" media="screen" />
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous.js?load=effects" type="text/javascript"></script>
<script src="js/lightbox.js" type="text/javascript"></script>
<script languaje="javascript">
function ShowImage(id)
{
var img_principal = Get('ImagenPrincipal');
var EpigrafePrincipal = Get('EpigrafePrincipal');
img_principal.style.display = 'none';
EpigrafePrincipal.style.display = 'none';
for (var i=0; i<100; i++)
{
var img_ocultar = Get(i + '_G');
var EpigrafeOcultar = Get(i + '_Epigrafe');
if (img_ocultar != undefined)
img_ocultar.style.display = 'none';
if (EpigrafeOcultar != undefined)
EpigrafeOcultar.style.display = 'none';
}
if (id == 'ImagenPrincipal')
{
var img = Get('ImagenPrincipal');
img.style.display = '';
EpigrafePrincipal.style.display = '';
}
else
{
var img = Get(id + '_G');
var Epigrafe = Get(id + '_Epigrafe');
img.style.display = '';
Epigrafe.style.display = '';
}
}
</script>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="200" valign="top">
<div align="left">
<?php
$Count = 1;
$Create = false;
if ($arr)
{
foreach ($arr as $oImagen)
{
if (file_exists($oImagen->Imagen))
$Create = true;
}
reset($arr);
}
$Create = true;
if ($Create)
{
foreach ($arr as $oImagen)
{
if ($Count == 1)
{
$ImagenPrincipal = $oImagen->Imagen;
$EpigrafePrincipal = $oImagen->Epigrafe;
}
?>
<a href="<?=$oImagen->Imagen?>" title="<?=$oImagen->Epigrafe?>" rel="lightbox[gallery]"><img src="<?=($oImagen->Imagen != '') ? $oImagen->Imagen : 'images/no_foto.jpg'?>" id="<?=$Count?>_G" name="<?=$Count?>_G" width="165" height="165" border="0" style="display:none;" /></a>
<span id="<?=$Count?>_Epigrafe" style="display:none;"><br /><?=$oImagen->Epigrafe?></span>
<?php
$Count++;
}
?>
<a href="<?=$ImagenPrincipal?>" title="<?=$EpigrafePrincipal?>" rel="lightbox[gallery]"><img src="<?=($oImagen->Imagen != '') ? $oImagen->Imagen : 'images/no_foto.jpg'?>" id="ImagenPrincipal" name="ImagenPrincipal" width="165" height="165" border="0" /></a>
<span id="EpigrafePrincipal"><br /><?=$EpigrafePrincipal?></span>
<br /><br />
<?php
$i = 1;
$Count = 1;
reset($arr);
?>
</div>
<div>
<table>
<?php
foreach ($arr as $oImagen)
{
if ($i == 1)
{
?>
<tr>
<?php
}
?>
<td valign="top">
<img src="<?=($oImagen->Imagen != '') ? $oImagen->Imagen : 'images/no_foto.jpg'?>" id="<?=$Count?>_C" name="<?=$Count?>_C" width="50" height="50" border="0" align="top" onclick="ShowImage('<?=$Count?>');" />
</td>
<?php
if ($i == 3)
{
?>
</tr>
<?php
$i = 0;
}
$i++;
$Count++;
}
}
else
{
?>
</table>
</div>
<div>
<table>
<tr>
<td>
<img src="<?=Config::ImagenDefault?>" name="ImagenPrincipal" width="165" border="0" id="ImagenPrincipal" />
<br /><br />
</td>
</tr>
</table>
</div>
<?php
}
?>
</td>
</tr>
</table>
<?php
//return $Gallery;
}
function PrintImageExtension($FileName)
{
$Extension = explode(".", $FileName);
$Extension = $Extension[sizeof($Extension)-1];
switch ($Extension)
{
case 'pdf':
echo "<img src='images/iconos/pdf.png' alt='PDF' />";
break;
case 'doc':
case 'docx':
echo "<img src='images/iconos/doc.png' alt='DOC'/>";
break;
case 'xls':
case 'xlsx':
echo "<img src='images/iconos/excel.png' alt='XLS' />";
break;
case 'txt':
echo "<img src='images/iconos/txt.png' alt='TXT' />";
break;
case 'ppt':
case 'pptx':
echo "<img src='images/iconos/ppt.png' alt='PPT' />";
break;
case 'csv':
echo "<img src='images/iconos/csv.png' alt='CSV' />";
break;
case 'jpg':
case 'jpeg':
echo "<img src='images/iconos/jpg.png' alt='JPG' />";
break;
case 'gif':
echo "<img src='images/iconos/gif.png' alt='GIF' />";
break;
case 'png':
echo "<img src='images/iconos/png.png' alt='PNG' />";
break;
}
}
function GetUrlImagenVideoYouTube($EmbedCode)
{
for ($i=0; $i<strlen($EmbedCode); $i++)
{
if (substr($EmbedCode, $i, 25) == "http://www.youtube.com/v/")
{
return "<img src='http://i1.ytimg.com/vi/" . substr($EmbedCode, $i+25, 11) . "/default.jpg' border='0' />";
}
}
$str = 'src="http://www.youtube.com/embed/';
$pos = strpos($EmbedCode, $str);
$video = substr($EmbedCode, $pos + strlen($str), 11);
if (!(empty($video)))
{
return "http://i1.ytimg.com/vi/" . $video . "/default.jpg";
}
return false;
}
function GetIdVideoYouTube($EmbedCode)
{
$str = 'www.youtube.com/embed/';
$pos = strpos($EmbedCode, $str);
return substr($EmbedCode, $pos + strlen($str), 11);
}
function ChangeSizeVideoYouTube($EmbedCode, $Width = 240, $Height = 195)
{
$new_width = 'width=' . $Width;
$str_width = 'width="';
$pos_width = strpos($EmbedCode, $str_width);
$width = substr($EmbedCode, $pos_width + strlen($str_width), 3);
$replace_width = $str_width . $width . '"';
$EmbedCode = str_replace($replace_width, $new_width, $EmbedCode);
$new_height = 'height=' . $Height;
$str_height = 'height="';
$pos_height = strpos($EmbedCode, $str_height);
$height = substr($EmbedCode, $pos_height + strlen($str_height), 3);
$replace_height = $str_height . $height . '"';
$EmbedCode = str_replace($replace_height, $new_height, $EmbedCode);
return $EmbedCode;
}
function CortarCadena($String, $CantidadCaracteres)
{
if (strlen($String) > $CantidadCaracteres)
{
return substr($String, 0, $CantidadCaracteres) . '...';
}
return $String;
}
function UrlFriendly($url)
{
// Tranformamos todo a minusculas
$url = strtolower($url);
// Rememplazamos caracteres especiales latinos
$find = array('�', '�', '�', '�', '�', '�');
$repl = array('a', 'e', 'i', 'o', 'u', 'n');
$url = str_replace($find, $repl, $url);
// A�aadimos los guiones
$find = array(' ', '&', '\r\n', '\n', '+');
$url = str_replace($find, '-', $url);
// Eliminamos y Reemplazamos dem�s caracteres especiales
$find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/');
$repl = array('', '-', '');
$url = preg_replace($find, $repl, $url);
if (sizeof($url) == 0)
$url = 'producto';
return $url;
}
function ParseNumber($str)
{
$str = number_format($str, 2, ',', '.');
$str = str_replace(',00', '', $str);
return $str;
}
function ConstructGalleryProductoBJ($arr)
{
$Gallery = '';
$Count = 1;
$Create = 0;
if ($arr)
{
foreach ($arr as $oImagen)
{
if (file_exists($oImagen->Imagen))
$Create = 1;
}
reset($arr);
}
if ($Create == 1)
{
foreach ($arr as $oImagen)
{
$display = "style=\"display:none;\"";
if ($Count == 1)
{
/*$ImagenPrincipal = $oImagen->Imagen;
$EpigrafePrincipal = $oImagen->Epigrafe;
$Gallery.= "<a href=\"" . $ImagenPrincipal . "\" title=\"" . $EpigrafePrincipal . "\" class=\"popup\">\n";
$Gallery.= "<img src=\"" . $ImagenPrincipal . "\" name=\"ImagenPrincipal\" border=\"0\" id=\"ImagenPrincipal\" /></a>\n";
*/
$display = "";
}
$Gallery.= "<a href=\"" . $oImagen->Imagen . "\" title=\"" . $oImagen->Epigrafe . "\" class=\"popup\">\n";
$Gallery.= "<img src=\"" . $oImagen->Imagen . "\" id=\"" . $Count . "_G\" border=\"0\" " . $display . " /></a>\n";
$Count++;
}
$i = 1;
$Count = 1;
reset($arr);
$Gallery.= "<div class=\"thumb-list\">\n";
$Gallery.= "<h3>Imagenes</h3>\n";
$Gallery.= "<ul>\n";
foreach ($arr as $oImagen)
{
$Gallery.= "<li>\n";
$Gallery.= "<img src=\"" . $oImagen->Imagen . "\" name=\"" . $Count . "_C\" border=\"0\" id=\"" . $Count . "_C\" onclick=\"ShowImage('" . $Count . "')\" />\n";
$Gallery.= "</li>\n";
$i++;
$Count++;
}
$Gallery.= "</ul>\n";
$Gallery.= "</div>\n";
}
return $Gallery;
}
function CambiarFecha($Fecha)
{
if (sizeof($Fecha) == 0)
return $Fecha;
if (strpos($Fecha, '-') === false && strpos($Fecha, '/') === false)
{
$Anio = substr($Fecha, 0, 4);
$Mes = substr($Fecha, 4, 2);
$Dia = substr($Fecha, 6, 2);
$Fecha = $Dia . '/' . $Mes . '/' . $Anio;
}
elseif (strpos($Fecha, '-'))
{
$Fecha = implode('-', array_reverse(explode('-', substr($Fecha, 0, 10))));
}
elseif (strpos($Fecha, '/'))
{
$Fecha = implode('/', array_reverse(explode('/', substr($Fecha, 0, 10))));
}
return $Fecha;
}
function CambiarFechaHora($String)
{
$Fecha = implode('-', array_reverse(explode('-', substr($String, 0, 10))));
$Hora = substr($String, 11, strlen($String));
$FechaHora = $Fecha . " | " . $Hora;
return $FechaHora;
}
function CambiarFechaHoraDelta($String, $delta)
{
$Fecha = implode('-', array_reverse(explode('-', substr($String, 0, 10))));
$Hora = substr($String, 11, strlen($String));
$h = intval(substr($Hora, 0, 2));
$h+= $delta;
$Hora = str_pad($h, 2, '0', STR_PAD_LEFT) . substr($Hora, 2, 3);
$FechaHora = $Fecha . " | " . $Hora;
return $FechaHora;
}
function RestaFechas($FechaInicio, $FechaFin)
{
$FechaInicio = str_replace("-", "", $FechaInicio);
$FechaInicio = str_replace("/", "", $FechaInicio);
$FechaFin = str_replace("-", "", $FechaFin);
$FechaFin = str_replace("/", "", $FechaFin);
ereg("([0-9]{1,2})([0-9]{1,2})([0-9]{2,4})", $FechaInicio, $FechaInicio);
ereg("([0-9]{1,2})([0-9]{1,2})([0-9]{2,4})", $FechaFin, $FechaFin);
$date1 = mktime(0, 0, 0, $FechaInicio[2], $FechaInicio[1], $FechaInicio[3]);
$date2 = mktime(0, 0, 0, $FechaFin[2], $FechaFin[1], $FechaFin[3]);
return round(($date2 - $date1) / (60 * 60 * 24));
}
function RestaHoras($HoraInicio, $HoraFin)
{
$horai = substr($HoraInicio, 0, 2);
$mini = substr($HoraInicio, 3, 2);
$segi = substr($HoraInicio, 6, 2);
$horaf = substr($HoraFin, 0, 2);
$minf = substr($HoraFin, 3, 2);
$segf = substr($HoraFin, 6, 2);
$ini = ((($horai * 60) * 60) + ($mini * 60) + $segi);
$fin = ((($horaf * 60) * 60) + ($minf * 60) + $segf);
$dif = $fin - $ini;
$difh = floor($dif / 3600);
$difm = floor(($dif - ($difh * 3600)) / 60);
$difs = $dif - ($difm * 60) - ($difh * 3600);
return date("H-i-s", mktime($difh, $difm, $difs));
}
function EliminarTildes($str)
{
$str = ereg_replace("�", "a", $str);
$str = ereg_replace("�", "e", $str);
$str = ereg_replace("�", "i", $str);
$str = ereg_replace("�", "o", $str);
$str = ereg_replace("�", "u", $str);
$str = ereg_replace("�", "a", $str);
$str = ereg_replace("�", "e", $str);
$str = ereg_replace("�", "i", $str);
$str = ereg_replace("�", "o", $str);
$str = ereg_replace("�", "u", $str);
$str = ereg_replace("�", "n", $str);
$str = ereg_replace("�", "N", $str);
return $str;
}
function ParseCssAsArray ($FileName)
{
$arr = array();
$Class = false;
$ClassName = '';
$File = fopen($FileName, 'r');
$String = str_replace("\n", "", fread($File, filesize($FileName)));
$String = str_replace("\r", "", $String);
$String = str_replace("\t", "", $String);
$String = str_replace(".", "", $String);
$String = str_replace(" ", "", $String);
for ($i=0; $i<=strlen($String)-1; $i++)
{
if (!$Class)
{
if ($String[$i] != '{')
{
$ClassName.= $String[$i];
}
else
{
$ClassName = str_replace("\n", "", $ClassName);
$arr[$ClassName] = 'style="';
$Class = true;
}
}
else
{
if ($String[$i] != '}')
{
$arr[$ClassName].= $String[$i];
}
else
{
//$arr[$ClassName].= '}"';
$arr[$ClassName].= '"';
$Class = false;
$ClassName = '';
}
}
}
return $arr;
}
function FindElement($arr, $id)
{
if (!is_array($arr))
return false;
if ($arr == false || $arr == '')
return false;
for ($i=0; $i<sizeof($arr); $i++)
{
if ($arr[$i] == $id)
return true;
}
return false;
}
function IsEmptyArray($arr)
{
if (!is_array($arr))
return true;
foreach ($arr as $index=>$value)
{
if (trim($value) != '')
return false;
}
return true;
}
function SendArray(array $arr)
{
if (!is_array($arr))
return '';
$tmp = serialize($arr);
$tmp = urlencode($tmp);
return $tmp;
}
function ReceiveArray($urlArray)
{
$tmp = stripslashes($urlArray);
$tmp = urldecode($tmp);
$tmp = unserialize($tmp);
return $tmp;
}
function ParseUrlFacebook()
{
$str = str_replace('/','%2F',$str);
$str = str_replace(':','%3A',$str);
return $str;
}
function FechaLetras($date) {
if (!$date) {
return '';
}
$arrFecha = explode('-', $date);
$d = date_create_from_format('Y-m-d', $date);
$arrDias = array(
'1' => 'Lunes',
'2' => 'Martes',
'3' => 'Miércoles',
'4' => 'Jueves',
'5' => 'Viernes',
'6' => 'Sábado',
'7' => 'Domingo',
);
return $arrFecha[2] . ' de ' . FechaMesShort($date) . ' ' . $arrFecha[0];
}
function FechaLetrasLong($date) {
if (!$date) {
return '';
}
$arrFecha = explode('-', $date);
$d = date_create_from_format('Y-m-d', $date);
$arrDias = array(
'1' => 'Lunes',
'2' => 'Martes',
'3' => 'Miércoles',
'4' => 'Jueves',
'5' => 'Viernes',
'6' => 'Sábado',
'7' => 'Domingo',
);
return $arrFecha[2] . ' de ' . FechaMesLong($date) . ' ' . $arrFecha[0];
}
function FechaMesShort($date) {
$arrFecha = explode('-', $date);
$arrMeses = array(
'01' => 'Ene',
'02' => 'Feb',
'03' => 'Mar',
'04' => 'Abr',
'05' => 'May',
'06' => 'Jun',
'07' => 'Jul',
'08' => 'Ago',
'09' => 'Sep',
'10' => 'Oct',
'11' => 'Nov',
'12' => 'Dic'
);
$d = date_create_from_format('Y-m-d', $date);
return $arrMeses[$arrFecha[1]];
}
function FechaMesLong($date) {
$arrFecha = explode('-', $date);
$arrMeses = array(
'01' => 'Enero',
'02' => 'Febrero',
'03' => 'Marzo',
'04' => 'Abril',
'05' => 'Mayo',
'06' => 'Junio',
'07' => 'Julio',
'08' => 'Agosto',
'09' => 'Septiembre',
'10' => 'Octubre',
'11' => 'Noviembre',
'12' => 'Diciembre'
);
$d = date_create_from_format('Y-m-d', $date);
return $arrMeses[$arrFecha[1]];
}
?>
Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat