$(function(){
$('#ghsubmitbtn').on('click', function(e){
e.preventDefault();
$('#ghapidata').html('<div id="loader"><img src="css/loader.gif" alt="loading..."></div>');
var reclocator = $('#ghreclocator').val();
var lastname = $('#ghlastname').val();
// var runapi = 'https://api.sandbox.amadeus.com/v1.2/travel-record/'+reclocator+'?last_name='+lastname+'&apikey=gGbK6Ig4qJD0tJlQ7MRRGAOX1v7hjz7N';
var runapi = 'http://mtomtours.com/jsonVIEW.json';
requestJSON(runapi, function(json) {
if(json.status == "404") {
$('#ghapidata').html("<h2>No User Info Found</h2>");
}
else {
// else we have a user and we display their info
var reclocator = json.record_locator;
var officeid = json.header.owner_office_id;
/* BEGIN TIME FORMATTER */
var minutes = 1000 * 60;
var hours = minutes * 60;
var days = hours * 24;
var years = days * 365;
var weekday = new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
var currentTime = new Date ( );
var currentDay = currentTime.getDate();
var currentYear = currentTime.getFullYear();
var currentMonth = currentTime.getMonth()+1;
var currentHours = currentTime.getHours ( );
var currentMinutes = currentTime.getMinutes ( );
var currentSeconds = currentTime.getSeconds ( );
// Pad the minutes and seconds with leading zeros, if required
currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
// Choose either "AM" or "PM" as appropriate
var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
// Convert the hours component to 12-hour format if needed
currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;
//...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.