Aide - Recherche - Membres - Calendrier
Version complète : [résolu] Quick update 2.1b
Forum osCommerce-fr > Adapter OsCommerce MS2 > Contributions
salva
Bonjour,

J'utilise la contribution quick update version 2.1b de Gnidhal elle fonctionne à merveille.
(il y a des version supérieur mais impossible de les faire fonctionner)

Mais serait'il possible à un "crak" en Php de l'améliorer.

En fait tout est parfais sur cette contrib mais elle le serai encore plus si elle premettait de mettre à jour également le "model" et le "nom" des articles, car atuellement le model et le nom appraissent en texte non modifiable.

J'ai bien essayé de modifer le code, mais mon niveau très limité dry.gif en Php ne m'a pas permis de mettre enoeuvre ces nouvelles fonctionnalité.

A moins qu'il existe une contrib qui elle permette de mettre à jour le model et le nom dans une liste global.

Je met ci-dessous le code de la page quick_update.php :

CODE
<?php
/*
  $Id: quick_updates.php,v 2.1b 2003/05/12 14:44:34 HRB Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Based on the original script contributed by Burt (burt@xwww.co.uk)
        and by Henri Bredehoeft (hrb@nermica.net)
  This version was contributed by GniDhal (fx@geniehalles.com)
  and Xaglo (xaglo@free.fr)
  (http://www.oscommerce-fr.com )

  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']);
    }

##// Uptade database
  switch ($HTTP_GET_VARS['action']) {
    case 'update' :
      $count_update=0;
      $item_updated = array();
       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 products SET products_price=$new_price WHERE products_id=$id");
         }
       }
       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 products SET products_weight=$new_weight WHERE products_id=$id");
         }
       }
       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 products SET products_quantity=$new_quantity WHERE products_id=$id");
         }
       }
       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);
         }
       }
       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 products SET products_tax_class_id=$new_tax_id 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];
     }

//// 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 //-->

<!-- 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" bgColor="#F5F5F5">
            <tr>
             <td class="pageHeading" colspan="3" bgColor="#FFFFFF"><?php echo HEADING_TITLE; ?></td>
           </tr>
           <tr>
             <?php echo tep_draw_form('row_by_page', FILENAME_QUICK_UPDATES, '', 'get'); ?>
             <td class="smallText" align="left"><?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();"'); ?>
             </td>
             </form>
             <td align="right" colspan="2">
               <table border="0"  cellspacing="0" cellpadding="2">
               <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" , 'NONSSL') . '"'; ?> method="post">
                 <tr class="dataTableHeadingRow">
                   <td class="main"  align="right" valign="middle" nowrap> <?php echo TEXT_INPUT_SPEC_PRICE; ?></td>
                   <td class="dataTableHeadingContent" align="right" valign="middle"> <?php echo tep_draw_input_field('spec_price',0,'size="5"'); ?> </td>
                   <td class="smalltext" align="right" 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");
                     } 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") . '">' . 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>
<?php echo tep_draw_form('categorie', FILENAME_QUICK_UPDATES, '', 'get'); ?>
                <td class="smallText" align="left"><?php echo DISPLAY_CATEGORIES . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td></form>
<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"; ?>">
               <td class="smalltext" align="middle"><?php echo WARNING_MESSAGE; ?> </td>
               <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>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent" align="left" valign="middle">
                  <table border="0" cellspacing="0" cellpadding="0">
                    <tr class="dataTableHeadingRow">
                     <td class="dataTableHeadingContent" align="right" valign="middle">
                     <?php echo " <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 )."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_down.gif', 'Desc')." </a></td> " .
                     "<td class=\"dataTableHeadingContent\" align=\"center\" valign=\"middle\">"  .TABLE_HEADING_MODEL ."</td>" .
                     "<td class=\"dataTableHeadingContent\" align=\"left\" valign=\"middle\"><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 )."\" > ".tep_image(DIR_WS_IMAGES . 'icon_arrow_up.gif', 'Asc')."</a></td>"; ?>
                    </tr>
                  </table>
                </td>
                <td class="dataTableHeadingContent" align="left" valign="middle">
                  <table border="0" cellspacing="0" cellpadding="0">
                    <tr class="dataTableHeadingRow">
                     <td class="dataTableHeadingContent" align="right" valign="middle">
                     <?php echo " <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 )."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_down.gif', 'Desc')." </a></td> " .
                     "<td class=\"dataTableHeadingContent\" align=\"center\" valign=\"middle\">" . TABLE_HEADING_PRODUCTS . "</td>" .
                     "<td class=\"dataTableHeadingContent\" align=\"left\" valign=\"middle\"><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 )."\" > ".tep_image(DIR_WS_IMAGES . 'icon_arrow_up.gif', 'Asc')."</a></td>"; ?>
                    </tr>
                  </table>
                </td>
                <td class="dataTableHeadingContent" align="center" valign="middle">
                  <table border="0" cellspacing="0" cellpadding="0">
                    <tr class="dataTableHeadingRow">
                     <td class="dataTableHeadingContent" align="right" valign="middle">
                    <?php echo "<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 )."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_down.gif', 'Desc')." </a></td> " .
                     "<td class=\"dataTableHeadingContent\" align=\"center\" valign=\"middle\">" . TABLE_HEADING_STATUS . "<br>off / on</td>" .
                     "<td class=\"dataTableHeadingContent\" align=\"left\" valign=\"middle\"><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 )."\" > ".tep_image(DIR_WS_IMAGES . 'icon_arrow_up.gif', 'Asc')."</a></td>"; ?>
                    </tr>
                  </table>
                </td>
                <td class="dataTableHeadingContent" align="center" valign="middle">
                  <table border="0" cellspacing="0" cellpadding="0">
                    <tr class="dataTableHeadingRow">
                     <td class="dataTableHeadingContent" align="right" valign="middle">
                     <?php echo " <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 ) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_down.gif', 'Desc')."</a></td> " .
                     "<td class=\"dataTableHeadingContent\" align=\"center\" valign=\"middle\">" . TABLE_HEADING_WEIGHT . "</td>" .
                     "<td class=\"dataTableHeadingContent\" align=\"left\" valign=\"middle\"><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 ) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_up.gif', 'Asc')."</a></td>"; ?>
                    </tr>
                  </table>
                </td>
                <td class="dataTableHeadingContent" align="center" valign="middle">
                  <table border="0" cellspacing="0" cellpadding="0">
                    <tr class="dataTableHeadingRow">
                     <td class="dataTableHeadingContent" align="right" valign="middle">
                     <?php echo " <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 )."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_down.gif', 'Desc')."</a></td> " .
                     "<td class=\"dataTableHeadingContent\" align=\"center\" valign=\"middle\">" . TABLE_HEADING_QUANTITY . "</td>" .
                     "<td class=\"dataTableHeadingContent\" align=\"left\" valign=\"middle\"><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 )."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_up.gif', 'Asc')."</a></td>"; ?>
                    </tr>
                  </table>
                </td>
                <td class="dataTableHeadingContent" align="center" valign="middle">
                <?php echo " <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 ) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_down.gif', 'Desc')."</a>" . TABLE_HEADING_PRICE . " <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 ) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_up.gif', 'Asc')."</a>"; ?> </td>
                <td class="dataTableHeadingContent" align="center" valign="middle">
                <?php echo " <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 )."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_down.gif', 'Desc')."</a> " . TABLE_HEADING_TAX . " <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 )."\" >".tep_image(DIR_WS_IMAGES . 'icon_arrow_up.gif', 'Asc')."</a> "; ?> </td>
                <td class="dataTableHeadingContent" align="center" valign="middle"></td>
                <td class="dataTableHeadingContent" align="center" valign="middle"></td>
              </tr>
          <tr class="datatableRow">
<?
//// get the specials products list
     $specials_array = array();
     $specials_query = tep_db_query("select p.products_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'];
     }
//// 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";
//// 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){
    $products_query_raw = "select p.products_id, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd where p.products_id = pd.products_id and pd.language_id = '$languages_id' $sort_by ";
  } else {    
    $products_query_raw = "select p.products_id, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc 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) == '%') {
        $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'];

//// display infos per row
        echo '<tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'">';
        echo "<td class=\"smallText\" align=\"left\">" . $products['products_model'] . "</td>\n";
        echo "<td class=\"smallText\" >".$products['products_name']."</td>\n";
//// Product status radio button
        if ($products['products_status'] == '1') {
         echo "<td class=\"smallText\" align=\"center\"><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\" align=\"center\"><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";
        }

        echo "<td class=\"smallText\" align=\"center\"><input type=\"text\" size=\"5\" name=\"product_new_weight[".$products['products_id']."]\" value=\"".$products['products_weight']."\"></td>\n";
        echo "<td class=\"smallText\" align=\"center\"><input type=\"text\" size=\"3\" name=\"product_new_quantity[".$products['products_id']."]\" value=\"".$products['products_quantity']."\"></td>\n";
//// check specials
        if ( in_array($products['products_id'],$specials_array)) {
            echo "<td class=\"smallText\" align=\"left\">    <input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" value=\"".$products['products_price']."\" disabled > <a href=\"".tep_href_link (FILENAME_SPECIALS, 'sID='.$products['products_id'])."\">". 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']."]\" 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']."]\" value=\"".$price ."\">".tep_draw_hidden_field('update_price['.$products['products_id'].']','yes')."</td>\n";
        }
        echo "<td class=\"smallText\" align=\"center\">".tep_draw_pull_down_menu("product_new_tax[".$products['products_id']."]\"", $tax_class_array, $products['products_tax_class_id'])."</td>\n";
//// links to preview or full edit
        echo "<td class=\"smallText\"  align=\"center\"><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";
        echo "<td class=\"smallText\"  align=\"center\"><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
        echo tep_draw_hidden_field('product_old_model['.$products['products_id'].']',$products['products_model']); //rajout
        echo tep_draw_hidden_field('product_old_name['.$products['products_id'].']',$products['products_name']); //rajout
        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_weight['.$products['products_id'].']',$products['products_weight']);
        echo tep_draw_hidden_field('product_old_price['.$products['products_id'].']',$products['products_price']);
        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 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'); ?>


Merci

Salutations.
fissiaux


En 1), il faut que tu convertisses ces lignes en ligne avec un input pour pouvoir les modifier :
CODE
        echo "<td class=\"smallText\" align=\"left\">" . $products['products_model'] . "</td>\n";
        echo "<td class=\"smallText\" >".$products['products_name']."</td>\n";



En 2), dans le case 'update' du début de fichier, il faut que tu rajoutes le contrôle par rapport aux anciennes valeurs de nom et modèle, et le cas échant procéder à la mise à jour de la base.
salva
Bonsoir fissiaux,

merci pour ton aide.

Sa marche en partie, j'aurai encore besoin d'un petit coup demain.

En fait maintenant j'ai bien des champs texte modifiable pour "model" et "name", par contre lorsque je les modifies et que je valide, la base de donné n'est pas mise à jour, l'affichage reste donc inchangé mais j'ai bien un texte en haut de la page qui me dit "1 article modifié"

Je n'ai pas trouvé ou pas compris comment se fait la mise à jour.

J'ai bien modifié le case 'update' comme tu me l'a dit mais il doit y avoir autre chose.

Peut-être qu'un autre fichier intervient dans cette fonction.

Merci

Salutations.
fissiaux

Qu'as tu fait comme modif dans l'update ?
Gnidhal
Tiens voilà la version que j'utilise en 3 blocs :
SQL
insert into configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) values ('300', 'MàJ rapide', 'Vous pouvez ici configurer ce que vous pourrez modifier dans le module MàJ Rapides.', '300', '1');

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Afficher le modèle.', 'DISPLAY_MODEL', 'true', 'Active/Desactive la visualisation du modèle', 300, 1, '2007-03-18 19:52:08', '2003-06-04 04:18:06', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Modifier le Modèle.', 'MODIFY_MODEL', 'true', 'Active/Desactive la modification du modèle', 300, 2, '2007-03-18 19:52:13', '2003-06-04 04:25:57', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Modifier le nom des produits.', 'MODIFY_NAME', 'true', 'Active/Desactive la modification du nom du produit', 300, 3, '2006-11-23 09:14:17', '2003-06-04 04:30:31', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Modifier le statut (Etat) des produits.', 'DISPLAY_STATUT', 'true', 'Active/Desactive le Statut (affichage et modification)', 300, 4, '2007-01-27 21:59:21', '2003-06-04 05:00:58', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Modifier le poids des produits.', 'DISPLAY_WEIGHT', 'true', 'Active/Desactive le Poids (affichage et modification)', 300, 5, '2003-06-04 05:06:44', '2003-06-04 04:33:16', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Modifier la quantité des produits.', 'DISPLAY_QUANTITY', 'true', 'Active/Desactive la quantité (affichage et modification)', 300, 6, '2007-02-02 09:57:53', '2003-06-04 04:34:34', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Modifier l''image des produits.', 'DISPLAY_IMAGE', 'false', 'Active/Desactive le chemin vers l''image (affichage et modification)', 300, 7, '2007-05-15 16:41:30', '2003-06-04 04:36:57', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Modifier la Production des produits.', 'MODIFY_MANUFACTURER', 'true', 'Active/Desactive le fabricant (affichage et modification)', 300, 8, '2006-07-16 19:57:54', '2003-06-04 04:37:40', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Modifier la classe de taxe des produits.', 'MODIFY_TAX', 'true', 'Active/Desactive la classe de taxe (affichage et modification)', 300, 9, '2007-01-31 14:57:23', '2003-06-04 04:31:53', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Afficher le prix TTC.', 'DISPLAY_TVA_OVER', 'false', 'Active/Desactive la visualisation du prix avec taxe en passant la souris au dessus du produit', 300, 10, '2007-01-27 21:25:32', '2003-06-04 04:38:45', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Afficher price with all included of tax.', 'DISPLAY_TVA_UP', 'true', 'Active/Desactive la visualisation du prix avec taxe quand vous saisissez le prix', 300, 11, '2003-06-04 05:07:06', '2003-06-04 04:40:12', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Afficher le lien vers la page dinfo du produit.', 'DISPLAY_PREVIEW', 'true', 'Active/Desactive le lien vers la page de visualisation du produit', 300, 12, '2006-07-16 19:58:28', '2003-06-04 05:15:50', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Afficher le lien vers la fiche de modification du produit.', 'DISPLAY_EDIT', 'true', 'Active/Desactive le lien vers la page de modification du produit (fiche complète)', 300, 13, '2003-06-04 05:19:08', '2003-06-04 05:17:05', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Afficher la Production.', 'DISPLAY_MANUFACTURER', 'true', 'Souhaitez-vous juste afficher la Production?', 300, 7, '2006-07-16 19:59:26', '2003-06-04 05:17:05', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Afficher la taxe.', 'DISPLAY_TAX', 'true', 'Do you want just display the tax ?', 300, 8, '2007-01-31 14:58:10', '2003-06-04 05:17:05', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Activer ou desactiver la marge commerciale.', 'ACTIVATE_COMMERCIAL_MARGIN', 'false', 'Voulez-vous activer le système de marge commerciale ?', 300, 14, '2006-07-16 19:58:34', '2003-06-04 05:17:05', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');


le script french/quick_update.php
CODE
<?php
/*
  $Id: quick_updates.php v 2.4 $

  The Exchange Project - Community Made Shopping!
  http://www.theexchangeproject.org

  Copyright (c) 2003 The Exchange Project

  Released under the GNU General Public License
*/

define('WARNING_MESSAGE','Enregistrez vos modifications AVANT tout changement d\'affichage (tri, page, catégorie, Marque...)');
define('TOP_BAR_TITLE', 'Mise à jour rapide');
define('HEADING_TITLE', 'Mise à jour rapide');
define('TEXT_PRODUCTS_UPDATED', 'Article(s) Mis à Jour!');
define('TEXT_IMAGE_PREVIEW','Visualiser');
define('TEXT_MARGE_INFO','Modification par marge commerciale : si vous cochez cette case, vos produits seront margés aux taux indiqué. Marger à 25%, signifie que le prix d\'achat est majoré de 33%.');
define('TEXT_IMAGE_SWITCH_EDIT','Bascule vers l\'édition de la fiche produit');
define('TEXT_QTY_UPDATED', 'modification(s)');
define('TEXT_INPUT_SPEC_PRICE','<b>(+/-) Valeur ou taux global :</b>');
define('TEXT_SPEC_PRICE_INFO1','Exemple: 10, 15%, -20, -25%,...');
define('TEXT_SPEC_PRICE_INFO2','<b>Note: </b>Décochez les prix que vous ne souhaitez pas modifier.');
define('TEXT_MAXI_ROW_BY_PAGE', 'Nombre maxi de ligne');
define('TEXT_SPECIALS_PRODUCTS', 'Produit en Promotion !');
define('TEXT_ALL_MANUFACTURERS', 'Toutes les Productions');
define('NO_TAX_TEXT','- N/A -');
define('NO_MANUFACTURER','- N/A -');
define('TABLE_HEADING_CATEGORIES', 'Catégorie');
define('TABLE_HEADING_MODEL', 'Modèle');
define('TABLE_HEADING_PRODUCTS', 'Nom');
define('TABLE_HEADING_PRICE', 'Prix');
define('TABLE_HEADING_TAX', 'TVA');
define('TABLE_HEADING_WEIGHT', 'Poids');
define('TABLE_HEADING_QUANTITY', 'Quantité');
define('TABLE_HEADING_MANUFACTURERS', 'Production');
define('TABLE_HEADING_IMAGE', 'Image');
define('TABLE_HEADING_STATUS', 'Statut');
define('DISPLAY_CATEGORIES', 'Par catégorie');
define('DISPLAY_MANUFACTURERS', 'Par Marque');
define('PRINT_TEXT', 'Imprimer cette page');
define('TOTAL_COST', 'TTC');

define('TEXT_SORT_ALL', 'Trier ');
define('TEXT_DESCENDINGLY', '- Descendant');
define('TEXT_ASCENDINGLY', '- Ascendant');
define('TEXT_BY', ' par ');
?>


C'est du copier/coller depuis mes scripts... pas envie de refaire une contrib' wink.gif
Gnidhal
et le script principal quick_update.php :

[codebox]<?php
/*
$Id: quick_updates.php,v 2.3 2003/06/04 11:44:34 HRB Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Based on the original script contributed by Burt (burt@xwww.co.uk)
and by Henri Bredehoeft (hrb@nermica.net) Version GnidHal

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_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 //-->

&lt;script type="text/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 . '<br>' . 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 . '<br>' . 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 . '<br>' . manufacturers_list(); ?></td></form>
<?php echo tep_draw_form('selection_produit', 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">Sur une partie du nom ?<br> <?php echo tep_draw_input_field('select_produit') ; ?></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>
<?php if(ACTIVATE_COMMERCIAL_MARGIN == 'true'){ echo '<td class="smalltext" align="center" valign="middle"> ' . tep_draw_checkbox_field('marge','yes','','no') . ' ' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_MARGE_INFO) . '</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\">" . '&lt;script type="text/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>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="left" valign="middle">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="left" valign="middle">
<?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>" ; ?>
</tr>
</table>
</td>
<td class="dataTableHeadingContent" align="left" valign="middle">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="left" valign="middle">
<?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>" ; ?>
</tr>
</table>
</td>
<td class="dataTableHeadingContent" align="center" valign="middle">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="center" valign="middle">
<?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>off / on</td>" ; ?>
</tr>
</table>
</td>
<td class="dataTableHeadingContent" align="center" valign="middle">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="center" valign="middle">
<?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>" ; ?>
</tr>
</table>
</td>
<td class="dataTableHeadingContent" align="center" valign="middle">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="center" valign="middle" width="50">
<?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>" ; ?>
</tr>
</table>
</td>
<td class="dataTableHeadingContent" align="left" valign="middle">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="left" valign="middle">
<?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>" ; ?>
</tr>
</table>
</td>
<td class="dataTableHeadingContent" align="left" valign="middle">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="left" valign="middle">
<?php if(DISPLAY_MANUFACTURER == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=manufacturers_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_MANUFACTURERS . ' ' . TEXT_ASCENDINGLY)."</a>
<a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=manufacturers_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_MANUFACTURERS . ' ' . TEXT_DESCENDINGLY)."</a>
<br> " . TABLE_HEADING_MANUFACTURERS . "</td>" ; ?>
</tr>
</table>
</td>
<td class="dataTableHeadingContent" align="left" valign="middle">
<?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="middle">
<?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 where p.products_id = pd.products_id and pd.language_id = '$languages_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 where p.products_id = pd.products_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 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 . "' 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 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 ";
}
}
if ($select_produit ) {
// echo "produit recherché : $select_produit";
$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 where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and LOCATE('$select_produit', pd.products_name)> 0 $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\" align=\"center\"><input type=\"text\" size=\"10\" 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\" align=\"center\"><input type=\"text\" size=\"30\" 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\" align=\"center\"><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\" align=\"center\"><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";
}
}else{
echo "<td class=\"smallText\" align=\"center\"></td>";
}
if(DISPLAY_WEIGHT == 'true')echo "<td class=\"smallText\" align=\"center\"><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\" align=\"center\"><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\" align=\"center\"><input type=\"text\" size=\"28\" 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\" align=\"center\">".tep_draw_pull_down_menu("product_new_manufacturer[".$products['products_id']."]\"", $manufacturers_array, $products['manufacturers_id'],' style="width:150px"')."</td>\n";else echo "<td class=\"smallText\" align=\"center\">" . $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_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_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()">' . 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'); ?>
[/codebox]

hop, bon code wink.gif
salva
Bonjour Fissiaux et Gnidhal


Je dois passer à côté de qqu chose blink.gif

J'ai bien compris que ton code avec les INSERT into sert à mettre a jour la bd.

Mais justement, dans le fichier quick update.php il n'y a aucun insert into même pour les champs qui de base mettent à jour la Bd.

Ils doivent donc se situer dans un autre fichier auquel Quick update fait référence mais je ne l'ai point trouvé dry.gif

Merci

@+

Gnidhal
as-tu remplacé le fichier quick_update.php que je donne aussi ci-dessus ?
il est à jour par rapport au script sql et compatible avec une MS2 standard normalement
salva
Bonjour Gnidhal,


Non je ne l'avais pas fait car l'affichage du fichier principal quick update que tu as donné est très bizarre

la case citation est toute en largeur (elle dépasse des colonne du forum unsure.gif ) et ne fait que 10 lignes en hauteur blink.gif

du coup je pensais que c'était un extrait du code.

Je l'ai copié mais en le collant il n'y a pas de retour à la ligne et le code est inbittable dry.gif

Sans vouloir abuser l'aurais tu sous une autre forme plus cohérente.

@+

PS : chez toi l'affichage de la citation est normal ?
Gnidhal
ahem, comment dire...

heu bon, le bloc de code a un ascenseur à droite...
Il faut copier tout le contenu du bloc dans un nouveau fichier.
Sinon tu me file ton mail par MP et je t'envoies le script zippé.

salva
Bonjour gindhal,


J'ai bien copié tout le script y a pas de problème de ce coté là
mais quand je le colle dans le bloc note (par exemple) il n'y a pas les retour à la ligne (même si il est activé)

du coup j'ai des // qui se retrouve devant du code et sa fou le Bor....

Je t'envoi mon mail par MP.

PS : Mais toi tu vois le script dans son intégralité ? la citation ne déborde pas à droite de l'écran ??

@+
Gnidhal
CITATION(salva @ 17 May 2007, 17:22) [snapback]235868[/snapback]
PS : Mais toi tu vois le script dans son intégralité ? la citation ne déborde pas à droite de l'écran ??

arf' bah non, j'ai un ascenseur dans la page sous FireFox. Mais il est vrai que sous IE c'est bien moins propre.... laugh.gif rhaaaa la compatibilité de IE, c'est pas ça !

Allez relève ton mail wink.gif

D'ailleurs, je viens de faire un essai de copier/coller depuis IE7 dans mon éditeur de code et paf! tout en vrac!
Depuis Firefox = zéro problème! (sauf les tabulations qui ont dégagé)

Tu as raison Salva, mais là, je confirme, change de navigateur!

IE7 c'est pour les utilisateurs et aussi pour vérifier que ton site est lisible dans cette daube de micromou, mais pour développer et même pour lire les forums, Firefox est LA référence et même l'INDISPENSABLE !
salva
Re,

Ok bien recu ton mail.

C'est quand même bizarre cette histoire d'affichage car tes messages précedents ou tu donnes par exemple le code de la page dans frensh ben la y a pas de problème.

Enfin bref.
J'ai le fichier je vais donc pouvoir avancer.

Merci encore

@+
salva
Salut gnidhal

Sa marche parfaitement.

Je cloture donc ce post.

Merci encore.

@+
Ceci est une version "bas débit" de notre forum. Pour voir la version complète avec plus d'informations, la mise en page et les images, veuillez cliquer ici.
Invision Power Board © 2001-2013 Invision Power Services, Inc.