} else { echo '{ success: false, errors: { message: "' . addslashes(str_replace("\n", '', nl2br($messageStack->outputPlain('account_edit')))) . '" } }'; } exit; } $account_query = smn_db_query("select c.*, ab.* from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab where ab.customers_id = '" . (int) $customer_id . "' and c.customers_id = '" . (int) $customer_id . "' and ab.address_book_id = c.customers_default_address_id"); $account = smn_db_fetch_array($account_query); $breadcrumb->add(NAVBAR_TITLE_1, smn_href_link(FILENAME_ACCOUNT, 'ID=' . $store_id, 'NONSSL')); $breadcrumb->add(NAVBAR_TITLE_2, smn_href_link(FILENAME_ACCOUNT_EDIT, 'ID=' . $store_id, 'NONSSL')); $store_categories = $spath_setup->smn_get_store_category_tree('0', '', '0'); $countries = smn_get_countries(); $Qzone = smn_db_query('select zone_name from ' . TABLE_ZONES . ' where (zone_code = "' . strtoupper($customerInfo->address_data['entry_state']) . '" || zone_name = "' . $customerInfo->address_data['entry_state'] . '")'); if (smn_db_num_rows($Qzone)) { $zone = smn_db_fetch_array($Qzone); $customerInfo->address_data['entry_state'] = $zone['zone_name']; } /* Common Elements For Tabs - BEGIN */ $commonCancelButton = $jQuery->getPluginClass('button', array('id' => 'cancel_button', 'text' => 'Cancel')); $commonDeleteButton = $jQuery->getPluginClass('button', array('id' => 'delete_button', 'text' => 'Delete')); $commonSaveButton = $jQuery->getPluginClass('button', array('id' => 'save_button', 'type' => 'submit', 'text' => 'Save')); /* Common Elements For Tabs - END */ /* Setup Tabs - BEGIN */ $jQuery->setGlobalVars(array('languages', 'languages_id', 'store_id', 'commonSaveButton', 'commonDeleteButton', 'commonCancelButton', 'account', 'customerInfo', 'customer_store_id', 'affiliate_id', 'customersStore', 'store_categories', 'countries')); $tabsArray = array(); $tabsArray[] = array('tabID' => 'tab-contact', 'filename' => 'tab_contact.php', 'text' => ACCOUNT_TAB_CONTACT); $tabsArray[] = array('tabID' => 'tab-personal', 'filename' => 'tab_personal.php', 'text' => ACCOUNT_TAB_PERSONAL);
function smn_get_country_list($name, $selected = '', $parameters = '') { $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT)); $countries = smn_get_countries(); for ($i = 0, $n = sizeof($countries); $i < $n; $i++) { $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); } return smn_draw_pull_down_menu($name, $countries_array, $selected, $parameters); }
$contents = array(); if ($action == 'list') { switch ($saction) { case 'new': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_SUB_ZONE . '</b>'); $contents = array('form' => smn_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] . '&' : '') . 'saction=insert_sub')); $contents[] = array('text' => TEXT_INFO_NEW_SUB_ZONE_INTRO); $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . smn_draw_pull_down_menu('zone_country_id', smn_get_countries(TEXT_ALL_COUNTRIES), '', 'onChange="update_zone(this.form);"')); $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . smn_draw_pull_down_menu('zone_id', smn_prepare_country_zones_pull_down())); $contents[] = array('align' => 'center', 'text' => '<br>' . smn_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . smn_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] : '')) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'edit': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_SUB_ZONE . '</b>'); $contents = array('form' => smn_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=save_sub')); $contents[] = array('text' => TEXT_INFO_EDIT_SUB_ZONE_INTRO); $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . smn_draw_pull_down_menu('zone_country_id', smn_get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'onChange="update_zone(this.form);"')); $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . smn_draw_pull_down_menu('zone_id', smn_prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id)); $contents[] = array('align' => 'center', 'text' => '<br>' . smn_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . smn_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'delete': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SUB_ZONE . '</b>'); $contents = array('form' => smn_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=deleteconfirm_sub')); $contents[] = array('text' => TEXT_INFO_DELETE_SUB_ZONE_INTRO); $contents[] = array('text' => '<br><b>' . $sInfo->countries_name . '</b>'); $contents[] = array('align' => 'center', 'text' => '<br>' . smn_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . smn_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; default: if (isset($sInfo) && is_object($sInfo)) { $heading[] = array('text' => '<b>' . $sInfo->countries_name . '</b>'); $contents[] = array('align' => 'center', 'text' => '<a href="' . smn_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '">' . smn_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . smn_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=delete') . '">' . smn_image_button('button_delete.gif', IMAGE_DELETE) . '</a>'); $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . smn_date_short($sInfo->date_added));
case 'new': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_ZONE . '</b>'); $contents = array('form' => smn_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&action=insert')); $contents[] = array('text' => TEXT_INFO_INSERT_INTRO); $contents[] = array('text' => '<br>' . TEXT_INFO_ZONES_NAME . '<br>' . smn_draw_input_field('zone_name')); $contents[] = array('text' => '<br>' . TEXT_INFO_ZONES_CODE . '<br>' . smn_draw_input_field('zone_code')); $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . smn_draw_pull_down_menu('zone_country_id', smn_get_countries())); $contents[] = array('align' => 'center', 'text' => '<br>' . smn_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . smn_href_link(FILENAME_ZONES, 'page=' . $_GET['page']) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'edit': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_ZONE . '</b>'); $contents = array('form' => smn_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=save')); $contents[] = array('text' => TEXT_INFO_EDIT_INTRO); $contents[] = array('text' => '<br>' . TEXT_INFO_ZONES_NAME . '<br>' . smn_draw_input_field('zone_name', $cInfo->zone_name)); $contents[] = array('text' => '<br>' . TEXT_INFO_ZONES_CODE . '<br>' . smn_draw_input_field('zone_code', $cInfo->zone_code)); $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . smn_draw_pull_down_menu('zone_country_id', smn_get_countries(), $cInfo->countries_id)); $contents[] = array('align' => 'center', 'text' => '<br>' . smn_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . smn_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'delete': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ZONE . '</b>'); $contents = array('form' => smn_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '<br><b>' . $cInfo->zone_name . '</b>'); $contents[] = array('align' => 'center', 'text' => '<br>' . smn_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . smn_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; default: if (isset($cInfo) && is_object($cInfo)) { $heading[] = array('text' => '<b>' . $cInfo->zone_name . '</b>'); $contents[] = array('align' => 'center', 'text' => '<a href="' . smn_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=edit') . '">' . smn_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . smn_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=delete') . '">' . smn_image_button('button_delete.gif', IMAGE_DELETE) . '</a>'); $contents[] = array('text' => '<br>' . TEXT_INFO_ZONES_NAME . '<br>' . $cInfo->zone_name . ' (' . $cInfo->zone_code . ')'); $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . ' ' . $cInfo->countries_name);
function smn_cfg_pull_down_country_list($country_id) { return smn_draw_pull_down_menu('configuration_value', smn_get_countries(), $country_id); }
?> </td> <!--Changed the $aInfo->affiliate_postcode to $aInfo->entry_postcode by Cimi --> <td class="main"><?php echo smn_draw_input_field('affiliate_postcode', $aInfo->entry_postcode, 'maxlength="8"', true); ?> </td> </tr> <tr> <td class="main"><?php echo ENTRY_COUNTRY; ?> </td> <!--Changed the $aInfo->affiliate_country_id to $aInfo->entry_country_id by Cimi --> <td class="main"><?php echo smn_draw_pull_down_menu('affiliate_country_id', smn_get_countries(), $aInfo->entry_country_id, 'onChange="update_zone(this.form);"'); ?> </td> </tr> <?php if (ACCOUNT_STATE == 'true') { ?> <tr> <td class="main"><?php echo ENTRY_STATE; ?> </td> <!--Changed the $aInfo->affiliate_zone_id to $aInfo->entry_zone_id and $aInfo->affiliate_country_id to $aInfo->entry_country_id by Cimi --> <td class="main"><?php echo smn_draw_pull_down_menu('affiliate_zone_id', smn_prepare_country_zones_pull_down($aInfo->entry_country_id), $aInfo->entry_zone_id, 'onChange="resetStateText(this.form);"'); ?>
?> <tr> <td class="main"><?php echo ENTRY_COUNTRY; ?> </td> <td class="main"> <?php if ($error == true) { if ($entry_country_error == true) { echo smn_draw_pull_down_menu('entry_country_id', smn_get_countries(), $sInfo->entry_country_id) . ' ' . ENTRY_COUNTRY_ERROR; } else { echo smn_get_country_name($sInfo->entry_country_id) . smn_draw_hidden_field('entry_country_id'); } } else { echo smn_draw_pull_down_menu('entry_country_id', smn_get_countries(), $sInfo->entry_country_id); } ?> </td> </tr> </table></td> </tr> <tr> <td><?php echo smn_draw_separator('pixel_trans.gif', '1', '10'); ?> </td> </tr> <tr> <td class="main" valign="top"></td> <td class="formAreaTitle"><?php
function quote_store($method = '') { global $_POST, $order, $shipping_weight, $shipping_num_boxes, $cart; global $store; if (smn_not_null($method) && isset($this->types[$method])) { $prod = $method; } else { $prod = 'GNDRES'; } if ($method) { $this->_upsAction('3'); } // return a single quote $this->_upsProduct($prod); $store_list = $cart->get_store_list(); for ($k = 0; $k < sizeof($store_list); $k++) { $country_name = smn_get_countries($cart->get_cart_store_country($store_list[$k]), true); $this->_upsOrigin($cart->get_cart_store_zip($store_list[$k]), $country_name['countries_iso_code_2']); $this->_upsDest($order->delivery['postcode'], $order->delivery['country']['iso_code_2']); $this->_upsRate(MODULE_SHIPPING_UPS_PICKUP); $this->_upsContainer(MODULE_SHIPPING_UPS_PACKAGE); $this->_upsWeight($shipping_weight); $this->_upsRescom(MODULE_SHIPPING_UPS_RES); $upsQuote[$store_list[$k]] = $this->_upsGetQuote(); } foreach ($upsQuote as $key => $value) { if (is_array($value) && sizeof($value) > 0) { $this->quotes_store[$key] = array('id' => $this->code, 'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)'); $methods = array(); $qsize = sizeof($value); for ($i = 0; $i < $qsize; $i++) { list($type, $cost) = each($value[$i]); $methods[] = array('id' => $type, 'title' => $this->types[$type], 'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes); } $this->quotes_store[$key]['methods'] = $methods; if ($this->tax_class > 0) { $this->quotes_store[$key]['tax'] = smn_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } } else { $this->quotes_store[$key] = array('module' => $this->title, 'error' => 'An error occured with the UPS shipping calculations.<br>' . $upsQuote . '<br>If you prefer to use UPS as your shipping method, please contact the store owner.'); } if (smn_not_null($this->icon)) { $this->quotes_store[$key]['icon'] = smn_image($this->icon, $this->title); } } return $this->quotes_store; }