function bizdir_edit_listing(id) {
clearMessage();
//Build SACK Call
var mysack = new sack(“https://www.insidetennis.com/wp-admin/admin-ajax.php”);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar(“action
“,”bizdir_edit_listing”);
mysack.setVar(“listing_id”,id);
mysack.onError = function() { alert('An ajax error occured while processing your request. Please reload the page and try again.') };
mysack.runAJAX();//excecute
return true;
}
function bizdir_add_category() {
clearMessage();
//Clear AutoFill Text
var description = document.getElementById(“bizdir_description”);
bizdir_clearAutoFill(description.id,description.getAttribute('bizdir_autofill'));
var mysack = new sack(“https://www.insidetennis.com/wp-admin/admin-ajax.php”);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar(“action”, “bizdir_add_category”);
mysack.setVar(“category”,document.getElementById(“bizdir_category”).value);
mysack.setVar(“description”,document.getElementById(“bizdir_description”).value);
mysack.onError = function () { alert('An ajax error occured while processing your request. Please reload the page and try again.') };
mysack.runAJAX();
return true;
}
function bizdir_edit_category(id) {
clearMessage();
var mysack = new sack(“https://www.insidetennis.com/wp-admin/admin-ajax.php”);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar(“action”, “bizdir_edit_category”);
mysack.setVar(“category_id”, id);
mysack.onError = function () { alert('An ajax error occured while processing your request. Please reload the page and try again.') };
mysack.runAJAX();
return true;
}
function bizdir_update_category() {
clearMessage();
//Disable buttons and display message
document.getElementById('bizdir_save').disabled = true;
document.getElementById('bizdir_cancel').disabled = true;
var submit_message = document.getElementById('bizdir_submit_message')
submit_message.className = “bizdir_message”;
submit_message.innerHTML = “Submitting…”;
//Build SACK Call
var mysack = new sack(“https://www.insidetennis.com/wp-admin/admin-ajax.php”);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar(“action”,”bizdir_update_category”);
mysack.setVar(“category_id”,document.getElementById(“bizdir_category_id”).value);
mysack.setVar(“category”,document.getElementById(“bizdir_category”).value);
mysack.setVar(“description”,document.getElementById(“bizdir_description”).value);
mysack.onError = function() { alert('An ajax error occured while updating the listing. Please reload the page and try again.') };
mysack.runAJAX();//excecute
return true;
}
function bizdir_update_listing(status) {
clearMessage();
//Disable buttons and display message
document.getElementById('bizdir_save').disabled = true;
var save_approve = document.getElementById('bizdir_save_approve')
if(save_approve != null)
save_approve.disabled = true;
document.getElementById('bizdir_cancel').disabled = true;
var submit_message = document.getElementById('bizdir_submit_message')
submit_message.className = “bizdir_message”;
submit_message.innerHTML = “Submitting…”;
//Clear AutoFill
bizdir_clearAllAutoFill();
//Build SACK Call
var mysack = new sack(“https://www.insidetennis.com/wp-admin/admin-ajax.php”);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar(“action”,”bizdir_update_listing”);
if(status == “approve”)
mysack.setVar(“status”,1);
mysack.setVar(“listing_id”,document.getElementById(“bizdir_listing_id”).value);
mysack.setVar(“category_id”, document.getElementById(“bizdir_category_id”).value);
mysack.setVar(“name”,document.getElementById(“bizdir_name”).value);
mysack.setVar(“email”,document.getElementById(“bizdir_email”).value);
mysack.setVar(“cName”,document.getElementById(“bizdir_cName”).value);
mysack.setVar(“description”,document.getElementById(“bizdir_description”).value);
mysack.setVar(“keywords”,document.getElementById(“bizdir_keywords”).value);
mysack.setVar(“website”,document.getElementById(“bizdir_website”).value);
mysack.setVar(“cEmail”,document.getElementById(“bizdir_cEmail”).value);
mysack.setVar(“phone”,document.getElementById(“bizdir_phone”).value);
mysack.setVar(“street1”,document.getElementById(“bizdir_street1”).value);
mysack.setVar(“street2”,document.getElementById(“bizdir_street2”).value);
mysack.setVar(“city”,document.getElementById(“bizdir_city”).value);
mysack.setVar(“state”,document.getElementById(“bizdir_state”).value);
mysack.setVar(“zip”,document.getElementById(“bizdir_zip”).value);
mysack.setVar(“country”,document.getElementById(“bizdir_country”).value);
mysack.onError = function() { alert('An ajax error occured while updating the listing. Please reload the page and try again.') };
mysack.runAJAX();//excecute
return true;
}
function bizdir_show_manager_home() {
clearMessage();
//Build SACK Call
var mysack = new sack(“https://www.insidetennis.com/wp-admin/admin-ajax.php”);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar(“action”,”bizdir_show_manager_home”);
mysack.onError = function() { alert('An ajax error occured while processing your request. Please reload the page and try again.') };
mysack.runAJAX();//excecute
return true;
}
function bizdir_show_category_home() {
clearMessage();
//Build SACK Call
var mysack = new sack(“https://www.insidetennis.com/wp-admin/admin-ajax.php”);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar(“action”,”bizdir_show_category_home”);
mysack.onError = function() { alert('An ajax error occured while processing your request. Please reload the page and try again.') };
mysack.runAJAX();//excecute
return true;
}
function bizdir_change_status(id,status) {
clearMessage();
//Build SACK Call
var mysack = new sack(“https://www.insidetennis.com/wp-admin/admin-ajax.php”);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar(“action”,”bizdir_change_listing_status”);
mysack.setVar(“listing_id”,id);
mysack.setVar(“status”,status);
mysack.onError = function() { alert('An ajax error occured while processing your request. Please reload the page and try again.') };
mysack.runAJAX();//excecute
return true;
}
function bizdir_delete_listing(id) {
clearMessage();
if(confirm('Are you sure you want to delete this listing? This listing will be perminantly removed.')) {
//Build SACK Call
var mysack = new sack(“https://www.insidetennis.com/wp-admin/admin-ajax.php”);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar(“action”,”bizdir_delete_listing”);
mysack.setVar(“listing_id”,id);
mysack.onError = function() { alert('An ajax error occured while processing your request. Please reload the page and try again.') };
mysack.runAJAX();//excecute
}
return true;
}
function bizdir_delete_category(id,name,count) {
clearMessage();
var confirmMessage = “Are you sure you want to delete the \”” name “\” category? “;
confirmMessage = “The \”” name “\” category and all listings in it will be perminantly removed “;
confirmMessage = “(There ” (count == 1?”is”:”are”) ” currently ” count ” listing” (count == 1?””:”s”) ” in the \”” name “\” category). “;
confirmMessage = “You may want to back up your database before deleting the \”” name “\” category.”;
if(confirm(confirmMessage)) {
//Build SACK Call
var mysack = new sack(“https://www.insidetennis.com/wp-admin/admin-ajax.php”);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar(“action”,”bizdir_delete_category”);
mysack.setVar(“category_id”,id);
mysack.onError = function() { alert('An ajax error occured while processing your request. Please reload the page and try again.') };
mysack.runAJAX();//excecute
}
return true;
}
#wpadminbar { display:none; }
document.body.className = document.body.className.replace('no-js','js');