|
|
|
|
|
' . TABLE_HEADING_DISCOUNT_CATEGORIES_NAME . '' . ENTRY_DISCOUNT_CATEGORIES_NAME_MAX_LENGTH; ?> |
| ' . $cInfo->discount_categories_id . ''; ?> |
discount_categories_name, 'maxlength="255" size="70"', false); ?> |
|
| ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?> |
|
|
|
|
| ' . TABLE_HEADING_NEW_DISCOUNT_CATEGORIES_NAME . '' . ENTRY_DISCOUNT_CATEGORIES_NAME_MAX_LENGTH; ?> |
|
|
| ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?> |
$row_by_page, 'text' => $row_by_page);
}
$row_bypage_array[] = array('id' => $i, 'text' => $i);
if ($row_by_page > 10 && $row_by_page%5 !== 0) {
if (($i < $row_by_page) && ($i+5 > $row_by_page)) {
$row_bypage_array[] = array('id' => $row_by_page, 'text' => $row_by_page);
}
}
} // end for ($i = 10; $i <= 100 ; $i = $i+5)
// populate array of discount categories for each with dropdowns in products
$get_discount_categories_query = tep_db_query("select discount_categories_id, discount_categories_name from " . TABLE_DISCOUNT_CATEGORIES . " order by discount_categories_name");
$get_discount_categories = array();
while ($_get_discount_categories = tep_db_fetch_array($get_discount_categories_query)) {
$get_discount_categories[$_get_discount_categories['discount_categories_id']] = $_get_discount_categories['discount_categories_name'];
}
?>
|
|
|
1) $rows = $split_page * MAX_DISPLAY_ROW_BY_PAGE - MAX_DISPLAY_ROW_BY_PAGE;
// select categories
if (is_int($dcID) && $dcID > 0) {
$select_dcID = " and ptdc.discount_categories_id = '" . $dcID . "' ";
} elseif (is_int($dcID) && $dcID == 0) {
$select_dcID = " and ptdc.discount_categories_id IS NULL ";
} elseif ($dcID == "all") {
$select_dcID = " "; // all discount categories
}
// control string sort page
if (isset($_GET['sort_by']) && !ereg('order by', $_GET['sort_by'])) {
switch ($_GET['sort_by']) {
case "pid":
$order = " order by p.products_id";
break;
case "pid-desc":
$order = " order by p.products_id DESC";
break;
case "model":
$order = " order by p.products_model";
break;
case "model-desc":
$order = " order by p.products_model DESC";
break;
case "name":
$order = " order by pd.products_name";
break;
case "name-desc":
$order = " order by pd.products_name DESC";
break;
default:
$order = " order by p.products_id";
}
}
if ($current_category_id == 0) {
if($manufacturer != 0){
$products_query_raw = "select p.products_id, p.products_model, pd.products_name, p.products_status, p.manufacturers_id, ptdc.discount_categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc using(products_id) where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . $manufacturer . "' $select_dcID $order";
} else {
$products_query_raw = "select p.products_id, p.products_model, pd.products_name, p.products_status, p.manufacturers_id, ptdc.discount_categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc using(products_id) where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' $select_dcID $order";
}
} // end if ($current_category_id == 0)
else {
if ($manufacturer != 0) {
$products_query_raw = "select p.products_id, p.products_model, pd.products_name, p.products_status, p.manufacturers_id, ptdc.discount_categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc using(products_id), " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.manufacturers_id = '" . $manufacturer . "' $select_dcID $order";
} else {
$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.manufacturers_id, ptdc.discount_categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc using(products_id), " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $select_dcID $order";
}
}
//// 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);
if ($products_query_numrows > 0) {
?>
|
|
|
|
|
|
' . "\n";
echo ' ' . $products['products_id'] . tep_draw_hidden_field('pdcID_old['. $products['products_id'] .']', (int)$products['discount_categories_id']) . ' | ' . "\n";
echo ' ' . $products['products_model'] . ' | ' . "\n";
echo ' ' . $products['products_name'] . ' | ' . "\n";
echo ' ';
if ($products['products_status'] == '1') {
echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', DC_ICON_STATUS_GREEN_LIGHT, 10, 10);
} else {
echo tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', DC_ICON_STATUS_RED_LIGHT, 10, 10);
}
echo ' | ' . "\n";
echo ' ' . discount_categories_drop_down($get_discount_categories, $products['discount_categories_id'], $products['products_id']) . ' | ' . "\n";
echo ' ' . tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', TEXT_IMAGE_SWITCH_EDIT) . ' | ' . "\n";
echo ' ' . "\n";
} // end while ($products = tep_db_fetch_array($products_query))
?>
| ';
echo TEXT_BACK_TO_DISCOUNT_CATEGORIES; ?> |
' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '';
?> |
|
| display_count($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, $split_page, TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?> |
display_links($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, MAX_DISPLAY_PAGE_LINKS, $split_page, tep_get_all_get_params(array('page', 'do', 'x', 'y'))); ?> |
|
0)
?>
|
0)
} else { // end action=show_products
?>
|
1-2-3 From Top '); ?> 3-2-1 From Top '); ?>
|
A-B-C From Top '); ?> Z-X-Y From Top '); ?>
|
|
discount_categories_id) ) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
?>
|
|
discount_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) . ''; } ?> |
| display_count($discount_categories_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_DISCOUNT_CATEGORIES); ?> |
display_links($discount_categories_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'dcID'))); ?> |
| ' . tep_image_button('button_reset.gif', IMAGE_RESET) . ''; ?> |
| ' . tep_image_button('button_insert.gif', IMAGE_INSERT) . ''; ?> |
|
|
''. tep_draw_separator('pixel_trans.gif', '11', '12') .' ' . TEXT_INFO_HEADING_DELETE_DISCOUNT_CATEGORY . '');
$contents = array('form' => tep_draw_form('discount_categories', FILENAME_DISCOUNT_CATEGORIES, tep_get_all_get_params(array('dcID', 'action')) . 'dcID=' . $cInfo->discount_categories_id . '&action=deleteconfirm'));
$contents[] = array('text' => TEXT_DELETE_INTRO . '
' . $cInfo->discount_categories_name . ' ');
/* if ($cInfo->number_of_reviews > 0) $contents[] = array('text' => ' ' . tep_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews)); */
$contents[] = array('align' => 'center', 'text' => ' ' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
} else {
$heading[] = array('text' => ''. tep_draw_separator('pixel_trans.gif', '11', '12') .' ' . TEXT_INFO_HEADING_DELETE_DISCOUNT_CATEGORY . '');
$contents[] = array('text' => ERROR_DISCOUNT_CATEGORIES_ID . '
' . $cInfo->discount_categories_name . ' ');
}
break;
default:
if (is_object($cInfo)) {
$heading[] = array('text' => ''. tep_draw_separator('pixel_trans.gif', '11', '12') .' ' . $cInfo->discount_categories_name . '');
$contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_edit.gif', IMAGE_EDIT) . ' ' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '');
$contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_show_products.gif', IMAGE_SHOW_PRODUCTS) . '');
}
break;
}
if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|