forked from qwerty/tupali
91 lines
3.0 KiB
PHP
91 lines
3.0 KiB
PHP
<?php
|
|
function brigadistas_grabar_imagen($data,$identificador) {
|
|
$respuesta = new xajaxResponse('utf-8');
|
|
$control = md5("$identificador");
|
|
//$form_id = $fomulario["formulario_id"];
|
|
|
|
$imagen= grabar_imagen($data,$control);
|
|
$preview = "<img src='$_SESSION[url]/images/secure/?file=150/$imagen'>";
|
|
$respuesta->addScript("javascript: document.getElementById('imagen').value= '$imagen' ;");
|
|
$respuesta->addAssign("aviso","innerHTML","$preview");
|
|
return $respuesta;
|
|
|
|
}
|
|
$xajax->registerFunction("brigadistas_grabar_imagen");
|
|
|
|
function brigadistas_grabar($formulario) {
|
|
|
|
$identificador = $formulario['identificador'];
|
|
$control = md5("$identificador");
|
|
$data = $formulario['debugConsole'];
|
|
$imagen= grabar_imagen($data,$control);
|
|
$texto_url = urlencode("#BrigadaDigital");
|
|
$uri = urlencode("$_SESSION[url]/images/secure/?file=600/$imagen");
|
|
$url ="https://twitter.com/share?url=$uri&text=$texto_url";
|
|
|
|
|
|
//$respuesta->addScript("window.location.href ='$url';");
|
|
|
|
|
|
$respuesta = new xajaxResponse('utf-8');
|
|
//$identificador = $formulario['identificador'];
|
|
$id_formulario = $formulario['formulario_id'];
|
|
$campo_imagen = buscar_campo_tipo("$id_formulario","15");
|
|
$formulario[$campo_imagen[0]][0] = $imagen;
|
|
$empresa = remplacetas('form_id','id',"$id_formulario",'id_empresa',"") ;
|
|
$id_empresa = $empresa[0];
|
|
|
|
include_once("librerias/conex.php");
|
|
$link=Conectarse();
|
|
mysql_query("SET NAMES 'utf8'");
|
|
|
|
foreach($formulario as $campo=>$valor){
|
|
if(is_array($valor)) {
|
|
foreach($valor as $c=>$v){
|
|
$consulta = "INSERT INTO form_datos ( timestamp,id_usuario,id_empresa,form_id,ip,control,id_campo,contenido) VALUES
|
|
( UNIX_TIMESTAMP(),'$_SESSION[id]','$id_empresa','$id_formulario','$ip' ,'$control', '$campo' , '".mysql_real_escape_string( $v )."')
|
|
";
|
|
$sql=mysql_query($consulta,$link);
|
|
|
|
// $campos .= " $campo // $valor // $c -> $v $consulta <br>";
|
|
}
|
|
}
|
|
}
|
|
$twitter = $formulario['498'][0];
|
|
$_SESSION['logis'] = "$control";
|
|
$_SESSION['mensaje'] = "$twitter";
|
|
$preview = "
|
|
<div class='row'>
|
|
<div class='center-block'>
|
|
<div class='thumbnail'>
|
|
<img src='$_SESSION[url]/images/secure/?file=300/$imagen'>
|
|
<h2 class='text-center'>$twitter<h2>
|
|
<a download='brigadistas.png' href='$_SESSION[url]images/secure/?file=600/$imagen' >
|
|
<span class='btn btn-default'><i class='fa fa-download'></i> </span>
|
|
</a>
|
|
<span class='btn btn-default'>
|
|
<a target= 'twitter' href ='milfs/addon/logis/funciones/twitter/tuitear.php' ><i class='fa fa-twitter'></i></a>
|
|
</span>
|
|
<a href='S58'>
|
|
<span class='btn btn-default'><i class='fa fa-eye'></i> </span>
|
|
</a>
|
|
<a href='#' onclick = \"javascript:location.reload(); \">
|
|
<span class='btn btn-default'><i class='fa fa-refresh'></i> </span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
";
|
|
$resultado = "$preview ";
|
|
|
|
$respuesta->addAssign("aviso","innerHTML","$preview");
|
|
//$respuesta->addAlert("$resultado");
|
|
//$respuesta->addScript("javascript:location.reload(true);");
|
|
return $respuesta;
|
|
}
|
|
$xajax->registerFunction("brigadistas_grabar");
|
|
|
|
|
|
|
|
?>
|