var categoryData = null;
var trackFormPanel = null;
function submitTrackName()
{
title = " ";
if( $('#tr_type').val() == 'WL')
title = "Check WL Status";
else
title = "Check Warranty Status";
document.getElementById("popup_title").innerHTML = title;
var name = $('#tr_name').val();
var sp = '
';
var errormsg = '';
if( name == '' )
errormsg += 'Please key in Name';
if( errormsg != '' )
{
document.getElementById("validation_msg").innerHTML = errormsg;
$("#modal-popup").modal("show");
return false;
}
else
{
ajaxCall( {
type: "POST",
url: "a/Warranty/checkWarrantyStatusByName",
async:true,
data: 'name=' + encodeURIComponent(name),
success: function(msg,ret) {
if( ret != 'success' )
{
document.getElementById("validation_msg").innerHTML = '
Network connection error, please try again later.
';
}
try {
var result = eval( '(' + msg +')' );
document.getElementById("validation_msg").innerHTML = result.msg;
}
catch(E)
{
document.getElementById("validation_msg").innerHTML = 'Network connection error, please try again later.
';
}
$("#modal-popup").modal("show");
return false;
}
});
}
}
function submitTrackMobile()
{
title = " ";
if( $('#tr_type').val() == 'WL')
title = "Check WL Status";
else
title = "Check Warranty Status";
document.getElementById("popup_title").innerHTML = title;
var mobileno = $('#tr_mobileno').val();
var sp = '
';
var errormsg = '';
if( mobileno == '' )
errormsg += 'Please key in Mobile Phone No.';
if( errormsg != '' )
{
document.getElementById("validation_msg").innerHTML = errormsg;
$("#modal-popup").modal("show");
return false;
}
else
{
ajaxCall( {
type: "POST",
url: "a/Warranty/checkWarrantyStatusByMobile",
async:true,
data: 'mobileno=' + encodeURIComponent(mobileno),
success: function(msg,ret) {
if( ret != 'success' )
{
document.getElementById("validation_msg").innerHTML = 'Network connection error, please try again later.
';
}
try {
var result = eval( '(' + msg +')' );
document.getElementById("validation_msg").innerHTML = result.msg;
}
catch(E)
{
document.getElementById("validation_msg").innerHTML = 'Network connection error, please try again later.
';
}
$("#modal-popup").modal("show");
return false;
}
});
}
}
function submitTrack()
{
title = " ";
if( $('#tr_type').val() == 'WL')
title = "Check WL Status";
else
title = "Check Warranty Status";
document.getElementById("popup_title").innerHTML = title;
var serialno = $('#tr_serialno').val();
var category = $('#tr_category').val();
var product = $('#tr_product').val();
var type = $('#tr_type').val();
var errormsg = '';
var sp = '
';
if( category == '' )
errormsg += 'Please key in Category'+sp;
if( product == '' )
errormsg += 'Please key in Model'+sp;
if( serialno == '' )
errormsg += 'Please key in Serial No.';
if( errormsg != '' )
{
document.getElementById("popup_title").innerHTML = title;
document.getElementById("validation_msg").innerHTML = errormsg;
$("#modal-popup").modal("show");
return false;
}
else
{
if( $('#tr_type').val() == 'WL')
var url = "a/Warranty/checkWLStatus";
else
var url = "a/Warranty/checkWarrantyStatus";
ajaxCall( {
type: "POST",
url: url,
async:true,
data: 'serialno=' + encodeURIComponent(serialno)+'&fk_product='+ encodeURIComponent(product),
success: function(msg,ret) {
if( ret != 'success' )
{
document.getElementById("validation_msg").innerHTML = 'Network connection error, please try again later.
';
}
try {
var result = eval( '(' + msg +')' );
document.getElementById("validation_msg").innerHTML = result.msg;
}
catch(E)
{
document.getElementById("validation_msg").innerHTML = 'Network connection error, please try again later.
';
}
$("#modal-popup").modal("show");
return false;
}
});
}
return false;
}
function OpenModal_WL_Warranty(code)
{
var title = "";
document.getElementById("tr_type").value="WARRANTY";
if(code=="WL")
document.getElementById("tr_type").value="WL";
if( $('#tr_type').val() == 'WL')
title = "Check WL Status";
else
title = "Check Warranty Status";
document.getElementById("wl_warranty_title").innerHTML = title;
$("#modal-WL_Warranty").modal("show");
return false;
}