|
'',
'products_description' => '',
'products_url' => '',
'products_id' => '',
'products_quantity' => '',
// -> VDSTAL
'products_stock_alert' => '',
// <- VDSTAL
'products_model' => '',
'products_image' => '',
'products_price' => '',
// -> QPBPP135
'products_qty_blocks' => '',
'discount_categories_id' => '',
// <- QPBPP135
// -> MARP256
'products_cost' => '',
// <- MARP256
'products_weight' => '',
'products_date_added' => '',
'products_last_modified' => '',
'products_date_available' => '',
'products_status' => '',
'products_tax_class_id' => '',
'manufacturers_id' => '');
$pInfo = new objectInfo($parameters);
// -> HTCT262
// -> MARP256
if (isset ($HTTP_GET_VARS['pID']) && (!$HTTP_POST_VARS) ) {
// -> VDSTAL+QPBPP135
$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.products_quantity, p.products_stock_alert, p.products_model, p.products_image, p.products_price, p.products_qty_blocks, p.products_cost, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id, ptdc.discount_categories_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc on p.products_id = ptdc.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);
// <- VDSTAL+QPBPP135
// <- MARP256
// <- HTCT262
$pInfo->objectInfo($product);
// -> QPBPP135
$price_breaks_array = array();
$price_breaks_query = tep_db_query("select products_price, products_qty from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id = '" . tep_db_input($pInfo->products_id) . "' order by products_qty");
while ($price_break = tep_db_fetch_array($price_breaks_query)) {
$price_breaks_array[] = $price_break;
}
// <- QPBPP135
} elseif (tep_not_null($HTTP_POST_VARS)) {
$pInfo->objectInfo($HTTP_POST_VARS);
// -> QPBPP135
$price_breaks_array = array();
for ($count = 0; $count <= (PRICE_BREAK_NOF_LEVELS - 1); $count++) {
if(isset($HTTP_POST_VARS['products_price' . $count]) && tep_not_null($HTTP_POST_VARS['products_price' . $count]) &&
isset($HTTP_POST_VARS['products_qty' . $count]) && tep_not_null($HTTP_POST_VARS['products_qty' . $count])) {
$price_breaks_array[] = array(
'products_price' => $HTTP_POST_VARS['products_price' . $count],
'products_qty' => $HTTP_POST_VARS['products_qty' . $count],
'products_delete' => (isset($HTTP_POST_VARS['products_delete' . $count]) && tep_not_null($HTTP_POST_VARS['products_delete' . $count])));
}
}
// <- QPBPP135
$products_name = $HTTP_POST_VARS['products_name'];
$products_description = $HTTP_POST_VARS['products_description'];
// -> VDFIXBACK
if ( is_array($products_description) )
{
$products_description = array_map('stripslashes', $products_description);
}
else {
$products_description = stripslashes($products_description);
}
// <- VDFIXBACK
$products_url = $HTTP_POST_VARS['products_url'];
}
$manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
$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']);
}
$tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
$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']);
}
// -> QPBPP135
$discount_categories_array = array(array('id' => '0', 'text' => TEXT_NONE));
$discount_categories_query = tep_db_query("select discount_categories_id, discount_categories_name from " . TABLE_DISCOUNT_CATEGORIES . " order by discount_categories_name");
while ($discount_categories = tep_db_fetch_array($discount_categories_query)) {
$discount_categories_array[] = array('id' => $discount_categories['discount_categories_id'],
'text' => $discount_categories['discount_categories_name']);
}
// <- QPBPP135
$languages = tep_get_languages();
if (!isset($pInfo->products_status)) $pInfo->products_status = '1';
switch ($pInfo->products_status) {
case '0': $in_status = false; $out_status = true; break;
case '1':
default: $in_status = true; $out_status = false;
}
?>
|
|
|
|
|
(YYYY-MM-DD) |
|
|
|
manufacturers_id); ?> |
|
|
products_id, $languages[$i]['id']))); ?> |
|
|
products_tax_class_id, 'onchange="updateGross()"'); ?> |
|
products_cost, ''); ?> |
|
products_price, 'onKeyUp="updateGross()"'); ?> |
|
products_price, 'OnKeyUp="updateNet()"'); ?> |
|
|
| |
products_id, $languages[$i]['id']))); ?> |
|
|
|
|
| |
products_id, $languages[$i]['id']))); ?> |
|
|
|
| |
products_id, $languages[$i]['id']))); ?> |
|
|
|
| |
products_id, $languages[$i]['id']))); ?> |
|
|
|
|
products_quantity); ?> |
|
|
products_stock_alert); ?> |
|
|
products_model); ?> |
|
|
|
' . ALERTE_NOTICE_IMAGE . ' ' . tep_image(DIR_WS_ADMIN . DIR_WS_ICONS . 'success.gif') . ' ' . NOTICE_IMAGE . ' '; ?> |
| |
products_image); ?> |
|
|
|
|
| ' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . ''; ?> |
products_id, $languages[$i]['id']))); ?> |
|
QPBPP135 ?>
|
|
discount_categories_id) . tep_draw_hidden_field('current_discount_cat_id', $pInfo->discount_categories_id); ?> |
|
products_qty_blocks, 'size="10"') . " " . TEXT_PRODUCTS_QTY_BLOCKS_HELP; ?> |
|
VDQPBPP : gestion des '%' dans les champs de prix palier
echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price' . $count, $price_breaks_array[$count]['products_price'], 'onChange="updateProductPriceLevel(\'products_price' . $count . '\')" size="10"');
// <- VDQPBPP
echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY;
echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty' . $count, $price_breaks_array[$count]['products_qty'], 'size="10"');
echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('products_delete' . $count, 'y', false) . TEXT_PRODUCTS_DELETE;
} else {
// -> VDQPBPP : gestion des '%' dans les champs de prix palier
echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price' . $count, '', 'onChange="updateProductPriceLevel(\'products_price' . $count . '\')" size="10"');
// <- VDQPBPP
echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY;
echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty' . $count, '', 'size="10"');
}
?>
|
|
|
products_weight); ?> |
|
|
| products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?> |
QPBPP135
$price_breaks_array = array();
for ($count = 0; $count <= (PRICE_BREAK_NOF_LEVELS - 1); $count++) {
if(isset($HTTP_POST_VARS['products_price' . $count]) && tep_not_null($HTTP_POST_VARS['products_price' . $count]) &&
isset($HTTP_POST_VARS['products_qty' . $count]) && tep_not_null($HTTP_POST_VARS['products_qty' . $count])) {
$price_breaks_array[] = array(
'products_price' => $HTTP_POST_VARS['products_price' . $count],
'products_qty' => $HTTP_POST_VARS['products_qty' . $count]);
}
}
// <- QPBPP135
} else {
// -> VDADMINTAX+QPBPP135+VDSTAL
$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_quantity, p.products_stock_alert, p.products_model, p.products_image, p.products_price, p.products_qty_blocks, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, ptdc.discount_categories_id, dc.discount_categories_name, p.products_tax_class_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc on p.products_id = ptdc.products_id left join " . TABLE_DISCOUNT_CATEGORIES . " dc using(discount_categories_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
// <- VDADMINTAX+QPBPP135+VDSTAL
$product = tep_db_fetch_array($product_query);
// <-- HTCT262
$pInfo = new objectInfo($product);
$products_image_name = $pInfo->products_image;
}
$form_action = (isset($HTTP_GET_VARS['pID'])) ? 'update_product' : 'insert_product';
echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');
// -> HTCT262
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {
$pInfo->products_name = tep_get_products_name($pInfo->products_id, $languages[$i]['id']);
$pInfo->products_description = tep_get_products_description($pInfo->products_id, $languages[$i]['id']);
$pInfo->products_head_title_tag = tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]);
$pInfo->products_head_desc_tag = tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]);
$pInfo->products_head_keywords_tag = tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]);
$pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']);
} else {
$pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]);
$pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]);
$pInfo->products_head_title_tag = tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]);
$pInfo->products_head_desc_tag = tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]);
$pInfo->products_head_keywords_tag = tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]);
$pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);
}
// <- HTCT262
?>
| products_name; ?> |
QPBPP135 ?>
format($pInfo->products_price);
$pf->loadProduct((int)$HTTP_GET_VARS['pID'], $pInfo->products_price, $pInfo->products_tax_class_id, (int)$pInfo->products_qty_blocks, $price_breaks_array);
echo $pf->getPriceString();
?> |
VDADMINTAX ?>
display_price($pInfo->products_price, tep_get_tax_rate($pInfo->products_tax_class_id)); ?> |
|
|
| products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description; ?> |
products_url) {
?>
|
| products_url); ?> |
|
products_date_available > date('Y-m-d')) {
?>
| products_date_available)); ?> |
| products_date_added)); ?> |
|
products_id;
}
?>
| ' . tep_image_button('button_back.gif', IMAGE_BACK) . ''; ?> |
|
HTCT262
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_head_title_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_title_tag[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_head_desc_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_desc_tag[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_head_keywords_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_keywords_tag[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
}
// <- HTCT262
echo tep_draw_hidden_field('products_image', stripslashes($products_image_name));
echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . ' ';
if (isset($HTTP_GET_VARS['pID'])) {
echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
} else {
echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
}
echo ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '';
?> |
|
|
|
|
HIDECATE20090102
// -> HTCT262
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.status_categ, cd.categories_htc_title_tag, cd.categories_htc_desc_tag, cd.categories_htc_keywords_tag, cd.categories_htc_description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and cd.categories_name like '%" . tep_db_input($search) . "%' order by c.sort_order, cd.categories_name");
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.status_categ, cd.categories_htc_title_tag, cd.categories_htc_desc_tag, cd.categories_htc_keywords_tag, cd.categories_htc_description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name");
}
// <- HIDECATE20090102
// <- HTCT262
while ($categories = tep_db_fetch_array($categories_query)) {
$categories_count++;
$rows++;
// Get parent_id for subcategories if search
if (isset($HTTP_GET_VARS['search'])) $cPath= $categories['parent_id'];
if ((!isset($HTTP_GET_VARS['cID']) && !isset($HTTP_GET_VARS['pID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $categories['categories_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
$category_childs = array('childs_count' => tep_childs_in_category_count($categories['categories_id']));
$category_products = array('products_count' => tep_products_in_category_count($categories['categories_id']));
$cInfo_array = array_merge($categories, $category_childs, $category_products);
$cInfo = new objectInfo($cInfo_array);
}
if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id) ) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
?>
| ' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . ' ' . $categories['categories_name'] . ''; ?> |
HIDECATE20090102 ?>
' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '';
} else {
echo '' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . ' '
. tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
}
?>
|
categories_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> |
VDADMINTAX+VDSTAL+MARP256+QPBPP135
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_stock_alert, p.products_image, p.products_price, p.products_qty_blocks, p.products_cost, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_hide_from_groups, p.products_tax_class_id, p2c.categories_id, ptdc.discount_categories_id, dc.discount_categories_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc on p.products_id = ptdc.products_id left join " . TABLE_DISCOUNT_CATEGORIES . " dc using(discount_categories_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
} else {
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_stock_alert, p.products_image, p.products_price, p.products_qty_blocks, p.products_cost, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_tax_class_id, ptdc.discount_categories_id, dc.discount_categories_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc on p.products_id = ptdc.products_id left join " . TABLE_DISCOUNT_CATEGORIES . " dc using(discount_categories_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
// -> VDADMINTAX+VDSTAL+MARP256+QPBPP135
}
while ($products = tep_db_fetch_array($products_query)) {
$products_count++;
$rows++;
// Get categories_id for product if search
if (isset($HTTP_GET_VARS['search'])) $cPath = $products['categories_id'];
if ( (!isset($HTTP_GET_VARS['pID']) && !isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['pID']) && ($HTTP_GET_VARS['pID'] == $products['products_id']))) && !isset($pInfo) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
// find out the rating average from customer reviews
$reviews_query = tep_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int)$products['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
$pInfo_array = array_merge($products, $reviews);
$pInfo = new objectInfo($pInfo_array);
}
if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id) ) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
?>
| ' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . ' ' . $products['products_name']; ?> |
' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '';
} else {
echo '' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . ' ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
}
// -> VDOFS : gestion des articles épuisés
if ($products['products_quantity'] == -99999)
{
echo ' ' . tep_image(DIR_WS_IMAGES . 'icon_status_purple.gif', IMAGE_ICON_STATUS_PURPLE, 10, 10) . '';
}
else
{
echo ' ' . tep_image(DIR_WS_IMAGES . 'icon_status_purple_light.gif', IMAGE_ICON_STATUS_PURPLE_LIGHT, 10, 10) . '';
// <- VDOFS
}
// <- VDOFS
?> |
products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> |
0) {
for ($i=0, $n=sizeof($cPath_array)-1; $i<$n; $i++) {
if (empty($cPath_back)) {
$cPath_back .= $cPath_array[$i];
} else {
$cPath_back .= '_' . $cPath_array[$i];
}
}
}
$cPath_back = (tep_not_null($cPath_back)) ? 'cPath=' . $cPath_back . '&' : '';
?>
|
|
'' . TEXT_INFO_HEADING_NEW_CATEGORY . '');
$contents = array('form' => tep_draw_form('newcategory', FILENAME_CATEGORIES, 'action=insert_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_NEW_CATEGORY_INTRO);
$category_inputs_string = '';
$languages = tep_get_languages();
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
$category_inputs_string .= ' ' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']');
// -> HTCT262
$category_htc_title_string .= ' ' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('categories_htc_title_tag[' . $languages[$i]['id'] . ']');
$category_htc_desc_string .= ' ' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('categories_htc_desc_tag[' . $languages[$i]['id'] . ']');
$category_htc_keywords_string .= ' ' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('categories_htc_keywords_tag[' . $languages[$i]['id'] . ']');
$category_htc_description_string .= ' ' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_textarea_field('categories_htc_description[' . $languages[$i]['id'] . ']', 'hard', 30, 5, '');
// <- HTCT262
}
$contents[] = array('text' => ' ' . TEXT_CATEGORIES_NAME . $category_inputs_string);
// -> FCKE22
// Le chiffre 700 (=width) et 150 (=height) permet de pouvoir choisir la taille de la fenêtre (voir la fonction dans admin/includes/funtions/html_output.php)
$contents[] = array('text' => ' ' . tep_image(DIR_WS_ADMIN . DIR_WS_ICONS . 'warning.gif') . ' ' . ALERTE_NOTICE_IMAGE . ' ' . tep_image(DIR_WS_ADMIN . DIR_WS_ICONS . 'success.gif') . ' ' . NOTICE_IMAGE . '');
$contents[] = array('text' => ' ' . TEXT_CATEGORIES_IMAGE . ' ' . tep_draw_file_field_image_fckeditor('categories_image', '212', '100', ''));
// <- FCKE22
$contents[] = array('text' => ' ' . TEXT_SORT_ORDER . ' ' . tep_draw_input_field('sort_order', '', 'size="2"'));
// -> HTCT262
$contents[] = array('text' => ' ' . 'Header Tags Category Title' . $category_htc_title_string);
$contents[] = array('text' => ' ' . 'Header Tags Category Description' . $category_htc_desc_string);
$contents[] = array('text' => ' ' . 'Header Tags Category Keywords' . $category_htc_keywords_string);
$contents[] = array('text' => ' ' . 'Header Tags Categories Description' . $category_htc_description_string);
// <- HTCT262
$contents[] = array('align' => 'center', 'text' => ' ' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'edit_category':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_EDIT_CATEGORY . '');
$contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"') . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
$contents[] = array('text' => TEXT_EDIT_INTRO);
$category_inputs_string = '';
$languages = tep_get_languages();
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
$category_inputs_string .= ' ' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', tep_get_category_name($cInfo->categories_id, $languages[$i]['id']));
// -> HTCT262
$category_htc_title_string .= ' ' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('categories_htc_title_tag[' . $languages[$i]['id'] . ']', tep_get_category_htc_title($cInfo->categories_id, $languages[$i]['id']));
$category_htc_desc_string .= ' ' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('categories_htc_desc_tag[' . $languages[$i]['id'] . ']', tep_get_category_htc_desc($cInfo->categories_id, $languages[$i]['id']));
$category_htc_keywords_string .= ' ' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('categories_htc_keywords_tag[' . $languages[$i]['id'] . ']', tep_get_category_htc_keywords($cInfo->categories_id, $languages[$i]['id']));
$category_htc_description_string .= ' ' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_textarea_field('categories_htc_description[' . $languages[$i]['id'] . ']', 'hard', 30, 5, tep_get_category_htc_description($cInfo->categories_id, $languages[$i]['id']));
// <- HTCT262
}
$contents[] = array('text' => ' ' . TEXT_EDIT_CATEGORIES_NAME . $category_inputs_string);
// -> FCKE22
// Le chiffre 700 (=width) et 150 (=height) permet de pouvoir choisir la taille de la fenêtre (voir la fonction dans admin/includes/funtions/html_output.php)
$contents[] = array('text' => ' ' . tep_image(DIR_WS_ADMIN . DIR_WS_ICONS . 'warning.gif') . ' ' . ALERTE_NOTICE_IMAGE . ' ' . tep_image(DIR_WS_ADMIN . DIR_WS_ICONS . 'success.gif') . ' ' . NOTICE_IMAGE . '');
$contents[] = array('text' => ' ' . TEXT_CATEGORIES_IMAGE . ' ' . tep_draw_file_field_image_fckeditor('categories_image', '212', '100', $cInfo->categories_image));
// <- FCKE22
$contents[] = array('text' => ' ' . TEXT_EDIT_SORT_ORDER . ' ' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'));
// -> HTCT262
$contents[] = array('text' => ' ' . 'Header Tags Category Title' . $category_htc_title_string);
$contents[] = array('text' => ' ' . 'Header Tags Category Description' . $category_htc_desc_string);
$contents[] = array('text' => ' ' . 'Header Tags Category Keywords' . $category_htc_keywords_string);
$contents[] = array('text' => ' ' . 'Header Tags Categories Description' . $category_htc_description_string);
// <- HTCT262
$contents[] = array('align' => 'center', 'text' => ' ' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'delete_category':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_CATEGORY . '');
$contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=delete_category_confirm&cPath=' . $cPath) . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
$contents[] = array('text' => TEXT_DELETE_CATEGORY_INTRO);
$contents[] = array('text' => ' ' . $cInfo->categories_name . '');
if ($cInfo->childs_count > 0) $contents[] = array('text' => ' ' . sprintf(TEXT_DELETE_WARNING_CHILDS, $cInfo->childs_count));
if ($cInfo->products_count > 0) $contents[] = array('text' => ' ' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $cInfo->products_count));
$contents[] = array('align' => 'center', 'text' => ' ' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'move_category':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_MOVE_CATEGORY . '');
$contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=move_category_confirm&cPath=' . $cPath) . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
$contents[] = array('text' => sprintf(TEXT_MOVE_CATEGORIES_INTRO, $cInfo->categories_name));
$contents[] = array('text' => ' ' . sprintf(TEXT_MOVE, $cInfo->categories_name) . ' ' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));
$contents[] = array('align' => 'center', 'text' => ' ' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'delete_product':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_PRODUCT . '');
$contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=delete_product_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
$contents[] = array('text' => TEXT_DELETE_PRODUCT_INTRO);
$contents[] = array('text' => ' ' . $pInfo->products_name . '');
$product_categories_string = '';
$product_categories = tep_generate_category_path($pInfo->products_id, 'product');
for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) {
$category_path = '';
for ($j = 0, $k = sizeof($product_categories[$i]); $j < $k; $j++) {
$category_path .= $product_categories[$i][$j]['text'] . ' > ';
}
$category_path = substr($category_path, 0, -16);
$product_categories_string .= tep_draw_checkbox_field('product_categories[]', $product_categories[$i][sizeof($product_categories[$i])-1]['id'], true) . ' ' . $category_path . ' ';
}
$product_categories_string = substr($product_categories_string, 0, -4);
$contents[] = array('text' => ' ' . $product_categories_string);
$contents[] = array('align' => 'center', 'text' => ' ' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'move_product':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_MOVE_PRODUCT . '');
$contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=move_product_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
$contents[] = array('text' => sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name));
$contents[] = array('text' => ' ' . TEXT_INFO_CURRENT_CATEGORIES . ' ' . tep_output_generated_category_path($pInfo->products_id, 'product') . '');
$contents[] = array('text' => ' ' . sprintf(TEXT_MOVE, $pInfo->products_name) . ' ' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));
$contents[] = array('align' => 'center', 'text' => ' ' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'copy_to':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_COPY_TO . '');
$contents = array('form' => tep_draw_form('copy_to', FILENAME_CATEGORIES, 'action=copy_to_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
$contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
$contents[] = array('text' => ' ' . TEXT_INFO_CURRENT_CATEGORIES . ' ' . tep_output_generated_category_path($pInfo->products_id, 'product') . '');
$contents[] = array('text' => ' ' . TEXT_CATEGORIES . ' ' . tep_draw_pull_down_menu('categories_id', tep_get_category_tree(), $current_category_id));
$contents[] = array('text' => ' ' . TEXT_HOW_TO_COPY . ' ' . tep_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . ' ' . tep_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);
$contents[] = array('align' => 'center', 'text' => ' ' . tep_image_submit('button_copy.gif', IMAGE_COPY) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
default:
if ($rows > 0) {
if (isset($cInfo) && is_object($cInfo)) { // category info box contents
$heading[] = array('text' => '' . $cInfo->categories_name . '');
$contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_edit.gif', IMAGE_EDIT) . ' ' . tep_image_button('button_delete.gif', IMAGE_DELETE) . ' ' . tep_image_button('button_move.gif', IMAGE_MOVE) . '');
$contents[] = array('text' => ' ' . TEXT_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
$contents[] = array('text' => ' ' . tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . ' ' . $cInfo->categories_image);
$contents[] = array('text' => ' ' . TEXT_SUBCATEGORIES . ' ' . $cInfo->childs_count . ' ' . TEXT_PRODUCTS . ' ' . $cInfo->products_count);
} elseif (isset($pInfo) && is_object($pInfo)) { // product info box contents
$heading[] = array('text' => '' . tep_get_products_name($pInfo->products_id, $languages_id) . '');
$contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_edit.gif', IMAGE_EDIT) . ' ' . tep_image_button('button_delete.gif', IMAGE_DELETE) . ' ' . tep_image_button('button_move.gif', IMAGE_MOVE) . ' ' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '');
$contents[] = array('text' => ' ' . TEXT_DATE_ADDED . ' ' . tep_date_short($pInfo->products_date_added));
if (tep_not_null($pInfo->products_last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($pInfo->products_last_modified));
if (date('Y-m-d') < $pInfo->products_date_available) $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' ' . tep_date_short($pInfo->products_date_available));
$contents[] = array('text' => ' ' . tep_info_image($pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . ' ' . $pInfo->products_image);
// -> MARP256
$contents[] = array('text' => ' ' . TEXT_PRODUCTS_COST_INFO . ' ' . $currencies->format($pInfo->products_cost) . ' ' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '
' . TEXT_PRODUCTS_PROFIT_INFO . ' ' . $currencies->format($pInfo->products_price-$pInfo->products_cost) . '
' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
// <- MARP256
$contents[] = array('text' => ' ' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');
// -> QPBPP135
$contents[] = array('text' => ' ' . TEXT_DISCOUNT_CATEGORY . ' ' . (tep_not_null($pInfo->discount_categories_name) ? $pInfo->discount_categories_name : TEXT_NONE));
// <- QPBPP135
}
} else { // create category/product info
$heading[] = array('text' => '' . EMPTY_CATEGORY . '');
$contents[] = array('text' => TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS);
}
break;
}
if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|