PATH:
var
/
www
/
vhosts
/
sandbox.dos-group.com
/
httpdocs
/
apilora-sdoppio
/
js
$(document).ready(function () { getSelectData(); }); // resetta le select e le popola tramite le richieste function getSelectData() { clearTable(); getAllTracker(); } // richiede i dati tramite AJAX e popola la select con i dati estratti relativi alle missioni disponibili function getAllTracker() { $.ajax({ "async": true, type: "GET", url: "api.php", data: {request: "getAllTracker"}, dataType: 'json', success: function (data) { // console.log(data); $.each(data, function (i, item) { if (typeof data !== 'undefined' && data.length === 0) { $('#tracker-list').append("Nessun tracker presente"); } else { stateMessagge = (item.mission_end != null || item.mission == null) ? 'Disponibile' : 'In missione'; state = (item.mission_end != null || item.mission == null) ? 'success' : 'danger'; item.mission = (item.mission == null) ? 'Nuovo tracker' : item.mission; $('#tracker-list').append("<tr><td>" + item.id_tracker + "</td><td>" + item.mission + "</td><td class='" + state + "'>" + stateMessagge + "</td></tr>"); } }); }, error: function (request, status, error) { if (status !== 'abort') { alert(error + ' - Errore incontrato durante l\'elaborazione dei dati, la pagina verrĂ ricaricata.'); location.reload(); } } }); } function clearTable() { $('#tracker-list').empty(); } $("#request-form").submit(function (e) { $.ajax({ type: "POST", url: "api.php", data: $("#request-form").serialize(), success: function () { $("#submit-error").hide(); $("#submit-success").show(); getSelectData(); }, error: function () { $("#submit-success").hide(); $("#submit-error").show(); } }); e.preventDefault(); // avoid to execute the actual submit of the form. });
[-] timepicker.js
[open]
[-] trackers-control.js
[open]
[-] track.js
[open]
[+]
..
[-] assign_mission.js
[open]
[-] history.js
[open]
[-] old_from-submit.js
[open]
[-] agents-control.js
[open]
[-] nice-date-picker.js
[open]
[-] mission_control.js
[open]
[-] seed.js
[open]