moklis Posted March 11, 2008 Report Share Posted March 11, 2008 alles da: <?php /* -------------------------------------------------------------- XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce -------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce (configure.php,v 1.13 2003/02/10); www.oscommerce.com Released under the GNU General Public License --------------------------------------------------------------*/ // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) define('HTTP_SERVER', 'http://www.pazianas.de'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', 'https://www.pazianas.de'); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', false); // secure webserver for checkout procedure? define('DIR_WS_CATALOG', '/xtcommerce/'); // absolute path required define('DIR_FS_DOCUMENT_ROOT', '/customers/pazianas.de/pazianas.de/httpd.www/xtcommerce/'); define('DIR_FS_CATALOG', '/customers/pazianas.de/pazianas.de/httpd.www/xtcommerce/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ORIGINAL_IMAGES', DIR_WS_IMAGES .'product_images/original_images/'); define('DIR_WS_THUMBNAIL_IMAGES', DIR_WS_IMAGES .'product_images/thumbnail_images/'); define('DIR_WS_INFO_IMAGES', DIR_WS_IMAGES .'product_images/info_images/'); define('DIR_WS_POPUP_IMAGES', DIR_WS_IMAGES .'product_images/popup_images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_INCLUDES',DIR_FS_DOCUMENT_ROOT. 'includes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_FS_CATALOG . 'lang/'); define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); define('DIR_FS_INC', DIR_FS_CATALOG . 'inc/'); // define our database connection define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers define('DB_SERVER_USERNAME', 'xxxxxxx'); define('DB_SERVER_PASSWORD', 'xxxxxxx'); define('DB_DATABASE', 'pazianas_de'); define('USE_PCONNECT', 'false'); // use persistent connections? define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql' ?>[/PHP] und die "xtc_get_shipping_status_name.inc.php" hab ich auch in xtcommerce/inc/ gefunden. wo und wie korrigiere ich das jetzt? Link to comment Share on other sites More sharing options...
rivendarkness Posted March 11, 2008 Author Report Share Posted March 11, 2008 Scheinbar ist der grund das es nicht geht, das er die Variable DIR_FS_INC nicht auflösen kann...wenn du geholfen werden willst melde dich per PN bei mir. So aus dem stegreif kann ich dir auch nicht sagen, wo der fehler dabei genau liegt. Das BEdarf dann wohl doch einer genaueren Analyse. Link to comment Share on other sites More sharing options...
SiCkSedy Posted March 13, 2008 Report Share Posted March 13, 2008 Das is mein Problem und ich weiss mir nicht zu helfen da die oroduct review bei mir doch nochmal anders aussieht als in dem Beispiel beschrieben ! [COLOR=#000000][B]1054 - Unknown column 'p.products_indiziert' in 'field list' select p.products_fsk18, p.products_indiziert, p.products_shippingtime, p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id from (((products_description pd, products p) left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c) left join specials s on p.products_id = s.products_id) where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '2' and p2c.categories_id = '8' ORDER BY p.products_price ASC [COLOR=#ff0000][XT SQL Error][/COLOR] [/B][/COLOR] Die Product_review : <?php /* ----------------------------------------------------------------------------------------- $Id: product_reviews.php 1238 2005-09-24 10:51:19Z mz $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce(product_reviews.php,v 1.47 2003/02/13); www.oscommerce.com (c) 2003 nextcommerce (product_reviews.php,v 1.12 2003/08/17); www.nextcommerce.org Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ include ('includes/application_top.php'); // create smarty elements $smarty = new Smarty; // include boxes require (DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php'); // include needed functions require_once (DIR_FS_INC.'xtc_row_number_format.inc.php'); require_once (DIR_FS_INC.'xtc_date_short.inc.php'); // lets retrieve all $HTTP_GET_VARS keys and values.. $get_params = xtc_get_all_get_params(); $get_params_back = xtc_get_all_get_params(array ('reviews_id')); // for back button $get_params = substr($get_params, 0, -1); //remove trailing & if (xtc_not_null($get_params_back)) { $get_params_back = substr($get_params_back, 0, -1); //remove trailing & } else { $get_params_back = $get_params; } $product_info_query = xtc_db_query("select pd.products_name from ".TABLE_PRODUCTS_DESCRIPTION." pd left join ".TABLE_PRODUCTS." p on pd.products_id = p.products_id where pd.language_id = '".(int) $_SESSION['languages_id']."' and p.products_status = '1' and pd.products_id = '".(int) $_GET['products_id']."'"); if (!xtc_db_num_rows($product_info_query)) xtc_redirect(xtc_href_link(FILENAME_REVIEWS)); $product_info = xtc_db_fetch_array($product_info_query); $breadcrumb->add(NAVBAR_TITLE_PRODUCT_REVIEWS, xtc_href_link(FILENAME_PRODUCT_REVIEWS, $get_params)); require (DIR_WS_INCLUDES.'header.php'); $smarty->assign('PRODUCTS_NAME', $product_info['products_name']); $data_reviews = array (); $reviews_query = xtc_db_query("select reviews_rating, reviews_id, customers_name, date_added, last_modified, reviews_read from ".TABLE_REVIEWS." where products_id = '".(int) $_GET['products_id']."' order by reviews_id DESC"); if (xtc_db_num_rows($reviews_query)) { $row = 0; while ($reviews = xtc_db_fetch_array($reviews_query)) { $row ++; $data_reviews[] = array ('ID' => $reviews['reviews_id'], 'AUTHOR' => '<a href="'.xtc_href_link(FILENAME_PRODUCT_REVIEWS_INFO, $get_params.'&reviews_id='.$reviews['reviews_id']).'">'.$reviews['customers_name'].'</a>', 'DATE' => xtc_date_short($reviews['date_added']), 'RATING' => xtc_image('templates/'.CURRENT_TEMPLATE.'/img/stars_'.$reviews['reviews_rating'].'.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'TEXT' => $reviews['reviews_text']); } } $smarty->assign('module_content', $data_reviews); $smarty->assign('BUTTON_BACK', '<a href="'.xtc_href_link(FILENAME_PRODUCT_INFO, $get_params_back).'">'.xtc_image_button('button_back.gif', IMAGE_BUTTON_BACK).'</a>'); $smarty->assign('BUTTON_WRITE', '<a href="'.xtc_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, $get_params).'">'.xtc_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW).'</a>'); $smarty->assign('language', $_SESSION['language']); // set cache ID if (!CacheCheck()) { $smarty->caching = 0; $main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/product_reviews.html'); } else { $smarty->caching = 1; $smarty->cache_lifetime = CACHE_LIFETIME; $smarty->cache_modified_check = CACHE_CHECK; $cache_id = $_SESSION['language'].$_GET['products_id']; $main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/product_reviews.html', $cache_id); } $smarty->assign('language', $_SESSION['language']); $smarty->assign('main_content', $main_content); $smarty->caching = 0; if (!defined(RM)) $smarty->load_filter('output', 'note'); $smarty->display(CURRENT_TEMPLATE.'/index.html'); include ('includes/application_bottom.php'); ?> Link to comment Share on other sites More sharing options...
GSX Posted March 16, 2008 Report Share Posted March 16, 2008 Hallo, vielleicht kann mir einer von euch helfen, habe mir im XT-Module ein Modul installiert und wollte es auf dem Server speichern und nun kam diese Fehlermeldung: 1054 - Unknown column 'pd.products_meta_searchpt' in 'field list' SELECT p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_image, p.products_price, p.products_status, pd.products_meta_searchpt, p.products_tax_class_id, p.products_date_added, m.manufacturers_name FROM products p LEFT JOIN manufacturers m ON p.manufacturers_id = m.manufacturers_id LEFT JOIN products_description pd ON p.products_id = pd.products_id LEFT JOIN specials s ON p.products_id = s.products_id WHERE p.products_status = 1 ORDER BY p.products_date_added DESC, pd.products_name [XT SQL Error] Die Datei findet Ihr hier im XT Forum Exportmodul für wir-lieben-preise.de. Ich habe schon einiges ausprobiert, aber komme nicht auf die Lösung. Link to comment Share on other sites More sharing options...
rivendarkness Posted March 16, 2008 Author Report Share Posted March 16, 2008 Ui, ich komm nich auf die seite, ich bin kein sponsor...würde mich aber gerne dem problem annehmen. Es ist in einer Datei, die ich nicht kenne und das müsste man mal intensiver untersuchen. meld dich einfach mal bei mir! Link to comment Share on other sites More sharing options...
systembauer Posted March 17, 2008 Report Share Posted March 17, 2008 Hallo zusammen, habe das gleiche heute schon mal gepostet, bevor ich diesen Thread hier fand. Sorry. Mein Problem: 1054 - Unknown column 'p.products_vpe' in 'field list' select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_vpe, p.products_vpe_status, p.products_vpe_value, p.products_price from products p, products_to_categories p2c, categories c where p.products_status=1 and p.products_id = p2c.products_id and p.products_id !='0' and c.categories_id = p2c.categories_id and c.categories_status=1 order by p.products_date_added desc limit 0 Nach dem Restore eines Datenbankupdates. Habe meinen alten 3.0.2 Shop mit allen Updates bis zur 3.0.4SP2.1 versehen und dann ein Backup der DB gemacht. Danach habe ich den Server (Server4You - rootDS) auf den Urzustand neu installieren lassen und die 3.0.4SP2.1 Vollversion raufgespult. Shop funktionierte - allerdings ohne Daten. Habe dann im phpMyAdmin das Backup wieder eingespielt, was etwa 2 Minuten dauerte und mit einer Erfolgsmeldung abgeschlossen wurde. Zu bemerken ist, daß ich nach dem Restore 4 Tabellen mehr in der DB habe als vorher, als der Shop gerade jungfräulich installiert war... Obige Fehlermeldung kommt sofort, wenn ich www.aggstein.de/index.php aufrufe. Also nix geht mehr... Was soll ich tun? Die bisher gebotene Hilfe hier im Forum bezieht sich ja zumeist auf ein serverseitiges Update der PHP Version (4 -> 5), jedoch habe ich dieses Problem nicht. Bei mir läuft PHP4x Danke schon vorab für Eure Hilfe... Link to comment Share on other sites More sharing options...
rivendarkness Posted March 17, 2008 Author Report Share Posted March 17, 2008 Ich glaube du hast da grundsätzlich was falsch gemacht. Wenn ich das richtig verstanden habe, hast du eine neue Shopversion neu installiert und deine alte Datenbank drübber geschrubbelt? Irgendwas hast du irgendwie falsch gemacht. So ganz schleu werd ich aus deinem Text nicht Liegt wohl an der Uhrzeit Link to comment Share on other sites More sharing options...
systembauer Posted March 17, 2008 Report Share Posted March 17, 2008 Ich habe den alten funktionierenden Shop Step-by-Step mit allen Updates und genau nach Anleitung auf die 3.0.4SP2.1 upgedatet. Dann - also mit Status 3.0.4SP2.1 - habe ich das Backup gemacht. Anschließend habe ich den Server neu aufsetzen lassen und eine jungfräuliche 3.0.4SP2.1 aufgespielt und installiert. Bis dahin alles ohne Fehler. Jetzt habe ich das DB-Backup wieder ingelesen. Und... nix geht mehr Ich habe also die Datenbank bereits vor dem Backup auf 3.0.4SP2.1 upgedatet. Ich kann mir jetzt höchstens noch vorstellen, daß es zwischen der Voll- und der Updateversion Unterschiede gibt. Aber ich habe inzwischen keine andere Wahl mehr, als die 3.0.4SP2.1 mit der vorhandenen Datenbank wieder lauffähig zu machen - auch wenn das 12 Stunden Fummelarbeit kostet. Nur weiß ich nicht, wo ich überhaupt ansetzen soll, um den Fehler zu beheben. Link to comment Share on other sites More sharing options...
rivendarkness Posted March 18, 2008 Author Report Share Posted March 18, 2008 Nein so funktioniert das leider nicht. Du kannst nicht updatet shop-datenbank in einen "neuen" shop zurückspielen. du müsstest den selben weg gehen, wie bei deinem alten shop. also alten shop installieren, shop updaten und dann die datenbank zurückspielen. Link to comment Share on other sites More sharing options...
systembauer Posted March 18, 2008 Report Share Posted March 18, 2008 Danke der Hilfe hier im Forum - habe mein Problem gelöst. Link to comment Share on other sites More sharing options...
rivendarkness Posted March 19, 2008 Author Report Share Posted March 19, 2008 Und wieder ein zufriedener Benutzer Ich find das toll!! Link to comment Share on other sites More sharing options...
b.morawitz Posted April 3, 2008 Report Share Posted April 3, 2008 Hallo, hatte das gleiche Problem und konnte es hiermit loesen! Hab nicht bis zum Ende durchgelesen, da ich zwischendurch mal den Geistesblitz bekam, dass in der default.php bei der letzten Abfrage mit left join ja _zwei_ left joins sind! Dementsprechend muss man auch beide Klammern! Danke an euch alle hier! Ciao! Bjoern Link to comment Share on other sites More sharing options...
rivendarkness Posted April 4, 2008 Author Report Share Posted April 4, 2008 Sehr schön das es auch bei Dir hiermit geklappt hat Alles durchzulesen bringt nichts, wenn es schon am anfang klappte Link to comment Share on other sites More sharing options...
it40 Posted April 10, 2008 Report Share Posted April 10, 2008 1054 - Unknown column 'products_shipping_time' in 'field list' insert into orders_products (orders_id, products_id, products_model, products_name, products_shipping_time, products_price, final_price, products_tax, products_discount_made, products_quantity, allow_tax) values ('32', '373', 'sis023', 'Steg in Argenteuil nach Sisley', '4-6 Wochen', '85.6', '85.6', '7', '', '1', '1') [XT SQL Error] Link to comment Share on other sites More sharing options...
rivendarkness Posted April 10, 2008 Author Report Share Posted April 10, 2008 wo kommt denn die meldung? Link to comment Share on other sites More sharing options...
it40 Posted April 11, 2008 Report Share Posted April 11, 2008 Hallo, vielen Dank, die Meldung kommt wenn ich die Bestellung wegschicke. In der URL steht die checkout_process.php. Link to comment Share on other sites More sharing options...
it40 Posted April 11, 2008 Report Share Posted April 11, 2008 Bei mir fehlte in der alten DB einfach die Spalte 'products_shipping_time' . Die hab ich eingefügt nun geht alles. Danke für die Mühe! Link to comment Share on other sites More sharing options...
mrniel Posted April 15, 2008 Report Share Posted April 15, 2008 übrigens, danke für die Hilfe in diesem Thema, habe so meine Probleme lösen können:o Link to comment Share on other sites More sharing options...
rivendarkness Posted April 16, 2008 Author Report Share Posted April 16, 2008 Danke fuer die Rueckmeldung! Ich find es toll, wenn es anderen hilft! Link to comment Share on other sites More sharing options...
didgee Posted July 29, 2008 Report Share Posted July 29, 2008 Boah wie unfair, allen haben ihre Probleme gelöst nur bei mir funzt gar nichts. Eigentlich hab ich das Problem schon seit einem Jahr vor mir hergeschoben. Nun hab ich mal Zeit und komm überhaupt nicht weiter. Hab auch schon die default und product_reviews_info.php gendert, trotzdem immer dieselbe Meldung (s.u.) . Soll ich einfach eine frische Datenbank bestellen und die 3.0.4 version aufbauen und alles wird gut ? Ich habe die Shopversion 3.0.3 und bin bei Host Europe. Meine Fehlermeldung: 1054 - Unknown column 'p.products_id' in 'on clause' SELECT DISTINCT p.products_model, pov.products_options_values_name, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_shippingtime, p.products_fsk18, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id FROM products p LEFT JOIN manufacturers m using(manufacturers_id), products_description pd LEFT JOIN specials s ON p.products_id = s.products_id, categories c, products_to_categories p2c, products LEFT JOIN products_attributes pa ON p.products_id = pa.products_id LEFT JOIN products_options_values pov ON pa.options_values_id = pov.products_options_values_id WHERE p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = '2' AND p.products_id = p2c.products_id AND p2c.categories_id = c.categories_id AND ( p.products_id = pa.products_id AND (pd.products_name LIKE '%kerlomat%' OR p.products_model LIKE '%kerlomat%' OR p.products_ean like '%kerlomat%' OR m.manufacturers_name LIKE '%kerlomat%' OR pov.products_options_values_name LIKE '%kerlomat%' OR pd.products_description LIKE '%kerlomat%' OR pd.products_short_description LIKE '%kerlomat%' OR pa.attributes_model LIKE '%kerlomat%') OR (pd.products_name LIKE '%kerlomat%' OR p.products_model like '%kerlomat%' OR p.products_ean LIKE '%kerlomat%' OR m.manufacturers_name LIKE '%kerlomat%' OR pd.products_description LIKE '%kerlomat%' OR pd.products_short_description LIKE '%kerlomat%') ) GROUP BY pd.products_id ORDER BY pd.products_name [XT SQL Error][/PHP] Link to comment Share on other sites More sharing options...
ziehdirdasmalrein Posted October 6, 2008 Report Share Posted October 6, 2008 in der default.php datei muußte ich die klammern nur richtig beidem left joint setzen! hier meine komplette default.php: <?php /* ----------------------------------------------------------------------------------------- $Id: default.php,v 1.27 2004/04/26 10:31:17 fanta2k Exp $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce(default.php,v 1.84 2003/05/07); www.oscommerce.com (c) 2003 nextcommerce (default.php,v 1.11 2003/08/22); www.nextcommerce.org Released under the GNU General Public License ----------------------------------------------------------------------------------------- Third Party contributions: Enable_Disable_Categories 1.3 Autor: Mikel Williams | [email protected] Customers Status v3.x (c) 2002-2003 Copyright Elari [email protected] | www.unlockgsm.com/dload-osc/ | CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ $default_smarty = new smarty; $default_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/'); $default_smarty->assign('session',session_id()); $main_content = ''; // include needed functions require_once(DIR_FS_INC . 'xtc_customer_greeting.inc.php'); require_once(DIR_FS_INC . 'xtc_get_path.inc.php'); require_once(DIR_FS_INC . 'xtc_draw_hidden_field.inc.php'); require_once(DIR_FS_INC . 'xtc_check_categories_status.inc.php'); require_once(DIR_FS_INC . 'xtc_image_button.inc.php'); if (xtc_check_categories_status($current_category_id)>=1) { $error=CATEGORIE_NOT_FOUND; include(DIR_WS_MODULES . FILENAME_ERROR_HANDLER); } else { if ($category_depth == 'nested') { if (GROUP_CHECK=='true') { $group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $category_query = xtc_db_query("select cd.categories_description, cd.categories_name, c.categories_template, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' ".$group_check." and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'"); $category = xtc_db_fetch_array($category_query); if (isset($cPath) && ereg('_', $cPath)) { // check to see if there are deeper categories within the current category $category_links = array_reverse($cPath_array); for($i = 0, $n = sizeof($category_links); $i < $n; $i++) { if (GROUP_CHECK=='true') { $group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $categories_query = xtc_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.parent_id = '" . $category_links[$i] . "' and c.categories_id = cd.categories_id ".$group_check." and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' order by sort_order, cd.categories_name"); if (xtc_db_num_rows($categories_query) < 1) { // do nothing, go through the loop } else { break; // we've found the deepest category the customer is in } } } else { if (GROUP_CHECK=='true') { $group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $categories_query = xtc_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id ".$group_check." and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' order by sort_order, cd.categories_name"); } $rows = 0; while ($categories = xtc_db_fetch_array($categories_query)) { $rows++; $cPath_new = xtc_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; $image=''; if ($categories['categories_image']!='') { $image=DIR_WS_IMAGES.'categories/'.$categories['categories_image']; } $categories_content[]=array( 'CATEGORIES_NAME' => $categories['categories_name'], 'CATEGORIES_IMAGE' => $image, 'CATEGORIES_LINK' => xtc_href_link(FILENAME_DEFAULT, $cPath_new), 'CATEGORIES_DESCRIPTION' => $categories['categories_description']); } $new_products_category_id = $current_category_id; include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); $image=''; if ($category['categories_image']!='') { $image=DIR_WS_IMAGES.'categories/'.$category['categories_image']; } $default_smarty->assign('CATEGORIES_NAME',$category['categories_name']); $default_smarty->assign('CATEGORIES_IMAGE',$image); $default_smarty->assign('CATEGORIES_DESCRIPTION',$category['categories_description']); $default_smarty->assign('language', $_SESSION['language']); $default_smarty->assign('module_content',$categories_content); // get default template if ($category['categories_template']=='' or $category['categories_template']=='default') { $files=array(); if ($dir= opendir(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/categorie_listing/')){ while (($file = readdir($dir)) !==false) { if (is_file( DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/categorie_listing/'.$file) and ($file !="index.html")){ $files[]=array( 'id' => $file, 'text' => $file); }//if } // while closedir($dir); } $category['categories_template']=$files[0]['id']; } $default_smarty->caching = 0; $main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/categorie_listing/'.$category['categories_template']); $smarty->assign('main_content',$main_content); } elseif ($category_depth == 'products' || $_GET['manufacturers_id']) { //fsk18 lock $fsk_lock=''; if ($_SESSION['customers_status']['customers_fsk18_display']=='0') { $fsk_lock=' and p.products_fsk18!=1'; } // show the products of a specified manufacturer if (isset($_GET['manufacturers_id'])) { if (isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) { // sorting query $sorting_query=xtc_db_query("SELECT products_sorting, products_sorting2 FROM ". TABLE_CATEGORIES." where categories_id='".(int)$_GET['filter_id']."'"); $sorting_data=xtc_db_fetch_array($sorting_query); if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name'; $sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' '; // We are asked to show only a specific category if (GROUP_CHECK=='true') { $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $listing_sql = "select DISTINCT p.products_fsk18, p.products_shippingtime, p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id from (". TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id ".$group_check." and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock." and p2c.categories_id = '" . (int)$_GET['filter_id'] . "'".$sorting; } else { // We show them all if (GROUP_CHECK=='true') { $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $listing_sql = "select p.products_fsk18, p.products_shippingtime, p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id ".$group_check." and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.manufacturers_id = m.manufacturers_id ".$fsk_lock." and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'"; } } else { // show the products in a given categorie if (isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) { // sorting query $sorting_query=xtc_db_query("SELECT products_sorting, products_sorting2 FROM ". TABLE_CATEGORIES." where categories_id='".$current_category_id."'"); $sorting_data=xtc_db_fetch_array($sorting_query); if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name'; $sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' '; // We are asked to show only specific catgeory if (GROUP_CHECK=='true') { $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $listing_sql = "select p.products_fsk18, p.products_shippingtime, p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id ".$group_check." and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock." and p2c.categories_id = '" . $current_category_id . "'".$sorting; } else { // sorting query $sorting_query=xtc_db_query("SELECT products_sorting, products_sorting2 FROM ". TABLE_CATEGORIES." where categories_id='".$current_category_id."'"); $sorting_data=xtc_db_fetch_array($sorting_query); if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name'; $sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' '; // We show them all if (GROUP_CHECK=='true') { $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $listing_sql = "select p.products_fsk18, p.products_shippingtime, p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id from ((" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id ".$group_check." and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock." and p2c.categories_id = '" . $current_category_id . "'".$sorting; } } // optional Product List Filter if (PRODUCT_LIST_FILTER > 0) { if (isset($_GET['manufacturers_id'])) { $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' order by cd.categories_name"; } else { $filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by m.manufacturers_name"; } $filterlist_query = xtc_db_query($filterlist_sql); if (xtc_db_num_rows($filterlist_query) > 1) { $manufacturer_dropdown= xtc_draw_form('filter', FILENAME_DEFAULT, 'GET') .' '; if (isset($_GET['manufacturers_id'])) { $manufacturer_dropdown.= xtc_draw_hidden_field('manufacturers_id', $_GET['manufacturers_id']); $options = array(array('text' => TEXT_ALL_CATEGORIES)); } else { $manufacturer_dropdown.= xtc_draw_hidden_field('cPath', $cPath); $options = array(array('text' => TEXT_ALL_MANUFACTURERS)); } $manufacturer_dropdown.= xtc_draw_hidden_field('sort', $_GET['sort']); while ($filterlist = xtc_db_fetch_array($filterlist_query)) { $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']); } $manufacturer_dropdown.= xtc_draw_pull_down_menu('filter_id', $options, $_GET['filter_id'], 'onchange="this.form.submit()"'); $manufacturer_dropdown.= '</form>' . "\n"; } } // Get the right image for the top-right $image = DIR_WS_IMAGES . 'table_background_list.gif'; if (isset($_GET['manufacturers_id'])) { $image = xtc_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'"); $image = xtc_db_fetch_array($image); $image = $image['manufacturers_image']; } elseif ($current_category_id) { $image = xtc_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . $current_category_id . "'"); $image = xtc_db_fetch_array($image); $image = $image['categories_image']; } include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); } else { // default page $shop_content_query=xtc_db_query("SELECT content_title, content_heading, content_text, content_file FROM ".TABLE_CONTENT_MANAGER." WHERE content_group='5' AND languages_id='".$_SESSION['languages_id']."'"); $shop_content_data=xtc_db_fetch_array($shop_content_query); $default_smarty->assign('title',$shop_content_data['content_heading']); include(DIR_WS_INCLUDES . FILENAME_CENTER_MODULES); if ($shop_content_data['content_file']!=''){ ob_start(); if (strpos($shop_content_data['content_file'],'.txt')) echo '<pre>'; include(DIR_FS_CATALOG.'media/content/'.$shop_content_data['content_file']); if (strpos($shop_content_data['content_file'],'.txt')) echo '</pre>'; $shop_content_data['content_text']=ob_get_contents(); ob_end_clean(); } $default_smarty->assign('text',str_replace('{$greeting}',xtc_customer_greeting(),$shop_content_data['content_text'])); $default_smarty->assign('language', $_SESSION['language']); // set cache ID if (USE_CACHE=='false') { $default_smarty->caching = 0; $main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html'); } else { $default_smarty->caching = 1; $default_smarty->cache_lifetime=CACHE_LIFETIME; $default_smarty->cache_modified_check=CACHE_CHECK; $cache_id = $_SESSION['language'].$_SESSION['currency'].$_SESSION['customer_id']; $main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html',$cache_id); } $smarty->assign('main_content',$main_content); } } ?> [/php] und meine advanced search sieht nun so aus: [php] <?php /* ----------------------------------------------------------------------------------------- $Id: advanced_search_result.php,v 1.8 2004/04/05 16:33:49 fanta2k Exp $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce(advanced_search_result.php,v 1.68 2003/05/14); www.oscommerce.com (c) 2003 nextcommerce (advanced_search_result.php,v 1.17 2003/08/21); www.nextcommerce.org Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ include( 'includes/application_top.php'); // create smarty elements $smarty = new Smarty; // include boxes require(DIR_FS_CATALOG .'templates/'.CURRENT_TEMPLATE. '/source/boxes.php'); // include needed functions require_once(DIR_FS_INC . 'xtc_parse_search_string.inc.php'); require_once(DIR_FS_INC . 'xtc_get_subcategories.inc.php'); require_once(DIR_FS_INC . 'xtc_parse_search_string.inc.php'); require_once(DIR_FS_INC . 'xtc_parse_search_string.inc.php'); require_once(DIR_FS_INC . 'xtc_parse_search_string.inc.php'); require_once(DIR_FS_INC . 'xtc_checkdate.inc.php'); require_once(DIR_FS_INC . 'xtc_get_currencies_values.inc.php'); $error = 0; // reset error flag to false $errorno = 0; if ( (isset($_GET['keywords']) && empty($_GET['keywords'])) && (isset($_GET['dfrom']) && (empty($_GET['dfrom']) || ($_GET['dfrom'] == DOB_FORMAT_STRING))) && (isset($_GET['dto']) && (empty($_GET['dto']) || ($_GET['dto'] == DOB_FORMAT_STRING))) && (isset($_GET['pfrom']) && empty($_GET['pfrom'])) && (isset($_GET['pto']) && empty($_GET['pto'])) ) { $errorno += 1; $error = 1; } $dfrom_to_check = (($_GET['dfrom'] == DOB_FORMAT_STRING) ? '' : $_GET['dfrom']); $dto_to_check = (($_GET['dto'] == DOB_FORMAT_STRING) ? '' : $_GET['dto']); if (strlen($dfrom_to_check) > 0) { if (!xtc_checkdate($dfrom_to_check, DOB_FORMAT_STRING, $dfrom_array)) { $errorno += 10; $error = 1; } } if (strlen($dto_to_check) > 0) { if (!xtc_checkdate($dto_to_check, DOB_FORMAT_STRING, $dto_array)) { $errorno += 100; $error = 1; } } if (strlen($dfrom_to_check) > 0 && !(($errorno & 10) == 10) && strlen($dto_to_check) > 0 && !(($errorno & 100) == 100)) { if (mktime(0, 0, 0, $dfrom_array[1], $dfrom_array[2], $dfrom_array[0]) > mktime(0, 0, 0, $dto_array[1], $dto_array[2], $dto_array[0])) { $errorno += 1000; $error = 1; } } if (strlen($_GET['pfrom']) > 0) { $pfrom_to_check = $_GET['pfrom']; if (!settype($pfrom_to_check, "double")) { $errorno += 10000; $error = 1; } } if (strlen($_GET['pto']) > 0) { $pto_to_check = $_GET['pto']; if (!settype($pto_to_check, "double")) { $errorno += 100000; $error = 1; } } if (strlen($_GET['pfrom']) > 0 && !(($errorno & 10000) == 10000) && strlen($_GET['pto']) > 0 && !(($errorno & 100000) == 100000)) { if ($pfrom_to_check > $pto_to_check) { $errorno += 1000000; $error = 1; } } if (strlen($_GET['keywords']) > 0) { if (!xtc_parse_search_string(stripslashes($_GET['keywords']), $search_keywords)) { $errorno += 10000000; $error = 1; } } if ($error == 1) { xtc_redirect(xtc_href_link(FILENAME_ADVANCED_SEARCH, 'errorno=' . $errorno . '&' . xtc_get_all_get_params(array('x', 'y')))); } else { $breadcrumb->add(NAVBAR_TITLE1_ADVANCED_SEARCH, xtc_href_link(FILENAME_ADVANCED_SEARCH)); $breadcrumb->add(NAVBAR_TITLE2_ADVANCED_SEARCH, xtc_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords=' . $_GET['keywords'] . '&search_in_description=' . $_GET['search_in_description'] . '&categories_id=' . $_GET['categories_id'] . '&inc_subcat=' . $_GET['inc_subcat'] . '&manufacturers_id=' . $_GET['manufacturers_id'] . '&pfrom=' . $_GET['pfrom'] . '&pto=' . $_GET['pto'] . '&dfrom=' . $_GET['dfrom'] . '&dto=' . $_GET['dto'])); require(DIR_WS_INCLUDES . 'header.php'); //fsk18 lock $fsk_lock=''; if ($_SESSION['customers_status']['customers_fsk18_display']=='0') { $fsk_lock=' and p.products_fsk18!=1'; } // create column list $select_str = "select distinct p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_fsk18, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id "; if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ( (isset($_GET['pfrom']) && xtc_not_null($_GET['pfrom'])) || (isset($_GET['pto']) && xtc_not_null($_GET['pto']))) ) { $select_str .= ", SUM(tr.tax_rate) as tax_rate "; } $from_str = "from ((" . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ( (isset($_GET['pfrom']) && xtc_not_null($_GET['pfrom'])) || (isset($_GET['pto']) && xtc_not_null($_GET['pto']))) ) { if (!isset($_SESSION['customer_country_id'])) { $_SESSION['customer_country_id'] = STORE_COUNTRY; $_SESSION['customer_zone_id'] = STORE_ZONE; } $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$_SESSION['customer_country_id'] . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$_SESSION['customer_zone_id'] . "')"; } if (GROUP_CHECK=='true') { $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $where_str = " where p.products_status = '1' ".$fsk_lock." and p.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.products_id = p2c.products_id ".$group_check." and p2c.categories_id = c.categories_id "; if (isset($_GET['categories_id']) && xtc_not_null($_GET['categories_id'])) { if ($_GET['inc_subcat'] == '1') { $subcategories_array = array(); xtc_get_subcategories($subcategories_array, $_GET['categories_id']); $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '" . (int)$_GET['categories_id'] . "'"; for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) { $where_str .= " or p2c.categories_id = '" . $subcategories_array[$i] . "'"; } $where_str .= ")"; } else { $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p2c.categories_id = '" . (int)$_GET['categories_id'] . "'"; } } if (isset($_GET['manufacturers_id']) && xtc_not_null($_GET['manufacturers_id'])) { $where_str .= " and m.manufacturers_id = '" . $_GET['manufacturers_id'] . "'"; } if (isset($_GET['keywords']) && xtc_not_null($_GET['keywords'])) { if (xtc_parse_search_string(stripslashes($_GET['keywords']), $search_keywords)) { $where_str .= " and ("; for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) { switch ($search_keywords[$i]) { case '(': case ')': case 'and': case 'or': $where_str .= " " . $search_keywords[$i] . " "; break; default: $where_str .= "(pd.products_name like '%" . addslashes($search_keywords[$i]) . "%' or p.products_model like '%" . addslashes($search_keywords[$i]) . "%' or m.manufacturers_name like '%" . addslashes($search_keywords[$i]) . "%'"; if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . addslashes($search_keywords[$i]) . "%'"; $where_str .= ')'; break; } } $where_str .= " )"; } } if (isset($_GET['dfrom']) && xtc_not_null($_GET['dfrom']) && ($_GET['dfrom'] != DOB_FORMAT_STRING)) { $where_str .= " and p.products_date_added >= '" . xtc_date_raw($dfrom_to_check) . "'"; } if (isset($_GET['dto']) && xtc_not_null($_GET['dto']) && ($_GET['dto'] != DOB_FORMAT_STRING)) { $where_str .= " and p.products_date_added <= '" . xtc_date_raw($dto_to_check) . "'"; } $rate=xtc_get_currencies_values($_SESSION['currency']); $rate=$rate['value']; if ($rate && $_GET['pfrom'] != '') { $pfrom = $_GET['pfrom'] / $rate; } if ($rate && $_GET['pto'] != '') { $pto = $_GET['pto'] / $rate; } if ($pfrom !='') $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) >= " . $pfrom . ")"; if ($pto !='') $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) <= " . $pto . ")"; $order_str = ' group by pd.products_name order by pd.products_name'; $listing_sql = $select_str . $from_str . $where_str . $order_str; require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); } $smarty->assign('language', $_SESSION['language']); $smarty->caching = 0; if (!defined(RM)) $smarty->load_filter('output', 'note'); $smarty->display(CURRENT_TEMPLATE . '/index.html'); ?>viel erfolg! Link to comment Share on other sites More sharing options...
mudoven Posted October 30, 2008 Report Share Posted October 30, 2008 Nun hat es mich auch erwischt könnt da bitte mal wer nachschauen wo der fehler hängt? Er taucht soweit ich mitnekomme nur bei Bestellungen auf Vieleicht hat wer einen Rat. 1054 - Unknown column 'o.dhl_tracking_id' in 'field list' select o.orders_id, o.orders_status, o.afterbuy_success, o.afterbuy_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, o.delivery_postcode, o.dhl_tracking_id, o.dpd_tracking_id, o.ups_tracking_id, o.chp_tracking_id, o.gls_tracking_id, o.hlg_tracking_id from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where (o.orders_status = s.orders_status_id and s.language_id = '2' and ot.class = 'ot_total') or (o.orders_status = '0' and ot.class = 'ot_total' and s.orders_status_id = '1' and s.language_id = '2') order by o.orders_id DESC limit 0, 20 [XT SQL Error]Meine Order.php <?php /* -------------------------------------------------------------- $Id: orders.php 1189 2005-08-28 15:27:00Z hhgag $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce -------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce(orders.php,v 1.109 2003/05/28); www.oscommerce.com (c) 2003 nextcommerce (orders.php,v 1.19 2003/08/24); www.nextcommerce.org Released under the GNU General Public License -------------------------------------------------------------- Third Party contribution: OSC German Banktransfer v0.85a Autor: Dominik Guder <[email protected]> Customers Status v3.x (c) 2002-2003 Copyright Elari [email protected] | www.unlockgsm.com/dload-osc/ | CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist credit card encryption functions for the catalog module BMC 2003 for the CC CVV Module Released under the GNU General Public License --------------------------------------------------------------*/ require ('includes/application_top.php'); require_once (DIR_FS_CATALOG.DIR_WS_CLASSES.'class.phpmailer.php'); require_once (DIR_FS_INC.'xtc_php_mail.inc.php'); require_once (DIR_FS_INC.'xtc_add_tax.inc.php'); require_once (DIR_FS_INC.'changedataout.inc.php'); require_once (DIR_FS_INC.'xtc_validate_vatid_status.inc.php'); require_once (DIR_FS_INC.'xtc_get_attributes_model.inc.php'); // initiate template engine for mail $smarty = new Smarty; require (DIR_WS_CLASSES.'currencies.php'); $currencies = new currencies(); if ((($_GET['action'] == 'edit') || ($_GET['action'] == 'update_order')) && ($_GET['oID'])) { $oID = xtc_db_prepare_input($_GET['oID']); $orders_query = xtc_db_query("select orders_id from ".TABLE_ORDERS." where orders_id = '".xtc_db_input($oID)."'"); $order_exists = true; if (!xtc_db_num_rows($orders_query)) { $order_exists = false; $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error'); } } require (DIR_WS_CLASSES.'order.php'); if ((($_GET['action'] == 'edit') || ($_GET['action'] == 'update_order')) && ($order_exists)) { $order = new order($oID); } $lang_query = xtc_db_query("select languages_id from " . TABLE_LANGUAGES . " where directory = '" . $order->info['language'] . "'"); $lang = xtc_db_fetch_array($lang_query); $lang=$lang['languages_id']; if (!isset($lang)) $lang=$_SESSION['languages_id']; $orders_statuses = array (); $orders_status_array = array (); $orders_status_query = xtc_db_query("select orders_status_id, orders_status_name from ".TABLE_ORDERS_STATUS." where language_id = '".$lang."'"); while ($orders_status = xtc_db_fetch_array($orders_status_query)) { $orders_statuses[] = array ('id' => $orders_status['orders_status_id'], 'text' => $orders_status['orders_status_name']); $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name']; } switch ($_GET['action']) { case 'update_order' : $oID = xtc_db_prepare_input($_GET['oID']); $status = xtc_db_prepare_input($_POST['status']); $comments = xtc_db_prepare_input($_POST['comments']); $dhl_tracking_id = xtc_db_prepare_input($_POST['dhl_tracking_id']); $dpd_tracking_id = xtc_db_prepare_input($_POST['dpd_tracking_id']); $ups_tracking_id = xtc_db_prepare_input($_POST['ups_tracking_id']); $chp_tracking_id = xtc_db_prepare_input($_POST['chp_tracking_id']); $gls_tracking_id = xtc_db_prepare_input($_POST['gls_tracking_id']); $hlg_tracking_id = xtc_db_prepare_input($_POST['hlg_tracking_id']); // $order = new order($oID); $order_updated = false; $check_status_query = xtc_db_query("select customers_name, customers_email_address, orders_status, date_purchased, delivery_postcode, dhl_tracking_id, dpd_tracking_id, ups_tracking_id, chp_tracking_id, gls_tracking_id, hlg_tracking_id from ".TABLE_ORDERS." where orders_id = '".xtc_db_input($oID)."'"); $check_status = xtc_db_fetch_array($check_status_query); if ($check_status['orders_status'] != $status || $comments != '' || $dhl_tracking_id != $check_status['dhl_tracking_id'] || $dpd_tracking_id != $check_status['dpd_tracking_id'] || $ups_tracking_id != $check_status['ups_tracking_id'] || $chp_tracking_id != $check_status['chp_tracking_id'] || $gls_tracking_id != $check_status['gls_tracking_id'] || $hlg_tracking_id != $check_status['hlg_tracking_id'] ) { xtc_db_query("update ".TABLE_ORDERS." set orders_status = '".xtc_db_input($status)."', last_modified = now(), dhl_tracking_id='" . xtc_db_input($dhl_tracking_id). "', dpd_tracking_id='" . xtc_db_input($dpd_tracking_id). "', ups_tracking_id='" . xtc_db_input($ups_tracking_id). "', chp_tracking_id='" . xtc_db_input($chp_tracking_id). "', gls_tracking_id='" . xtc_db_input($gls_tracking_id). "', hlg_tracking_id='" . xtc_db_input($hlg_tracking_id). "' where orders_id = '".xtc_db_input($oID)."'"); $customer_notified = '0'; if ($_POST['notify'] == 'on') { $notify_comments = ''; if ($_POST['notify_comments'] == 'on') { //$notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments)."\n\n"; $notify_comments = $comments; } else { $notify_comments = ''; } // assign language to template for caching $smarty->assign('language', $_SESSION['language']); $smarty->caching = false; // set dirs manual $smarty->template_dir = DIR_FS_CATALOG.'templates'; $smarty->compile_dir = DIR_FS_CATALOG.'templates_c'; $smarty->config_dir = DIR_FS_CATALOG.'lang'; $smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/'); $smarty->assign('logo_path', HTTP_SERVER.DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/img/'); $smarty->assign('NAME', $check_status['customers_name']); $smarty->assign('ZIPCODE', $check_status['delivery_postcode']); $smarty->assign('DHL_TRACKING_ID', $dhl_tracking_id); $smarty->assign('DPD_TRACKING_ID', $dpd_tracking_id); $smarty->assign('UPS_TRACKING_ID', $ups_tracking_id); $smarty->assign('CHP_TRACKING_ID', $chp_tracking_id); $smarty->assign('GLS_TRACKING_ID', $gls_tracking_id); $smarty->assign('HLG_TRACKING_ID', $hlg_tracking_id); $smarty->assign('ORDER_NR', $oID); $smarty->assign('ORDER_LINK', xtc_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id='.$oID, 'SSL')); $smarty->assign('ORDER_DATE', xtc_date_long($check_status['date_purchased'])); $smarty->assign('NOTIFY_COMMENTS', $notify_comments); $smarty->assign('ORDER_STATUS', $orders_status_array[$status]); $html_mail = $smarty->fetch(CURRENT_TEMPLATE.'/admin/mail/'.$order->info['language'].'/change_order_mail.html'); $txt_mail = $smarty->fetch(CURRENT_TEMPLATE.'/admin/mail/'.$order->info['language'].'/change_order_mail.txt'); xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', EMAIL_BILLING_SUBJECT, $html_mail, $txt_mail); $customer_notified = '1'; } xtc_db_query("insert into ".TABLE_ORDERS_STATUS_HISTORY." (orders_id, orders_status_id, date_added, customer_notified, comments) values ('".xtc_db_input($oID)."', '".xtc_db_input($status)."', now(), '".$customer_notified."', '".xtc_db_input($comments)."')"); $order_updated = true; } if ($order_updated) { $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success'); } else { $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning'); } xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('action')).'action=edit')); break; case 'deleteconfirm' : $oID = xtc_db_prepare_input($_GET['oID']); xtc_remove_order($oID, $_POST['restock']); xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')))); break; // BMC Delete CC info Start // Remove CVV Number case 'deleteccinfo' : $oID = xtc_db_prepare_input($_GET['oID']); xtc_db_query("update ".TABLE_ORDERS." set cc_cvv = null where orders_id = '".xtc_db_input($oID)."'"); xtc_db_query("update ".TABLE_ORDERS." set cc_number = '0000000000000000' where orders_id = '".xtc_db_input($oID)."'"); xtc_db_query("update ".TABLE_ORDERS." set cc_expires = null where orders_id = '".xtc_db_input($oID)."'"); xtc_db_query("update ".TABLE_ORDERS." set cc_start = null where orders_id = '".xtc_db_input($oID)."'"); xtc_db_query("update ".TABLE_ORDERS." set cc_issue = null where orders_id = '".xtc_db_input($oID)."'"); xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'oID='.$_GET['oID'].'&action=edit')); break; case 'afterbuy_send' : $oID = xtc_db_prepare_input($_GET['oID']); require_once (DIR_FS_CATALOG.'includes/classes/afterbuy.php'); $aBUY = new xtc_afterbuy_functions($oID); if ($aBUY->order_send()) $aBUY->process_order(); break; // BMC Delete CC Info End } ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $_SESSION['language_charset']; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- header //--> <?php require (DIR_WS_INCLUDES.'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td class="columnLeft2" width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td class="boxCenter" width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php if (($_GET['action'] == 'edit') && ($order_exists)) { // $order = new order($oID); ?> <tr> <td width="100%"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="80" rowspan="2"><?php echo xtc_image(DIR_WS_ICONS.'heading_customers.gif'); ?></td> <td class="pageHeading"><?php echo HEADING_TITLE . ' Nr : ' . $oID . ' - ' . $order->info['date_purchased'] ; ?></td> </tr> <tr> <td class="main" valign="top">XT Customers</td> </tr> </table> <?php echo '<a class="button" href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('action'))) . '">' . BUTTON_BACK . '</a>'; ?> <!-- Bestellbearbeitung Anfang --> <a class="button" href="<?php echo xtc_href_link(FILENAME_ORDERS_EDIT, 'oID='.$_GET['oID'].'&cID=' . $order->customer['ID']);?>"><?php echo BUTTON_EDIT ?></a> <!-- Bestellbearbeitung Ende --> </td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="3"><?php echo xtc_draw_separator(); ?></td> </tr> <tr> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2"> <?php if ($order->customer['csID']!='') { ?> <tr> <td class="main" valign="top" bgcolor="#FFCC33"><b><?php echo ENTRY_CID; ?></b></td> <td class="main" bgcolor="#FFCC33"><?php echo $order->customer['csID']; ?></td> </tr> <?php } ?> <tr> <td class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td> <td class="main"><?php echo xtc_address_format($order->customer['format_id'], $order->customer, 1, '', '<br />'); ?></td> </tr> <tr> <td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td class="main" valign="top"><b><?php echo CUSTOMERS_MEMO; ?></b></td> <?php // memoquery $memo_query = xtc_db_query("SELECT count(*) as count FROM ".TABLE_CUSTOMERS_MEMO." where customers_id='".$order->customer['ID']."'"); $memo_count = xtc_db_fetch_array($memo_query); ?> <td class="main"><b><?php echo $memo_count['count'].'</b>'; ?> <a style="cursor:hand" onClick="javascript:window.open('<?php echo xtc_href_link(FILENAME_POPUP_MEMO,'ID='.$order->customer['ID']); ?>', 'popup', 'scrollbars=yes, width=500, height=500')">(<?php echo DISPLAY_MEMOS; ?>)</a></td> </tr> <tr> <td class="main"><b><?php echo ENTRY_TELEPHONE; ?></b></td> <td class="main"><?php echo $order->customer['telephone']; ?></td> </tr> <tr> <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td> <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td> </tr> <tr> <td class="main"><b><?php echo ENTRY_CUSTOMERS_VAT_ID; ?></b></td> <td class="main"><?php echo $order->customer['vat_id']; ?></td> </tr> <tr> <td class="main" valign="top" bgcolor="#FFCC33"><b><?php echo IP; ?></b></td> <td class="main" bgcolor="#FFCC33"><b><?php echo $order->customer['cIP']; ?></b></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td> <td class="main"><?php echo xtc_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />'); ?></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td> <td class="main"><?php echo xtc_address_format($order->billing['format_id'], $order->billing, 1, '', '<br />'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo ENTRY_LANGUAGE; ?></b></td> <td class="main"><?php echo $order->info['language']; ?></td> </tr> <tr> <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td> <td class="main"><?php echo $order->info['payment_method']; ?></td> </tr> <?php if ((($order->info['cc_type']) || ($order->info['cc_owner']) || ($order->info['cc_number']))) { ?> <tr> <td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td> <td class="main"><?php echo $order->info['cc_type']; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td> <td class="main"><?php echo $order->info['cc_owner']; ?></td> </tr> <?php // BMC CC Mod Start if ($order->info['cc_number'] != '0000000000000000') { if (strtolower(CC_ENC) == 'true') { $cipher_data = $order->info['cc_number']; $order->info['cc_number'] = changedataout($cipher_data, CC_KEYCHAIN); } } // BMC CC Mod End ?> <tr> <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td> <td class="main"><?php echo $order->info['cc_number']; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CREDIT_CARD_CVV; ?></td> <td class="main"><?php echo $order->info['cc_cvv']; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td> <td class="main"><?php echo $order->info['cc_expires']; ?></td> </tr> <?php } // begin modification for banktransfer $banktransfer_query = xtc_db_query("select banktransfer_prz, banktransfer_status, banktransfer_owner, banktransfer_number, banktransfer_bankname, banktransfer_blz, banktransfer_fax from banktransfer where orders_id = '".xtc_db_input($_GET['oID'])."'"); $banktransfer = xtc_db_fetch_array($banktransfer_query); if (($banktransfer['banktransfer_bankname']) || ($banktransfer['banktransfer_blz']) || ($banktransfer['banktransfer_number'])) { ?> <tr> <td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_BANK_NAME; ?></td> <td class="main"><?php echo $banktransfer['banktransfer_bankname']; ?></td> </tr> <tr> <td class="main"><?php echo TEXT_BANK_BLZ; ?></td> <td class="main"><?php echo $banktransfer['banktransfer_blz']; ?></td> </tr> <tr> <td class="main"><?php echo TEXT_BANK_NUMBER; ?></td> <td class="main"><?php echo $banktransfer['banktransfer_number']; ?></td> </tr> <tr> <td class="main"><?php echo TEXT_BANK_OWNER; ?></td> <td class="main"><?php echo $banktransfer['banktransfer_owner']; ?></td> </tr> <?php if ($banktransfer['banktransfer_status'] == 0) { ?> <tr> <td class="main"><?php echo TEXT_BANK_STATUS; ?></td> <td class="main"><?php echo "OK"; ?></td> </tr> <?php } else { ?> <tr> <td class="main"><?php echo TEXT_BANK_STATUS; ?></td> <td class="main"><?php echo $banktransfer['banktransfer_status']; ?></td> </tr> <?php switch ($banktransfer['banktransfer_status']) { case 1 : $error_val = TEXT_BANK_ERROR_1; break; case 2 : $error_val = TEXT_BANK_ERROR_2; break; case 3 : $error_val = TEXT_BANK_ERROR_3; break; case 4 : $error_val = TEXT_BANK_ERROR_4; break; case 5 : $error_val = TEXT_BANK_ERROR_5; break; case 8 : $error_val = TEXT_BANK_ERROR_8; break; case 9 : $error_val = TEXT_BANK_ERROR_9; break; } ?> <tr> <td class="main"><?php echo TEXT_BANK_ERRORCODE; ?></td> <td class="main"><?php echo $error_val; ?></td> </tr> <tr> <td class="main"><?php echo TEXT_BANK_PRZ; ?></td> <td class="main"><?php echo $banktransfer['banktransfer_prz']; ?></td> </tr> <?php } } if ($banktransfer['banktransfer_fax']) { ?> <tr> <td class="main"><?php echo TEXT_BANK_FAX; ?></td> <td class="main"><?php echo $banktransfer['banktransfer_fax']; ?></td> </tr> <?php } // end modification for banktransfer if ($order->info['payment_method'] == 'luupws') include( DIR_FS_CATALOG.DIR_WS_INCLUDES.'nusoap/luup_orders.php' ); if ($order->info['payment_method'] == 'amoneybookers') { if (file_exists(DIR_FS_CATALOG.DIR_WS_MODULES.'payment/'.$order->info['payment_method'].'.php')) { include(DIR_FS_CATALOG.DIR_WS_MODULES.'payment/'.$order->info['payment_method'].'.php'); include(DIR_FS_CATALOG.'lang/'.$order->info['language'].'/modules/payment/'.$order->info['payment_method'].'.php'); $class = $order->info['payment_method']; $payment = new $class(); $payment->admin_order($_GET['oID']); } } ?> </table></td> </tr> <tr> <td><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td> <?php if ($order->products[0]['allow_tax'] == 1) { ?> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td> <?php } ?> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; if ($order->products[$i]['allow_tax'] == 1) { echo ' (excl.)'; } ?></td> </tr> <?php for ($i = 0, $n = sizeof($order->products); $i < $n; $i ++) { echo ' <tr class="dataTableRow">'."\n".' <td class="dataTableContent" valign="top" align="right">'.$order->products[$i]['qty'].' x </td>'."\n".' <td class="dataTableContent" valign="top">'.$order->products[$i]['name']; if (sizeof($order->products[$i]['attributes']) > 0) { for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j ++) { echo '<br /><nobr><small> <i> - '.$order->products[$i]['attributes'][$j]['option'].': '.$order->products[$i]['attributes'][$j]['value'].': '; } echo '</i></small></nobr>'; } echo ' </td>'."\n".' <td class="dataTableContent" valign="top">'; if ($order->products[$i]['model'] != '') { echo $order->products[$i]['model']; } else { echo '<br />'; } // attribute models if (sizeof($order->products[$i]['attributes']) > 0) { for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j ++) { $model = xtc_get_attributes_model($order->products[$i]['id'], $order->products[$i]['attributes'][$j]['value'],$order->products[$i]['attributes'][$j]['option']); if ($model != '') { echo $model.'<br />'; } else { echo '<br />'; } } } echo ' </td>'."\n".' <td class="dataTableContent" align="right" valign="top">'.format_price($order->products[$i]['final_price'] / $order->products[$i]['qty'], 1, $order->info['currency'], $order->products[$i]['allow_tax'], $order->products[$i]['tax']).'</td>'."\n"; if ($order->products[$i]['allow_tax'] == 1) { echo '<td class="dataTableContent" align="right" valign="top">'; echo xtc_display_tax_value($order->products[$i]['tax']).'%'; echo '</td>'."\n"; echo '<td class="dataTableContent" align="right" valign="top"><b>'; echo format_price($order->products[$i]['final_price'] / $order->products[$i]['qty'], 1, $order->info['currency'], 0, 0); echo '</b></td>'."\n"; } echo ' <td class="dataTableContent" align="right" valign="top"><b>'.format_price(($order->products[$i]['final_price']), 1, $order->info['currency'], 0, 0).'</b></td>'."\n"; echo ' </tr>'."\n"; } ?> <tr> <td align="right" colspan="10"><table border="0" cellspacing="0" cellpadding="2"> <?php for ($i = 0, $n = sizeof($order->totals); $i < $n; $i ++) { echo ' <tr>'."\n".' <td align="right" class="smallText">'.$order->totals[$i]['title'].'</td>'."\n".' <td align="right" class="smallText">'.$order->totals[$i]['text'].'</td>'."\n".' </tr>'."\n"; } ?> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><table border="1" cellspacing="0" cellpadding="5"> <tr> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> </tr> <?php $orders_history_query = xtc_db_query("select orders_status_id, date_added, customer_notified, comments from ".TABLE_ORDERS_STATUS_HISTORY." where orders_id = '".xtc_db_input($oID)."' order by date_added"); if (xtc_db_num_rows($orders_history_query)) { while ($orders_history = xtc_db_fetch_array($orders_history_query)) { echo ' <tr>'."\n".' <td class="smallText" align="center">'.xtc_datetime_short($orders_history['date_added']).'</td>'."\n".' <td class="smallText" align="center">'; if ($orders_history['customer_notified'] == '1') { echo xtc_image(DIR_WS_ICONS.'tick.gif', ICON_TICK)."</td>\n"; } else { echo xtc_image(DIR_WS_ICONS.'cross.gif', ICON_CROSS)."</td>\n"; } echo ' <td class="smallText">'; if($orders_history['orders_status_id']!='0') { echo $orders_status_array[$orders_history['orders_status_id']]; }else{ echo '<font color="#FF0000">'.TEXT_VALIDATING.'</font>'; } echo '</td>'."\n".' <td class="smallText">'.nl2br(xtc_db_output($orders_history['comments'])).' </td>'."\n".' </tr>'."\n"; } } else { echo ' <tr>'."\n".' <td class="smallText" colspan="5">'.TEXT_NO_ORDER_HISTORY.'</td>'."\n".' </tr>'."\n"; } ?> </table></td> </tr> <tr> <td class="main"><br /><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> </tr> <tr> <td><?php echo xtc_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr><?php echo xtc_draw_form('status', FILENAME_ORDERS, xtc_get_all_get_params(array('action')) . 'action=update_order'); ?> <td class="main"><?php echo xtc_draw_textarea_field('comments', 'soft', '60', '5', $order->info['comments']); ?></td> </tr> <tr> <td><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td><table border="0" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo xtc_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td> </tr> <tr> <td class="main"><b><?php echo 'DHL-Deutschland Tracking Nummer:'; ?></b> <?php echo xtc_draw_input_field('dhl_tracking_id', $order->info['dhl_tracking_id'] ); ?></td> </tr> <tr> <td class="main"><b><?php echo 'DPD Tracking Nummer:'; ?></b> <?php echo xtc_draw_input_field('dpd_tracking_id', $order->info['dpd_tracking_id'] ); ?></td> </tr> <tr> <td class="main"><b><?php echo 'UPS Tracking Nummer:'; ?></b> <?php echo xtc_draw_input_field('ups_tracking_id', $order->info['ups_tracking_id'] ); ?></td> </tr> <tr> <td class="main"><b><?php echo 'Schweizerische Post Tracking Nr.:'; ?></b> <?php echo xtc_draw_input_field('chp_tracking_id', $order->info['chp_tracking_id'] ); ?></td> </tr> <tr> <td class="main"><b><?php echo 'GLS Tracking Nummer:'; ?></b> <?php echo xtc_draw_input_field('gls_tracking_id', $order->info['gls_tracking_id'] ); ?></td> </tr> <tr> <td class="main"><b><?php echo 'Hermes Tracking Nummer:'; ?></b> <?php echo xtc_draw_input_field('hlg_tracking_id', $order->info['hlg_tracking_id'] ); ?></td> </tr> <tr> <td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo xtc_draw_checkbox_field('notify', '', true); ?></td> <td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo xtc_draw_checkbox_field('notify_comments', '', true); ?></td> </tr> </table></td> <td valign="top"><input type="submit" class="button" value="<?php echo BUTTON_UPDATE; ?>"></td> </tr> </table></td> </form></tr> <tr> <td colspan="2" align="right"> <?php if (ACTIVATE_GIFT_SYSTEM == 'true') { echo '<a class="button" href="'.xtc_href_link(FILENAME_GV_MAIL, xtc_get_all_get_params(array ('cID', 'action')).'cID='.$order->customer['ID']).'">'.BUTTON_SEND_COUPON.'</a>'; } ?> <a class="button" href="javascript:void()" onClick="window.open('<?php echo xtc_href_link(FILENAME_PRINT_ORDER,'oID='.$_GET['oID']); ?>', 'popup', 'toolbar=0, width=640, height=600')"><?php echo BUTTON_INVOICE; ?></a> <a class="button" href="javascript:void()" onClick="window.open('<?php echo xtc_href_link(FILENAME_PRINT_PACKINGSLIP,'oID='.$_GET['oID']); ?>', 'popup', 'toolbar=0, width=640, height=600')"><?php echo BUTTON_PACKINGSLIP; ?></a> <!-- BMC Delete CC Info --> <a class="button" href="<?php echo xtc_href_link(FILENAME_ORDERS, 'oID='.$_GET['oID'].'&action=deleteccinfo').'">'.BUTTON_REMOVE_CC_INFO;?></a> <a class="button" href="<?php echo xtc_href_link(FILENAME_ORDERS, 'page='.$_GET['page'].'&oID='.$_GET['oID']).'">'.BUTTON_BACK;?></a> </td> </tr> <?php } elseif ($_GET['action'] == 'custom_action') { include ('orders_actions.php'); } else { ?> <tr> <td width="100%"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="80" rowspan="2"><?php echo xtc_image(DIR_WS_ICONS.'heading_customers.gif'); ?></td> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"> <?php echo xtc_draw_form('orders', FILENAME_ORDERS, '', 'get'); ?> <?php echo HEADING_TITLE_SEARCH . ' ' . xtc_draw_input_field('oID', '', 'size="12"') . xtc_draw_hidden_field('action', 'edit').xtc_draw_hidden_field(xtc_session_name(), xtc_session_id()); ?> </form> </td> </tr> <tr> <td class="main" valign="top">XT Customers</td> <td class="main" valign="top" align="right"><?php echo xtc_draw_form('status', FILENAME_ORDERS, '', 'get'); ?> <?php echo HEADING_TITLE_STATUS . ' ' . xtc_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)),array(array('id' => '0', 'text' => TEXT_VALIDATING)), $orders_statuses), '', 'onChange="this.form.submit();"').xtc_draw_hidden_field(xtc_session_name(), xtc_session_id()); ?> </form></td> </tr> </table> </td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo 'Nr'; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td> <?php if (AFTERBUY_ACTIVATED=='true') { ?> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_AFTERBUY; ?></td> <?php } ?> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <?php if ($_GET['cID']) { $cID = xtc_db_prepare_input($_GET['cID']); $orders_query_raw = "select o.orders_id, o.afterbuy_success, o.afterbuy_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.orders_status, s.orders_status_name, ot.text as order_total from ((".TABLE_ORDERS." o left join ".TABLE_ORDERS_TOTAL." ot on (o.orders_id = ot.orders_id), ".TABLE_ORDERS_STATUS." s where o.customers_id = '".xtc_db_input($cID)."' and (o.orders_status = s.orders_status_id and s.language_id = '".$_SESSION['languages_id']."' and ot.class = 'ot_total') or (o.orders_status = '0' and ot.class = 'ot_total' and s.orders_status_id = '1' and s.language_id = '".$_SESSION['languages_id']."') order by orders_id DESC"; } elseif ($_GET['status']=='0') { $orders_query_raw = "select o.orders_id, o.afterbuy_success, o.afterbuy_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.orders_status, ot.text as order_total, o.delivery_postcode, o.dhl_tracking_id, o.dpd_tracking_id, o.ups_tracking_id, o.chp_tracking_id, o.gls_tracking_id, o.hlg_tracking_id from ((".TABLE_ORDERS." o left join ".TABLE_ORDERS_TOTAL." ot on (o.orders_id = ot.orders_id) where o.orders_status = '0' and ot.class = 'ot_total' order by o.orders_id DESC"; } elseif ($_GET['status']) { $status = xtc_db_prepare_input($_GET['status']); $orders_query_raw = "select o.orders_id, o.afterbuy_success, o.afterbuy_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, o.delivery_postcode, o.dhl_tracking_id, o.dpd_tracking_id, o.ups_tracking_id, o.chp_tracking_id, o.gls_tracking_id, o.hlg_tracking_id from ((".TABLE_ORDERS." o left join ".TABLE_ORDERS_TOTAL." ot on (o.orders_id = ot.orders_id), ".TABLE_ORDERS_STATUS." s where o.orders_status = s.orders_status_id and s.language_id = '".$_SESSION['languages_id']."' and s.orders_status_id = '".xtc_db_input($status)."' and ot.class = 'ot_total' order by o.orders_id DESC"; } else { $orders_query_raw = "select o.orders_id, o.orders_status, o.afterbuy_success, o.afterbuy_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, o.delivery_postcode, o.dhl_tracking_id, o.dpd_tracking_id, o.ups_tracking_id, o.chp_tracking_id, o.gls_tracking_id, o.hlg_tracking_id from ((".TABLE_ORDERS." o left join ".TABLE_ORDERS_TOTAL." ot on (o.orders_id = ot.orders_id), ".TABLE_ORDERS_STATUS." s where (o.orders_status = s.orders_status_id and s.language_id = '".$_SESSION['languages_id']."' and ot.class = 'ot_total') or (o.orders_status = '0' and ot.class = 'ot_total' and s.orders_status_id = '1' and s.language_id = '".$_SESSION['languages_id']."') order by o.orders_id DESC"; } $orders_split = new splitPageResults($_GET['page'], '20', $orders_query_raw, $orders_query_numrows); $orders_query = xtc_db_query($orders_query_raw); while ($orders = xtc_db_fetch_array($orders_query)) { if (((!$_GET['oID']) || ($_GET['oID'] == $orders['orders_id'])) && (!$oInfo)) { $oInfo = new objectInfo($orders); } if ((is_object($oInfo)) && ($orders['orders_id'] == $oInfo->orders_id)) { echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\''.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=edit').'\'">'."\n"; } else { echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\''.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID')).'oID='.$orders['orders_id']).'\'">'."\n"; } ?> <td class="dataTableContent"><?php echo '<a href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . xtc_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $orders['customers_name']; ?></td> <td class="dataTableContent" align="right"><?php echo $orders['orders_id']; ?></td> <td class="dataTableContent" align="right"><?php echo strip_tags($orders['order_total']); ?></td> <td class="dataTableContent" align="center"><?php echo xtc_datetime_short($orders['date_purchased']); ?></td> <td class="dataTableContent" align="right"><?php if($orders['orders_status']!='0') { echo $orders['orders_status_name']; }else{ echo '<font color="#FF0000">'.TEXT_VALIDATING.'</font>';}?></td> <?php if (AFTERBUY_ACTIVATED=='true') { ?> <td class="dataTableContent" align="right"><?php if ($orders['afterbuy_success'] == 1) { echo $orders['afterbuy_id']; } else { echo 'TRANSMISSION_ERROR'; } ?></td> <?php } ?> <td class="dataTableContent" align="right"><?php if ( (is_object($oInfo)) && ($orders['orders_id'] == $oInfo->orders_id) ) { echo xtc_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . xtc_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td> </tr> <?php } ?> <tr> <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, '20', $_GET['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td> <td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, '20', MAX_DISPLAY_PAGE_LINKS, $_GET['page'], xtc_get_all_get_params(array('page', 'oID', 'action'))); ?></td> </tr> </table></td> </tr> </table></td> <?php $heading = array (); $contents = array (); switch ($_GET['action']) { case 'delete' : $heading[] = array ('text' => '<b>'.TEXT_INFO_HEADING_DELETE_ORDER.'</b>'); $contents = array ('form' => xtc_draw_form('orders', FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=deleteconfirm')); $contents[] = array ('text' => TEXT_INFO_DELETE_INTRO.'<br /><br /><b>'.$cInfo->customers_firstname.' '.$cInfo->customers_lastname.'</b>'); $contents[] = array ('text' => '<br />'.xtc_draw_checkbox_field('restock').' '.TEXT_INFO_RESTOCK_PRODUCT_QUANTITY); $contents[] = array ('align' => 'center', 'text' => '<br /><input type="submit" class="button" value="'. BUTTON_DELETE .'"><a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id).'">' . BUTTON_CANCEL . '</a>'); break; default : if (is_object($oInfo)) { $heading[] = array ('text' => '<b>['.$oInfo->orders_id.'] '.xtc_datetime_short($oInfo->date_purchased).'</b>'); $contents[] = array ('align' => 'center', 'text' => '<a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=edit').'">'.BUTTON_EDIT.'</a> <a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=delete').'">'.BUTTON_DELETE.'</a>'); if (AFTERBUY_ACTIVATED == 'true') { $contents[] = array ('align' => 'center', 'text' => '<a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=afterbuy_send').'">'.BUTTON_AFTERBUY_SEND.'</a>'); } //$contents[] = array('align' => 'center', 'text' => ''); $contents[] = array ('text' => '<br />'.TEXT_DATE_ORDER_CREATED.' '.xtc_date_short($oInfo->date_purchased)); if ($oInfo->dhl_tracking_id == 0) $contents[] = array ('text' => '<br /> DHL Nr.: <strong>Nicht zugeordnet</strong>'); else $contents[] = array ('text' => '<br /> DHL Nr.: <a class="button" href="http://nolp.dhl.de/nextt-online-public/set_identcodes.do?lang=de&idc=' . $oInfo->dhl_tracking_id . '&submit=&zip='.$oInfo->delivery_postcode.'">'.$oInfo->dhl_tracking_id.'</a>'); if ($oInfo->dpd_tracking_id == 0) $contents[] = array ('text' => '<br /> DPD Nr.: <strong>Nicht zugeordnet</strong>'); else $contents[] = array ('text' => '<br /> DPD Nr.: <a class="button" href="http://extranet.dpd.de/cgi-bin/delistrack?typ=1〈=de&pknr=' . $oInfo->dpd_tracking_id . '&submit=" target="_blank">'.$oInfo->dpd_tracking_id.'</a>'); if ($oInfo->ups_tracking_id == 0) $contents[] = array ('text' => '<br /> UPS Nr.: <strong>Nicht zugeordnet</strong>'); else $contents[] = array ('text' => '<br /> UPS Nr.: <a class="button" href="http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&Requester=UPSHome&error_carried=true&tracknums_displayed=5&TypeOfInquiryNumber=T&loc=de_DE&InquiryNumber1=' . $oInfo->ups_tracking_id . '&InquiryNumber2=&InquiryNumber3=&InquiryNumber4=&InquiryNumber5=&AgreeToTermsAndConditions=yes&track.x=72&track.y=9" target="_blank">'.$oInfo->dpd_tracking_id.'</a>'); if ($oInfo->chp_tracking_id == 0) $contents[] = array ('text' => '<br /> CH-Post Nr.: <strong>Nicht zugeordnet</strong>'); else $contents[] = array ('text' => '<br /> CH-Post Nr.: <a class="button" href="http://www.post.ch/swisspost-tracking?formattedParcelCodes=' . $oInfo->chp_tracking_id . '&submit=" target="_blank">'.$oInfo->chp_tracking_id.'</a>'); if ($oInfo->gls_tracking_id == 0) $contents[] = array ('text' => '<br /> GLS Nr.: <strong>Nicht zugeordnet</strong>'); else $contents[] = array ('text' => '<br /> GLS Nr.: <a class="button" href="http://www.gls-germany.com/online/paketstatus.php3?paketliste[0]=' . $oInfo->gls_tracking_id . '" target="_blank">'.$oInfo->gls_tracking_id.'</a>'); if ($oInfo->hlg_tracking_id == 0) $contents[] = array ('text' => '<br /> Hermes Nr.: <strong>Nicht zugeordnet</strong>'); else $contents[] = array ('text' => '<br /> Hermes Nr.: <a class="button" href="http://tracking.hlg.de/Tracking.jsp?TrackID=' . $oInfo->hlg_tracking_id . '" target="_blank">'.$oInfo->hlg_tracking_id.'</a>'); if (xtc_not_null($oInfo->last_modified)) $contents[] = array ('text' => TEXT_DATE_ORDER_LAST_MODIFIED.' '.xtc_date_short($oInfo->last_modified)); $contents[] = array ('text' => '<br />'.TEXT_INFO_PAYMENT_METHOD.' '.$oInfo->payment_method); // elari added to display product list for selected order $order = new order($oInfo->orders_id); $contents[] = array ('text' => '<br /><br />'.sizeof($order->products).' Products '); for ($i = 0; $i < sizeof($order->products); $i ++) { $contents[] = array ('text' => $order->products[$i]['qty'].' x'.$order->products[$i]['name']); if (sizeof($order->products[$i]['attributes']) > 0) { for ($j = 0; $j < sizeof($order->products[$i]['attributes']); $j ++) { $contents[] = array ('text' => '<small> <i> - '.$order->products[$i]['attributes'][$j]['option'].': '.$order->products[$i]['attributes'][$j]['value'].'</i></small></nobr>'); } } } // elari End add display products } break; } if ((xtc_not_null($heading)) && (xtc_not_null($contents))) { echo ' <td width="25%" valign="top">'."\n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>'."\n"; } ?> </tr> </table></td> </tr> <?php } ?> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require (DIR_WS_INCLUDES.'footer.php'); ?> <!-- footer_eof //--> <br /> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>[/php] Link to comment Share on other sites More sharing options...
Philipp Posted November 9, 2008 Report Share Posted November 9, 2008 [COLOR=#000000][B]1054 - Unknown column 'p.products_id' in 'on clause' select p.products_fsk18, p.products_shippingtime, p.products_model, p.products_ean, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_vpe, p.products_vpe_status, p.products_vpe_value, p.products_discount_allowed, p.products_tax_class_id from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '2' and p2c.categories_id = '1' ORDER BY p.products_price ASC [COLOR=#ff0000][XT SQL Error][/COLOR] [/B][/COLOR]Und nun? Der Shop ist gerade frisch installiert. Erste Kategorie angelegt und dann sowas wenn ich auf die Kategorie klicken will Link to comment Share on other sites More sharing options...
artep0123 Posted February 15, 2009 Report Share Posted February 15, 2009 Habe diesem Fehler wenn ich im Bestellvorgang die AGB angeklickt habe und auf weiter klicke: 1054 - Unknown column 'c.group_permission_3' in 'where clause' SELECT content_title, content_heading, content_text, content_file FROM content_manager WHERE content_group='3' and c.group_permission_3=1 AND languages_id='2' [XT SQL Error] Alles wird richtig im Shop angezeigt, nur beim letzten Schritt kommt der Fehler. Habt Ihr für dieses Phänomen auch eine Lösung parat??? Weiß nicht wo das herkommt!!! Ich würde mich riesig freuen! System: xt:Commerce v3.0.4 SP2.1 Link to comment Share on other sites More sharing options...
rubaff Posted February 24, 2009 Report Share Posted February 24, 2009 ich arbeite noch mit 2.irgendwas..., hier deine bereinigte default.php, Dietolino, vermutlich aus Version 3.?.?., übernehme keine Gewähr, da ich's nicht testen konnte. Die Änderungen beziehen sich auf folgende Teile: from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join[/php]Zwischen [b][i]from[/i][/b] und [b][i]left join[/i][/b] müssen ab MySql 5 Klammern gesetzt werden. Dieser Teil kommt im Script 4 mal so oder so ähnlich vor. Hier die komplette Datei: [php]<?php /* ----------------------------------------------------------------------------------------- $Id: default.php,v 1.28 2004/05/08 18:13:41 fanta2k Exp $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce(default.php,v 1.84 2003/05/07); www.oscommerce.com (c) 2003 nextcommerce (default.php,v 1.11 2003/08/22); www.nextcommerce.org Released under the GNU General Public License ----------------------------------------------------------------------------------------- Third Party contributions: Enable_Disable_Categories 1.3 Autor: Mikel Williams | [email protected] Customers Status v3.x (c) 2002-2003 Copyright Elari [email protected] | www.unlockgsm.com/dload-osc/ | CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ $default_smarty = new smarty; $default_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/'); $default_smarty->assign('session',session_id()); $main_content = ''; // include needed functions require_once(DIR_FS_INC . 'xtc_customer_greeting.inc.php'); require_once(DIR_FS_INC . 'xtc_get_path.inc.php'); require_once(DIR_FS_INC . 'xtc_draw_hidden_field.inc.php'); require_once(DIR_FS_INC . 'xtc_check_categories_status.inc.php'); require_once(DIR_FS_INC . 'xtc_image_button.inc.php'); if (xtc_check_categories_status($current_category_id)>=1) { $error=CATEGORIE_NOT_FOUND; include(DIR_WS_MODULES . FILENAME_ERROR_HANDLER); } else { if ($category_depth == 'nested') { if (GROUP_CHECK=='true') { $group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $category_query = "select cd.categories_description, cd.categories_name, cd.categories_heading_title, c.categories_template, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' ".$group_check." and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'"; $category_query = xtDBquery($category_query); $category = xtc_db_fetch_array(&$category_query,true); if (isset($cPath) && ereg('_', $cPath)) { // check to see if there are deeper categories within the current category $category_links = array_reverse($cPath_array); for($i = 0, $n = sizeof($category_links); $i < $n; $i++) { if (GROUP_CHECK=='true') { $group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $categories_query = "select cd.categories_description, c.categories_id, cd.categories_name, cd.categories_heading_title, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.parent_id = '" . $category_links[$i] . "' and c.categories_id = cd.categories_id ".$group_check." and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' order by sort_order, cd.categories_name"; $categories_query = xtDBquery($categories_query); if (xtc_db_num_rows(&$categories_query,true) < 1) { // do nothing, go through the loop } else { break; // we've found the deepest category the customer is in } } } else { if (GROUP_CHECK=='true') { $group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $categories_query = "select cd.categories_description, c.categories_id, cd.categories_name, cd.categories_heading_title, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id ".$group_check." and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' order by sort_order, cd.categories_name"; $categories_query = xtDBquery($categories_query); } $rows = 0; while ($categories = xtc_db_fetch_array(&$categories_query,true)) { $rows++; $cPath_new = xtc_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; $image=''; if ($categories['categories_image']!='') { $image=DIR_WS_IMAGES.'categories/'.$categories['categories_image']; } $SEF_parameter=''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') $SEF_parameter='&category='.xtc_cleanName($categories['categories_name']); $categories_content[]=array( 'CATEGORIES_NAME' => $categories['categories_name'], 'CATEGORIES_HEADING_TITLE' => $categories['categories_heading_title'], 'CATEGORIES_IMAGE' => $image, 'CATEGORIES_LINK' => xtc_href_link(FILENAME_DEFAULT, $cPath_new.$SEF_parameter), 'CATEGORIES_DESCRIPTION' => $categories['categories_description']); } $new_products_category_id = $current_category_id; include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); $image=''; if ($category['categories_image']!='') { $image=DIR_WS_IMAGES.'categories/'.$category['categories_image']; } $default_smarty->assign('CATEGORIES_NAME',$category['categories_name']); $default_smarty->assign('CATEGORIES_HEADING_TITLE',$category['categories_heading_title']); $default_smarty->assign('CATEGORIES_IMAGE',$image); $default_smarty->assign('CATEGORIES_DESCRIPTION',$category['categories_description']); $default_smarty->assign('language', $_SESSION['language']); $default_smarty->assign('module_content',$categories_content); // get default template if ($category['categories_template']=='' or $category['categories_template']=='default') { $files=array(); if ($dir= opendir(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/categorie_listing/')){ while (($file = readdir($dir)) !==false) { if (is_file( DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/categorie_listing/'.$file) and ($file !="index.html")){ $files[]=array( 'id' => $file, 'text' => $file); }//if } // while closedir($dir); } $category['categories_template']=$files[0]['id']; } $default_smarty->caching = 0; $main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/categorie_listing/'.$category['categories_template']); $smarty->assign('main_content',$main_content); } elseif ($category_depth == 'products' || $_GET['manufacturers_id']) { //fsk18 lock $fsk_lock=''; if ($_SESSION['customers_status']['customers_fsk18_display']=='0') { $fsk_lock=' and p.products_fsk18!=1'; } // show the products of a specified manufacturer if (isset($_GET['manufacturers_id'])) { if (isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) { // sorting query $sorting_query=xtc_db_query("SELECT products_sorting, products_sorting2 FROM ". TABLE_CATEGORIES." where categories_id='".(int)$_GET['filter_id']."'"); $sorting_data=xtc_db_fetch_array($sorting_query); if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name'; $sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' '; // We are asked to show only a specific category if (GROUP_CHECK=='true') { $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $listing_sql = "select DISTINCT p.products_fsk18, p.products_shippingtime, p.products_model, pd.products_name, p.products_ean, p.products_price, p.products_tax_class_id, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id ".$group_check." ".$fsk_lock." and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock." and p2c.categories_id = '" . (int)$_GET['filter_id'] . "'".$sorting; } else { // We show them all if (GROUP_CHECK=='true') { $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $listing_sql = "select p.products_fsk18, p.products_shippingtime, p.products_model, p.products_ean, pd.products_name, p.products_id, p.products_price, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.manufacturers_id, p.products_discount_allowed, p.products_tax_class_id from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id ".$group_check." ".$fsk_lock." and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.manufacturers_id = m.manufacturers_id ".$fsk_lock." and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'"; } } else { // show the products in a given categorie if (isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) { // sorting query $sorting_query=xtc_db_query("SELECT products_sorting, products_sorting2 FROM ". TABLE_CATEGORIES." where categories_id='".$current_category_id."'"); $sorting_data=xtc_db_fetch_array($sorting_query); if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name'; $sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' '; // We are asked to show only specific catgeory if (GROUP_CHECK=='true') { $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $listing_sql = "select p.products_fsk18, p.products_shippingtime, p.products_model, p.products_ean, pd.products_name, p.products_id, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id ".$group_check." ".$fsk_lock." and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock." and p2c.categories_id = '" . $current_category_id . "'".$sorting; } else { // sorting query $sorting_query=xtc_db_query("SELECT products_sorting, products_sorting2 FROM ". TABLE_CATEGORIES." where categories_id='".$current_category_id."'"); $sorting_data=xtc_db_fetch_array($sorting_query); if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name'; $sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' '; // We show them all if (GROUP_CHECK=='true') { $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $listing_sql = "select p.products_fsk18, p.products_shippingtime, p.products_model, p.products_ean, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id from ((" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id ".$group_check." ".$fsk_lock." and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock." and p2c.categories_id = '" . $current_category_id . "'".$sorting; } } // optional Product List Filter if (PRODUCT_LIST_FILTER > 0) { if (isset($_GET['manufacturers_id'])) { $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' order by cd.categories_name"; } else { $filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by m.manufacturers_name"; } $filterlist_query = xtDBquery($filterlist_sql); if (xtc_db_num_rows(&$filterlist_query,true) > 1) { $manufacturer_dropdown= xtc_draw_form('filter', FILENAME_DEFAULT, 'get'); if (isset($_GET['manufacturers_id'])) { $manufacturer_dropdown.= xtc_draw_hidden_field('manufacturers_id', $_GET['manufacturers_id']); $options = array(array('text' => TEXT_ALL_CATEGORIES)); } else { $manufacturer_dropdown.= xtc_draw_hidden_field('cPath', $cPath); $options = array(array('text' => TEXT_ALL_MANUFACTURERS)); } $manufacturer_dropdown.= xtc_draw_hidden_field('sort', $_GET['sort']); $manufacturer_dropdown.= xtc_draw_hidden_field(xtc_session_name(), xtc_session_id()); while ($filterlist = xtc_db_fetch_array(&$filterlist_query,true)) { $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']); } $manufacturer_dropdown.= xtc_draw_pull_down_menu('filter_id', $options, $_GET['filter_id'], 'onchange="this.form.submit()"'); $manufacturer_dropdown.= '</form>' . "\n"; } } // Get the right image for the top-right $image = DIR_WS_IMAGES . 'table_background_list.gif'; if (isset($_GET['manufacturers_id'])) { $image = xtc_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'"); $image = xtc_db_fetch_array($image); $image = $image['manufacturers_image']; } elseif ($current_category_id) { $image = xtc_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . $current_category_id . "'"); $image = xtc_db_fetch_array($image); $image = $image['categories_image']; } include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); } else { // default page if (GROUP_CHECK=='true') { $group_check="and group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; } $shop_content_query=xtc_db_query("SELECT content_title, content_heading, content_text, content_file FROM ".TABLE_CONTENT_MANAGER." WHERE content_group='5' ".$group_check." AND languages_id='".$_SESSION['languages_id']."'"); $shop_content_data=xtc_db_fetch_array($shop_content_query); $default_smarty->assign('title',$shop_content_data['content_heading']); include(DIR_WS_INCLUDES . FILENAME_CENTER_MODULES); if ($shop_content_data['content_file']!=''){ ob_start(); if (strpos($shop_content_data['content_file'],'.txt')) echo '<pre>'; include(DIR_FS_CATALOG.'media/content/'.$shop_content_data['content_file']); if (strpos($shop_content_data['content_file'],'.txt')) echo '</pre>'; $shop_content_data['content_text']=ob_get_contents(); ob_end_clean(); } $default_smarty->assign('text',str_replace('{$greeting}',xtc_customer_greeting(),$shop_content_data['content_text'])); $default_smarty->assign('language', $_SESSION['language']); // set cache ID if (USE_CACHE=='false') { $default_smarty->caching = 0; $main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html'); } else { $default_smarty->caching = 1; $default_smarty->cache_lifetime=CACHE_LIFETIME; $default_smarty->cache_modified_check=CACHE_CHECK; $cache_id = $_SESSION['language'].$_SESSION['currency'].$_SESSION['customer_id']; $main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html',$cache_id); } $smarty->assign('main_content',$main_content); } } ?>Viel Erfolg! Danke an stutzi für diesen Code, nun läuft mein Shop nach fast 6 stündiger Rumprobiererei wieder! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.