Skip to content

Instantly share code, notes, and snippets.

@EnriqueV
Last active August 29, 2015 14:11
Show Gist options
  • Save EnriqueV/a53b960542cc6f350f9d to your computer and use it in GitHub Desktop.
Save EnriqueV/a53b960542cc6f350f9d to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function ajaxCall(url, parameters, successCallback) {
$.ajax({
type: 'POST',
datatype: 'json',
url: url,
data: parameters,
success: function (response) {
alert(response);
},
error: function(xhr, textStatus, errorThrown) {
console.log('error');
}
});
}
function callback(){
var numbe; //window.Tele.getTelephoneNumber();
var uid="398f46273cfb9adf";//window.Tele.getTelephoneNumber();
//var uuiid=device.uuid;
var dataPhone={
codigo:uid
,numero:number
}
if(number!= null){
//ajaxCall("http://dev2.mirebate.com/mobile/buscarNumero.php",dataPhone);
ajaxCall("http://dev2.mirebate.com/mobile/buscarNumero.php",dataPhone, function (response){});
var obj=eval("("+response+")");
if(obj.length>0){
var fechaUser=obj[0].fechahoy;
var fechaExp=obj[0].fechaExp;
if(fechaUser<=fechaExp){
alert("hola desde termsAccepted");//termsAccepted(Db);
}
else{
//Toast.showShortTop('Lo sentimos el periodo de uso de la aplicacion a expirado');
alert("Lo sentimos el periodo de uso de la aplicacion a expirado");
}
}
else
{
alert("No hay datos en la db");//phonePage(Db);
}
}
else{
//ajaxCall("http://dev2.mirebate.com/mobile/buscarUID.php",dataPhone);
ajaxCall("http://dev2.mirebate.com/mobile/buscarUID.php",dataPhone, function (response) {});
//var obj=eval("("+output+")");
var obj=eval("("+response+")");
if(obj.length>0){
var fechaUser=obj[0].fechahoy;
var fechaExp=obj[0].fechaExp;
if(fechaUser<=fechaExp){
termsAccepted(Db);
}
else{
//Toast.showShortTop
alert("Lo sentimos el periodo de uso de la aplicacion a expirado");
}
}
else{
alert("No hay datos en la db"); //phonePage(Db);
}
}
//else {
//Toast.showShortTop('Porfavor acepte la Liencia de esta aplicación');
alert("Lo sentimos el periodo de uso de la aplicacion a expirado");
//}
//else {
var number; //window.Tele.getTelephoneNumber();
var uid="398f46273cfb9adf";//device.uuid;
var dataPhone={
numero:number
,codigo:uid
}
if(number!= null){
//ajaxCall("http://dev2.mirebate.com/mobile/buscarNumero.php",dataPhone);
ajaxCall("http://dev2.mirebate.com/mobile/buscarNumero.php",dataPhone, function (response){});
var obj=eval("("+response+")");;
if(obj.length>0){
var fechaUser=obj[0].fechahoy;
var fechaExp=obj[0].fechaExp;
if(fechaUser<=fechaExp){
alert("termsAccepted(Db);");
}
else{
//Toast.showShortTop
alert('Lo sentimos el periodo de uso de la aplicacion a expirado');
}
}
else
{
phonePage(Db);
}
}
else{
ajaxCall("http://dev2.mirebate.com/mobile/buscarUID.php",dataPhone, function (response){});
var obj=append ("("+response+")");
if(obj.length>0){
var fechaUser=obj[0].fechahoy;
var fechaExp=obj[0].fechaExp;
if(fechaUser<=fechaExp){
termsAccepted(Db);
}
else{
//Toast.showShortTop
alert('Lo sentimos el periodo de uso de la aplicacion a expirado');
}
}
else
{
alert("hola hoy es"+fechaUser);
phonePage(Db);
}
}
alert("hola hoy es"+fechaUser);
termsAccepted(Db); //phonePage(Db);
//}
}
</script>
</head>
<body>
</table>
<span id="res">
<input type="button" id="enviar" onclick="callback()" value="Insertar"/>
</span>
</body
</html>
@carloscarcamo
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment