2016-12-01 03:01:51 +00:00
|
|
|
<?php
|
|
|
|
function tuitealo($form,$tipo) {
|
|
|
|
if($tipo =='formulario') {
|
|
|
|
$formulario = formulario_areas('297','campos');
|
|
|
|
$descripcion = remplacetas('form_id','id','297','descripcion',"") ;
|
2016-12-01 03:07:48 +00:00
|
|
|
$nombre = remplacetas('form_id','id','297','nombre',"") ;
|
2016-12-01 03:01:51 +00:00
|
|
|
$formulario ="
|
|
|
|
|
|
|
|
<h1 >$nombre[0]</h1>
|
|
|
|
<h2>$descripcion[0]</h2>
|
|
|
|
<form id='form_tuitealo' >
|
|
|
|
$formulario
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<div id='tuitealo_div'>
|
|
|
|
<div id='tuitealo_error'></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a class='btn btn-block btn-primary' onclick=\"xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar');\">Previsualizar</a>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div class='text-center'>
|
2016-12-01 18:15:08 +00:00
|
|
|
<p class='text-center'>Powered by: <a href='https://qwerty.co/milfs'>MILFS</a></p>
|
2016-12-01 03:01:51 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
";
|
|
|
|
return $formulario;
|
|
|
|
}
|
|
|
|
$respuesta = new xajaxResponse('utf-8');
|
|
|
|
$sujeto = $form[1301][0];
|
|
|
|
$accion = $form[1302][0];
|
|
|
|
$verbo = $form[1303][0];
|
|
|
|
$tiempo = $form[1305][0];
|
|
|
|
$ht = $form[1306][0];
|
|
|
|
$mensaje = $form[1307][0];
|
|
|
|
$arroba = $form[1301][0];
|
|
|
|
if( $accion =="" or $verbo =="" or $tiempo =="" or $ht =="" or $arroba =="" ) {
|
|
|
|
$error ="<div class='alert alert-warning text-center'><h1><i class='fa fa-exclamation-triangle'></i> Hay campos vacíos</h1></div>";
|
|
|
|
$respuesta->addAssign("tuitealo_error","innerHTML","$error");
|
|
|
|
return $respuesta;
|
|
|
|
|
|
|
|
}
|
|
|
|
$arroba = remplacetas('form_datos','control',"$arroba",'contenido',"id_campo = '77'") ;
|
|
|
|
$arroba = $arroba[0];
|
|
|
|
$url_propia = urlencode("https://patos.redpatodos.co");
|
|
|
|
$texto="$sujeto $accion $verbo $tiempo $ht $mensaje cc $arroba ";
|
|
|
|
$texto = ucfirst($texto);
|
|
|
|
$texto_url=urlencode($texto);
|
|
|
|
$largo = strlen($texto.$url_propia);
|
|
|
|
if($largo > 140) { $alert ="danger"; $mensaje ="<i class='fa fa-exclamation-triangle'></i> El texto es demasiado largo y se recortará";
|
|
|
|
$texto = substr($texto, 0, 140)."..."; }
|
|
|
|
else{$alert='success'; $mensaje="";}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$url ="https://twitter.com/share?url=$url_propia&text=$texto_url";
|
|
|
|
|
|
|
|
$previsualizar ="<br>
|
|
|
|
|
|
|
|
<div id='tuitealo_error'></div>
|
|
|
|
<div class='alert alert-$alert'><div class='badge'>$largo</div>$mensaje<h1>$texto</h1></div>
|
|
|
|
|
|
|
|
<a class='btn btn-block btn-primary' onclick=\"xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar');\">Previsualizar</a>
|
|
|
|
<a class='btn btn-block btn-success' onclick=\"xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'confirmar');\">Tuitéalo</a>
|
|
|
|
<img style='width:1px;' src='milfs/images/100x100.png'
|
|
|
|
onload=\"
|
2016-12-01 15:14:09 +00:00
|
|
|
document.getElementById('1301[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
|
|
document.getElementById('1302[0]').onkeyup = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
|
|
document.getElementById('1303[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
|
|
document.getElementById('1304[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
|
|
document.getElementById('1305[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
|
|
document.getElementById('1306[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
|
|
document.getElementById('1307[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
2016-12-01 03:01:51 +00:00
|
|
|
|
|
|
|
\" >
|
|
|
|
";
|
|
|
|
|
|
|
|
if( $tipo =="previsualizar") {
|
2016-12-01 18:15:08 +00:00
|
|
|
$control = md5(rand(1,99999999).microtime());
|
2016-12-01 17:44:56 +00:00
|
|
|
$formulario_grabar ="
|
2016-12-01 17:53:04 +00:00
|
|
|
|
2016-12-01 18:01:40 +00:00
|
|
|
<input type='hidden' id= '1308[0]' name= '1308[0]' value='$texto' >
|
2016-12-01 18:15:08 +00:00
|
|
|
<input type='hidden' id= 'form_id' name= 'form_id' value='297' >
|
|
|
|
<input type='hidden' id= 'control' name= 'control' value='$control' >
|
2016-12-01 17:44:56 +00:00
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
$previsualizar .="$formulario_grabar";
|
2016-12-01 03:01:51 +00:00
|
|
|
$respuesta->addAssign("tuitealo_div","innerHTML","$previsualizar");
|
|
|
|
|
|
|
|
}else{
|
2016-12-01 15:09:03 +00:00
|
|
|
// <div onclick=\" xajax_formulario_grabar(xajax.getFormValues('$control'));\" class='btn btn-block btn-success'>Grabar</div>
|
2016-12-01 18:05:12 +00:00
|
|
|
$respuesta->addAssign("xajax_formulario_grabar(xajax.getFormValues('form_tuitealo'));");
|
2016-12-01 03:01:51 +00:00
|
|
|
$respuesta->addScript("window.location.href ='$url';");
|
2016-12-01 18:05:12 +00:00
|
|
|
|
2016-12-01 03:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return $respuesta;
|
|
|
|
}
|
|
|
|
|
|
|
|
$xajax->registerFunction("tuitealo");
|
|
|
|
|
|
|
|
?>
|