function getListing() { $cats = tep_db_read("SELECT * FROM categories c LEFT JOIN categories_description cd ON (c.categories_id=cd.categories_id AND cd.language_id='{$this->lang}') WHERE c.parent_id='{$this->cat}' ORDER BY sort_order", 'categories_id'); foreach ($cats as $cid => $c) { $cats[$cid]['key'] = 'c' . $cid; } $prods = tep_db_read("SELECT * FROM products_to_categories p2c,products p LEFT JOIN products_description pd ON (p.master_products_id=pd.products_id AND pd.language_id='{$this->lang}') WHERE p2c.categories_id='{$this->cat}' AND p.products_id=p2c.products_id ORDER BY p.products_sort_order", 'products_id'); foreach ($prods as $pid => $p) { $prods[$pid]['key'] = 'p' . $pid; } return array_merge($cats, $prods); }
$messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error'); } } else { $cID = $_POST['customers_id']; if (empty($cID)) { if (preg_match('/(.+)\\@(.+)/', $_POST['email_address'])) { $cID = tep_db_read("SELECT customers_id \n\t\t\t\t\t\t\t\t\tFROM customers \n\t\t\t\t\t\t\t\t\tWHERE customers_email_address = '" . $_POST['email_address'] . "'\n\t\t\t\t\t\t\t\t ", NULL, 'customers_id'); if ($cID) { $messageStack->add("Using existing customer account", 'warning'); } } else { $cntry_code = tep_db_read("SELECT countries_id \n\t\t\t\t\t\t\t\t\t\t FROM countries \n\t\t\t\t\t\t\t\t\t\t WHERE (countries_iso_code_2 = '" . $_POST['country'] . "' \n\t\t\t\t\t\t\t\t\t\t\tOR countries_name = '" . $_POST['country'] . "')\n\t\t\t\t\t\t\t\t\t \t\t", NULL, 'countries_id'); if (!$cntry_code) { $cntry_code = 223; } $state_info = tep_db_read("SELECT zone_id, zone_name \n\t\t\t\t\t\t\t\t\t\t FROM zones \n\t\t\t\t\t\t\t\t\t\t WHERE (zone_code = '" . $_POST['state'] . "' OR zone_name='" . $_POST['state'] . "')\n\t\t\t\t\t\t\t\t\t\t "); if (!$state_info) { $state_info = array('zone_name' => $_POST['state']); } if (!$cntry_code) { $cntry_code = 223; } $cus_flds = array('customers_email_address' => $_POST['email_address'], 'customers_firstname' => $_POST['firstname'], 'customers_lastname' => $_POST['lastname'], 'customers_telephone' => $_POST['telephone'], 'customers_fax' => $_POST['fax']); $addr_flds = array('entry_firstname' => $_POST['firstname'], 'entry_lastname' => $_POST['lastname'], 'entry_company' => $_POST['company'], 'entry_street_address' => $_POST['street_address'], 'entry_city' => $_POST['city'], 'entry_suburb' => $_POST['suburb'], 'entry_postcode' => $_POST['postcode'], 'entry_state' => $state_info['zone_name'], 'entry_country_id' => $cntry_code, 'entry_zone_id' => $state_info['zone_id']); tep_db_perform('address_book', $addr_flds); $cus_flds['customers_default_address_id'] = tep_db_insert_id(); tep_db_perform('customers', $cus_flds); $cID = tep_db_insert_id(); if ($cID) { $messageStack->add("Customer account created: " . $cID, 'warning'); }
<table width="100%" align="center" cellpadding="5" cellspacing="0" border="0" style="border:1px dashed #CCC"> <?php $xsellChannels = tep_db_read("SELECT * FROM xsell_channels", 'xsell_channel', 'xsell_title'); $xsellPullDown = array(); $mdlpulldn = array(array('id' => '', 'text' => 'All Models')); $product_query = tep_db_query("SELECT p.products_id,ov.products_options_values_name FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id=pa.products_id LEFT JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " ov ON ov.products_options_values_id=pa.options_values_id AND ov.language_id='{$languages_id}' WHERE master_products_id='" . $pInfo->products_id . "' AND p.master_products_id!=p.products_id ORDER BY pa.options_sort"); $attrs = array(); while ($row = tep_db_fetch_array($product_query)) { if (!isset($attrs[$row['products_id']])) { $attrs[$row['products_id']] = array(); } $attrs[$row['products_id']][] = $row['products_options_values_name']; } foreach ($attrs as $mid => $att) { $mdlpulldn[] = array('id' => $mid, 'text' => join(',', $att)); } foreach ($xsellChannels as $ch => $chname) { $xsellPullDown[] = array('id' => $ch, 'text' => $chname); ?> <tr> <td colspan="9" style="background-color:#6295FD; color:#FFF"> Channel - <b><?php echo $chname; ?> </b> </td></tr> <tr style="background-color:#D4EAB7;"> <td align="center"><u>ID</u></td>