forked from qwerty/tupali
109 lines
5.0 KiB
PHP
109 lines
5.0 KiB
PHP
<?php
|
|
function tuitealo($form,$tipo) {
|
|
if($tipo =='formulario') {
|
|
$formulario = formulario_areas('297','campos');
|
|
$descripcion = remplacetas('form_id','id','297','descripcion',"") ;
|
|
$nombre = remplacetas('form_id','id','297','nombre',"") ;
|
|
$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'>
|
|
<p class='text-center'>Powered by: <a href='https://qwerty.co/milfs'>MILFS</a></p>
|
|
</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=\"
|
|
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')};
|
|
|
|
\" >
|
|
";
|
|
|
|
if( $tipo =="previsualizar") {
|
|
$control = md5(rand(1,99999999).microtime());
|
|
$formulario_grabar ="
|
|
|
|
<input type='hidden' id= '1308[0]' name= '1308[0]' value='$texto' >
|
|
<input type='hidden' id= 'form_id' name= 'form_id' value='297' >
|
|
<input type='hidden' id= 'control' name= 'control' value='$control' >
|
|
|
|
";
|
|
|
|
$previsualizar .="$formulario_grabar";
|
|
$respuesta->addAssign("tuitealo_div","innerHTML","$previsualizar");
|
|
|
|
}else{
|
|
// <div onclick=\" xajax_formulario_grabar(xajax.getFormValues('$control'));\" class='btn btn-block btn-success'>Grabar</div>
|
|
$respuesta->addAssign("xajax_formulario_grabar(xajax.getFormValues('form_tuitealo'));");
|
|
$respuesta->addScript("window.location.href ='$url';");
|
|
|
|
}
|
|
|
|
return $respuesta;
|
|
}
|
|
|
|
$xajax->registerFunction("tuitealo");
|
|
|
|
?>
|