// my reservations module $('#my-reservations').on("submit", function (e) { e.preventDefault(); $form = $(this); var username = $(this).find('input[name="username"]').val(); var loginAsAgent = $(this).find('input[name="agentLogin"]').is(":checked"); var dataObj = { Password: $(this).find('input[name="password"]').val(), Company_ID: 4 }; if (username.has('@')) { dataObj.Email = username; dataObj.Method = 'Email'; } else if (loginAsAgent) { dataObj.Member = username; dataObj.Method = 'Agent'; dataObj.Service = 'Agent'; } else { dataObj.Contact_ID = username; dataObj.Method = 'Contact'; } var gaClientIdParam = ""; if (gaClientId != undefined) { gaClientIdParam = "&clientId=" + gaClientId + "&"; } var url = (isMobile() ? mobileBooking : desktopBooking) + '/authentication/Login.aspx?callback=?', mobileDashboardUrl = mobileBooking + "/Dashboard.aspx?Company_ID=4"; $.getJSON(url, dataObj).done(function (data) { if (data.Status == 1) { if (isMobile()) { window.location = mobileBooking + '/Dashboard.aspx?Company_ID=4' + gaClientIdParam; } else { showIframe(desktopBooking + '/Dashboard.aspx?Company_ID=4' + gaClientIdParam); } } else { $('.error-tip').fadeIn().delay(3000).fadeOut(); } }); });