ZenCart_Documentation  1.5.0
http://www.collinsharper.com
C:/xampp/htdocs/zen-cart/admin/categories.php
Go to the documentation of this file.
00001 <?php
00009   require('includes/application_top.php');
00010 
00011   require(DIR_WS_MODULES . 'prod_cat_header_code.php');
00012 
00013   $action = (isset($_GET['action']) ? $_GET['action'] : '');
00014   if (isset($_GET['page'])) $_GET['page'] = (int)$_GET['page'];
00015   if (isset($_GET['product_type'])) $_GET['product_type'] = (int)$_GET['product_type'];
00016 
00017   if (!isset($_SESSION['categories_products_sort_order'])) {
00018     $_SESSION['categories_products_sort_order'] = CATEGORIES_PRODUCTS_SORT_ORDER;
00019   }
00020 
00021   if (!isset($_GET['reset_categories_products_sort_order'])) {
00022     $reset_categories_products_sort_order = $_SESSION['categories_products_sort_order'];
00023   }
00024 
00025   if (zen_not_null($action)) {
00026     switch ($action) {
00027       case 'set_categories_products_sort_order':
00028       $_SESSION['categories_products_sort_order'] = $_GET['reset_categories_products_sort_order'];
00029       $action='';
00030       zen_redirect(zen_href_link(FILENAME_CATEGORIES,  'cPath=' . $_GET['cPath'] . ((isset($_GET['pID']) and !empty($_GET['pID'])) ? '&pID=' . $_GET['pID'] : '') . ((isset($_GET['page']) and !empty($_GET['page'])) ? '&page=' . $_GET['page'] : '')));
00031       break;
00032       case 'set_editor':
00033       // Reset will be done by init_html_editor.php. Now we simply redirect to refresh page properly.
00034       $action='';
00035       zen_redirect(zen_href_link(FILENAME_CATEGORIES,  'cPath=' . $_GET['cPath'] . ((isset($_GET['pID']) and !empty($_GET['pID'])) ? '&pID=' . $_GET['pID'] : '') . ((isset($_GET['page']) and !empty($_GET['page'])) ? '&page=' . $_GET['page'] : '')));
00036       break;
00037 
00038       case 'update_category_status':
00039       // disable category and products including subcategories
00040       if (isset($_POST['categories_id'])) {
00041         $categories_id = zen_db_prepare_input($_POST['categories_id']);
00042 
00043         $categories = zen_get_category_tree($categories_id, '', '0', '', true);
00044 
00045         for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
00046           $product_ids = $db->Execute("select products_id
00047                                          from " . TABLE_PRODUCTS_TO_CATEGORIES . "
00048                                          where categories_id = '" . (int)$categories[$i]['id'] . "'");
00049 
00050           while (!$product_ids->EOF) {
00051             $products[$product_ids->fields['products_id']]['categories'][] = $categories[$i]['id'];
00052             $product_ids->MoveNext();
00053           }
00054         }
00055 
00056         // change the status of categories and products
00057         zen_set_time_limit(600);
00058         for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
00059           if ($_POST['categories_status'] == '1') {
00060             $categories_status = '0';
00061             $products_status = '0';
00062           } else {
00063             $categories_status = '1';
00064             $products_status = '1';
00065           }
00066 
00067           $sql = "update " . TABLE_CATEGORIES . " set categories_status='" . $categories_status . "'
00068                   where categories_id='" . $categories[$i]['id'] . "'";
00069           $db->Execute($sql);
00070 
00071           // set products_status based on selection
00072           if ($_POST['set_products_status'] == 'set_products_status_nochange') {
00073             // do not change current product status
00074           } else {
00075             if ($_POST['set_products_status'] == 'set_products_status_on') {
00076               $products_status = '1';
00077             } else {
00078               $products_status = '0';
00079             }
00080 
00081             $sql = "select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $categories[$i]['id'] . "'";
00082             $category_products = $db->Execute($sql);
00083 
00084             while (!$category_products->EOF) {
00085               $sql = "update " . TABLE_PRODUCTS . " set products_status='" . $products_status . "' where products_id='" . $category_products->fields['products_id'] . "'";
00086               $db->Execute($sql);
00087               $category_products->MoveNext();
00088             }
00089           }
00090         } // for
00091 
00092       }
00093       zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&cID=' . $_GET['cID'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '')));
00094       break;
00095 
00096       case 'remove_type':
00097         if (isset($_POST['type_id']))
00098         {
00099           $sql = "delete from " .  TABLE_PRODUCT_TYPES_TO_CATEGORY . "
00100                   where category_id = '" . (int)zen_db_prepare_input($_GET['cID']) . "'
00101                  and product_type_id = '" . (int)zen_db_prepare_input($_POST['type_id']) . "'";
00102 
00103           $db->Execute($sql);
00104           zen_remove_restrict_sub_categories($_GET['cID'], (int)$_POST['type_id']);
00105           $action = "edit";
00106           zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'action=edit_category&cPath=' . $_GET['cPath'] . '&cID=' . zen_db_prepare_input($_GET['cID'])));
00107         }
00108       break;
00109       case 'setflag':
00110 
00111       if ( isset($_POST['flag']) && ($_POST['flag'] == '0') || ($_POST['flag'] == '1') ) {
00112         if (isset($_GET['pID'])) {
00113           zen_set_product_status($_GET['pID'], $_POST['flag']);
00114         }
00115       }
00116 
00117       zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&pID=' . $_GET['pID'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '')));
00118       break;
00119       case 'insert_category':
00120       case 'update_category':
00121       if ( isset($_POST['add_type']) or isset($_POST['add_type_all']) ) {
00122         // check if it is already restricted
00123         $sql = "select * from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . "
00124                 where category_id = '" . (int)zen_db_prepare_input($_POST['categories_id']) . "'
00125                 and product_type_id = '" . (int)zen_db_prepare_input($_POST['restrict_type']) . "'";
00126 
00127         $type_to_cat = $db->Execute($sql);
00128         if ($type_to_cat->RecordCount() < 1) {
00129           //@@TODO find all sub-categories and restrict them as well.
00130 
00131           $insert_sql_data = array('category_id' => zen_db_prepare_input($_POST['categories_id']),
00132                                    'product_type_id' => zen_db_prepare_input($_POST['restrict_type']));
00133 
00134           zen_db_perform(TABLE_PRODUCT_TYPES_TO_CATEGORY, $insert_sql_data);
00135           /*
00136           // moved below so evaluated separately from current category
00137           if (isset($_POST['add_type_all'])) {
00138           zen_restrict_sub_categories($_POST['categories_id'], $_POST['restrict_type']);
00139           }
00140           */
00141         }
00142         // add product type restrictions to subcategories if not already set
00143         if (isset($_POST['add_type_all'])) {
00144           zen_restrict_sub_categories($_POST['categories_id'], $_POST['restrict_type']);
00145         }
00146         $action = "edit";
00147         zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'action=edit_category&cPath=' . $cPath . '&cID=' . zen_db_prepare_input($_POST['categories_id'])));
00148       }
00149       if (isset($_POST['categories_id'])) $categories_id = zen_db_prepare_input($_POST['categories_id']);
00150       $sort_order = zen_db_prepare_input($_POST['sort_order']);
00151 
00152       $sql_data_array = array('sort_order' => (int)$sort_order);
00153 
00154       if ($action == 'insert_category') {
00155         $insert_sql_data = array('parent_id' => (int)$current_category_id,
00156                                  'date_added' => 'now()');
00157 
00158         $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
00159 
00160         zen_db_perform(TABLE_CATEGORIES, $sql_data_array);
00161 
00162         $categories_id = zen_db_insert_id();
00163         // check if [arent is restricted
00164         $sql = "select parent_id from " . TABLE_CATEGORIES . "
00165                 where categories_id = '" . (int)$categories_id . "'";
00166 
00167         $parent_cat = $db->Execute($sql);
00168         if ($parent_cat->fields['parent_id'] != '0') {
00169           $sql = "select * from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . "
00170                   where category_id = '" . $parent_cat->fields['parent_id'] . "'";
00171           $has_type = $db->Execute($sql);
00172           if ($has_type->RecordCount() > 0 ) {
00173             while (!$has_type->EOF) {
00174               $insert_sql_data = array('category_id' => (int)$categories_id,
00175                                        'product_type_id' => (int)$has_type->fields['product_type_id']);
00176               zen_db_perform(TABLE_PRODUCT_TYPES_TO_CATEGORY, $insert_sql_data);
00177               $has_type->moveNext();
00178             }
00179           }
00180         }
00181       } elseif ($action == 'update_category') {
00182         $update_sql_data = array('last_modified' => 'now()');
00183 
00184         $sql_data_array = array_merge($sql_data_array, $update_sql_data);
00185 
00186         zen_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "'");
00187       }
00188 
00189       $languages = zen_get_languages();
00190       for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
00191         $categories_name_array = $_POST['categories_name'];
00192         $categories_description_array = $_POST['categories_description'];
00193         $language_id = $languages[$i]['id'];
00194 
00195         // clean $categories_description when blank or just <p /> left behind
00196         $sql_data_array = array('categories_name' => zen_db_prepare_input($categories_name_array[$language_id]),
00197                                 'categories_description' => ($categories_description_array[$language_id] == '<p />' ? '' : zen_db_prepare_input($categories_description_array[$language_id])));
00198 
00199         if ($action == 'insert_category') {
00200           $insert_sql_data = array('categories_id' => (int)$categories_id,
00201                                    'language_id' => (int)$languages[$i]['id']);
00202 
00203           $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
00204 
00205           zen_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);
00206         } elseif ($action == 'update_category') {
00207           zen_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
00208         }
00209       }
00210 
00211       if ($_POST['categories_image_manual'] != '') {
00212         // add image manually
00213         $categories_image_name = zen_db_input($_POST['img_dir'] . $_POST['categories_image_manual']);
00214         $db->Execute("update " . TABLE_CATEGORIES . "
00215                       set categories_image = '" . $categories_image_name . "'
00216                       where categories_id = '" . (int)$categories_id . "'");
00217       } else {
00218         if ($categories_image = new upload('categories_image')) {
00219           $categories_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']);
00220           if ($categories_image->parse() && $categories_image->save()) {
00221             $categories_image_name = zen_db_input($_POST['img_dir'] . $categories_image->filename);
00222           }
00223           if ($categories_image->filename != 'none' && $categories_image->filename != '' && $_POST['image_delete'] != 1) {
00224             // save filename when not set to none and not blank
00225             $db->Execute("update " . TABLE_CATEGORIES . "
00226                           set categories_image = '" . $categories_image_name . "'
00227                           where categories_id = '" . (int)$categories_id . "'");
00228           } else {
00229             // remove filename when set to none and not blank
00230             if ($categories_image->filename != '' || $_POST['image_delete'] == 1) {
00231               $db->Execute("update " . TABLE_CATEGORIES . "
00232                             set categories_image = ''
00233                             where categories_id = '" . (int)$categories_id . "'");
00234             }
00235           }
00236         }
00237       }
00238 
00239       zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '')));
00240       break;
00241 
00242       // bof: categories meta tags
00243       case 'update_category_meta_tags':
00244       // add or update meta tags
00245       //die('I SEE ' . $action . ' - ' . $_POST['categories_id']);
00246       $categories_id = $_POST['categories_id'];
00247       $languages = zen_get_languages();
00248       for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
00249         $language_id = $languages[$i]['id'];
00250         $check = $db->Execute("select *
00251                                from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . "
00252                                where categories_id = '" . (int)$categories_id . "'
00253                                and language_id = '" . (int)$language_id . "'");
00254         if ($check->RecordCount() > 0) {
00255           $action = 'update_category_meta_tags';
00256         } else {
00257           $action = 'insert_categories_meta_tags';
00258         }
00259         if (empty($_POST['metatags_title'][$language_id]) && empty($_POST['metatags_keywords'][$language_id]) && empty($_POST['metatags_description'][$language_id])) {
00260           $action = 'delete_category_meta_tags';
00261         }
00262 
00263         $sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]),
00264                                 'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]),
00265                                 'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id]));
00266 
00267         if ($action == 'insert_categories_meta_tags') {
00268           $insert_sql_data = array('categories_id' => (int)$categories_id,
00269                                    'language_id' => (int)$language_id);
00270           $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
00271 
00272           zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array);
00273         } elseif ($action == 'update_category_meta_tags') {
00274           zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'");
00275         } elseif ($action == 'delete_category_meta_tags') {
00276           $remove_categories_metatag = "DELETE from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . " WHERE categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'";
00277           $db->Execute($remove_categories_metatag);
00278         }
00279       }
00280 
00281       zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
00282       break;
00283       // eof: categories meta tags
00284 
00285       case 'delete_category_confirm_old':
00286       // demo active test
00287       if (zen_admin_demo()) {
00288         $_GET['action']= '';
00289         $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
00290         zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
00291       }
00292       if (isset($_POST['categories_id'])) {
00293         $categories_id = zen_db_prepare_input($_POST['categories_id']);
00294 
00295         $categories = zen_get_category_tree($categories_id, '', '0', '', true);
00296         $products = array();
00297         $products_delete = array();
00298 
00299         for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
00300           $product_ids = $db->Execute("select products_id
00301                                            from " . TABLE_PRODUCTS_TO_CATEGORIES . "
00302                                            where categories_id = '" . (int)$categories[$i]['id'] . "'");
00303 
00304           while (!$product_ids->EOF) {
00305             $products[$product_ids->fields['products_id']]['categories'][] = $categories[$i]['id'];
00306             $product_ids->MoveNext();
00307           }
00308         }
00309 
00310         reset($products);
00311         while (list($key, $value) = each($products)) {
00312           $category_ids = '';
00313 
00314           for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++) {
00315             $category_ids .= "'" . (int)$value['categories'][$i] . "', ";
00316           }
00317           $category_ids = substr($category_ids, 0, -2);
00318 
00319           $check = $db->Execute("select count(*) as total
00320                                            from " . TABLE_PRODUCTS_TO_CATEGORIES . "
00321                                            where products_id = '" . (int)$key . "'
00322                                            and categories_id not in (" . $category_ids . ")");
00323           if ($check->fields['total'] < '1') {
00324             $products_delete[$key] = $key;
00325           }
00326         }
00327 
00328         // removing categories can be a lengthy process
00329         zen_set_time_limit(600);
00330         for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
00331           zen_remove_category($categories[$i]['id']);
00332         }
00333 
00334         reset($products_delete);
00335         while (list($key) = each($products_delete)) {
00336           zen_remove_product($key);
00337         }
00338       }
00339 
00340 
00341       zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
00342       break;
00343 
00345       // delete new
00346 
00347       case 'delete_category_confirm':
00348       // demo active test
00349       if (zen_admin_demo()) {
00350         $_GET['action']= '';
00351         $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
00352         zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
00353       }
00354 
00355       // future cat specific deletion
00356       $delete_linked = 'true';
00357       if ($_POST['delete_linked'] == 'delete_linked_no') {
00358         $delete_linked = 'false';
00359       } else {
00360         $delete_linked = 'true';
00361       }
00362 
00363       // delete category and products
00364       if (isset($_POST['categories_id']) && $_POST['categories_id'] != '' && is_numeric($_POST['categories_id']) && $_POST['categories_id'] != 0) {
00365         $categories_id = zen_db_prepare_input($_POST['categories_id']);
00366 
00367         // create list of any subcategories in the selected category,
00368         $categories = zen_get_category_tree($categories_id, '', '0', '', true);
00369 
00370         zen_set_time_limit(600);
00371 
00372         // loop through this cat and subcats for delete-processing.
00373         for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
00374           $sql = "select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $categories[$i]['id'] . "'";
00375           $category_products = $db->Execute($sql);
00376 
00377           while (!$category_products->EOF) {
00378             $cascaded_prod_id_for_delete = $category_products->fields['products_id'];
00379             $cascaded_prod_cat_for_delete = array();
00380             $cascaded_prod_cat_for_delete[] = $categories[$i]['id'];
00381             //echo 'processing product_id: ' . $cascaded_prod_id_for_delete . ' in category: ' . $cascaded_prod_cat_for_delete . '<br>';
00382 
00383             // determine product-type-specific override script for this product
00384             $product_type = zen_get_products_type($category_products->fields['products_id']);
00385             // now loop thru the delete_product_confirm script for each product in the current category
00386             if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php')) {
00387               require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php');
00388             } else {
00389               require(DIR_WS_MODULES . 'delete_product_confirm.php');
00390             }
00391 
00392             // THIS LINE COMMENTED BECAUSE IT'S DONE ALREADY DURING DELETE_PRODUCT_CONFIRM.PHP:
00393             //zen_remove_product($category_products->fields['products_id'], $delete_linked);
00394             $category_products->MoveNext();
00395           }
00396 
00397           zen_remove_category($categories[$i]['id']);
00398 
00399         } // end for loop
00400       }
00401       zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
00402       break;
00403 
00404       // eof delete new
00406       // @@TODO where is delete_product_confirm
00407 
00408       case 'move_category_confirm':
00409       if (isset($_POST['categories_id']) && ($_POST['categories_id'] != $_POST['move_to_category_id'])) {
00410         $categories_id = zen_db_prepare_input($_POST['categories_id']);
00411         $new_parent_id = zen_db_prepare_input($_POST['move_to_category_id']);
00412 
00413         $path = explode('_', zen_get_generated_category_path_ids($new_parent_id));
00414 
00415         if (in_array($categories_id, $path)) {
00416           $messageStack->add_session(ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT, 'error');
00417 
00418           zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
00419         } else {
00420 
00421           $sql = "select count(*) as count from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . (int)$new_parent_id . "'";
00422           $zc_count_products = $db->Execute($sql);
00423 
00424           if ( $zc_count_products->fields['count'] > 0) {
00425             $messageStack->add_session(ERROR_CATEGORY_HAS_PRODUCTS, 'error');
00426           } else {
00427             $messageStack->add_session(SUCCESS_CATEGORY_MOVED, 'success');
00428           }
00429 
00430           $db->Execute("update " . TABLE_CATEGORIES . "
00431                             set parent_id = '" . (int)$new_parent_id . "', last_modified = now()
00432                             where categories_id = '" . (int)$categories_id . "'");
00433 
00434           // fix here - if this is a category with subcats it needs to know to loop through
00435           // reset all products_price_sorter for moved category products
00436           $reset_price_sorter = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . (int)$categories_id . "'");
00437           while (!$reset_price_sorter->EOF) {
00438             zen_update_products_price_sorter($reset_price_sorter->fields['products_id']);
00439             $reset_price_sorter->MoveNext();
00440           }
00441 
00442           zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id));
00443         }
00444       } else {
00445         $messageStack->add_session(ERROR_CANNOT_MOVE_CATEGORY_TO_CATEGORY_SELF . $cPath, 'error');
00446         zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
00447       }
00448 
00449       break;
00450       // @@TODO where is move_product_confirm
00451       // @@TODO where is insert_product
00452       // @@TODO where is update_product
00453 
00454       // attribute features
00455       case 'delete_attributes':
00456       zen_delete_products_attributes($_GET['products_id']);
00457       $messageStack->add_session(SUCCESS_ATTRIBUTES_DELETED . ' ID#' . $_GET['products_id'], 'success');
00458       $action='';
00459 
00460       // reset products_price_sorter for searches etc.
00461       zen_update_products_price_sorter($_GET['products_id']);
00462 
00463       zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['products_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
00464       break;
00465 
00466       case 'update_attributes_sort_order':
00467       zen_update_attributes_products_option_values_sort_order($_GET['products_id']);
00468       $messageStack->add_session(SUCCESS_ATTRIBUTES_UPDATE . ' ID#' . $_GET['products_id'], 'success');
00469       $action='';
00470       zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['products_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
00471       break;
00472 
00473       // attributes copy to product
00474       case 'update_attributes_copy_to_product':
00475       $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
00476       $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
00477       $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
00478       zen_copy_products_attributes($_POST['products_id'], $_POST['products_update_id']);
00479       //      die('I would copy Product ID#' . $_POST['products_id'] . ' to a Product ID#' . $_POST['products_update_id'] . ' - Existing attributes ' . $_POST['copy_attributes']);
00480       $_GET['action']= '';
00481       zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['products_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
00482       break;
00483 
00484       // attributes copy to category
00485       case 'update_attributes_copy_to_category':
00486       $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
00487       $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
00488       $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
00489       $copy_to_category = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . (int)$_POST['categories_update_id'] . "'");
00490       while (!$copy_to_category->EOF) {
00491         zen_copy_products_attributes($_POST['products_id'], $copy_to_category->fields['products_id']);
00492         $copy_to_category->MoveNext();
00493       }
00494       //      die('CATEGORIES - I would copy Product ID#' . $_POST['products_id'] . ' to a Category ID#' . $_POST['categories_update_id']  . ' - Existing attributes ' . $_POST['copy_attributes'] . ' Total Products ' . $copy_to_category->RecordCount());
00495 
00496       $_GET['action']= '';
00497       zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['products_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
00498       break;
00499       case 'new_product':
00500       if (isset($_GET['product_type'])) {
00501         // see if this category is restricted
00502         $pieces = explode('_',$_GET['cPath']);
00503         $cat_id = $pieces[sizeof($pieces)-1];
00504         //      echo $cat_id;
00505         $sql = "select product_type_id from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " where category_id = '" . (int)$cat_id . "'";
00506         $product_type_list = $db->Execute($sql);
00507         $sql = "select product_type_id from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " where category_id = '" . (int)$cat_id . "' and product_type_id = '" . (int)$_GET['product_type'] . "'";
00508         $product_type_good = $db->Execute($sql);
00509         if ($product_type_list->RecordCount() < 1 || $product_type_good->RecordCount() > 0) {
00510           $url = zen_get_all_get_params();
00511           $sql = "select type_handler from " . TABLE_PRODUCT_TYPES . " where type_id = '" . (int)$_GET['product_type'] . "'";
00512           $handler = $db->Execute($sql);
00513           zen_redirect(zen_href_link($handler->fields['type_handler'] . '.php', zen_get_all_get_params()));
00514         } else {
00515           $messageStack->add(ERROR_CANNOT_ADD_PRODUCT_TYPE, 'error');
00516         }
00517       }
00518       break;
00519     }
00520   }
00521 
00522   // check if the catalog image directory exists
00523   if (is_dir(DIR_FS_CATALOG_IMAGES)) {
00524     if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
00525   } else {
00526     $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
00527   }
00528 ?>
00529 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
00530 <html <?php echo HTML_PARAMS; ?>>
00531 <head>
00532 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
00533 <title><?php echo TITLE; ?></title>
00534 <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
00535 <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
00536 <script language="javascript" src="includes/menu.js"></script>
00537 <script language="javascript" src="includes/general.js"></script>
00538 <script type="text/javascript">
00539 <!--
00540 function init()
00541 {
00542   cssjsmenu('navbar');
00543   if (document.getElementById)
00544   {
00545     var kill = document.getElementById('hoverJS');
00546     kill.disabled = true;
00547   }
00548   if (typeof _editor_url == "string") HTMLArea.replaceAll();
00549 }
00550 // -->
00551 </script>
00552 <?php if ($action != 'edit_category_meta_tags') { // bof: categories meta tags ?>
00553 <?php if ($editor_handler != '') include ($editor_handler); ?>
00554 <?php } // meta tags disable editor eof: categories meta tags?>
00555 </head>
00556 <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
00557 <div id="spiffycalendar" class="text"></div>
00558 <!-- header //-->
00559 <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
00560 <!-- header_eof //-->
00561 
00562 <!-- body //-->
00563 <table border="0" width="100%" cellspacing="2" cellpadding="2">
00564 <?php if ($action == '') { ?>
00565       <tr>
00566         <td><table border="0" cellspacing="0" cellpadding="0">
00567           <tr>
00568             <td class="smallText" align="center" width="100" valign="top"><?php echo TEXT_LEGEND; ?></td>
00569             <td class="smallText" align="center" width="100" valign="top"><?php echo TEXT_LEGEND_STATUS_OFF . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF); ?></td>
00570             <td class="smallText" align="center" width="100" valign="top"><?php echo TEXT_LEGEND_STATUS_ON . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON); ?></td>
00571             <td class="smallText" align="center" width="100" valign="top"><?php echo TEXT_LEGEND_LINKED . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_LINKED); ?></td>
00572             <td class="smallText" align="center" width="150" valign="top"><?php echo TEXT_LEGEND_META_TAGS . '<br />' . TEXT_YES . '&nbsp;' . TEXT_NO . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_edit_metatags_on.gif', ICON_METATAGS_ON) . '&nbsp;' . zen_image(DIR_WS_IMAGES . 'icon_edit_metatags_off.gif', ICON_METATAGS_OFF); ?></td>
00573           </tr>
00574         </table></td>
00575       </tr>
00576   <tr>
00577     <td class="smallText" width="100%" align="right">
00578 <?php
00579       // toggle switch for editor
00580       echo TEXT_EDITOR_INFO . zen_draw_form('set_editor_form', FILENAME_CATEGORIES, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('reset_editor', $editors_pulldown, $current_editor_key, 'onChange="this.form.submit();"') . zen_hide_session_id() .
00581             zen_draw_hidden_field('cID', $cPath) .
00582             zen_draw_hidden_field('cPath', $cPath) .
00583             zen_draw_hidden_field('pID', $_GET['pID']) .
00584             zen_draw_hidden_field('page', $_GET['page']) .
00585             zen_draw_hidden_field('action', 'set_editor') .
00586       '</form>';
00587 ?>
00588     </td>
00589   </tr>
00590 
00591   <tr>
00592     <td class="smallText" width="100%" align="right">
00593       <?php
00594       // check for which buttons to show for categories and products
00595       $check_categories = zen_has_category_subcategories($current_category_id);
00596       $check_products = zen_products_in_category_count($current_category_id, false, false, 1);
00597 
00598       $zc_skip_products = false;
00599       $zc_skip_categories = false;
00600 
00601       if ($check_products == 0) {
00602         $zc_skip_products = false;
00603         $zc_skip_categories = false;
00604       }
00605       if ($check_categories == true) {
00606         $zc_skip_products = true;
00607         $zc_skip_categories = false;
00608       }
00609       if ($check_products > 0) {
00610         $zc_skip_products = false;
00611         $zc_skip_categories = true;
00612       }
00613 
00614       if ($zc_skip_products == true) {
00615         // toggle switch for display sort order
00616         $categories_products_sort_order_array = array(array('id' => '0', 'text' => TEXT_SORT_CATEGORIES_SORT_ORDER_PRODUCTS_NAME),
00617         array('id' => '1', 'text' => TEXT_SORT_CATEGORIES_NAME)
00618         );
00619       } else {
00620         // toggle switch for display sort order
00621         $categories_products_sort_order_array = array(array('id' => '0', 'text' => TEXT_SORT_PRODUCTS_SORT_ORDER_PRODUCTS_NAME),
00622         array('id' => '1', 'text' => TEXT_SORT_PRODUCTS_NAME),
00623         array('id' => '2', 'text' => TEXT_SORT_PRODUCTS_MODEL),
00624         array('id' => '3', 'text'=> TEXT_SORT_PRODUCTS_QUANTITY),
00625         array('id' => '4', 'text'=> TEXT_SORT_PRODUCTS_QUANTITY_DESC),
00626         array('id' => '5', 'text'=> TEXT_SORT_PRODUCTS_PRICE),
00627         array('id' => '6', 'text'=> TEXT_SORT_PRODUCTS_PRICE_DESC)
00628         );
00629       }
00630 
00631       echo TEXT_CATEGORIES_PRODUCTS_SORT_ORDER_INFO . zen_draw_form('set_categories_products_sort_order_form', FILENAME_CATEGORIES, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('reset_categories_products_sort_order', $categories_products_sort_order_array, $reset_categories_products_sort_order, 'onChange="this.form.submit();"') . zen_hide_session_id() .
00632             zen_draw_hidden_field('cID', $cPath) .
00633             zen_draw_hidden_field('cPath', $cPath) .
00634             zen_draw_hidden_field('pID', $_GET['pID']) .
00635             zen_draw_hidden_field('page', $_GET['page']) .
00636             zen_draw_hidden_field('action', 'set_categories_products_sort_order') .
00637       '</form>';
00638       ?>
00639     </td>
00640   </tr>
00641 
00642 <?php } ?>
00643   <tr>
00644 <!-- body_text //-->
00645     <td width="100%" valign="top">
00646 <?php
00647   require(DIR_WS_MODULES . 'category_product_listing.php');
00648 
00649   $heading = array();
00650   $contents = array();
00651   // Make an array of product types
00652   $sql = "select type_id, type_name from " . TABLE_PRODUCT_TYPES;
00653   $product_types = $db->Execute($sql);
00654   while (!$product_types->EOF) {
00655     $type_array[] = array('id' => $product_types->fields['type_id'], 'text' => $product_types->fields['type_name']);
00656     $product_types->MoveNext();
00657   }
00658 
00659   if (isset($_GET['cPath'])) {
00660     $cPath = $_GET['cPath'];
00661   }
00662 
00663   switch ($action) {
00664     case 'setflag_categories':
00665     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_STATUS_CATEGORY . '</b>');
00666     $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category_status&cPath=' . $_GET['cPath'] . '&cID=' . $_GET['cID'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : ''), 'post', 'enctype="multipart/form-data"') . zen_draw_hidden_field('categories_id', $cInfo->categories_id) . zen_draw_hidden_field('categories_status', $cInfo->categories_status));
00667     $contents[] = array('text' => zen_get_category_name($cInfo->categories_id, $_SESSION['languages_id']));
00668     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_STATUS_WARNING . '<br /><br />');
00669     $contents[] = array('text' => TEXT_CATEGORIES_STATUS_INTRO . ' ' . ($cInfo->categories_status == '1' ? TEXT_CATEGORIES_STATUS_OFF : TEXT_CATEGORIES_STATUS_ON));
00670     if ($cInfo->categories_status == '1') {
00671       $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_STATUS_INFO . ' ' . TEXT_PRODUCTS_STATUS_OFF . zen_draw_hidden_field('set_products_status_off', true));
00672     } else {
00673       $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_STATUS_INFO . '<br />' .
00674       zen_draw_radio_field('set_products_status', 'set_products_status_on', true) . ' ' . TEXT_PRODUCTS_STATUS_ON . '<br />' .
00675       zen_draw_radio_field('set_products_status', 'set_products_status_off') . ' ' . TEXT_PRODUCTS_STATUS_OFF . '<br />' .
00676       zen_draw_radio_field('set_products_status', 'set_products_status_nochange') . ' ' . TEXT_PRODUCTS_STATUS_NOCHANGE);
00677     }
00678 
00679 
00680     //        $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_STATUS_INFO . '<br />' . zen_draw_radio_field('set_products_status', 'set_products_status_off', true) . ' ' . TEXT_PRODUCTS_STATUS_OFF . '<br />' . zen_draw_radio_field('set_products_status', 'set_products_status_on') . ' ' . TEXT_PRODUCTS_STATUS_ON);
00681 
00682     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00683     break;
00684 
00685     case 'new_category':
00686     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_CATEGORY . '</b>');
00687 
00688     $contents = array('form' => zen_draw_form('newcategory', FILENAME_CATEGORIES, 'action=insert_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"'));
00689     $contents[] = array('text' => TEXT_NEW_CATEGORY_INTRO);
00690 
00691     $category_inputs_string = '';
00692     $languages = zen_get_languages();
00693     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
00694       $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', '', zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
00695     }
00696 
00697     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_NAME . $category_inputs_string);
00698     $category_inputs_string = '';
00699 
00700     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
00701       $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;';
00702       $category_inputs_string .= zen_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', htmlspecialchars(zen_get_category_description($cInfo->categories_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE));
00703     }
00704     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_DESCRIPTION . $category_inputs_string);
00705     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_IMAGE . '<br />' . zen_draw_file_field('categories_image'));
00706     $dir = @dir(DIR_FS_CATALOG_IMAGES);
00707     $dir_info[] = array('id' => '', 'text' => "Main Directory");
00708     while ($file = $dir->read()) {
00709       if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
00710         $dir_info[] = array('id' => $file . '/', 'text' => $file);
00711       }
00712     }
00713     $dir->close();
00714     sort($dir_info);
00715     $default_directory = 'categories/';
00716 
00717     $contents[] = array('text' => TEXT_CATEGORIES_IMAGE_DIR . ' ' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));
00718     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_IMAGE_MANUAL . '&nbsp;' . zen_draw_input_field('categories_image_manual'));
00719 
00720     $contents[] = array('text' => '<br />' . TEXT_SORT_ORDER . '<br />' . zen_draw_input_field('sort_order', '', 'size="6"'));
00721     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00722     break;
00723     case 'edit_category':
00724     // echo 'I SEE ' . $_SESSION['html_editor_preference_status'];
00725     // set image delete
00726     $on_image_delete = false;
00727     $off_image_delete = true;
00728     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_CATEGORY . '</b>');
00729 
00730     $contents[] = array('text' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category&cPath=' . $cPath . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : ''), 'post', 'enctype="multipart/form-data"') . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
00731     $contents[] = array('text' => TEXT_EDIT_INTRO);
00732 
00733     $languages = zen_get_languages();
00734 
00735     $category_inputs_string = '';
00736     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
00737       $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', htmlspecialchars(zen_get_category_name($cInfo->categories_id, $languages[$i]['id'])), zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
00738     }
00739     $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_NAME . $category_inputs_string);
00740     $category_inputs_string = '';
00741     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
00742       $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' ;
00743       $category_inputs_string .= zen_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', htmlspecialchars(zen_get_category_description($cInfo->categories_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE));
00744     }
00745     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_DESCRIPTION . $category_inputs_string);
00746     $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_IMAGE . '<br />' . zen_draw_file_field('categories_image'));
00747 
00748     $dir = @dir(DIR_FS_CATALOG_IMAGES);
00749     $dir_info[] = array('id' => '', 'text' => "Main Directory");
00750     while ($file = $dir->read()) {
00751       if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
00752         $dir_info[] = array('id' => $file . '/', 'text' => $file);
00753       }
00754     }
00755     $dir->close();
00756     sort($dir_info);
00757     $default_directory = substr( $cInfo->categories_image, 0,strpos( $cInfo->categories_image, '/')+1);
00758 
00759     $contents[] = array('text' => TEXT_CATEGORIES_IMAGE_DIR . ' ' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));
00760 
00761     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_IMAGE_MANUAL . '&nbsp;' . zen_draw_input_field('categories_image_manual'));
00762 
00763     $contents[] = array('text' => '<br />' . zen_info_image($cInfo->categories_image, $cInfo->categories_name));
00764     $contents[] = array('text' => '<br />' . $cInfo->categories_image);
00765     $contents[] = array('text' => '<br />' . TEXT_IMAGES_DELETE . ' ' . zen_draw_radio_field('image_delete', '0', $off_image_delete) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('image_delete', '1', $on_image_delete) . '&nbsp;' . TABLE_HEADING_YES);
00766 
00767     $contents[] = array('text' => '<br />' . TEXT_EDIT_SORT_ORDER . '<br />' . zen_draw_input_field('sort_order', $cInfo->sort_order, 'size="6"'));
00768     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '') . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00769     $contents[] = array('text' => TEXT_RESTRICT_PRODUCT_TYPE . ' ' . zen_draw_pull_down_menu('restrict_type', $type_array) . '&nbsp<input type="submit" name="add_type_all" value="' . BUTTON_ADD_PRODUCT_TYPES_SUBCATEGORIES_ON . '">' . '&nbsp<input type="submit" name="add_type" value="' . BUTTON_ADD_PRODUCT_TYPES_SUBCATEGORIES_OFF . '"></form>');
00770     $sql = "select * from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . "
00771                            where category_id = '" . (int)$cInfo->categories_id . "'";
00772 
00773     $restrict_types = $db->Execute($sql);
00774     if ($restrict_types->RecordCount() > 0 ) {
00775       $contents[] = array('text' => '<br />' . TEXT_CATEGORY_HAS_RESTRICTIONS . '<br />');
00776       while (!$restrict_types->EOF) {
00777         $sql = "select type_name from " . TABLE_PRODUCT_TYPES . " where type_id = '" . (int)$restrict_types->fields['product_type_id'] . "'";
00778         $type = $db->Execute($sql);
00779         $contents[] = array('text' => zen_draw_form('remove_type', FILENAME_CATEGORIES, 'action=remove_type&cPath=' . $cPath . '&cID='.$cInfo->categories_id) . zen_draw_hidden_field('type_id', $restrict_types->fields['product_type_id']) . zen_image_submit('button_delete.gif', IMAGE_DELETE) . '</form>&nbsp;' . $type->fields['type_name'] . '<br />');
00780         $restrict_types->MoveNext();
00781       }
00782     }
00783     break;
00784     case 'delete_category':
00785     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CATEGORY . '</b>');
00786 
00787     $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=delete_category_confirm&cPath=' . $cPath) . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
00788     $contents[] = array('text' => TEXT_DELETE_CATEGORY_INTRO);
00789     $contents[] = array('text' => '<br />' . TEXT_DELETE_CATEGORY_INTRO_LINKED_PRODUCTS);
00790     $contents[] = array('text' => '<br /><b>' . $cInfo->categories_name . '</b>');
00791     if ($cInfo->childs_count > 0) $contents[] = array('text' => '<br />' . sprintf(TEXT_DELETE_WARNING_CHILDS, $cInfo->childs_count));
00792     if ($cInfo->products_count > 0) $contents[] = array('text' => '<br />' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $cInfo->products_count));
00793     /*
00794     // future cat specific
00795     if ($cInfo->products_count > 0) {
00796     $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_LINKED_INFO . '<br />' .
00797     zen_draw_radio_field('delete_linked', 'delete_linked_yes') . ' ' . TEXT_PRODUCTS_DELETE_LINKED_YES . '<br />' .
00798     zen_draw_radio_field('delete_linked', 'delete_linked_no', true) . ' ' . TEXT_PRODUCTS_DELETE_LINKED_NO);
00799     }
00800     */
00801     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00802     break;
00803 
00804     // bof: categories meta tags
00805     case 'edit_category_meta_tags':
00806     $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_EDIT_CATEGORY_META_TAGS . '</strong>');
00807 
00808     $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category_meta_tags&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"') . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
00809     $contents[] = array('text' => TEXT_EDIT_CATEGORIES_META_TAGS_INTRO . ' - <strong>' . $cInfo->categories_id . ' ' . $cInfo->categories_name . '</strong>');
00810 
00811     $languages = zen_get_languages();
00812 
00813     $category_inputs_string_metatags_title = '';
00814     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
00815       $category_inputs_string_metatags_title .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['metatags_title']) . '&nbsp;' . zen_draw_input_field('metatags_title[' . $languages[$i]['id'] . ']', htmlspecialchars(zen_get_category_metatags_title($cInfo->categories_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_METATAGS_CATEGORIES_DESCRIPTION, 'metatags_title'));
00816     }
00817     $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_META_TAGS_TITLE . $category_inputs_string_metatags_title);
00818 
00819     $category_inputs_string_metatags_keywords = '';
00820     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
00821       $category_inputs_string_metatags_keywords .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['metatags_keywords']) . '&nbsp;' ;
00822       $category_inputs_string_metatags_keywords .= zen_draw_textarea_field('metatags_keywords[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', htmlspecialchars(zen_get_category_metatags_keywords($cInfo->categories_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE));
00823     }
00824     $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_META_TAGS_KEYWORDS . $category_inputs_string_metatags_keywords);
00825 
00826     $category_inputs_string_metatags_description = '';
00827     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
00828       $category_inputs_string_metatags_description .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' ;
00829       $category_inputs_string_metatags_description .= zen_draw_textarea_field('metatags_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', htmlspecialchars(zen_get_category_metatags_description($cInfo->categories_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE));
00830     }
00831     $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_META_TAGS_DESCRIPTION . $category_inputs_string_metatags_description);
00832 
00833     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00834     break;
00835     // eof: categories meta tags
00836 
00837     case 'move_category':
00838     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_CATEGORY . '</b>');
00839 
00840     $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=move_category_confirm&cPath=' . $cPath) . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
00841     $contents[] = array('text' => sprintf(TEXT_MOVE_CATEGORIES_INTRO, $cInfo->categories_name));
00842     $contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $cInfo->categories_name) . '<br />' . zen_draw_pull_down_menu('move_to_category_id', zen_get_category_tree(), $current_category_id));
00843     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00844     break;
00845     case 'delete_product':
00846     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_PRODUCT . '</b>');
00847 
00848     $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=delete_product_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
00849     $contents[] = array('text' => TEXT_DELETE_PRODUCT_INTRO);
00850     $contents[] = array('text' => '<br /><b>' . $pInfo->products_name . ' ID#' . $pInfo->products_id . '</b>');
00851 
00852     $product_categories_string = '';
00853     $product_categories = zen_generate_category_path($pInfo->products_id, 'product');
00854     for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) {
00855       $category_path = '';
00856       for ($j = 0, $k = sizeof($product_categories[$i]); $j < $k; $j++) {
00857         $category_path .= $product_categories[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';
00858       }
00859       $category_path = substr($category_path, 0, -16);
00860       $product_categories_string .= zen_draw_checkbox_field('product_categories[]', $product_categories[$i][sizeof($product_categories[$i])-1]['id'], true) . '&nbsp;' . $category_path . '<br />';
00861     }
00862     $product_categories_string = substr($product_categories_string, 0, -4);
00863 
00864     $contents[] = array('text' => '<br />' . $product_categories_string);
00865     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00866     break;
00867     case 'move_product':
00868     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_PRODUCT . '</b>');
00869 
00870     $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=move_product_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
00871     $contents[] = array('text' => sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name));
00872     $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_CATEGORIES . '<br /><b>' . zen_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
00873     $contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $pInfo->products_name) . '<br />' . zen_draw_pull_down_menu('move_to_category_id', zen_get_category_tree(), $current_category_id));
00874     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00875     break;
00876     case 'copy_to':
00877     $copy_attributes_delete_first = '0';
00878     $copy_attributes_duplicates_skipped = '0';
00879     $copy_attributes_duplicates_overwrite = '0';
00880     $copy_attributes_include_downloads = '1';
00881     $copy_attributes_include_filename = '1';
00882 
00883     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');
00884     // WebMakers.com Added: Split Page
00885     if (empty($pInfo->products_id)) {
00886       $pInfo->products_id= $pID;
00887     }
00888 
00889     $contents = array('form' => zen_draw_form('copy_to', FILENAME_CATEGORIES, 'action=copy_to_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
00890     $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
00891     $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_PRODUCT . '<br /><b>' . $pInfo->products_name  . ' ID#' . $pInfo->products_id . '</b>');
00892     $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_CATEGORIES . '<br /><b>' . zen_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
00893     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES . '<br />' . zen_draw_pull_down_menu('categories_id', zen_get_category_tree(), $current_category_id));
00894     $contents[] = array('text' => '<br />' . TEXT_HOW_TO_COPY . '<br />' . zen_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br />' . zen_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);
00895 
00896     // only ask about attributes if they exist
00897     if (zen_has_product_attributes($pInfo->products_id, 'false')) {
00898       $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
00899       $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_ONLY);
00900       $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . ' ' . TEXT_COPY_ATTRIBUTES_YES . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_no') . ' ' . TEXT_COPY_ATTRIBUTES_NO);
00901       // future          $contents[] = array('align' => 'center', 'text' => '<br />' . ATTRIBUTES_NAMES_HELPER . '<br />' . zen_draw_separator('pixel_trans.gif', '1', '10'));
00902       $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
00903     }
00904 
00905     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00906 
00907     break;
00908     // attribute features
00909     case 'attribute_features':
00910     $copy_attributes_delete_first = '0';
00911     $copy_attributes_duplicates_skipped = '0';
00912     $copy_attributes_duplicates_overwrite = '0';
00913     $copy_attributes_include_downloads = '1';
00914     $copy_attributes_include_filename = '1';
00915     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
00916 
00917     $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . TEXT_PRODUCTS_ATTRIBUTES_INFO . '</strong>' . '<br />');
00918 
00919     $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><br />' .
00920     (zen_has_product_attributes($pInfo->products_id, 'false') ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=attributes_preview' . '&products_filter=' . $pInfo->products_id . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a>' . '&nbsp;&nbsp;' : '') .
00921     '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $pInfo->products_id . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_edit_attribs.gif', IMAGE_EDIT_ATTRIBUTES) . '</a>' .
00922     '<br /><br />');
00923     // only if attributes
00924     if (zen_has_product_attributes($pInfo->products_id, 'false')) {
00925       $contents[] = array('align' => 'left', 'text' => '<br />' . '<strong>' . TEXT_PRODUCT_ATTRIBUTES_DOWNLOADS . '</strong>' . zen_has_product_attributes_downloads($pInfo->products_id) . zen_has_product_attributes_downloads($pInfo->products_id, true));
00926       $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_DELETE . '<strong>' . zen_get_products_name($pInfo->products_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_attributes' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
00927       $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_UPDATES . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=update_attributes_sort_order' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_update.gif', IMAGE_UPDATE) . '</a>');
00928       $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_PRODUCT . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
00929       $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_CATEGORY . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_category' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
00930     }
00931     $contents[] = array('align' => 'center', 'text' => '<br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00932     break;
00933 
00934     // attribute copier to product
00935     case 'attribute_features_copy_to_product':
00936     $_GET['products_update_id'] = '';
00937     // excluded current product from the pull down menu of products
00938     $products_exclude_array = array();
00939     $products_exclude_array[] = $pInfo->products_id;
00940 
00941     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
00942     $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=update_attributes_copy_to_product&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id) . zen_draw_hidden_field('products_update_id', $_GET['products_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']));
00943     $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE);
00944     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_draw_products_pull_down('products_update_id', '', $products_exclude_array, true) . '<br /><br />' . zen_image_submit('button_copy_to.gif', IMAGE_COPY_TO). '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00945     break;
00946 
00947     // attribute copier to product
00948     case 'attribute_features_copy_to_category':
00949     $_GET['categories_update_id'] = '';
00950 
00951     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
00952     $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=update_attributes_copy_to_category&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id) . zen_draw_hidden_field('categories_update_id', $_GET['categories_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']));
00953     $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE);
00954     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_draw_products_pull_down_categories('categories_update_id', '', '', true) . '<br /><br />' . zen_image_submit('button_copy_to.gif', IMAGE_COPY_TO) . '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00955     break;
00956 
00957   } // switch
00958 
00959   if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
00960     echo '            <td valign="top">' . "\n";
00961 
00962     $box = new box;
00963     echo $box->infoBox($heading, $contents);
00964 
00965     echo '            </td>' . "\n";
00966   }
00967 ?>
00968 
00969           </tr>
00970           <tr>
00971             <td class="alert" colspan="3" width="100%" align="center">
00972 <?php
00973   // warning if products are in top level categories
00974   $check_products_top_categories = $db->Execute("select count(*) as products_errors from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = 0");
00975   if ($check_products_top_categories->fields['products_errors'] > 0) {
00976     echo WARNING_PRODUCTS_IN_TOP_INFO . $check_products_top_categories->fields['products_errors'] . '<br />';
00977   }
00978 ?>
00979             </td>
00980           </tr>
00981           <tr>
00982 <?php
00983 // Split Page
00984 if ($products_query_numrows > 0) {
00985   if (empty($pInfo->products_id)) {
00986     $pInfo->products_id= $pID;
00987   }
00988 ?>
00989             <td class="smallText" align="center"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS) . '<br>' . $products_split->display_links($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'pID')) ); ?></td>
00990 
00991 <?php
00992 }
00993 // Split Page
00994 ?>
00995           </tr>
00996         </table></td>
00997       </tr>
00998     </table>
00999     </td>
01000 <!-- body_text_eof //-->
01001   </tr>
01002 </table>
01003 <!-- body_eof //-->
01004 
01005 <!-- footer //-->
01006 <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
01007 <!-- footer_eof //-->
01008 <br />
01009 </body>
01010 </html>
01011 <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
 All Data Structures Namespaces Files Functions Variables Enumerations