/* sendload.js is a required part of the Javascript Weight & Balance program. Copyright (C) 2011-2014 Terry Liittschwager This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ function saveLoad() { 'use strict'; window.location.hash='#gtTop'; var d=new Date(); ld.sYear=d.getUTCFullYear(); ld.sMonth=sprintf('%02d',d.getUTCMonth()+1); ld.sDay=sprintf('%02d',d.getUTCDate()); ld.sHour=sprintf('%02d',d.getUTCHours()); ld.sMinutes=sprintf('%02d',d.getUTCMinutes()); ld.sSeconds=sprintf('%02d',d.getUTCSeconds()) ld.sLoadFileName=ld.sYear + '-' + ld.sMonth + '-' + ld.sDay + '_' + ld.sHour + ld.sMinutes + ld.sSeconds + '_' + ld.sPosFileName.substring(0,ld.sPosFileName.length-5) + '_' + ld.sTailNum + '.jload'; if (isServer) $.jStorage.set(ld.sLoadFileName,ld); $.prompt(ld.sLoadFileName + ' saved to LOCAL.'); } function sendLoad() { 'use strict'; if (bLoadMatch) { $.prompt('Prohibited operation: you can' send a load to the server that's already there.'); } else { window.location.hash='#gtTop'; var d=new Date(); ld.sYear=d.getUTCFullYear(); ld.sMonth=sprintf('%02d',d.getUTCMonth()+1); ld.sDay=sprintf('%02d',d.getUTCDate()); ld.sHour=sprintf('%02d',d.getUTCHours()); ld.sMinutes=sprintf('%02d',d.getUTCMinutes()); ld.sSeconds=sprintf('%02d',d.getUTCSeconds()) ld.sLoadFileName=ld.sYear + '-' + ld.sMonth + '-' + ld.sDay + '_' + ld.sHour + ld.sMinutes + ld.sSeconds + '_' + ld.sPosFileName.substring(0,ld.sPosFileName.length-5) + '_' + ld.sTailNum + '.jload'; if (isServer) $.jStorage.set(ld.sLoadFileName,ld); var ldfile=JSON.stringify(ld); var jqxhr = $.post("receiveload.php",ldfile,function() {}).error(function() {alert("error");}).complete(function() { $.prompt(ld.sLoadFileName + ' sent to SERVER.'); $wb.qrCodeLoad.qrcode({width:160,height:160,text:'http://terryliittschwager.com/WB/index.php'}); }); bLoadMatch=true; } }