1
0
Fork 0

correciones en la api y nuevo tipo de campo adjunto

This commit is contained in:
fredyrivera 2017-09-17 12:24:26 -05:00
parent 4ba738a1d5
commit 85353f9875
8 changed files with 368 additions and 11 deletions

Binary file not shown.

93
milfs/archivos/index.php Normal file
View File

@ -0,0 +1,93 @@
<?php
session_start();
// Comprobamos si existe la variable
/*if ( !isset ( $_SESSION['id'] ) ) {
// Si no existe
header("Location: ../nodisponible.jpg");
// echo "hola mundo2";
}*/
if(!isset($_GET['archivo']) ){
header("Location: ../images/sinimagen.jpg");
}else {$archivo = $_GET['archivo'];}
include("../includes/datos.php");
function remplacetas($tabla,$campo,$valor,$por,$and){
include_once("../funciones/conex.php");
$link=Conectarse_recursivo();
mysqli_set_charset($link, "utf8");
if(@$and !=''){$AND = "AND $and";}else{$AND ="";}
//$consulta = "SELECT * , md5(binary $por ) as md5_".$por." FROM $tabla WHERE $campo = '$valor' $AND order by $campo DESC limit 1";
$consulta = "SELECT * , md5(binary $por ) as md5_".$por." FROM $tabla WHERE $campo = '$valor' $AND order by id DESC limit 1";
$sql=mysqli_query($link,$consulta);
if (@mysqli_num_rows($sql)!=0){
$resultado[] = mysqli_result($sql,0,$por);
$resultado[] = mysqli_result($sql,0,'id');
$resultado[] = $consulta;
$resultado[] = mysqli_result($sql,0,"md5_$por");
$resultado[] = @mysqli_result($sql,0,"timestamp");
$resultado[] = @mysqli_result($sql,0,"form_id");
$resultado[] = @mysqli_result($sql,0,"id_usuario"); //6
$resultado[] = @mysqli_result($sql,0,"id_empresa"); //7
$resultado[] = @mysqli_result($sql,0,"equipo");
}else{
$resultado[0] = '';
$resultado[1] ="";
$resultado[2] = $consulta;
$resultado[3] = NULL;
$resultado[4] = NULL;
$resultado[4] = NULL;
}
return $resultado;
}
function mysqli_result($res,$row=0,$col=0){
$numrows = @mysqli_num_rows($res);
if ($numrows && $row <= ($numrows-1) && $row >=0){
mysqli_data_seek($res,$row);
$resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
if (isset($resrow[$col])){
return $resrow[$col];
}
}
return false;
}
$control = remplacetas('form_datos','contenido',"$archivo",'control',"") ;
$privacidad = remplacetas('form_id','id',"$control[5]",'publico',"") ;
if($privacidad[0] == 0 AND ($_SESSION['id'] != $control[6] OR $_SESSION['id_empresa'] != $control[7]) or $_SESSION['equipo'] != $control[8] ) {
header("Location: ../images/seguridad.gif");
exit();
}
$dir="$path_images_secure/full/";
if ((!$file=realpath($dir.$_GET['archivo']))
|| strpos($file,realpath($dir))!==0 || substr($file,-4)=='.php'){
//header('HTTP/1.0 404 Not Found');
header("Location: ../images/sinimagen.jpg");
exit();
}
$ref=$_SERVER['HTTP_REFERER'];
if (strpos($ref,'https://')===0 || strpos($ref,'https')!==0){
/* $mime=array(
'jpg'=>'image/jpeg',
'png'=>'image/png',
'mid'=>'audio/x-midi',
'wav'=>'audio/x-wav'
);
if($mime[substr($file,-3)] =='') {
header('Location: ../pixel.png');
exit();
}*/
$stat=stat($file);
header('Content-Type: '.$mime[substr($file,-3)]);
header('Content-Length: '.$stat[7]);
header('Last-Modified: '.gmdate('D, d M Y H:i:s',$stat[9]).' GMT');
readfile($file);
exit();
}
header('Pragma: no-cache');
header('Cache-Control: no-cache, no-store, must-revalidate');
include($file.'.php');
?>

View File

@ -36,12 +36,16 @@ function Conectarse_recursivo(){
@include("milfs/includes/datos.php");
if(!isset($db)) {
include("../milfs/includes/datos.php");
@include("../milfs/includes/datos.php");
if(!isset($db)) {
include("../includes/datos.php");
}
}
if (!($link=mysqli_connect($servidor,$usuario,$password,$db)))
{
echo "Error conectando a la base de datos. ";
echo "Error conectando a la base de datos. $servidor,$usuario,$password,$db ";
exit();
}
/* if (!mysqli_select_db($db,$link))

View File

@ -150,6 +150,39 @@ $contenido .= "
}
$resultado="
<div class='container' style=' display: table;'>$contenido</div>";
return $resultado;
}
function json_tabla($contenido,$campo,$control){
$tipo = remplacetas('form_campos','id',"$campo",'campo_tipo',"") ;
$datos = json_decode($contenido, true);
foreach ($datos as $id_campo => $valor) {
foreach ($valor as $c => $v) {
if($tipo[0]==31 AND $c=="nombre") {
$url= $full= "$_SESSION[site]milfs/archivos/?archivo=".$v;
$linea .= "<tr><td>$c</td><td><strong><a href='$url'>$v</a></strong></td></tr>";
}else{
$linea .= "<tr><td>$c</td><td><strong>$v</strong></td></tr>";
}
}
}
$resultado="
<table class='table table-striped table-responsive' id='tabla_$control' >
<tr><th>Campo</th><th>Valor</th></tr>
$linea
</table>
";
return $resultado;
}
@ -552,6 +585,7 @@ $acciones="<div class='btn-group' role='group' aria-label='...'>
<a class='btn btn-info ' target='api' href='$_SESSION[site]/milfs/api.php?id=$id&tipo=simple'> {json simple}</a>
$mapa
<a class='btn btn-info ' target='api' href='$_SESSION[site]/l$id'>Informe</a>
<a class='btn btn-info ' target='api' href='$_SESSION[site]/b$id?registros=10'>Mostrar</a>
<a class='btn btn-info ' target='api' href='$_SESSION[site]/f$id?registros=10'>Llenar</a>
<a class='btn btn-info ' target='api' href='$_SESSION[site]/g$id?registros=10'>Embeber</a>
@ -1679,10 +1713,16 @@ while( $row = mysqli_fetch_array( $datos_consulta ) ) {
if($tipo_campo[0] =="15" ) {$imagen ="<img style='width:100%' class='img img-responsive' src='$_SESSION[site]milfs/images/secure/?file=300/$contenido[0]'> "; $contenido[0]="";}else{$imagen ="";}
if($tipo_campo[0] =="6" ) {$contenido[0] =imprimir_buscador_campo("$row[id_campo]",$contenido[0]) ; }
if($tipo_campo[0] =="29" ) {$contenido[0] ="<img class='img img-responsive' src='$contenido[0]'> "; }//$contenido="<img class='img img-responsive' src='$contenido'>";
if($tipo_campo[0] =="31" ) {
$link_url = "$_SESSION[site]milfs/archivos/?archivo=$contenido[0]";
$contenido[0] = "<a href='$link_url' target='_blank' >$contenido[0]</a>";
}
if($tipo_campo[0]=='10'){
$render = relacion_render("$row[form_id]","$row[id_campo]",$contenido[0],'5','');
$contenido[0] = "$valor_actual";}
else {$render=html_entity_decode($contenido[0]);}
$json_array[$row['campo_nombre']."_titulo"] = "$contenido[0]";
//imprimir_buscador_campo($id_campo,$valor)
$listado_atenciones .= "<tr >
@ -4644,12 +4684,14 @@ while( $row = mysqli_fetch_array( $sql ) ) {
$listado_campos = listar_campos_formulario("$id_form",'');
foreach($listado_campos as $campo=>$valor){
$id_campo=$valor;
//$imagen = buscar_imagen($if_form,$row['control'],"","");
$contenido = remplacetas('form_datos','control',$row['control'],'contenido',"id_campo ='$valor' ") ;
$id_dato = remplacetas('form_datos','control',$row['control'],'id',"id_campo ='$valor' ") ;
$multiple = remplacetas('form_contenido_campos','id_form',$id_form,'multiple',"id_campo ='$valor' ") ;
//$id_empresa = remplacetas('form_datos','control',$row['control'],'id_empresa',"id_campo ='$valor' ") ;
$tipo_campo = remplacetas('form_campos','id',$valor,'campo_tipo',"") ;
$web = remplacetas("empresa","id",$id_empresa,"web","");
if($tipo_campo[0] ==15 AND $contenido[0] != "") {
@$listado_campos .= "
@ -4680,8 +4722,16 @@ foreach($listado_campos as $campo=>$valor){
@$listado_campos .= "<td title='' ><img class='img' height='100' src='$contenido[0]'> </td>";
}
elseif($tipo_campo[0] =="30" or $tipo_campo[0] =="24") {
$valor_actual = json_render("$contenido[0]","html","$row[control]");
elseif($tipo_campo[0] =="30" or $tipo_campo[0] =="24" ) {
$json = html_entity_decode($contenido[0]);
$valor_actual = json_render(html_entity_decode($contenido[0]),"html","$row[control]");
@$listado_campos .= "<td title='' >$valor_actual</td>";
}
elseif($tipo_campo[0] =="31") {
//$json = html_entity_decode($contenido[0]);
$link_url = "$_SESSION[site]milfs/archivos/?archivo=$contenido[0]";
$valor_actual = "<a href='$link_url' target='_blank' >$contenido[0]</a>";
@$listado_campos .= "<td title='' >$valor_actual</td>";
}
//
@ -4844,12 +4894,7 @@ $array["identificador"] = "$identificador";
while($row = mysqli_fetch_array( $sql ))
{
//$contenido = remplacetas('form_datos','id',$row[id],'contenido',"") ;
$id_campo = remplacetas('form_datos','id',$row["id"],'id_campo',"") ;
$campo_tipo = remplacetas("form_campos","id",$row["id_campo"],"campo_tipo","");
$multiple = remplacetas('form_contenido_campos','id_form',$row['form_id'],'multiple',"id_campo ='$id_campo[0]' ") ;
if($multiple[0] =='1') { $contenido_multiple = formulario_valor_campo("$row[form_id]","$id_campo[0]","","$row[control]",'',"$row[timestamp]"); $contenido[0] = $contenido_multiple[9];}
@ -4858,6 +4903,12 @@ while($row = mysqli_fetch_array( $sql ))
if($campo_tipo[0]=='10'){
$valor_actual = relacion_render($row["form_id"],$row["id_campo"],$contenido[0],'5','relacion_drop');
$contenido[0] = "$valor_actual";}
if($campo_tipo[0] =='31') {
$link_url = "$_SESSION[site]milfs/archivos/?archivo=$contenido[0]";
$contenido[0] = $link_url;
}
else{
}
@ -8587,6 +8638,7 @@ $mostrar = mostrar_areas($datos['id'],"","","api");
//$nombre_campo =remplacetas('form_campos','id',$id_campo[0],'campo_nombre',"") ;
$id_campo = remplacetas('form_datos','id',$row["id_dato"],'id_campo',"") ;
$formulario = remplacetas('form_datos','id',$row["id_dato"],'form_id',"") ;
$campo_tipo = remplacetas("form_campos","id",$row["id_campo"],"campo_tipo","");
//// PRIVACIDAD
$privado = remplacetas('form_parametrizacion','campo',"$formulario[0]",'opcion'," tabla='form_id' AND descripcion ='$id_campo[0]' AND opcion REGEXP '^privacidad:' ") ;
$privado = explode(":",$privado[0]);
@ -8601,6 +8653,11 @@ $mostrar = mostrar_areas($datos['id'],"","","api");
$features[] = "'$nombre_campo[0]' : '$contenido[0]'";//$row[id_campo];
}
else {
if($campo_tipo[0] == '31') {
$link_url = "$_SESSION[site]milfs/archivos/?archivo=$row[contenido]";
$row['contenido']= $link_url;
}
$features[] = $row;
}
}
@ -9855,10 +9912,16 @@ if (mysqli_num_rows($sql)!='0'){
$contenido_full = json_render("$contenido","csv","$control");
$valor_actual = json_render("$contenido","html","$control");
$contenido = "$valor_actual";}
elseif($campo_tipo =="31"){
$link_url = "$_SESSION[site]milfs/archivos/?archivo=$contenido";
$contenido = "<a href='$link_url' target='_blank' >$contenido</a>";
}
elseif($campo_tipo=="24"){
$contenido_full = json_render("$contenido","csv","$control");
$valor_actual = json_render("$contenido","html","$control");
$contenido = "$valor_actual";}
elseif($campo_tipo=='5' AND $contenido !=""){
if($tipo =="") {
$contenido = trim($contenido); $contenido = "
@ -10714,7 +10777,7 @@ return $respuesta;
function remplacetas($tabla,$campo,$valor,$por,$and){
/// depende de la funcion mysqli_result por compatibilidad hacia atras
$link=Conectarse();
mysqli_set_charset($link, "utf8");
if(@$and !=''){$AND = "AND $and";}else{$AND ="";}
@ -10728,13 +10791,19 @@ $resultado[] = $consulta;
$resultado[] = mysqli_result($sql,0,"md5_$por");
$resultado[] = @mysqli_result($sql,0,"timestamp");
$resultado[] = @mysqli_result($sql,0,"form_id");
$resultado[] = @mysqli_result($sql,0,"id_usuario"); //6
$resultado[] = @mysqli_result($sql,0,"id_empresa"); //7
$resultado[] = @mysqli_result($sql,0,"equipo"); //8
}else{
$resultado[0] = '';
$resultado[1] ="";
$resultado[2] = $consulta;
$resultado[3] = NULL;
$resultado[4] = NULL;
$resultado[4] = NULL;
$resultado[5] = NULL;
$resultado[6] = NULL;
$resultado[7] = NULL;
$resultado[8] = NULL;
}
return $resultado;
}
@ -12193,7 +12262,47 @@ return $respuesta;
}
$xajax->registerFunction("campo_multiple");
function subidor_generico($campo,$item){
$name= $campo."[".$item."]";
$resultado = "
<div id='wrap'>
<div id='alert_$name' class='alert alert-info'>
<input id='$name' name='$name' value='' type=''/>
<div class='row '>
<div class='col-xs-4'>
<input calss='form-control' value='' type='file' id='$campo-$item' name='$campo-$item' class='rm-input'
onchange=\"selectedFile($campo,$item);uploadFile($campo,$item); \"
onclick=\"document.getElementById('progressBar_').value='0'; document.getElementById('image_preview_$name').src = '';
document.getElementById('alert_$name').className = 'alert alert-info';
document.getElementById('div_preview_$name').innerHTML = '';
\";
/>
</div>
<div class='col-xs-4'>
<img id='image_preview_$name' style='max-width:200px;' alt='' /><div id= div_preview_$name></div>
</div>
<div class='col-xs-4'>
<div id='fileSize_$name'></div><div id='fileType_$name'></div><div id='fileName_$name'></div><div id='percentageCalc_$name'></div>
</div>
</div>
</div>
<progress id='progressBar_' value='0' max='100' class='rm-progress'></progress>
<div id='percentageCalc_'></div>
</div>
";
return $resultado;
}
function formulario_campos_render($id_campo,$id_form,$control,$item,$id_dato){
$cols ="";
$style="";
@ -12311,6 +12420,11 @@ elseif($campo_tipo_accion == 'email'){$render = "
// $gps = leer_exif($file);
$render= "<input value='$value' type='hidden' id='".$id_campo."[".$item."]' name='".$id_campo."[".$item."]' class='form-control' placeholder='$campo_descripcion' > "; //subir_imagen('',$id_campo[$item]);
$cols='12'; }
elseif($campo_tipo_accion == 'adjunto'){
$render=subidor_generico($id_campo,$item);
$cols='12'; }
elseif($campo_tipo_accion == 'html'){
$render = "

BIN
milfs/images/seguridad.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

BIN
milfs/images/seguridad.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -0,0 +1,46 @@
<?php
echo 'content="text/plain; charset=utf-8"';
// En versiones de PHP anteriores a la 4.1.0, debería utilizarse $HTTP_POST_FILES en lugar
// de $_FILES.
//$campo= "campo$_REQUEST[campo]-$_REQUEST[item]";
$campo= "$_REQUEST[campo]-$_REQUEST[item]";
$tipo = $_FILES["$campo"]['type'];
//$nombrecillo = $_FILES['myfile']['nombrecillo'];
if($tipo=="image/png") {$ext = ".png"; $imagen=1; }
elseif($tipo=="image/jpeg") {$ext = ".jpg"; $imagen=1; }
elseif($tipo=="image/gif") {$ext = ".gif"; $imagen=1; }
else {
$ext = explode(".", $_FILES["$campo"]['name']); $ext = ".".strtolower($ext[count($ext) - 1]);
// $ext = "novalida";
$imagen=0;}
$nombrecillo= $_REQUEST['nombrecillo'];
$name = "$nombrecillo";
$dir_subida = '/home/images_secure/';
$fichero_subido = $dir_subida ."full/".$name;
if (move_uploaded_file($_FILES["$campo"]['tmp_name'], $fichero_subido)) {
if($imagen==1) {
echo miniaturizar($name,"150",$dir_subida);
echo miniaturizar($name,"300",$dir_subida);
echo miniaturizar($name,"600",$dir_subida);
}
} else {
echo "¡Posible ataque de subida de ficheros!\n";
}
function miniaturizar($file,$width,$directorio) { //$archivo = $file;
$archivo = "$directorio"."full/".$file; $file_info = getimagesize($archivo); $ratio = $file_info[0] / $file_info[1]; $newwidth = $width; $newheight = round($newwidth / $ratio); $ext = explode(".", $file); $ext = strtolower($ext[count($ext) - 1]); if ($ext == "jpeg") $ext = "jpg"; switch ($ext) { case "jpg": $img = imagecreatefromjpeg($archivo); // $img = imagecreatefromstring($archivo); break; case "png": $img = imagecreatefrompng($archivo); break; case "gif": $img = imagecreatefromgif($archivo); break; } $thumb = imagecreatetruecolor($newwidth, $newheight);
imagealphablending( $thumb, false );
imagesavealpha( $thumb, true ); imagecopyresampled($thumb, $img, 0, 0, 0, 0, $newwidth, $newheight, $file_info[0], $file_info[1]);
if($ext=="jpg") { imagejpeg($thumb,$directorio.$width."/$file", 80);
}else {
imagepng($thumb,$directorio.$width."/$file", 9);
}
}
?>

View File

@ -1,3 +1,103 @@
//// funciones upload_generico
function selectedFile(campo,item) {
var campo;
var item;
var nombre = campo+"["+item+"]";
var archivoSeleccionado = document.getElementById(campo+"-"+item);
// alert(nombre);
var file = archivoSeleccionado.files[0];
if (file) {
var fileSize = 0;
if (file.size > 1048576)
fileSize = (Math.round(file.size * 100 / 1048576) / 100).toString() + ' MB';
else
fileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + ' Kb';
var divfileSize = document.getElementById('fileSize_'+nombre);
var divfileType = document.getElementById('fileType_'+nombre);
var divfileName = document.getElementById('fileName_'+nombre);
divfileSize.innerHTML = 'Tamaño: <strong>' + fileSize+"</strong>";
divfileType.innerHTML = 'Tipo: <strong>' + file.type+"</strong>";
divfileName.innerHTML = 'Nombre original: <strong>' + file.name+"</strong>" ;
if ((file.type != "image/jpeg") && (file.type != "image/png") ) {
document.getElementById("div_preview_"+nombre).innerHTML = "<h2><i class='fa fa-file' aria-hidden='true'></i><br>"+file.type+"</h2>";
}else{
document.getElementById("div_preview_"+nombre).innerHTML = "<h2>"+file.type+"</h2>";
document.getElementById("image_preview_"+nombre).src = window.URL.createObjectURL(archivoSeleccionado.files[0]);
// document.getElementById("image_preview_"+nombre).alt = file.type;
}
document.getElementById("alert_"+nombre).className = "alert alert-success";
}
}
function uploadFile(campo,item) {
var campo;
var item;
var nombre = campo+"["+item+"]";
var archivoSeleccionado = document.getElementById(campo+"-"+item);
var file = archivoSeleccionado.files[0];
var extension = getFileExtension(file.name);
var nombrecillo = hex_md5(Math.random()+file.name)+"."+extension;
// var arreglo = '[{"nombre_original":"'+file.name+'","tipo":"'+file.type+'","nombre":"'+nombrecillo+'","campo":"'+campo+'","item":"'+item+'","size":"'+file.size+'","extensión":"'+extension+'"}]';
//var myJsonString = JSON.stringify(arreglo);
//document.getElementById(nombre).value=nombrecillo;
document.getElementById(nombre).value=nombrecillo;
var url = "milfs/includes/upload_generico.php?nombrecillo="+nombrecillo+"&campo="+campo+"&item="+item;
var fd = new FormData();
fd.append(campo+"-"+item, file);
var xmlHTTP= new XMLHttpRequest();
xmlHTTP.upload.addEventListener("progress", progressFunction, false);
document.getElementById("percentageCalc_"+nombre).innerHTML = "<strong>Archivo se subió con éxito </strong>";
xmlHTTP.addEventListener("error", uploadFailed, false);
xmlHTTP.addEventListener("abort", uploadCanceled, false);
xmlHTTP.open("POST", url, true);
//xmlHTTP.setRequestHeader('book_id','10');
xmlHTTP.send(fd);
}
function progressFunction(evt){
var progressBar = document.getElementById("progressBar_");
var percentageDiv = document.getElementById("percentageCalc_");
if (evt.lengthComputable) {
progressBar.max = evt.total;
progressBar.value = evt.loaded;
percentageDiv.innerHTML = Math.round(evt.loaded / evt.total * 100) + "%";
}
}
function getFileExtension(filename) {
return filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2);
}
function uploadFailed(evt) {
alert("Hubo un error al subir el archivo.");
}
function uploadCanceled(evt) {
alert("La operación se canceló o la conexión fue interrunpida.");
}
var hexcase=0;function hex_md5(a){return rstr2hex(rstr_md5(str2rstr_utf8(a)))}function hex_hmac_md5(a,b){return rstr2hex(rstr_hmac_md5(str2rstr_utf8(a),str2rstr_utf8(b)))}function md5_vm_test(){return hex_md5("abc").toLowerCase()=="900150983cd24fb0d6963f7d28e17f72"}function rstr_md5(a){return binl2rstr(binl_md5(rstr2binl(a),a.length*8))}function rstr_hmac_md5(c,f){var e=rstr2binl(c);if(e.length>16){e=binl_md5(e,c.length*8)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=binl_md5(a.concat(rstr2binl(f)),512+f.length*8);return binl2rstr(binl_md5(d.concat(g),512+128))}function rstr2hex(c){try{hexcase}catch(g){hexcase=0}var f=hexcase?"0123456789ABCDEF":"0123456789abcdef";var b="";var a;for(var d=0;d<c.length;d++){a=c.charCodeAt(d);b+=f.charAt((a>>>4)&15)+f.charAt(a&15)}return b}function str2rstr_utf8(c){var b="";var d=-1;var a,e;while(++d<c.length){a=c.charCodeAt(d);e=d+1<c.length?c.charCodeAt(d+1):0;if(55296<=a&&a<=56319&&56320<=e&&e<=57343){a=65536+((a&1023)<<10)+(e&1023);d++}if(a<=127){b+=String.fromCharCode(a)}else{if(a<=2047){b+=String.fromCharCode(192|((a>>>6)&31),128|(a&63))}else{if(a<=65535){b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))}else{if(a<=2097151){b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))}}}}}return b}function rstr2binl(b){var a=Array(b.length>>2);for(var c=0;c<a.length;c++){a[c]=0}for(var c=0;c<b.length*8;c+=8){a[c>>5]|=(b.charCodeAt(c/8)&255)<<(c%32)}return a}function binl2rstr(b){var a="";for(var c=0;c<b.length*32;c+=8){a+=String.fromCharCode((b[c>>5]>>>(c%32))&255)}return a}function binl_md5(p,k){p[k>>5]|=128<<((k)%32);p[(((k+64)>>>9)<<4)+14]=k;var o=1732584193;var n=-271733879;var m=-1732584194;var l=271733878;for(var g=0;g<p.length;g+=16){var j=o;var h=n;var f=m;var e=l;o=md5_ff(o,n,m,l,p[g+0],7,-680876936);l=md5_ff(l,o,n,m,p[g+1],12,-389564586);m=md5_ff(m,l,o,n,p[g+2],17,606105819);n=md5_ff(n,m,l,o,p[g+3],22,-1044525330);o=md5_ff(o,n,m,l,p[g+4],7,-176418897);l=md5_ff(l,o,n,m,p[g+5],12,1200080426);m=md5_ff(m,l,o,n,p[g+6],17,-1473231341);n=md5_ff(n,m,l,o,p[g+7],22,-45705983);o=md5_ff(o,n,m,l,p[g+8],7,1770035416);l=md5_ff(l,o,n,m,p[g+9],12,-1958414417);m=md5_ff(m,l,o,n,p[g+10],17,-42063);n=md5_ff(n,m,l,o,p[g+11],22,-1990404162);o=md5_ff(o,n,m,l,p[g+12],7,1804603682);l=md5_ff(l,o,n,m,p[g+13],12,-40341101);m=md5_ff(m,l,o,n,p[g+14],17,-1502002290);n=md5_ff(n,m,l,o,p[g+15],22,1236535329);o=md5_gg(o,n,m,l,p[g+1],5,-165796510);l=md5_gg(l,o,n,m,p[g+6],9,-1069501632);m=md5_gg(m,l,o,n,p[g+11],14,643717713);n=md5_gg(n,m,l,o,p[g+0],20,-373897302);o=md5_gg(o,n,m,l,p[g+5],5,-701558691);l=md5_gg(l,o,n,m,p[g+10],9,38016083);m=md5_gg(m,l,o,n,p[g+15],14,-660478335);n=md5_gg(n,m,l,o,p[g+4],20,-405537848);o=md5_gg(o,n,m,l,p[g+9],5,568446438);l=md5_gg(l,o,n,m,p[g+14],9,-1019803690);m=md5_gg(m,l,o,n,p[g+3],14,-187363961);n=md5_gg(n,m,l,o,p[g+8],20,1163531501);o=md5_gg(o,n,m,l,p[g+13],5,-1444681467);l=md5_gg(l,o,n,m,p[g+2],9,-51403784);m=md5_gg(m,l,o,n,p[g+7],14,1735328473);n=md5_gg(n,m,l,o,p[g+12],20,-1926607734);o=md5_hh(o,n,m,l,p[g+5],4,-378558);l=md5_hh(l,o,n,m,p[g+8],11,-2022574463);m=md5_hh(m,l,o,n,p[g+11],16,1839030562);n=md5_hh(n,m,l,o,p[g+14],23,-35309556);o=md5_hh(o,n,m,l,p[g+1],4,-1530992060);l=md5_hh(l,o,n,m,p[g+4],11,1272893353);m=md5_hh(m,l,o,n,p[g+7],16,-155497632);n=md5_hh(n,m,l,o,p[g+10],23,-1094730640);o=md5_hh(o,n,m,l,p[g+13],4,681279174);l=md5_hh(l,o,n,m,p[g+0],11,-358537222);m=md5_hh(m,l,o,n,p[g+3],16,-722521979);n=md5_hh(n,m,l,o,p[g+6],23,76029189);o=md5_hh(o,n,m,l,p[g+9],4,-640364487);l=md5_hh(l,o,n,m,p[g+12],11,-421815835);m=md5_hh(m,l,o,n,p[g+15],16,530742520);n=md5_hh(n,m,l,o,p[g+2],23,-995338651);o=md5_ii(o,n,m,l,p[g+0],6,-198630844);l=md5_ii(l,o,n,m,p[g+7],10,1126891415);m=md5_ii(m,l,o,n,p[g+14],15,-1416354905);n=md5_ii(n,m,l,o,p[g+5],21,-57434055);o=md5_ii(o,n,m,l,p[g+12],6,1700485571);l=md5_ii(l,o,n,m,p[g+3],10,-1894986606);m=md5_ii(m,l,o,n,p[g+10],15,-1051523);n=md5_ii(n,m,l,o,p[g+1],21,-2054922799);o=md5_ii(o,n,m,l,p[g+8],6,1873313359);l=md5_ii(l,o,n,m,p[g+15],10,-30611744);m=md5_ii(m,l,o,n,p[g+6],15,-1560198380);n=md5_ii(n,m,l,o,p[g+13],21,1309151649);o=md5_ii(o,n,m,l,p[g+4],6,-145523070);l=md5_ii(l,o,n,m,p[g+11],10,-1120210379);m=md5_ii(m,l,o,n,p[g+2],15,718787259);n=md5_ii(n,m,l,o,p[g+9],21,-343485551);o=safe_add(o,j);n=safe_add(n,h);m=safe_add(m,f);l=safe_add(l,e)}return Array(o,n,m,l)}function md5_cmn(h,e,d,c,g,f){return safe_add(bit_rol(safe_add(safe_add(e,h),safe_add(c,f)),g),d)}function md5_ff(g,f,k,j,e,i,h){return md5_cmn((f&k)|((~f)&j),g,f,e,i,h)}function md5_gg(g,f,k,j,e,i,h){return md5_cmn((f&j)|(k&(~j)),g,f,e,i,h)}function md5_hh(g,f,k,j,e,i,h){return md5_cmn(f^k^j,g,f,e,i,h)}function md5_ii(g,f,k,j,e,i,h){return md5_cmn(k^(f|(~j)),g,f,e,i,h)}function safe_add(a,d){var c=(a&65535)+(d&65535);var b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function bit_rol(a,b){return(a<<b)|(a>>>(32-b))};
/// fin funciones upload generico
//// drag div
// Cargo los ID's de los arrays que se convierten en "scrollables"
var scrollDivs=new Array();