function biz_addr_reset() { $('#store_edit_id').val(''); } function biz_addr_del() { //addr_sel var thelink = 'api_connect.php?Action=BUSINESS_ADDR&ref_type=DEL&returntype=json'; var id_data = $('#biz_addr_params_id').val(); if (id_data) { //alert(id_data); //thelink = 'api_connect.php?Action=BUSINESS_ADDR&ref_type=DEL&id='+id+'returntype=json'; //jqsendrequest('POST',thelink,biz_addr_del_delegate,'text'); jqsendrequestarray('POST',thelink,"#biz_addr_params",biz_addr_del_delegate,"html"); } else { // thelink = 'api_connect.php?Action=BUSINESS_ADDR&ref_type=DEL&returntype=json'; jqsendrequestarray('POST',thelink,"#address_selection",biz_addr_del_delegate,"html"); } } function biz_addr_del_delegate(data) { //addr_sel // var thelink = 'api_connect.php?Action=BUSINESS_ADDR&ref_type=DEL&returntype=json'; // jqsendrequestarray('POST',thelink,"#address_data",biz_addr_save_delegate,"html"); // alert(data); obj = JSON.parse(data); if (obj.ret) window.location.reload(); else alert('Please make a selection'); // $("#status_log").html(data); } function biz_addr_save(id) { var thelink = 'api_connect.php?Action=BUSINESS_ADDR&ref_type=ADD&returntype=json'; // alert(thelink); jqsendrequestarray('POST',thelink,"#address_data",biz_addr_save_delegate,"html"); } function biz_addr_save_delegate(data) { obj = JSON.parse(data); if (obj.ret) { window.location.reload(); } } function biz_addr_del_set_id(id) { $('#biz_addr_params_id').val(id); $("#biz_addr_del_container").html(" "); } function biz_addr_get(id) { var thelink = 'api_connect.php?Action=BUSINESS_ADDR&ref_type=GET&id='+id+'&returntype=json'; //alert(thelink); //jqsendrequestarray('POST',thelink,"#address_data",biz_addr_get_delegate,"html"); jqsendrequest('POST',thelink,biz_addr_get_delegate,'text'); } function biz_addr_get_delegate(data) { obj = JSON.parse(data); $('#store_edit_id').val(obj.data.id); $('#store_label').val(obj.data.label); $('#store_address1').val(obj.data.address); $('#store_address2').val(obj.data.address2); $('#store_city').val(obj.data.city); $('#store_state').val(obj.data.state); $('#store_zip').val(obj.data.zip); $('#store_country').val(obj.data.country); $('#location_type').val(obj.data.location_type); }