So... I'm ordered :'( to create a information system for a heavy machinery rent firm, wich have a GPS for every machine, the data from the GPS is prvided by another an external firm wich uses a web services. (I'm very lost with these project...)
I need to (load at least) read data from a web service, to populate a DB with it, the web service respond comma separated data, and in another cases it respond the same, but is a .txt inside a .zip.
so when it just echoes the in a page... it seems like these:
0
739,-70.61692,-33.44053,0,0,2005-10-03 13:54:15.0,Cada 00:02:00 hh:mm:ss.
739,-70.61685,-33.44038,0,0,2005-10-03 13:19:00.0,Detención Mayor a 2 Min.
739,-70.61682,-33.44040,0,0,2005-10-03 13:14:47.0,Cada 00:02:00 hh:mm:ss.
739,-70.61685,-33.44040,0,0,2005-10-03 12:56:09.0,Detención Mayor a 2 Min.
739,-70.61683,-33.44037,0,0,2005-09-21 03:19:23.0,Cada 00:02:00 hh:mm:ss.
739,-70.61738,-33.44057,0,0,2005-09-21 03:16:45.0,Detención Mayor a 2 Min.
739,-70.62070,-33.44182,0,0,2005-09-21 03:14:41.0,Cada 00:02:00 hh:mm:ss.
739,-70.62060,-33.44165,0,0,2005-09-21 03:09:44.0,Cada 00:02:00 hh:mm:ss.
739,-70.61685,-33.44040,0,0,2005-09-21 01:05:31.0,Cada 00:02:00 hh:mm:ss.
……
……
……
739,-70.61687,-33.44040,0,0,2005-09-21 01:00:35.0,Cada 00:02:00 hh:mm:ss.
739,-70.61685,-33.44038,0,0,2005-09-21 00:56:02.0,Detencion Mayor a 2 Min.
FIN
the zipped data looks exactly like that. But I can't even manage to load the data, so How am I supposed to work with it, i.e. use it to feed a database (which is actually what I want to do)
the Jquery code I'm using looks like these:
$("a").click(function(event){
event.preventDefault();
var webdir = $(this).attr("href");
alert("I'm supposed to load the following URL: "+webdir);
$.ajax({
url: webdir,
success: function(data){
$('#resultado').html(data);
alert('Load was performed.');
}
}).fail(function(){
alert("error");
});//this at least throws an error
});
-you can see a working (failing to be honest) example-
And I'm not even capable to get the data, and I don't even know if I need to get the data using jquery, or if I have to get it using PHP.... so please, help me with the jquery... then if you have time, point in the right direction on how to populate a DB with data from a WEB service like these.