/** * This function is used to delete address * * @return string */ function delAddress() { //language include_once 'classes/Core/CLanguage.php'; Core_CLanguage::setLanguage('ADDRESS_BOOK'); include 'classes/Core/CUserAddressBook.php'; include_once 'classes/Core/CCurrencySettings.php'; Core_CCurrencySettings::getDefaultCurrency(); $result = Core_CUserAddressBook::delAddress(); $this->showMyAddressBook($result); }
/** * This function is used to Display the Add Address from check out * @param array $arrCountry * @param array $arrAdd * @return string */ function showAddAddressFromCheckout($arrCountry, $arrAdd = array()) { include "classes/Lib/HandleErrors.php"; include_once 'classes/Core/CUserAddressBook.php'; Core_CUserAddressBook::Ulogin($Err); $output['val'] = $Err->values; $output['msg'] = $Err->messages; if (count($arrAdd) > 0 && count($output['val']) == 0) { $gName = $arrAdd[0]['contact_name']; $fName = $arrAdd[0]['first_name']; $lName = $arrAdd[0]['last_name']; $company = $arrAdd[0]['company']; $eMail = $arrAdd[0]['email']; $address = $arrAdd[0]['address']; $city = $arrAdd[0]['city']; $suburb = $arrAdd[0]['suburb']; $state = $arrAdd[0]['state']; $country = $arrAdd[0]['country']; $zip = $arrAdd[0]['zip']; $telephone = $arrAdd[0]['phone_no']; $fax = $arrAdd[0]['fax']; $status = isset($_GET['id']) ? 1 : 0; $group = $_GET['id']; } else { $gName = $output['val']['txtGName']; $fName = $output['val']['txtFName']; $lName = $output['val']['txtLName']; $company = $output['val']['txtCompany']; $eMail = $output['val']['txtEMail']; $address = $output['val']['txtAddress']; $city = $output['val']['txtCity']; $suburb = $output['val']['txtSuburb']; $state = $output['val']['txtState']; $country = $output['val']['selCountry']; $zip = $output['val']['txtZip']; $telephone = $output['val']['txtPhone']; $fax = $output['val']['txtFax']; $status = $output['val']['hidStatus']; $group = $output['val']['hidGroup']; } if ($status == 1) { $buttonCaption = 'Update'; $action = "edit"; $readonly = "readonly"; } else { $buttonCaption = 'Create'; $action = "add"; $readonly = ""; } $output1 .= ' <form name="frmAddress" method="post" action="' . $_SESSION['base_url'] . '/index.php?do=addaddress&action=' . $action . '"> <input type="hidden" name="hidStatus" value="' . $status . '"> <input type="hidden" name="hidGroup" value="' . $group . '"> <div align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="checkout_rigistration" align="center"> <tr> <td class="serachresult">Address Book</td> <td colspan=2></td> <td align="right" class="account_address" nowrap><!--<a href="?do=addressbook" class="categoryList">View Contacts</a>--> </td> </tr> <tr> <td width="26%"><b>Group Name</b> <span>*</span></td> <td width="4%">:</td> <td width="70%"><input name="txtGName" type="text" class="txtbox1 w4 TxtC1" id="textfield9" value="' . $gName . '" /><h1><AJDF:output>' . $output['msg']['txtGName'] . '</AJDF:output></h1></td> </tr> <tr> <td width="26%" align="top">First Name <span>*</span></td> <td width="4%">:</td> <td width="70%"><input name="txtFName" type="text" class="txtbox1 w4 TxtC1" id="textfield9" value="' . $fName . '" /><h1><AJDF:output>' . $output['msg']['txtFName'] . '</AJDF:output></h1></td> </tr> <tr> <td valign="top">Last Name <span>*</span></td> <td valign=top>:</td> <td><input name="txtLName" type="text" class="txtbox1 w4 TxtC1" id="textfield2" value="' . $lName . '"/><h1><AJDF:output>' . $output['msg']['txtLName'] . '</AJDF:output></h1></td> </tr> <tr> <td>Company</td> <td>:</td> <td><input name="txtCompany" type="text" class="txtbox1 w4 TxtC1" id="textfield3" value="' . $company . '"/></td> </tr> <tr> <td>Email Address</td> <td>:</td> <td><input name="txtEMail" type="text" class="txtbox1 w4 TxtC1" id="textfield4" value="' . $eMail . '"/><h1><AJDF:output>' . $output['msg']['txtEMail'] . '</AJDF:output></h1></td> </tr> <tr> <td>Address <span>*</span></td> <td>:</td> <td><input name="txtAddress" type="text" class="txtbox1 w4 TxtC1" id="textfield7" value="' . $address . '"/><h1><AJDF:output>' . $output['msg']['txtAddress'] . '</AJDF:output></h1></td> </tr> <tr> <td>City <span>*</span></td> <td>:</td> <td><input name="txtCity" type="text" class="txtbox1 w4 TxtC1" id="textfield8" value="' . $city . '"/><h1><AJDF:output>' . $output['msg']['txtCity'] . '</AJDF:output></h1></td> </tr> <tr> <td>Sub Urb </td> <td>:</td> <td><input name="txtSuburb" type="text" class="txtbox1 w4 TxtC1" id="textfield8" value="' . $suburb . '"/></td> </tr> <tr> <td>State/Province <span>*</span></td> <td>:</td> <td><input name="txtState" type="text" class="txtbox1 w4 TxtC1" id="textfield8" value="' . $state . '"/><br><h1><AJDF:output>' . $output['msg']['txtState'] . '</AJDF:output></h1> </td> </tr> <tr> <td>Country <span>*</span></td> <td>:</td> <td><select name="selCountry" id="select3" class="listbox1 w4a TxtC1">'; for ($i = 0; $i < count($arrCountry); $i++) { $sel = ''; if ($country == $arrCountry[$i]['cou_code']) { $sel = 'selected'; } $output1 .= '<option value="' . $arrCountry[$i]['cou_code'] . '" ' . $sel . '>' . $arrCountry[$i]['cou_name'] . '</option>'; } $output1 .= '</select></td> </tr> <tr> <td>Zip/Postal Code <span>*</span></td> <td>:</td> <td><input name="txtZip" type="text" class="txtbox1 w4 TxtC1" id="textfield82" value="' . $zip . '"/><h1><AJDF:output>' . $output['msg']['txtZip'] . '</AJDF:output></h1></td> </tr> <tr> <td>Telephone </td> <td>:</td> <td><input name="txtPhone" type="text" class="txtbox1 w4 TxtC1" id="textfield822" value="' . $telephone . '"/></td> </tr> <tr> <td>Fax</td> <td>:</td> <td><input name="txtFax" type="text" class="txtbox1 w4 TxtC1" id="textfield823" value="' . $fax . '"/></td> </tr> <tr> <td colspan=2></td><td style="padding-top:10px;" align="right"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><div> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right" class="button_left"></td> <td><input type="submit" name="Submit2" value="' . $buttonCaption . '" class="button" /></td> <td class="button_right"></td> </tr> </table> </div></td> </tr> </table></td> </tr> </table> </div> </form>'; return $output1; }