♥stubbsy Posted August 9, 2007 Share Posted August 9, 2007 (edited) Hello All, I think this is a great contribution, I've been using it for a while now, but I would like to add a new column to it and wondered if anyone could help? I'm using a contribution allowing me to add vendor information against each product and I would like to have an additional column in this contribution with a dropdown menu listing all my vendors to allow me to select/change the vendor for each product. The contribution I'm using is http://www.oscommerce.com/community/contri...l/search,vendor and basically it adds an additional field in the products table into which the product ID is listed Could anyone help me with this? Thanks Dave Edited August 9, 2007 by stubbsy Quote Link to comment Share on other sites More sharing options...
Thenes Posted August 10, 2007 Share Posted August 10, 2007 Hi Joe, Sorry I haven't replied sooner. I compared the files earlier this week - unfortunately I didn't find any errors or discrepancies. I'm including the file that I'm using, just in case you want to try it out. Are you using any other contributions? Sometimes contributions & modifications can conflict with each other. <?php /* $Id: quick_updates.php 2005/09/14 13:55:34 HRB Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Based on the original script contributed by Burt ([email protected]) and by Henri Bredehoeft ([email protected]) Changelog: by Infobroker [email protected] Copyright (c) 2002 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); ($row_by_page) ? define('MAX_DISPLAY_ROW_BY_PAGE' , $row_by_page ) : $row_by_page = MAX_DISPLAY_SEARCH_RESULTS; define('MAX_DISPLAY_ROW_BY_PAGE' , MAX_DISPLAY_SEARCH_RESULTS ); //// Tax Row $tax_class_array = array(array('id' => '0', 'text' => NO_TAX_TEXT)); $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title"); while ($tax_class = tep_db_fetch_array($tax_class_query)) { $tax_class_array[] = array('id' => $tax_class['tax_class_id'], 'text' => $tax_class['tax_class_title']); } ////Info Row pour le champ fabriquant $manufacturers_array = array(array('id' => '0', 'text' => NO_MANUFACTURER)); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } // Display the list of the manufacturers function manufacturers_list(){ global $manufacturer; $manufacturers_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m order by m.manufacturers_name ASC"); $return_string = '<select name="manufacturer" onChange="this.form.submit();">'; $return_string .= '<option value="' . 0 . '">' . TEXT_ALL_MANUFACTURERS . '</option>'; while($manufacturers = tep_db_fetch_array($manufacturers_query)){ $return_string .= '<option value="' . $manufacturers['manufacturers_id'] . '"'; if($manufacturer && $manufacturers['manufacturers_id'] == $manufacturer) $return_string .= ' SELECTED'; $return_string .= '>' . $manufacturers['manufacturers_name'] . '</option>'; } $return_string .= '</select>'; return $return_string; } ##// Uptade database switch ($HTTP_GET_VARS['action']) { case 'update' : $count_update=0; $item_updated = array(); if($HTTP_POST_VARS['product_new_model']){ foreach($HTTP_POST_VARS['product_new_model'] as $id => $new_model) { if (trim($HTTP_POST_VARS['product_new_model'][$id]) != trim($HTTP_POST_VARS['product_old_model'][$id])) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_model='" . $new_model . "', products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_name']){ foreach($HTTP_POST_VARS['product_new_name'] as $id => $new_name) { if (trim($HTTP_POST_VARS['product_new_name'][$id]) != trim($HTTP_POST_VARS['product_old_name'][$id])) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . " SET products_name='" . $new_name . "' WHERE products_id=$id and language_id=" . $languages_id); mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_sort_order']){ foreach($HTTP_POST_VARS['product_new_sort_order'] as $id => $new_sort_order) { if ($HTTP_POST_VARS['product_new_sort_order'][$id] != $HTTP_POST_VARS['product_old_sort_order'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_sort_order=$new_sort_order, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_price']){ foreach($HTTP_POST_VARS['product_new_price'] as $id => $new_price) { if ($HTTP_POST_VARS['product_new_price'][$id] != $HTTP_POST_VARS['product_old_price'][$id] && $HTTP_POST_VARS['update_price'][$id] == 'yes') { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_price=$new_price, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_weight']){ foreach($HTTP_POST_VARS['product_new_weight'] as $id => $new_weight) { if ($HTTP_POST_VARS['product_new_weight'][$id] != $HTTP_POST_VARS['product_old_weight'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_weight=$new_weight, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_quantity']){ foreach($HTTP_POST_VARS['product_new_quantity'] as $id => $new_quantity) { if ($HTTP_POST_VARS['product_new_quantity'][$id] != $HTTP_POST_VARS['product_old_quantity'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_quantity=$new_quantity, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_manufacturer']){ foreach($HTTP_POST_VARS['product_new_manufacturer'] as $id => $new_manufacturer) { if ($HTTP_POST_VARS['product_new_manufacturer'][$id] != $HTTP_POST_VARS['product_old_manufacturer'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET manufacturers_id=$new_manufacturer, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_image']){ foreach($HTTP_POST_VARS['product_new_image'] as $id => $new_image) { if (trim($HTTP_POST_VARS['product_new_image'][$id]) != trim($HTTP_POST_VARS['product_old_image'][$id])) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_image='" . $new_image . "', products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_status']){ foreach($HTTP_POST_VARS['product_new_status'] as $id => $new_status) { if ($HTTP_POST_VARS['product_new_status'][$id] != $HTTP_POST_VARS['product_old_status'][$id]) { $count_update++; $item_updated[$id] = 'updated'; tep_set_product_status($id, $new_status); mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_tax']){ foreach($HTTP_POST_VARS['product_new_tax'] as $id => $new_tax_id) { if ($HTTP_POST_VARS['product_new_tax'][$id] != $HTTP_POST_VARS['product_old_tax'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_tax_class_id=$new_tax_id, products_last_modified=now() WHERE products_id=$id"); } } } $count_item = array_count_values($item_updated); if ($count_item['updated'] > 0) $messageStack->add($count_item['updated'].' '.TEXT_PRODUCTS_UPDATED . " $count_update " . TEXT_QTY_UPDATED, 'success'); break; case 'calcul' : if ($HTTP_POST_VARS['spec_price']) $preview_global_price = 'true'; break; } //// explode string parameters from preview product if($info_back && $info_back!="-") { $infoback = explode('-',$info_back); $sort_by = $infoback[0]; $page = $infoback[1]; $current_category_id = $infoback[2]; $row_by_page = $infoback[3]; $manufacturer = $infoback[4]; } //// define the step for rollover lines per page $row_bypage_array = array(array()); for ($i = 10; $i <=100; $i=$i+5) { $row_bypage_array[] = array('id' => $i, 'text' => $i); } ##// Let's start displaying page with forms ?> <!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 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 //--> <script language="javascript"> <!-- var browser_family; var up = 1; if (document.all && !document.getElementById) browser_family = "dom2"; else if (document.layers) browser_family = "ns4"; else if (document.getElementById) browser_family = "dom2"; else browser_family = "other"; function display_ttc(action, prix, taxe, up){ if(action == 'display'){ if(up != 1) valeur = Math.round((prix + (taxe / 100) * prix) * 100) / 100; }else{ if(action == 'keyup'){ valeur = Math.round((parseFloat(prix) + (taxe / 100) * parseFloat(prix)) * 100) / 100; }else{ valeur = '0'; } } switch (browser_family){ case 'dom2': document.getElementById('descDiv').innerHTML = '<?php echo TOTAL_COST; ?> : '+valeur; break; case 'ie4': document.all.descDiv.innerHTML = '<?php echo TOTAL_COST; ?> : '+valeur; break; case 'ns4': document.descDiv.document.descDiv_sub.document.write(valeur); document.descDiv.document.descDiv_sub.document.close(); break; case 'other': break; } } --> </script> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td 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 width="100%" valign="top"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" colspan="3" valign="top"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"> <?php if($current_category_id != 0){ $image_query = tep_db_query("select c.categories_image from " . TABLE_CATEGORIES . " c where c.categories_id=" . $current_category_id); $image = tep_db_fetch_array($image_query); echo tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $image['categories_image'], '', 40); }else{ if($manufacturer){ $image_query = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id=" . $manufacturer); $image = tep_db_fetch_array($image_query); echo tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $image['manufacturers_image'], '', 40); } } ?> </td></tr> </table></td></tr> <tr><td align="center"> <table width="100%" cellspacing="0" cellpadding="0" border="1" bgcolor="#F3F9FB" bordercolor="#D1E7EF" height="100"><tr align="left"><td valign="middle"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr><td height="5"></td></tr> <tr align="center"> <td class="smalltext"><?php echo tep_draw_form('row_by_page', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'manufacturer', $manufacturer); echo tep_draw_hidden_field( 'cPath', $current_category_id);?></td> <td class="smallText"><?php echo TEXT_MAXI_ROW_BY_PAGE . ' ' . tep_draw_pull_down_menu('row_by_page', $row_bypage_array, $row_by_page, 'onChange="this.form.submit();"'); ?></form></td> <?php echo tep_draw_form('categorie', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'manufacturer', $manufacturer); ?> <td class="smallText" align="center" valign="top"><?php echo DISPLAY_CATEGORIES . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td></form> <?php echo tep_draw_form('manufacturers', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'cPath', $current_category_id);?> <td class="smallText" align="center" valign="top"><?php echo DISPLAY_MANUFACTURERS . ' ' . manufacturers_list(); ?></td></form> </tr> </table> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr align="center"> <td align="center"> <table border="0" cellspacing="0"> <form name="spec_price" <?php echo 'action="' . tep_href_link(FILENAME_QUICK_UPDATES, tep_get_all_get_params(array('action', 'info', 'pID')) . "action=calcul&page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer" , 'NONSSL') . '"'; ?> method="post"> <tr> <td class="main" align="center" valign="middle" nowrap> <?php echo TEXT_INPUT_SPEC_PRICE; ?></td> <td align="center" valign="middle"> <?php echo tep_draw_input_field('spec_price',0,'size="5"'); ?> </td> <td class="smalltext" align="center" valign="middle"><?php if ($preview_global_price != 'true') { echo ' ' . tep_image_submit('button_preview.gif', IMAGE_PREVIEW, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer"); } else echo ' <a href="' . tep_href_link(FILENAME_QUICK_UPDATES, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer") . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';?></td> </tr> <tr> <td class="smalltext" align="center" valign="middle" colspan="3" nowrap> <?php if ($preview_global_price != 'true') { echo TEXT_SPEC_PRICE_INFO1; } else echo TEXT_SPEC_PRICE_INFO2;?> </td> </tr> </form> </table> </td> </tr> <tr><td height="5"></td></tr> </td></tr> <br> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr align="center"> <form name="update" method="POST" action="<?php echo "$PHP_SELF?action=update&page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer"; ?>"> <td class="smalltext" align="middle"><?php echo WARNING_MESSAGE; ?> </td> <?php echo "<td class=\"pageHeading\" align=\"right\">" . '<script language="javascript"><!-- switch (browser_family) { case "dom2": case "ie4": document.write(\'<div id="descDiv">\'); break; default: document.write(\'<ilayer id="descDiv"><layer id="descDiv_sub">\'); break; } --> </script>' . "</td>\n"; ?> <td align="right" valign="middle"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE, "action=update&cPath=$current_category_id&page=$page&sort_by=$sort_by&row_by_page=$row_by_page");?></td> </tr> </table> </td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <!-- Arbeitsfarbe --> <td valign="top"><table border="0" bordercolor="#FF0000" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" valign="top"> <!-- Modell ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_MODEL == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_model ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_MODEL . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_model DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_MODEL . ' ' . TEXT_DESCENDINGLY)."</a> <br>" .TABLE_HEADING_MODEL; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><?php echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=pd.products_name ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_PRODUCTS . TEXT_ASCENDINGLY)."</a><a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=pd.products_name DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_PRODUCTS . ' ' . TEXT_DESCENDINGLY)."</a><br>" .TABLE_HEADING_PRODUCTS; ?></td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Status ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_STATUT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_status ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . 'OFF ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_status DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . 'ON ' . TEXT_ASCENDINGLY)."</a> <br>" .TABLE_HEADING_STATUS; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Gewicht ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_WEIGHT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_weight ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_WEIGHT . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_weight DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_WEIGHT . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_WEIGHT; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Stück ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_QUANTITY == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_quantity ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_QUANTITY . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_quantity DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_QUANTITY . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_QUANTITY; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Bild ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_IMAGE == 'true')echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_image ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_IMAGE . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_image DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_IMAGE . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_IMAGE; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Hersteller ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_MANUFACTURER == 'true')echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=m.manufacturers_name ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_MANUFACTURERS . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=m.manufacturers_name DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_MANUFACTURERS . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_MANUFACTURERS; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"> <!-- Preis ++++++++++++++++++++++++++++++++++ --> <?php echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_price ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_PRICE . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_price DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_PRICE . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_PRICE;?> </td> <td class="dataTableHeadingContent" align="left" valign="top"> <!-- MwSt ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_TAX == 'true')echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_tax_class_id ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_TAX . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_tax_class_id DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_TAX . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_TAX; ?> </td> <td class="dataTableHeadingContent" align="center" valign="middle"> </td> <td class="dataTableHeadingContent" align="center" valign="middle"> </td> </tr><tr class="datatableRow"> <?php //// control string sort page if ($sort_by && !ereg('order by',$sort_by)) $sort_by = 'order by '.$sort_by; //// define the string parameters for good back preview product $origin = FILENAME_QUICK_UPDATES."?info_back=$sort_by-$page-$current_category_id-$row_by_page-$manufacturer"; //// controle lenght (lines per page) $split_page = $page; if ($split_page > 1) $rows = $split_page * MAX_DISPLAY_ROW_BY_PAGE - MAX_DISPLAY_ROW_BY_PAGE; //// select categories if ($current_category_id == 0){ if($manufacturer){ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = m.manufacturers_id and p.manufacturers_id = " . $manufacturer . " $sort_by "; }else{ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and p.manufacturers_id = m.manufacturers_id and pd.language_id = '$languages_id' $sort_by "; } } else { // if($manufacturer){ // $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = m.manufacturers_id and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.manufacturers_id = " . $manufacturer . " $sort_by "; // }else{ // $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = m.manufacturers_id and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by "; // } // } //Quick Price Update Manfacturers Patch if($manufacturer){ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id, m.manufacturers_id, manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, ".TABLE_MANUFACTURERS." m where p.products_id = pd.products_id and m.manufacturers_id = p.manufacturers_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.manufacturers_id = " . $manufacturer . " $sort_by "; }else{ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id, m.manufacturers_id, manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc left join ". TABLE_MANUFACTURERS." m on m.manufacturers_id = p.manufacturers_id where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by "; } } //// page splitter and display each products info $products_split = new splitPageResults($split_page, MAX_DISPLAY_ROW_BY_PAGE, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { $rows++; if (strlen($rows) < 2) { $rows = '0' . $rows; } //// check for global add value or rates, calcul and round values rates if ($HTTP_POST_VARS['spec_price']){ $flag_spec = 'true'; if (substr($HTTP_POST_VARS['spec_price'],-1) == '%') { if($HTTP_POST_VARS['marge'] && substr($HTTP_POST_VARS['spec_price'],0,1) != '-'){ $valeur = (1 - (ereg_replace("%", "", $HTTP_POST_VARS['spec_price']) / 100)); $price = sprintf("%01.2f", round($products['products_price'] / $valeur,2)); }else{ $price = sprintf("%01.2f", round($products['products_price'] + (($spec_price / 100) * $products['products_price']),2)); } } else $price = sprintf("%01.2f", round($products['products_price'] + $spec_price,2)); } else $price = $products['products_price']; //// Check Tax_rate for displaying TTC $tax_query = tep_db_query("select r.tax_rate, c.tax_class_title from " . TABLE_TAX_RATES . " r, " . TABLE_TAX_CLASS . " c where r.tax_class_id=" . $products['products_tax_class_id'] . " and c.tax_class_id=" . $products['products_tax_class_id']); $tax_rate = tep_db_fetch_array($tax_query); if($tax_rate['tax_rate'] == '')$tax_rate['tax_rate'] = 0; if(MODIFY_MANUFACTURER == 'false'){ $manufacturer_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id=" . $products['manufacturers_id']); $manufacturer = tep_db_fetch_array($manufacturer_query); } //// display infos per row if($flag_spec){echo '<tr class="dataTableRow" onmouseover="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'display\', ' . $price . ', ' . $tax_rate['tax_rate'] . ');';} echo 'this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'delete\');';} echo 'this.className=\'dataTableRow\'">'; }else{ echo '<tr class="dataTableRow" onmouseover="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'display\', ' . $products['products_price'] . ', ' . $tax_rate['tax_rate'] . ');';} echo 'this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'delete\', \'\', \'\', 0);';} echo 'this.className=\'dataTableRow\'">';} if(DISPLAY_MODEL == 'true'){if(MODIFY_MODEL == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"6\" name=\"product_new_model[".$products['products_id']."]\" value=\"".$products['products_model']."\"></td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $products['products_model'] . "</td>\n";}else{ echo "<td class=\"smallText\" align=\"left\">";} if(MODIFY_NAME == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"35\" name=\"product_new_name[".$products['products_id']."]\" value=\"".$products['products_name']."\"></td>\n";else echo "<td class=\"smallText\" align=\"left\">".$products['products_name']."</td>\n"; //// Product status radio button if(DISPLAY_STATUT == 'true'){ if ($products['products_status'] == '1') { echo "<td class=\"smallText\"><input type=\"radio\" name=\"product_new_status[".$products['products_id']."]\" value=\"0\" ><input type=\"radio\" name=\"product_new_status[".$products['products_id']."]\" value=\"1\" checked ></td>\n"; } else { echo "<td class=\"smallText\"><input type=\"radio\" style=\"background-color: #EEEEEE\" name=\"product_new_status[".$products['products_id']."]\" value=\"0\" checked ><input type=\"radio\" style=\"background-color: #EEEEEE\" name=\"product_new_status[".$products['products_id']."]\" value=\"1\"></td>\n"; } } if(DISPLAY_WEIGHT == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"5\" name=\"product_new_weight[".$products['products_id']."]\" value=\"".$products['products_weight']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_QUANTITY == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"3\" name=\"product_new_quantity[".$products['products_id']."]\" value=\"".$products['products_quantity']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_IMAGE == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"8\" name=\"product_new_image[".$products['products_id']."]\" value=\"".$products['products_image']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_MANUFACTURER == 'true'){if(MODIFY_MANUFACTURER == 'true')echo "<td class=\"smallText\">".tep_draw_pull_down_menu("product_new_manufacturer[".$products['products_id']."]\"", $manufacturers_array, $products['manufacturers_id'])."</td>\n";else echo "<td class=\"smallText\">" . $manufacturer['manufacturers_name'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";} //// get the specials products list $specials_array = array(); $specials_query = tep_db_query("select p.products_id, s.products_id, s.specials_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id"); while ($specials = tep_db_fetch_array($specials_query)) { $specials_array[] = $specials['products_id']; } //// check specials if ( in_array($products['products_id'],$specials_array)) { $spec_query = tep_db_query("select s.products_id, s.specials_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = " . (int)$products['products_id'] . ""); $spec = tep_db_fetch_array($spec_query); echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" value=\"".$products['products_price']."\" disabled > <a target=blank href=\"".tep_href_link (FILENAME_SPECIALS, 'sID='.$spec['specials_id']).'&action=edit'."\">". tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_SPECIALS_PRODUCTS) ."</a></td>\n"; } else { if ($flag_spec == 'true') { echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" "; if(DISPLAY_TVA_UP == 'true'){ echo "onKeyUp=\"display_ttc('keyup', this.value" . ", " . $tax_rate['tax_rate'] . ", 1);\"";} echo " value=\"".$price ."\">".tep_draw_checkbox_field('update_price['.$products['products_id'].']','yes','checked','no')."</td>\n"; } else { echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" "; if(DISPLAY_TVA_UP == 'true'){ echo "onKeyUp=\"display_ttc('keyup', this.value" . ", " . $tax_rate['tax_rate'] . ", 1);\"";} echo " value=\"".$price ."\">".tep_draw_hidden_field('update_price['.$products['products_id'].']','yes'). "</td>\n";} } if(DISPLAY_TAX == 'true'){if(MODIFY_TAX == 'true')echo "<td class=\"smallText\" align=\"left\">".tep_draw_pull_down_menu("product_new_tax[".$products['products_id']."]\"", $tax_class_array, $products['products_tax_class_id'])."</td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $tax_rate['tax_class_title'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";} //// links to preview or full edit if(DISPLAY_PREVIEW == 'true')echo "<td class=\"smallText\" align=\"left\"><a href=\"".tep_href_link (FILENAME_CATEGORIES, 'pID='.$products['products_id'].'&action=new_product_preview&read=only&sort_by='.$sort_by.'&page='.$split_page.'&origin='.$origin)."\">". tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_IMAGE_PREVIEW) ."</a></td>\n"; if(DISPLAY_EDIT == 'true')echo "<td class=\"smallText\" align=\"left\"><a href=\"".tep_href_link (FILENAME_CATEGORIES, 'pID='.$products['products_id'].'&cPath='.$categories_products[0].'&action=new_product')."\">". tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', TEXT_IMAGE_SWITCH_EDIT) ."</a></td>\n"; //// Hidden parameters for cache old values if(MODIFY_NAME == 'true') echo tep_draw_hidden_field('product_old_name['.$products['products_id'].'] ',$products['products_name']); if(MODIFY_MODEL == 'true') echo tep_draw_hidden_field('product_old_model['.$products['products_id'].'] ',$products['products_model']); echo tep_draw_hidden_field('product_old_sort_order['.$products['products_id'].']',$products['products_sort_order']); echo tep_draw_hidden_field('product_old_make_an_offer['.$products['products_id'].']',$products['products_make_an_offer']); echo tep_draw_hidden_field('product_old_zusatz3['.$products['products_id'].']',$products['products_zusatz3']); echo tep_draw_hidden_field('product_old_status['.$products['products_id'].']',$products['products_status']); echo tep_draw_hidden_field('product_old_quantity['.$products['products_id'].']',$products['products_quantity']); echo tep_draw_hidden_field('product_old_image['.$products['products_id'].']',$products['products_image']); if(MODIFY_MANUFACTURER == 'true')echo tep_draw_hidden_field('product_old_manufacturer['.$products['products_id'].']',$products['manufacturers_id']); echo tep_draw_hidden_field('product_old_weight['.$products['products_id'].']',$products['products_weight']); echo tep_draw_hidden_field('product_old_base_price['.$products['products_id'].']',$products['products_base_price']); echo tep_draw_hidden_field('product_old_base_unit['.$products['products_id'].']',$products['products_base_unit']); echo tep_draw_hidden_field('product_old_price_ek['.$products['products_id'].']',$products['products_price_ek']); echo tep_draw_hidden_field('product_old_price['.$products['products_id'].']',$products['products_price']); if(MODIFY_TAX == 'true')echo tep_draw_hidden_field('product_old_tax['.$products['products_id'].']',$products['products_tax_class_id']); //// hidden display parameters echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'sort_by', $sort_by); echo tep_draw_hidden_field( 'page', $split_page); } echo "</table>\n"; ?> </td> </tr> </table></td> </tr> <tr> <td align="right"> <?php //// display bottom page buttons echo '<a href="java script:window.print()">' . tep_image_submit('button_print.gif', PRINT_TEXT) . '</a> '; echo tep_image_submit('button_update.gif', IMAGE_UPDATE); echo ' <a href="' . tep_href_link(FILENAME_QUICK_UPDATES,"row_by_page=$row_by_page") . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td> </tr> </form> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, $split_page, TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, MAX_DISPLAY_PAGE_LINKS, $split_page, '&cPath='. $current_category_id .'&sort_by='.$sort_by . '&row_by_page=' . $row_by_page); ?></td> </table></td> </tr> </table></td> </tr> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> </tr> </table> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Hi Thenes Here's the code thanks for taking your time to help me i am so thankful mate !!!!! Thank you again for taking your time to help me !!! :thumbsup: :thumbsup: :thumbsup:thumbsup.gif thumbsup.gif thumbsup.gif thumbsup.gif Quote Link to comment Share on other sites More sharing options...
joebloggs Posted August 10, 2007 Share Posted August 10, 2007 OMG IT WORKED ! I DUNNO WHY BUT THIS WORKED THENES !!!!!!!!!!!!!!!!!! Quick Update Prices with Gross Price Beta 1 flom 30 Apr 2007 On your own risk... as usual :) Quote Link to comment Share on other sites More sharing options...
Thenes Posted August 11, 2007 Share Posted August 11, 2007 Fantastic! :thumbsup: Could've been anything - I did see the format of our files were a little different - it could've been a carriage return, which happens with some text editors. Glad I could help. OMG IT WORKED ! I DUNNO WHY BUT THIS WORKED THENES !!!!!!!!!!!!!!!!!!Quick Update Prices with Gross Price Beta 1 flom 30 Apr 2007 On your own risk... as usual :) Quote Link to comment Share on other sites More sharing options...
♥stubbsy Posted August 12, 2007 Share Posted August 12, 2007 (edited) Hi there, I've been modifying the code to be able to modify the products vendor rather than the products manufacturer and have it working to a fashion. Basically all I have done (as i can't write php) is replace instances of manufacturer with vendor, so that it only shows vendors in the dropdown. The problem I have encountered is that currently none of my products have vendors assigned to them, so using quick updates I can go into a category and using the old manufacturers drop down (now replaced with vendors) I can instead assign vendors to each product. The problem is though that when i save it only some of the vendor are saved against some of the products. If i do it again then I can get some more to be saved and then I'm left with a few that no matter how many times I update it will not save the vendors id against the product. Does anyone have any ideas what might cause this? (I don't like pasting huge amounts of code in the forum, but guess I'll have to this time to show you what i've done) Thanks Dave <?php /* $Id: quick_updates.php 2005/09/14 13:55:34 HRB Exp $ osCommerce, Open Source E-Commerce Solutions [url=http://www.oscommerce.com]http://www.oscommerce.com[/url] Based on the original script contributed by Burt ([email protected]) and by Henri Bredehoeft ([email protected]) Changelog: by Infobroker [email protected] Copyright © 2002 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); ($row_by_page) ? define('MAX_DISPLAY_ROW_BY_PAGE' , $row_by_page ) : $row_by_page = MAX_DISPLAY_SEARCH_RESULTS; define('MAX_DISPLAY_ROW_BY_PAGE' , MAX_DISPLAY_SEARCH_RESULTS ); //// Tax Row $tax_class_array = array(array('id' => '0', 'text' => NO_TAX_TEXT)); $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title"); while ($tax_class = tep_db_fetch_array($tax_class_query)) { $tax_class_array[] = array('id' => $tax_class['tax_class_id'], 'text' => $tax_class['tax_class_title']); } ////Info Row pour le champ fabriquant $vendors_array = array(array('id' => '0', 'text' => NO_VENDOR)); $vendors_query = tep_db_query("select vendors_id, vendors_name from " . TABLE_VENDORS . " order by vendors_name"); while ($vendors = tep_db_fetch_array($vendors_query)) { $vendors_array[] = array('id' => $vendors['vendors_id'], 'text' => $vendors['vendors_name']); } // Display the list of the vendors function vendors_list(){ global $vendor; $vendors_query = tep_db_query("select m.vendors_id, m.vendors_name from " . TABLE_VENDORS . " m order by m.vendors_name ASC"); $return_string = '<select name="vendor" onChange="this.form.submit();">'; $return_string .= '<option value="' . 0 . '">' . TEXT_ALL_VENDORS . '</option>'; while($vendors = tep_db_fetch_array($vendors_query)){ $return_string .= '<option value="' . $vendors['vendors_id'] . '"'; if($vendor && $vendors['vendors_id'] == $vendor) $return_string .= ' SELECTED'; $return_string .= '>' . $vendors['vendors_name'] . '</option>'; } $return_string .= '</select>'; return $return_string; } ##// Uptade database switch ($HTTP_GET_VARS['action']) { case 'update' : $count_update=0; $item_updated = array(); if($HTTP_POST_VARS['product_new_model']){ foreach($HTTP_POST_VARS['product_new_model'] as $id => $new_model) { if (trim($HTTP_POST_VARS['product_new_model'][$id]) != trim($HTTP_POST_VARS['product_old_model'][$id])) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_model='" . $new_model . "', products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_name']){ foreach($HTTP_POST_VARS['product_new_name'] as $id => $new_name) { if (trim($HTTP_POST_VARS['product_new_name'][$id]) != trim($HTTP_POST_VARS['product_old_name'][$id])) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . " SET products_name='" . $new_name . "' WHERE products_id=$id and language_id=" . $languages_id); mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_sort_order']){ foreach($HTTP_POST_VARS['product_new_sort_order'] as $id => $new_sort_order) { if ($HTTP_POST_VARS['product_new_sort_order'][$id] != $HTTP_POST_VARS['product_old_sort_order'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_sort_order=$new_sort_order, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_price']){ foreach($HTTP_POST_VARS['product_new_price'] as $id => $new_price) { if ($HTTP_POST_VARS['product_new_price'][$id] != $HTTP_POST_VARS['product_old_price'][$id] && $HTTP_POST_VARS['update_price'][$id] == 'yes') { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_price=$new_price, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_weight']){ foreach($HTTP_POST_VARS['product_new_weight'] as $id => $new_weight) { if ($HTTP_POST_VARS['product_new_weight'][$id] != $HTTP_POST_VARS['product_old_weight'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_weight=$new_weight, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_quantity']){ foreach($HTTP_POST_VARS['product_new_quantity'] as $id => $new_quantity) { if ($HTTP_POST_VARS['product_new_quantity'][$id] != $HTTP_POST_VARS['product_old_quantity'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_quantity=$new_quantity, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_vendor']){ foreach($HTTP_POST_VARS['product_new_vendor'] as $id => $new_vendor) { if ($HTTP_POST_VARS['product_new_vendor'][$id] != $HTTP_POST_VARS['product_old_vendor'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET vendors_id=$new_vendor, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_image']){ foreach($HTTP_POST_VARS['product_new_image'] as $id => $new_image) { if (trim($HTTP_POST_VARS['product_new_image'][$id]) != trim($HTTP_POST_VARS['product_old_image'][$id])) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_image='" . $new_image . "', products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_status']){ foreach($HTTP_POST_VARS['product_new_status'] as $id => $new_status) { if ($HTTP_POST_VARS['product_new_status'][$id] != $HTTP_POST_VARS['product_old_status'][$id]) { $count_update++; $item_updated[$id] = 'updated'; tep_set_product_status($id, $new_status); mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_tax']){ foreach($HTTP_POST_VARS['product_new_tax'] as $id => $new_tax_id) { if ($HTTP_POST_VARS['product_new_tax'][$id] != $HTTP_POST_VARS['product_old_tax'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_tax_class_id=$new_tax_id, products_last_modified=now() WHERE products_id=$id"); } } } $count_item = array_count_values($item_updated); if ($count_item['updated'] > 0) $messageStack->add($count_item['updated'].' '.TEXT_PRODUCTS_UPDATED . " $count_update " . TEXT_QTY_UPDATED, 'success'); break; case 'calcul' : if ($HTTP_POST_VARS['spec_price']) $preview_global_price = 'true'; break; } //// explode string parameters from preview product if($info_back && $info_back!="-") { $infoback = explode('-',$info_back); $sort_by = $infoback[0]; $page = $infoback[1]; $current_category_id = $infoback[2]; $row_by_page = $infoback[3]; $vendor = $infoback[4]; } //// define the step for rollover lines per page $row_bypage_array = array(array()); for ($i = 10; $i <=100; $i=$i+5) { $row_bypage_array[] = array('id' => $i, 'text' => $i); } ##// Let's start displaying page with forms ?> <!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 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 //--> <script language="javascript"> <!-- var browser_family; var up = 1; if (document.all && !document.getElementById) browser_family = "dom2"; else if (document.layers) browser_family = "ns4"; else if (document.getElementById) browser_family = "dom2"; else browser_family = "other"; function display_ttc(action, prix, taxe, up){ if(action == 'display'){ if(up != 1) valeur = Math.round((prix + (taxe / 100) * prix) * 100) / 100; }else{ if(action == 'keyup'){ valeur = Math.round((parseFloat(prix) + (taxe / 100) * parseFloat(prix)) * 100) / 100; }else{ valeur = '0'; } } switch (browser_family){ case 'dom2': document.getElementById('descDiv').innerHTML = '<?php echo TOTAL_COST; ?> : '+valeur; break; case 'ie4': document.all.descDiv.innerHTML = '<?php echo TOTAL_COST; ?> : '+valeur; break; case 'ns4': document.descDiv.document.descDiv_sub.document.write(valeur); document.descDiv.document.descDiv_sub.document.close(); break; case 'other': break; } } --> </script> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td 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 width="100%" valign="top"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" colspan="3" valign="top"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"> <?php if($current_category_id != 0){ $image_query = tep_db_query("select c.categories_image from " . TABLE_CATEGORIES . " c where c.categories_id=" . $current_category_id); $image = tep_db_fetch_array($image_query); echo tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $image['categories_image'], '', 40); }else{ if($vendor){ $image_query = tep_db_query("select vendors_image from " . TABLE_VENDORS . " where vendors_id=" . $vendor); $image = tep_db_fetch_array($image_query); echo tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $image['vendors_image'], '', 40); } } ?> </td></tr> </table></td></tr> <tr><td align="center"> <table width="100%" cellspacing="0" cellpadding="0" border="1" bgcolor="#F3F9FB" bordercolor="#D1E7EF" height="100"><tr align="left"><td valign="middle"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr><td height="5"></td></tr> <tr align="center"> <td class="smalltext"><?php echo tep_draw_form('row_by_page', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'vendor', $vendor); echo tep_draw_hidden_field( 'cPath', $current_category_id);?></td> <td class="smallText"><?php echo TEXT_MAXI_ROW_BY_PAGE . ' ' . tep_draw_pull_down_menu('row_by_page', $row_bypage_array, $row_by_page, 'onChange="this.form.submit();"'); ?></form></td> <?php echo tep_draw_form('categorie', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'vendor', $vendor); ?> <td class="smallText" align="center" valign="top"><?php echo DISPLAY_CATEGORIES . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td></form> <?php echo tep_draw_form('vendors', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'cPath', $current_category_id);?> <td class="smallText" align="center" valign="top"><?php echo DISPLAY_VENDORS . ' ' . vendors_list(); ?></td></form> </tr> </table> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr align="center"> <td align="center"> <table border="0" cellspacing="0"> <form name="spec_price" <?php echo 'action="' . tep_href_link(FILENAME_QUICK_UPDATES, tep_get_all_get_params(array('action', 'info', 'pID')) . "action=calcul&page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&vendor=$vendor" , 'NONSSL') . '"'; ?> method="post"> <tr> <td class="main" align="center" valign="middle" nowrap> <?php echo TEXT_INPUT_SPEC_PRICE; ?></td> <td align="center" valign="middle"> <?php echo tep_draw_input_field('spec_price',0,'size="5"'); ?> </td> <td class="smalltext" align="center" valign="middle"><?php if ($preview_global_price != 'true') { echo ' ' . tep_image_submit('button_preview.gif', IMAGE_PREVIEW, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&vendor=$vendor"); } else echo ' <a href="' . tep_href_link(FILENAME_QUICK_UPDATES, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&vendor=$vendor") . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';?></td> </tr> <tr> <td class="smalltext" align="center" valign="middle" colspan="3" nowrap> <?php if ($preview_global_price != 'true') { echo TEXT_SPEC_PRICE_INFO1; } else echo TEXT_SPEC_PRICE_INFO2;?> </td> </tr> </form> </table> </td> </tr> <tr><td height="5"></td></tr> </td></tr> <br> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr align="center"> <form name="update" method="POST" action="<?php echo "$PHP_SELF?action=update&page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&vendor=$vendor"; ?>"> <td class="smalltext" align="middle"><?php echo WARNING_MESSAGE; ?> </td> <?php echo "<td class=\"pageHeading\" align=\"right\">" . '<script language="javascript"><!-- switch (browser_family) { case "dom2": case "ie4": document.write(\'<div id="descDiv">\'); break; default: document.write(\'<ilayer id="descDiv"><layer id="descDiv_sub">\'); break; } --> </script>' . "</td>\n"; ?> <td align="right" valign="middle"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE, "action=update&cPath=$current_category_id&page=$page&sort_by=$sort_by&row_by_page=$row_by_page");?></td> </tr> </table> </td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <!-- Arbeitsfarbe --> <td valign="top"><table border="0" bordercolor="#FF0000" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" valign="top"> <!-- Modell ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_MODEL == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_model ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_MODEL . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_model DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_MODEL . ' ' . TEXT_DESCENDINGLY)."</a> <br>" .TABLE_HEADING_MODEL; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><?php echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=pd.products_name ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_PRODUCTS . TEXT_ASCENDINGLY)."</a><a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=pd.products_name DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_PRODUCTS . ' ' . TEXT_DESCENDINGLY)."</a><br>" .TABLE_HEADING_PRODUCTS; ?></td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Status ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_STATUT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_status ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . 'OFF ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_status DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . 'ON ' . TEXT_ASCENDINGLY)."</a> <br>" .TABLE_HEADING_STATUS; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Gewicht ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_WEIGHT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_weight ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_WEIGHT . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_weight DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_WEIGHT . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_WEIGHT; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Stück ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_QUANTITY == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_quantity ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_QUANTITY . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_quantity DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_QUANTITY . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_QUANTITY; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Bild ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_IMAGE == 'true')echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_image ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_IMAGE . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_image DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_IMAGE . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_IMAGE; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Hersteller ++++++++++++++++++++++++++++++++++ --> <?php echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=m.vendors_name ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_VENDORS . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=m.vendors_name DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_vendors . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_VENDORS; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"> <!-- Preis ++++++++++++++++++++++++++++++++++ --> <?php echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_price ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_PRICE . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_price DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_PRICE . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_PRICE;?> </td> <td class="dataTableHeadingContent" align="left" valign="top"> <!-- MwSt ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_TAX == 'true')echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_tax_class_id ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_TAX . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_tax_class_id DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&vendor=' . $vendor)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_TAX . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_TAX; ?> </td> <td class="dataTableHeadingContent" align="center" valign="middle"> </td> <td class="dataTableHeadingContent" align="center" valign="middle"> </td> </tr><tr class="datatableRow"> <?php //// control string sort page if ($sort_by && !ereg('order by',$sort_by)) $sort_by = 'order by '.$sort_by; //// define the string parameters for good back preview product $origin = FILENAME_QUICK_UPDATES."?info_back=$sort_by-$page-$current_category_id-$row_by_page-$vendor"; //// controle lenght (lines per page) $split_page = $page; if ($split_page > 1) $rows = $split_page * MAX_DISPLAY_ROW_BY_PAGE - MAX_DISPLAY_ROW_BY_PAGE; //// select categories if ($current_category_id == 0){ if($vendor){ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.vendors_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_VENDORS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.vendors_id = m.vendors_id and p.vendors_id = " . $vendor . " $sort_by "; }else{ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.vendors_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_VENDORS . " m where p.products_id = pd.products_id and p.vendors_id = m.vendors_id and pd.language_id = '$languages_id' $sort_by "; } } else { // if($vendor){ // $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.vendors_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_VENDORS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.vendors_id = m.vendors_id and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.vendors_id = " . $vendor . " $sort_by "; // }else{ // $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.vendors_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_VENDORS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.vendors_id = m.vendors_id and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by "; // } // } //Quick Price Update Manfacturers Patch if($vendor){ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.vendors_id, p.products_price, p.products_tax_class_id, m.vendors_id, vendors_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, ".TABLE_VENDORS." m where p.products_id = pd.products_id and m.vendors_id = p.vendors_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.vendors_id = " . $vendor . " $sort_by "; }else{ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.vendors_id, p.products_price, p.products_tax_class_id, m.vendors_id, vendors_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc left join ". TABLE_VENDORS." m on m.vendors_id = p.vendors_id where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by "; } } //// page splitter and display each products info $products_split = new splitPageResults($split_page, MAX_DISPLAY_ROW_BY_PAGE, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { $rows++; if (strlen($rows) < 2) { $rows = '0' . $rows; } //// check for global add value or rates, calcul and round values rates if ($HTTP_POST_VARS['spec_price']){ $flag_spec = 'true'; if (substr($HTTP_POST_VARS['spec_price'],-1) == '%') { if($HTTP_POST_VARS['marge'] && substr($HTTP_POST_VARS['spec_price'],0,1) != '-'){ $valeur = (1 - (ereg_replace("%", "", $HTTP_POST_VARS['spec_price']) / 100)); $price = sprintf("%01.2f", round($products['products_price'] / $valeur,2)); }else{ $price = sprintf("%01.2f", round($products['products_price'] + (($spec_price / 100) * $products['products_price']),2)); } } else $price = sprintf("%01.2f", round($products['products_price'] + $spec_price,2)); } else $price = $products['products_price']; //// Check Tax_rate for displaying TTC $tax_query = tep_db_query("select r.tax_rate, c.tax_class_title from " . TABLE_TAX_RATES . " r, " . TABLE_TAX_CLASS . " c where r.tax_class_id=" . $products['products_tax_class_id'] . " and c.tax_class_id=" . $products['products_tax_class_id']); $tax_rate = tep_db_fetch_array($tax_query); if($tax_rate['tax_rate'] == '')$tax_rate['tax_rate'] = 0; if(MODIFY_MANUFACTURER == 'false'){ $vendor_query = tep_db_query("select vendors_name from " . TABLE_VENDORS . " where vendors_id=" . $products['vendors_id']); $vendor = tep_db_fetch_array($vendor_query); } //// display infos per row if($flag_spec){echo '<tr class="dataTableRow" onmouseover="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'display\', ' . $price . ', ' . $tax_rate['tax_rate'] . ');';} echo 'this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'delete\');';} echo 'this.className=\'dataTableRow\'">'; }else{ echo '<tr class="dataTableRow" onmouseover="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'display\', ' . $products['products_price'] . ', ' . $tax_rate['tax_rate'] . ');';} echo 'this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'delete\', \'\', \'\', 0);';} echo 'this.className=\'dataTableRow\'">';} if(DISPLAY_MODEL == 'true'){if(MODIFY_MODEL == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"6\" name=\"product_new_model[".$products['products_id']."]\" value=\"".$products['products_model']."\"></td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $products['products_model'] . "</td>\n";}else{ echo "<td class=\"smallText\" align=\"left\">";} if(MODIFY_NAME == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"35\" name=\"product_new_name[".$products['products_id']."]\" value=\"".$products['products_name']."\"></td>\n";else echo "<td class=\"smallText\" align=\"left\">".$products['products_name']."</td>\n"; //// Product status radio button if(DISPLAY_STATUT == 'true'){ if ($products['products_status'] == '1') { echo "<td class=\"smallText\"><input type=\"radio\" name=\"product_new_status[".$products['products_id']."]\" value=\"0\" ><input type=\"radio\" name=\"product_new_status[".$products['products_id']."]\" value=\"1\" checked ></td>\n"; } else { echo "<td class=\"smallText\"><input type=\"radio\" style=\"background-color: #EEEEEE\" name=\"product_new_status[".$products['products_id']."]\" value=\"0\" checked ><input type=\"radio\" style=\"background-color: #EEEEEE\" name=\"product_new_status[".$products['products_id']."]\" value=\"1\"></td>\n"; } } if(DISPLAY_WEIGHT == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"5\" name=\"product_new_weight[".$products['products_id']."]\" value=\"".$products['products_weight']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_QUANTITY == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"3\" name=\"product_new_quantity[".$products['products_id']."]\" value=\"".$products['products_quantity']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_IMAGE == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"8\" name=\"product_new_image[".$products['products_id']."]\" value=\"".$products['products_image']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_MANUFACTURER == 'true'){if(MODIFY_MANUFACTURER == 'true')echo "<td class=\"smallText\">".tep_draw_pull_down_menu("product_new_vendor[".$products['products_id']."]\"", $vendors_array, $products['vendors_id'])."</td>\n";else echo "<td class=\"smallText\">" . $vendor['vendors_name'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";} //// get the specials products list $specials_array = array(); $specials_query = tep_db_query("select p.products_id, s.products_id, s.specials_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id"); while ($specials = tep_db_fetch_array($specials_query)) { $specials_array[] = $specials['products_id']; } //// check specials if ( in_array($products['products_id'],$specials_array)) { $spec_query = tep_db_query("select s.products_id, s.specials_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = " . (int)$products['products_id'] . ""); $spec = tep_db_fetch_array($spec_query); echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" value=\"".$products['products_price']."\" disabled > <a target=blank href=\"".tep_href_link (FILENAME_SPECIALS, 'sID='.$spec['specials_id']).'&action=edit'."\">". tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_SPECIALS_PRODUCTS) ."</a></td>\n"; } else { if ($flag_spec == 'true') { echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" "; if(DISPLAY_TVA_UP == 'true'){ echo "onKeyUp=\"display_ttc('keyup', this.value" . ", " . $tax_rate['tax_rate'] . ", 1);\"";} echo " value=\"".$price ."\">".tep_draw_checkbox_field('update_price['.$products['products_id'].']','yes','checked','no')."</td>\n"; } else { echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" "; if(DISPLAY_TVA_UP == 'true'){ echo "onKeyUp=\"display_ttc('keyup', this.value" . ", " . $tax_rate['tax_rate'] . ", 1);\"";} echo " value=\"".$price ."\">".tep_draw_hidden_field('update_price['.$products['products_id'].']','yes'). "</td>\n";} } if(DISPLAY_TAX == 'true'){if(MODIFY_TAX == 'true')echo "<td class=\"smallText\" align=\"left\">".tep_draw_pull_down_menu("product_new_tax[".$products['products_id']."]\"", $tax_class_array, $products['products_tax_class_id'])."</td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $tax_rate['tax_class_title'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";} //// links to preview or full edit if(DISPLAY_PREVIEW == 'true')echo "<td class=\"smallText\" align=\"left\"><a href=\"".tep_href_link (FILENAME_CATEGORIES, 'pID='.$products['products_id'].'&action=new_product_preview&read=only&sort_by='.$sort_by.'&page='.$split_page.'&origin='.$origin)."\">". tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_IMAGE_PREVIEW) ."</a></td>\n"; if(DISPLAY_EDIT == 'true')echo "<td class=\"smallText\" align=\"left\"><a href=\"".tep_href_link (FILENAME_CATEGORIES, 'pID='.$products['products_id'].'&cPath='.$categories_products[0].'&action=new_product')."\">". tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', TEXT_IMAGE_SWITCH_EDIT) ."</a></td>\n"; //// Hidden parameters for cache old values if(MODIFY_NAME == 'true') echo tep_draw_hidden_field('product_old_name['.$products['products_id'].'] ',$products['products_name']); if(MODIFY_MODEL == 'true') echo tep_draw_hidden_field('product_old_model['.$products['products_id'].'] ',$products['products_model']); echo tep_draw_hidden_field('product_old_sort_order['.$products['products_id'].']',$products['products_sort_order']); echo tep_draw_hidden_field('product_old_make_an_offer['.$products['products_id'].']',$products['products_make_an_offer']); echo tep_draw_hidden_field('product_old_zusatz3['.$products['products_id'].']',$products['products_zusatz3']); echo tep_draw_hidden_field('product_old_status['.$products['products_id'].']',$products['products_status']); echo tep_draw_hidden_field('product_old_quantity['.$products['products_id'].']',$products['products_quantity']); echo tep_draw_hidden_field('product_old_image['.$products['products_id'].']',$products['products_image']); if(MODIFY_vendor == 'true')echo tep_draw_hidden_field('product_old_vendor['.$products['products_id'].']',$products['vendors_id']); echo tep_draw_hidden_field('product_old_weight['.$products['products_id'].']',$products['products_weight']); echo tep_draw_hidden_field('product_old_base_price['.$products['products_id'].']',$products['products_base_price']); echo tep_draw_hidden_field('product_old_base_unit['.$products['products_id'].']',$products['products_base_unit']); echo tep_draw_hidden_field('product_old_price_ek['.$products['products_id'].']',$products['products_price_ek']); echo tep_draw_hidden_field('product_old_price['.$products['products_id'].']',$products['products_price']); if(MODIFY_TAX == 'true')echo tep_draw_hidden_field('product_old_tax['.$products['products_id'].']',$products['products_tax_class_id']); //// hidden display parameters echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'sort_by', $sort_by); echo tep_draw_hidden_field( 'page', $split_page); } echo "</table>\n"; ?> </td> </tr> </table></td> </tr> <tr> <td align="right"> <?php //// display bottom page buttons echo '<a href="java script:window.print()">' . tep_image_submit('button_print.gif', PRINT_TEXT) . '</a> '; echo tep_image_submit('button_update.gif', IMAGE_UPDATE); echo ' <a href="' . tep_href_link(FILENAME_QUICK_UPDATES,"row_by_page=$row_by_page") . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td> </tr> </form> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, $split_page, TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, MAX_DISPLAY_PAGE_LINKS, $split_page, '&cPath='. $current_category_id .'&sort_by='.$sort_by . '&row_by_page=' . $row_by_page); ?></td> </table></td> </tr> </table></td> </tr> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> </tr> </table> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Edited August 12, 2007 by stubbsy Quote Link to comment Share on other sites More sharing options...
Papegaai01 Posted August 13, 2007 Share Posted August 13, 2007 Hi I have installed the contribution and the update. I get the following error: 1054 - Unknown column 'p.manufacturers_id' in 'on clause' select count(*) as total from products p, products_description pd, products_to_categories pc left join manufacturers m on m.manufacturers_id = p.manufacturers_id where p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = pc.products_id and pc.categories_id = '86' This is when i select a category. Anyone an idea? Thanks Erik Quote Link to comment Share on other sites More sharing options...
compuskill Posted August 13, 2007 Share Posted August 13, 2007 Hello, please help me someone! I would like to quick edit prices and special prices. Does anyone see a possibility on how to modify the code? Thx Quote Link to comment Share on other sites More sharing options...
compuskill Posted August 14, 2007 Share Posted August 14, 2007 Hello, please help me someone! I would like to quick edit prices and special prices. Does anyone see a possibility on how to modify the code? Thx Hi, you might have wondered what I am talking about. Meanwhile, I have found out that you can change prices, but only regular ones. I did not know that as I only have special prices in my shop, and special ones are blocked. Does anyone know how I can let the special prices show up in the quick update menu? Quote Link to comment Share on other sites More sharing options...
ctec2001 Posted August 18, 2007 Share Posted August 18, 2007 I have installed the contribution and it works great, but when I try to ad a product i get this error: Warning: Cannot modify header information - headers already sent by (output started at /home/morones5/public_html/test/admin/includes/languages/english.php:613) in /home/morones5/public_html/test/admin/includes/functions/general.php on line 22 Please help. Quote Do or Do Not, there is no try. Link to comment Share on other sites More sharing options...
ctec2001 Posted August 18, 2007 Share Posted August 18, 2007 (edited) I am sorry, I corrected one problem, but not the one mentioned before in my post. I now have this issue. In the Admin Area I have < script language="javascript"> next to the update button. Anyone? Please advise. Never mind, I corrected this issue. There was a < in place of a < Searched for it, found it, changed it, now it works. Edited August 18, 2007 by ctec2001 Quote Do or Do Not, there is no try. Link to comment Share on other sites More sharing options...
Papegaai01 Posted August 20, 2007 Share Posted August 20, 2007 Well now i get another error when i select some of my categories: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 select manufacturers_name from manufacturers where manufacturers_id= Anyone? Quote Link to comment Share on other sites More sharing options...
joebloggs Posted August 27, 2007 Share Posted August 27, 2007 Anyone know how to fix the pages not changing in the admin section of this contribution ? i had the same problem with product attributes admin page and i fixed it with this code $option_page = (isset($HTTP_GET_VARS['option_page']) ? $HTTP_GET_VARS['option_page'] : '1'); $value_page = (isset($HTTP_GET_VARS['value_page']) ? $HTTP_GET_VARS['value_page'] : '1'); $attribute_page = (isset($HTTP_GET_VARS['attribute_page']) ? $HTTP_GET_VARS['attribute_page'] : '1'); Anyway with the quick updates page selected from the admin i cant change the page of the amount of results per page !!! Can someone please help ? Thanks Quote Link to comment Share on other sites More sharing options...
azer Posted September 10, 2007 Author Share Posted September 10, 2007 as i started this thread i give you a little summary of what still needed to be done , idea, bug, request: 1. NEW FEATURES : Add a column with selection of tva , and insrting of price with taxes I made the price column to be inclusive of VAT and allow a VAT inclusive price to be entered. I did not use the contribution that has two columns. This is all done using one. The VAT is hardcoded for UK and does not use the tax-rate variable of osCommerce. So, this contribution will only work for UK shops that use VAT on all products. Because of the way this contribution works combined with the above VAT change the code thinks that every single price has changed, so updating will update every single price at once (regardless of it you have made changes.. it just overwrites the same value). To offset this, I added checkbox next to the price column. Ticking this will allow the price to be updated for that product and any that are not ticked will not be updated (only applicable for price.. the rest of the columns work as normal) 2. TO AMELIORATE : Change the layout and expand some field that need to be larger 3. TO AMELIORATE : The prices are with 4 decimals and with a point , in europe price should be with 3 decimals maximum and not a point but a comma , 4. TODO : stop posting new version number with addon for other contrib, but rather post them in a separate folder so that the commun code is upgraded more easily 5. BUG : Post a full release with a thrusted and tested solution for the "no manufacurer" products listing . 6. BUG : and also the fix already posted for multi page listing after having selected a manufacutrer (gjferrando 1 Sep 2007 ) hope it would give energy to our member to make this great contribution evolve :thumbsup: Quote MS2 Link to comment Share on other sites More sharing options...
joebloggs Posted September 12, 2007 Share Posted September 12, 2007 Can anyone tell me why, when im on the quick updates page the i cant go to the next page of products of increase the amount of lines on view !!!! can anyone help please ? Quote Link to comment Share on other sites More sharing options...
enigmabunny Posted September 24, 2007 Share Posted September 24, 2007 Hi, great contribution, but cant access it, ive installed it and followed instructions. i added the quick_updates to my admin screen in catalogue, but it does not show anywhere. any ideas on why this is? Thanks Eddie Quote Link to comment Share on other sites More sharing options...
wajn Posted October 2, 2007 Share Posted October 2, 2007 I have been using the QPU for a long time. Just set up new store on new server and now only the Category drop down is working. If I select a manufacture from the drop-down it shows the correct selection in the address bar (Ex. quick_updates.php?row_by_page=20&cPath=&manufacturer=19) but it is like it never executes the command and I get all products listed again. Same thing happens for "Lines Per Page". Any sugestions? BIG THNX!! Quote Link to comment Share on other sites More sharing options...
elcidd Posted October 3, 2007 Share Posted October 3, 2007 Hello, I am currently getting this error message on my Quick Prices Update module: 1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 select manufacturers_name from manufacturers where manufacturers_id= This only happens when I try to sort by manufacturer. I applied the split_page_result fix but nothing seemed to change. Does anyone have any idea what the problem is (and how I can fix it?). Thanks Lionel P.S. This issues started happening after I installed Easy Populate 2.76f r1 (here) ) and imported some new products. Quote Link to comment Share on other sites More sharing options...
elcidd Posted October 9, 2007 Share Posted October 9, 2007 Hello, I am currently getting this error message on my Quick Prices Update module: 1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 select manufacturers_name from manufacturers where manufacturers_id= This only happens when I try to sort by manufacturer. I applied the split_page_result fix but nothing seemed to change. Does anyone have any idea what the problem is (and how I can fix it?). Thanks Lionel P.S. This issues started happening after I installed Easy Populate 2.76f r1 (here) ) and imported some new products. I am not sure if this is the cause of my problem, however, once I removed the other languages from my store the Quick Price update as well as Easy Populate started working together. I don't use the other languages so it is not a problem for me. Quote Link to comment Share on other sites More sharing options...
Elazar Posted October 24, 2007 Share Posted October 24, 2007 Could someone help please?? The contribution work to me but there is an one issue that I could not solve !? I have 84 products in my site. But when I use quick update I get only text that it say I have 75 products ?? I checked the box for "all manufacturers" option.. Here is my admin quick update file: ________________________________________________________________________________ ___ <?php /* $Id: quick_updates.php 2005/09/14 13:55:34 HRB Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Based on the original script contributed by Burt ([email protected]) and by Henri Bredehoeft ([email protected]) Changelog: by Infobroker [email protected] Copyright © 2002 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); ($row_by_page) ? define('MAX_DISPLAY_ROW_BY_PAGE' , $row_by_page ) : $row_by_page = MAX_DISPLAY_SEARCH_RESULTS; define('MAX_DISPLAY_ROW_BY_PAGE' , MAX_DISPLAY_SEARCH_RESULTS ); //// Tax Row $tax_class_array = array(array('id' => '0', 'text' => NO_TAX_TEXT)); $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title"); while ($tax_class = tep_db_fetch_array($tax_class_query)) { $tax_class_array[] = array('id' => $tax_class['tax_class_id'], 'text' => $tax_class['tax_class_title']); } ////Info Row pour le champ fabriquant $manufacturers_array = array(array('id' => '0', 'text' => NO_MANUFACTURER)); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } // Display the list of the manufacturers function manufacturers_list(){ global $manufacturer; $manufacturers_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m order by m.manufacturers_name ASC"); $return_string = '<select name="manufacturer" onChange="this.form.submit();">'; $return_string .= '<option value="' . 0 . '">' . TEXT_ALL_MANUFACTURERS . '</option>'; while($manufacturers = tep_db_fetch_array($manufacturers_query)){ $return_string .= '<option value="' . $manufacturers['manufacturers_id'] . '"'; if($manufacturer && $manufacturers['manufacturers_id'] == $manufacturer) $return_string .= ' SELECTED'; $return_string .= '>' . $manufacturers['manufacturers_name'] . '</option>'; } $return_string .= '</select>'; return $return_string; } ##// Uptade database switch ($HTTP_GET_VARS['action']) { case 'update' : $count_update=0; $item_updated = array(); if($HTTP_POST_VARS['product_new_model']){ foreach($HTTP_POST_VARS['product_new_model'] as $id => $new_model) { if (trim($HTTP_POST_VARS['product_new_model'][$id]) != trim($HTTP_POST_VARS['product_old_model'][$id])) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_model='" . $new_model . "', products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_name']){ foreach($HTTP_POST_VARS['product_new_name'] as $id => $new_name) { if (trim($HTTP_POST_VARS['product_new_name'][$id]) != trim($HTTP_POST_VARS['product_old_name'][$id])) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . " SET products_name='" . $new_name . "' WHERE products_id=$id and language_id=" . $languages_id); mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_sort_order']){ foreach($HTTP_POST_VARS['product_new_sort_order'] as $id => $new_sort_order) { if ($HTTP_POST_VARS['product_new_sort_order'][$id] != $HTTP_POST_VARS['product_old_sort_order'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_sort_order=$new_sort_order, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_price']){ foreach($HTTP_POST_VARS['product_new_price'] as $id => $new_price) { if ($HTTP_POST_VARS['product_new_price'][$id] != $HTTP_POST_VARS['product_old_price'][$id] && $HTTP_POST_VARS['update_price'][$id] == 'yes') { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_price=$new_price, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_weight']){ foreach($HTTP_POST_VARS['product_new_weight'] as $id => $new_weight) { if ($HTTP_POST_VARS['product_new_weight'][$id] != $HTTP_POST_VARS['product_old_weight'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_weight=$new_weight, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_quantity']){ foreach($HTTP_POST_VARS['product_new_quantity'] as $id => $new_quantity) { if ($HTTP_POST_VARS['product_new_quantity'][$id] != $HTTP_POST_VARS['product_old_quantity'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_quantity=$new_quantity, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_manufacturer']){ foreach($HTTP_POST_VARS['product_new_manufacturer'] as $id => $new_manufacturer) { if ($HTTP_POST_VARS['product_new_manufacturer'][$id] != $HTTP_POST_VARS['product_old_manufacturer'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET manufacturers_id=$new_manufacturer, products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_image']){ foreach($HTTP_POST_VARS['product_new_image'] as $id => $new_image) { if (trim($HTTP_POST_VARS['product_new_image'][$id]) != trim($HTTP_POST_VARS['product_old_image'][$id])) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_image='" . $new_image . "', products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_status']){ foreach($HTTP_POST_VARS['product_new_status'] as $id => $new_status) { if ($HTTP_POST_VARS['product_new_status'][$id] != $HTTP_POST_VARS['product_old_status'][$id]) { $count_update++; $item_updated[$id] = 'updated'; tep_set_product_status($id, $new_status); mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_last_modified=now() WHERE products_id=$id"); } } } if($HTTP_POST_VARS['product_new_tax']){ foreach($HTTP_POST_VARS['product_new_tax'] as $id => $new_tax_id) { if ($HTTP_POST_VARS['product_new_tax'][$id] != $HTTP_POST_VARS['product_old_tax'][$id]) { $count_update++; $item_updated[$id] = 'updated'; mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_tax_class_id=$new_tax_id, products_last_modified=now() WHERE products_id=$id"); } } } $count_item = array_count_values($item_updated); if ($count_item['updated'] > 0) $messageStack->add($count_item['updated'].' '.TEXT_PRODUCTS_UPDATED . " $count_update " . TEXT_QTY_UPDATED, 'success'); break; case 'calcul' : if ($HTTP_POST_VARS['spec_price']) $preview_global_price = 'true'; break; } //// explode string parameters from preview product if($info_back && $info_back!="-") { $infoback = explode('-',$info_back); $sort_by = $infoback[0]; $page = $infoback[1]; $current_category_id = $infoback[2]; $row_by_page = $infoback[3]; $manufacturer = $infoback[4]; } //// define the step for rollover lines per page $row_bypage_array = array(array()); for ($i = 10; $i <=100 ; $i=$i+5) { $row_bypage_array[] = array('id' => $i, 'text' => $i); } ##// Let's start displaying page with forms ?> <!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 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 //--> <script language="javascript"> <!-- var browser_family; var up = 1; if (document.all && !document.getElementById) browser_family = "dom2"; else if (document.layers) browser_family = "ns4"; else if (document.getElementById) browser_family = "dom2"; else browser_family = "other"; function display_ttc(action, prix, taxe, up){ if(action == 'display'){ if(up != 1) valeur = Math.round((prix + (taxe / 100) * prix) * 100) / 100; }else{ if(action == 'keyup'){ valeur = Math.round((parseFloat(prix) + (taxe / 100) * parseFloat(prix)) * 100) / 100; }else{ valeur = '0'; } } switch (browser_family){ case 'dom2': document.getElementById('descDiv').innerHTML = '<?php echo TOTAL_COST; ?> : '+valeur; break; case 'ie4': document.all.descDiv.innerHTML = '<?php echo TOTAL_COST; ?> : '+valeur; break; case 'ns4': document.descDiv.document.descDiv_sub.document.write(valeur); document.descDiv.document.descDiv_sub.document.close(); break; case 'other': break; } } --> </script> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td 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 width="100%" valign="top"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" colspan="3" valign="top"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"> <?php if($current_category_id != 0){ $image_query = tep_db_query("select c.categories_image from " . TABLE_CATEGORIES . " c where c.categories_id=" . $current_category_id); $image = tep_db_fetch_array($image_query); echo tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $image['categories_image'], '', 40); }else{ if($manufacturer){ $image_query = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id=" . $manufacturer); $image = tep_db_fetch_array($image_query); echo tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $image['manufacturers_image'], '', 40); } } ?> </td></tr> </table></td></tr> <tr><td align="center"> <table width="100%" cellspacing="0" cellpadding="0" border="1" bgcolor="#F3F9FB" bordercolor="#D1E7EF" height="100"><tr align="left"><td valign="middle"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr><td height="5"></td></tr> <tr align="center"> <td class="smalltext"><?php echo tep_draw_form('row_by_page', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'manufacturer', $manufacturer); echo tep_draw_hidden_field( 'cPath', $current_category_id);?></td> <td class="smallText"><?php echo TEXT_MAXI_ROW_BY_PAGE . ' ' . tep_draw_pull_down_menu('row_by_page', $row_bypage_array, $row_by_page, 'onChange="this.form.submit();"'); ?></form></td> <?php echo tep_draw_form('categorie', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'manufacturer', $manufacturer); ?> <td class="smallText" align="center" valign="top"><?php echo DISPLAY_CATEGORIES . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td></form> <?php echo tep_draw_form('manufacturers', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'cPath', $current_category_id);?> <td class="smallText" align="center" valign="top"><?php echo DISPLAY_MANUFACTURERS . ' ' . manufacturers_list(); ?></td></form> </tr> </table> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr align="center"> <td align="center"> <table border="0" cellspacing="0"> <form name="spec_price" <?php echo 'action="' . tep_href_link(FILENAME_QUICK_UPDATES, tep_get_all_get_params(array('action', 'info', 'pID')) . "action=calcul&page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer" , 'NONSSL') . '"'; ?> method="post"> <tr> <td class="main" align="center" valign="middle" nowrap> <?php echo TEXT_INPUT_SPEC_PRICE; ?></td> <td align="center" valign="middle"> <?php echo tep_draw_input_field('spec_price',0,'size="5"'); ?> </td> <td class="smalltext" align="center" valign="middle"><?php if ($preview_global_price != 'true') { echo ' ' . tep_image_submit('button_preview.gif', IMAGE_PREVIEW, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer"); } else echo ' <a href="' . tep_href_link(FILENAME_QUICK_UPDATES, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer") . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';?></td> </tr> <tr> <td class="smalltext" align="center" valign="middle" colspan="3" nowrap> <?php if ($preview_global_price != 'true') { echo TEXT_SPEC_PRICE_INFO1 ; } else echo TEXT_SPEC_PRICE_INFO2;?> </td> </tr> </form> </table> </td> </tr> <tr><td height="5"></td></tr> </td></tr> <br> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr align="center"> <form name="update" method="POST" action="<?php echo "$PHP_SELF?action=update&page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer"; ?>"> <td class="smalltext" align="middle"><?php echo WARNING_MESSAGE; ?> </td> <?php echo "<td class=\"pageHeading\" align=\"right\">" . '<script language="javascript"><!-- switch (browser_family) { case "dom2": case "ie4": document.write(\'<div id="descDiv">\'); break; default: document.write(\'<ilayer id="descDiv"><layer id="descDiv_sub">\'); break; } --> </script>' . "</td>\n"; ?> <td align="right" valign="middle"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE, "action=update&cPath=$current_category_id&page=$page&sort_by=$sort_by&row_by_page=$row_by_page");?></td> </tr> </table> </td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <!-- Arbeitsfarbe --> <td valign="top"><table border="0" bordercolor="#FF0000" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" valign="top"> <!-- Modell ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_MODEL == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_model ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_MODEL . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_model DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_MODEL . ' ' . TEXT_DESCENDINGLY)."</a> <br>" .TABLE_HEADING_MODEL; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><?php echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=pd.products_name ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_PRODUCTS . TEXT_ASCENDINGLY)."</a><a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=pd.products_name DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_PRODUCTS . ' ' . TEXT_DESCENDINGLY)."</a><br>" .TABLE_HEADING_PRODUCTS; ?></td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Status ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_STATUT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_status ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . 'OFF ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_status DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . 'ON ' . TEXT_ASCENDINGLY)."</a> <br>" .TABLE_HEADING_STATUS; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Gewicht ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_WEIGHT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_weight ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_WEIGHT . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_weight DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_WEIGHT . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_WEIGHT; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Stück ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_QUANTITY == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_quantity ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_QUANTITY . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_quantity DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_QUANTITY . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_QUANTITY; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Bild ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_IMAGE == 'true')echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_image ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_IMAGE . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_image DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_IMAGE . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_IMAGE; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"><!-- Hersteller ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_MANUFACTURER == 'true')echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=m.manufacturers_name ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_MANUFACTURERS . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=m.manufacturers_name DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_MANUFACTURERS . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_MANUFACTURERS; ?> </td> <td class="dataTableHeadingContent" align="left" valign="top"> <!-- Preis ++++++++++++++++++++++++++++++++++ --> <?php echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_price ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_PRICE . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_price DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_PRICE . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_PRICE;?> </td> <td class="dataTableHeadingContent" align="left" valign="top"> <!-- MwSt ++++++++++++++++++++++++++++++++++ --> <?php if(DISPLAY_TAX == 'true')echo "<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_tax_class_id ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_TAX . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_tax_class_id DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_TAX . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_TAX; ?> </td> <td class="dataTableHeadingContent" align="center" valign="middle"> </td> <td class="dataTableHeadingContent" align="center" valign="middle"> </td> </tr><tr class="datatableRow"> <?php //// control string sort page if ($sort_by && !ereg('order by',$sort_by)) $sort_by = 'order by '.$sort_by ; //// define the string parameters for good back preview product $origin = FILENAME_QUICK_UPDATES."?info_back=$sort_by-$page-$current_category_id-$row_by_page-$manufacturer"; //// controle lenght (lines per page) $split_page = $page; if ($split_page > 1) $rows = $split_page * MAX_DISPLAY_ROW_BY_PAGE - MAX_DISPLAY_ROW_BY_PAGE; //// select categories if ($current_category_id == 0){ if($manufacturer){ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = m.manufacturers_id and p.manufacturers_id = " . $manufacturer . " $sort_by "; }else{ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and p.manufacturers_id = m.manufacturers_id and pd.language_id = '$languages_id' $sort_by "; } } else { if($manufacturer){ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = m.manufacturers_id and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.manufacturers_id = " . $manufacturer . " $sort_by "; }else{ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = m.manufacturers_id and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by "; } } //// page splitter and display each products info $products_split = new splitPageResults($split_page, MAX_DISPLAY_ROW_BY_PAGE, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { $rows++; if (strlen($rows) < 2) { $rows = '0' . $rows; } //// check for global add value or rates, calcul and round values rates if ($HTTP_POST_VARS['spec_price']){ $flag_spec = 'true' ; if (substr($HTTP_POST_VARS['spec_price'],-1) == '%') { if($HTTP_POST_VARS['marge'] && substr($HTTP_POST_VARS['spec_price'],0,1) != '-'){ $valeur = (1 - (ereg_replace("%", "", $HTTP_POST_VARS['spec_price']) / 100)); $price = sprintf("%01.2f", round($products['products_price'] / $valeur,2)); }else{ $price = sprintf("%01.2f", round($products['products_price'] + (($spec_price / 100) * $products['products_price']),2)); } } else $price = sprintf("%01.2f", round($products['products_price'] + $spec_price,2)); } else $price = $products['products_price'] ; //// Check Tax_rate for displaying TTC $tax_query = tep_db_query("select r.tax_rate, c.tax_class_title from " . TABLE_TAX_RATES . " r, " . TABLE_TAX_CLASS . " c where r.tax_class_id=" . $products['products_tax_class_id'] . " and c.tax_class_id=" . $products['products_tax_class_id']); $tax_rate = tep_db_fetch_array($tax_query); if($tax_rate['tax_rate'] == '')$tax_rate['tax_rate'] = 0; if(MODIFY_MANUFACTURER == 'false'){ $manufacturer_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id=" . $products['manufacturers_id']); $manufacturer = tep_db_fetch_array($manufacturer_query); } //// display infos per row if($flag_spec){echo '<tr class="dataTableRow" onmouseover="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'display\', ' . $price . ', ' . $tax_rate['tax_rate'] . ');';} echo 'this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'delete\');';} echo 'this.className=\'dataTableRow\'">'; }else{ echo '<tr class="dataTableRow" onmouseover="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'display\', ' . $products['products_price'] . ', ' . $tax_rate['tax_rate'] . ');';} echo 'this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'delete\', \'\', \'\', 0);';} echo 'this.className=\'dataTableRow\'">';} if(DISPLAY_MODEL == 'true'){if(MODIFY_MODEL == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"6\" name=\"product_new_model[".$products['products_id']."]\" value=\"".$products['products_model']."\"></td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $products['products_model'] . "</td>\n";}else{ echo "<td class=\"smallText\" align=\"left\">";} if(MODIFY_NAME == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"35\" name=\"product_new_name[".$products['products_id']."]\" value=\"".$products['products_name']."\"></td>\n";else echo "<td class=\"smallText\" align=\"left\">".$products['products_name']."</td>\n"; //// Product status radio button if(DISPLAY_STATUT == 'true'){ if ($products['products_status'] == '1') { echo "<td class=\"smallText\"><input type=\"radio\" name=\"product_new_status[".$products['products_id']."]\" value=\"0\" ><input type=\"radio\" name=\"product_new_status[".$products['products_id']."]\" value=\"1\" checked ></td>\n"; } else { echo "<td class=\"smallText\"><input type=\"radio\" style=\"background-color: #EEEEEE\" name=\"product_new_status[".$products['products_id']."]\" value=\"0\" checked ><input type=\"radio\" style=\"background-color: #EEEEEE\" name=\"product_new_status[".$products['products_id']."]\" value=\"1\"></td>\n"; } } if(DISPLAY_WEIGHT == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"5\" name=\"product_new_weight[".$products['products_id']."]\" value=\"".$products['products_weight']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_QUANTITY == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"3\" name=\"product_new_quantity[".$products['products_id']."]\" value=\"".$products['products_quantity']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_IMAGE == 'true')echo "<td class=\"smallText\"><input type=\"text\" size=\"8\" name=\"product_new_image[".$products['products_id']."]\" value=\"".$products['products_image']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_MANUFACTURER == 'true'){if(MODIFY_MANUFACTURER == 'true')echo "<td class=\"smallText\">".tep_draw_pull_down_menu("product_new_manufacturer[".$products['products_id']."]\"", $manufacturers_array, $products['manufacturers_id'])."</td>\n";else echo "<td class=\"smallText\">" . $manufacturer['manufacturers_name'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";} //// get the specials products list $specials_array = array(); $specials_query = tep_db_query("select p.products_id, s.products_id, s.specials_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id"); while ($specials = tep_db_fetch_array($specials_query)) { $specials_array[] = $specials['products_id']; } //// check specials if ( in_array($products['products_id'],$specials_array)) { $spec_query = tep_db_query("select s.products_id, s.specials_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = " . (int)$products['products_id'] . ""); $spec = tep_db_fetch_array($spec_query); echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" value=\"".$products['products_price']."\" disabled > <a target=blank href=\"".tep_href_link (FILENAME_SPECIALS, 'sID='.$spec['specials_id']).'&action=edit'."\">". tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_SPECIALS_PRODUCTS) ."</a></td>\n"; } else { if ($flag_spec == 'true') { echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" "; if(DISPLAY_TVA_UP == 'true'){ echo "onKeyUp=\"display_ttc('keyup', this.value" . ", " . $tax_rate['tax_rate'] . ", 1);\"";} echo " value=\"".$price ."\">".tep_draw_checkbox_field('update_price['.$products['products_id'].']','yes','checked','no')."</td>\n"; } else { echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" "; if(DISPLAY_TVA_UP == 'true'){ echo "onKeyUp=\"display_ttc('keyup', this.value" . ", " . $tax_rate['tax_rate'] . ", 1);\"";} echo " value=\"".$price ."\">".tep_draw_hidden_field('update_price['.$products['products_id'].']','yes'). "</td>\n";} } if(DISPLAY_TAX == 'true'){if(MODIFY_TAX == 'true')echo "<td class=\"smallText\" align=\"left\">".tep_draw_pull_down_menu("product_new_tax[".$products['products_id']."]\"", $tax_class_array, $products['products_tax_class_id'])."</td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $tax_rate['tax_class_title'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";} //// links to preview or full edit if(DISPLAY_PREVIEW == 'true')echo "<td class=\"smallText\" align=\"left\"><a href=\"".tep_href_link (FILENAME_CATEGORIES, 'pID='.$products['products_id'].'&action=new_product_preview&read=only&sort_by='.$sort_by.'&page='.$split_page.'&origin='.$origin)."\">". tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_IMAGE_PREVIEW) ."</a></td>\n"; if(DISPLAY_EDIT == 'true')echo "<td class=\"smallText\" align=\"left\"><a href=\"".tep_href_link (FILENAME_CATEGORIES, 'pID='.$products['products_id'].'&cPath='.$categories_products[0].'&action=new_product')."\">". tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', TEXT_IMAGE_SWITCH_EDIT) ."</a></td>\n"; //// Hidden parameters for cache old values if(MODIFY_NAME == 'true') echo tep_draw_hidden_field('product_old_name['.$products['products_id'].'] ',$products['products_name']); if(MODIFY_MODEL == 'true') echo tep_draw_hidden_field('product_old_model['.$products['products_id'].'] ',$products['products_model']); echo tep_draw_hidden_field('product_old_sort_order['.$products['products_id'].']',$products['products_sort_order']); echo tep_draw_hidden_field('product_old_make_an_offer['.$products['products_id'].']',$products['products_make_an_offer']); echo tep_draw_hidden_field('product_old_zusatz3['.$products['products_id'].']',$products['products_zusatz3']); echo tep_draw_hidden_field('product_old_status['.$products['products_id'].']',$products['products_status']); echo tep_draw_hidden_field('product_old_quantity['.$products['products_id'].']',$products['products_quantity']); echo tep_draw_hidden_field('product_old_image['.$products['products_id'].']',$products['products_image']); if(MODIFY_MANUFACTURER == 'true')echo tep_draw_hidden_field('product_old_manufacturer['.$products['products_id'].']',$products['manufacturers_id']); echo tep_draw_hidden_field('product_old_weight['.$products['products_id'].']',$products['products_weight']); echo tep_draw_hidden_field('product_old_base_price['.$products['products_id'].']',$products['products_base_price']); echo tep_draw_hidden_field('product_old_base_unit['.$products['products_id'].']',$products['products_base_unit']); echo tep_draw_hidden_field('product_old_price_ek['.$products['products_id'].']',$products['products_price_ek']); echo tep_draw_hidden_field('product_old_price['.$products['products_id'].']',$products['products_price']); if(MODIFY_TAX == 'true')echo tep_draw_hidden_field('product_old_tax['.$products['products_id'].']',$products['products_tax_class_id']); //// hidden display parameters echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'sort_by', $sort_by); echo tep_draw_hidden_field( 'page', $split_page); } echo "</table>\n"; ?> </td> </tr> </table></td> </tr> <tr> <td align="right"> <?php //// display bottom page buttons echo '<a href="java script:window.print()">' . tep_image_submit('button_print.gif', PRINT_TEXT) . '</a> '; echo tep_image_submit('button_update.gif', IMAGE_UPDATE); echo ' <a href="' . tep_href_link(FILENAME_QUICK_UPDATES,"row_by_page=$row_by_page") . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td> </tr> </form> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, $split_page, TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, MAX_DISPLAY_PAGE_LINKS, $split_page, '&cPath='. $current_category_id .'&sort_by='.$sort_by . '&row_by_page=' . $row_by_page); ?></td> </table></td> </tr> </table></td> </tr> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> </tr> </table> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> ______________________________________________________________________________ could someone help me to solve it please?? Elazar Quote Link to comment Share on other sites More sharing options...
Guest Posted October 28, 2007 Share Posted October 28, 2007 Hi, I've just started getting a HTTP 406 error when I click on the "Update" button in quick update. I am using IE7. Anyone able to suggest what the problem is? Quote Link to comment Share on other sites More sharing options...
data2700 Posted October 30, 2007 Share Posted October 30, 2007 Im using Quick Price Update v2.7 Full Version with CRE Loaded dated september 4 2007. I love this contribution it is saving me ALOT of time. How can I change the form layout so that I can see my entire MODEL name, which I have modified to be longer than the standard OSC model number of 8 characters? I have looked through quick_updates.php but Im not sure what to change. Quote Link to comment Share on other sites More sharing options...
devilgrins Posted November 14, 2007 Share Posted November 14, 2007 is anyone able to advise how i can make the model# & the Tax Status column s"editable" like the price/quantity as such.. i would like to be edit the model# and select the tax too.. please any assistance else i am loving this contribute Quote Link to comment Share on other sites More sharing options...
devilgrins Posted November 14, 2007 Share Posted November 14, 2007 opps sorry.. i didnt see that its already there but not turned on :) is anyone able to advise how i can make the model# & the Tax Status column s"editable" like the price/quantity as such.. i would like to be edit the model# and select the tax too.. please any assistance else i am loving this contribute Quote Link to comment Share on other sites More sharing options...
BullionFever Posted January 2, 2008 Share Posted January 2, 2008 This doesn't seem to be working for me. I just installed v 2.7 Full Version from September 4. I followed all instructions from the install_repack file. Now, when I log into the control panel, I see that a new link has been added to the catalog box. This link reads BOX_CATALOG_QUICK_UPDATES. That seemed a little odd, because I was expecting it to just say "Quick Updates". When I click on the link, it tries to open: http://www.mystore.com/admin/FILENAME_QUICK_UPDATES This, in turn, gives me an error 404, saying that "FILENAME_QUICK_UPDATES was not found on this server." I double checked all of the files, especially admin/includes/fileanames.php. After I checked them all, I reuploaded, and get the same result. I have no idea why this is not working. It did not mess anything up, so that's a plus - it just doesn't work. It seems to be something with where it calls the filename. Did anyone else have this problem? How did you get by it? Quote Link to comment Share on other sites More sharing options...
computel Posted March 25, 2008 Share Posted March 25, 2008 Can anyone get this to work on PHP 5 as it only shows the first page and you can't change the line counts or page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.