Created
October 6, 2014 16:57
-
-
Save AlexandrBasan/db42498905dc9f8091c2 to your computer and use it in GitHub Desktop.
Teleport SaaS (www.teleport-ds.com) check inquiry status form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<!-- Teleport LOGO for some CMS delivery select --> | |
<img id="teleport_logo" onclick="ShowForm()" src="http://www.teleport-ds.com/assets/teleport_logo_eng_0-97dc4f4c6a152de97ea2e046e7dcc824.png"> | |
<!-- Show form if logo click --> | |
<script> | |
$("#teleport_logo").click(function () { | |
$("#select_delivery_method_teleport").show(); | |
}); | |
</script> | |
<div id="select_delivery_method_teleport"> | |
<div class="row"> | |
<div class="panel-group" id="accordion"> | |
<!--Inquiry form--> | |
<div class="row-fluid"> | |
<div class="col-md-4"> | |
<!-- inquiry status script block --> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h4 class="panel-title"> | |
<a data-toggle="collapse" data-parent="#accordion" href="#collapseinquiry"> | |
Inquiry status | |
</a> | |
</h4> | |
</div> | |
<input id="inquiry_status" name="inquiry_status" class="form-control" type="text"> | |
<div class="actions text-center"> | |
<input class="btn btn-sm btn-primary" onclick="Inquiry_status()" type="submit" value="Inquiry status check"> | |
</div> | |
</div> | |
<!-- inquiry status script block --> | |
</div> | |
<!-- inquiry status script --> | |
<script> | |
// Your login and Password for Teleport SaaS | |
var login = "2@gmail.com"; | |
//var pass = "infinity8"; | |
var pass = "infinity"; | |
function Inquiry_status() { | |
// Inquiry ID for Update | |
var inquiry_id = document.getElementById('inquiry_status').value; | |
// Show Please wait | |
$('#delivery_companies').empty(); | |
$('#delivery_companies').append('<p>Check status. Please wait...</p>'); | |
// Send reguest to Teleport SaaS - Create inquiry | |
jQuery.ajax({ | |
// Test Server configuration | |
url: 'http://localhost:3000/api/inquiry_status?email=' + login + '&pass=' + pass + '&id=' + inquiry_id, | |
method: 'GET', | |
crossDomain: true | |
}).done(function (response) { | |
$('#delivery_companies').empty(); | |
// Do something with the response | |
var json_resp = JSON.stringify(response) | |
var data = $.parseJSON(json_resp); | |
//alert(JSON.stringify(data.error)); | |
if (data.error) { | |
// Return information Teleport SaaS Error | |
var error_data = data.error | |
$('#delivery_companies').append(error_data); | |
} | |
else { | |
// Return information about new inquiry | |
var inquiry_id = data.inquiry; | |
var inquiry_number = data.inquiry_number; | |
var delivery_status = data.delivery_status; | |
var payment_status = data.payment_status; | |
$('#delivery_companies').append('<p><strong>Inquiry ID:<strong></p>'); | |
$('#delivery_companies').append(inquiry_id); | |
$('#delivery_companies').append('<p><strong>Inquiry number:<strong></p>'); | |
$('#delivery_companies').append(inquiry_number); | |
$('#delivery_companies').append('<p><strong>Delivery status:<strong></p>'); | |
$('#delivery_companies').append(delivery_status); | |
$('#delivery_companies').append('<p><strong>Payment status:<strong></p>'); | |
$('#delivery_companies').append(payment_status); | |
} | |
}).fail(function () { | |
$('#delivery_companies').empty(); | |
$('#delivery_companies').append('<p>Sorry, inquiry status not received.</p>'); | |
// Whoops; show an error. | |
}); | |
} | |
; | |
</script> | |
<!-- inquiry status script --> | |
<!-- Show user information about Delivery Companies --> | |
<div class="col-md-8"> | |
<div class="panel panel-default overflowb"> | |
<div class="panel-heading"> | |
<h4 class="panel-title"> | |
<a data-toggle="collapse" data-parent="#accordion" href="#collapsecompany"> | |
Status | |
</a> | |
</h4> | |
</div> | |
<div id="collapsecompany" class="panel-collapse collapse in"> | |
<div class="panel-body"> | |
<div id="delivery_companies"></div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!-- Show user information about Delivery Companies --> | |
</div> | |
</div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment