当前位置: 首页>>代码示例>>PHP>>正文


PHP tep_remove_product函数代码示例

本文整理汇总了PHP中tep_remove_product函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_remove_product函数的具体用法?PHP tep_remove_product怎么用?PHP tep_remove_product使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了tep_remove_product函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tep_db_prepare_input

        case 'deleteconfirm':
            $manufacturers_id = tep_db_prepare_input($HTTP_GET_VARS['mID']);
            if (isset($HTTP_POST_VARS['delete_image']) && $HTTP_POST_VARS['delete_image'] == 'on') {
                $manufacturer_query = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int) $manufacturers_id . "'");
                $manufacturer = tep_db_fetch_array($manufacturer_query);
                $image_location = DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES . $manufacturer['manufacturers_image'];
                if (file_exists($image_location)) {
                    @unlink($image_location);
                }
            }
            tep_db_query("delete from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int) $manufacturers_id . "'");
            tep_db_query("delete from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int) $manufacturers_id . "'");
            if (isset($HTTP_POST_VARS['delete_products']) && $HTTP_POST_VARS['delete_products'] == 'on') {
                $products_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where manufacturers_id = '" . (int) $manufacturers_id . "'");
                while ($products = tep_db_fetch_array($products_query)) {
                    tep_remove_product($products['products_id']);
                }
            } else {
                tep_db_query("update " . TABLE_PRODUCTS . " set manufacturers_id = '' where manufacturers_id = '" . (int) $manufacturers_id . "'");
            }
            if (USE_CACHE == 'true') {
                tep_reset_cache_block('manufacturers');
            }
            tep_redirect(tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page']));
            break;
    }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html <?php 
echo HTML_PARAMS;
开发者ID:JanZ,项目名称:oscommerce2,代码行数:31,代码来源:manufacturers.php

示例2: while

    while ($products = tep_db_fetch_array($products_query)) {
        $products_code = 'bbk' . sprintf('%010d', (int) $products['products_id']);
        $products_model_1 = (int) preg_replace('/[^\\d]/', '', $products['products_model']);
        tep_db_query("update " . TABLE_PRODUCTS . " set products_code = '" . tep_db_input($products_code) . "', products_model_1 = '" . tep_db_input($products_model_1) . "' where products_id = '" . (int) $products['products_id'] . "'");
        tep_db_query("update " . TABLE_PRODUCTS_INFO . " set products_code = '" . tep_db_input($products_code) . "' where products_id = '" . (int) $products['products_id'] . "'");
    }
}
tep_db_select_db(DB_DATABASE);
die('done');
tep_set_time_limit(600);
$products_to_remove = array();
$products_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_types_id = '0'");
while ($products = tep_db_fetch_array($products_query)) {
    $products_to_remove[] = $products['products_id'];
}
tep_remove_product($products_to_remove);
die('done');
$shops_query = tep_db_query("select shops_database, shops_default_status from " . TABLE_SHOPS . " where shops_database <> '' order by shops_default_status desc");
while ($shops = tep_db_fetch_array($shops_query)) {
    tep_db_select_db($shops['shops_database']);
    $categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where products_types_id > '1'");
    while ($categories = tep_db_fetch_array($categories_query)) {
        $categories_code = 'bfd' . sprintf('%010d', (int) $categories['categories_id']);
        tep_db_query("update " . TABLE_CATEGORIES . " set categories_code = '" . tep_db_input($categories_code) . "' where categories_id = '" . (int) $categories['categories_id'] . "'");
    }
}
tep_db_select_db(DB_DATABASE);
die('done');
$series_query = tep_db_query("select series_id from " . TABLE_SERIES . " where products_types_id > '1'");
while ($series = tep_db_fetch_array($series_query)) {
    $series_code = 'bsr' . sprintf('%010d', (int) $series['series_id']);
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:31,代码来源:discounts.php

示例3: tep_reset_cache_block

         tep_reset_cache_block('categories');
         tep_reset_cache_block('also_purchased');
     }
     tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
     break;
 case 'delete_product_confirm':
     if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['product_categories']) && is_array($HTTP_POST_VARS['product_categories'])) {
         $product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
         $product_categories = $HTTP_POST_VARS['product_categories'];
         for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) {
             tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int) $product_id . "' and categories_id = '" . (int) $product_categories[$i] . "'");
         }
         $product_categories_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int) $product_id . "'");
         $product_categories = tep_db_fetch_array($product_categories_query);
         if ($product_categories['total'] == '0') {
             tep_remove_product($product_id);
         }
     }
     if (USE_CACHE == 'true') {
         tep_reset_cache_block('categories');
         tep_reset_cache_block('also_purchased');
     }
     tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
     break;
 case 'move_category_confirm':
     if (isset($HTTP_POST_VARS['categories_id']) && $HTTP_POST_VARS['categories_id'] != $HTTP_POST_VARS['move_to_category_id']) {
         $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
         $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);
         $path = explode('_', tep_get_generated_category_path_ids($new_parent_id));
         if (in_array($categories_id, $path)) {
             $messageStack->add_session(ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT, 'error');
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:categories.php

示例4: switch

if (!empty($action)) {
    switch ($action) {
        case 'delete_product_confirm':
            if (isset($_GET['pID']) && isset($_POST['product_categories']) && is_array($_POST['product_categories']) && !empty($_POST['product_categories'])) {
                $Qpc = $osC_Database->query('delete from :table_products_to_categories where products_id = :products_id and categories_id in :categories_id');
                $Qpc->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
                $Qpc->bindInt(':products_id', $_GET['pID']);
                $Qpc->bindRaw(':categories_id', '("' . implode('", "', $_POST['product_categories']) . '")');
                $Qpc->execute();
                if ($osC_Database->isError() === false) {
                    $Qcheck = $osC_Database->query('select count(*) as total from :table_products_to_categories where products_id = :products_id');
                    $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
                    $Qcheck->bindInt(':products_id', $_GET['pID']);
                    $Qcheck->execute();
                    if ($Qcheck->valueInt('total') < 1) {
                        tep_remove_product($_GET['pID']);
                    }
                    osC_Cache::clear('categories');
                    osC_Cache::clear('category_tree');
                    osC_Cache::clear('also_purchased');
                    $osC_MessageStack->add_session('header', SUCCESS_DB_ROWS_UPDATED, 'success');
                }
            }
            tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search']));
            break;
        case 'move_product_confirm':
            if (isset($_GET['pID']) && is_numeric($_GET['pID'])) {
                $Qcheck = $osC_Database->query('select count(*) as total from :table_products_to_categories where products_id = :products_id and categories_id = :categories_id');
                $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
                $Qcheck->bindInt(':products_id', $_GET['pID']);
                $Qcheck->bindInt(':categories_id', end(explode('_', $_POST['move_to_category_id'])));
开发者ID:itnovator,项目名称:oscommerce_cvs,代码行数:31,代码来源:products.php

示例5: foreach

         foreach ($products as $key => $value) {
             $Qcheck = $osC_Database->query('select count(*) as total from :table_products_to_categories where products_id = :products_id and categories_id not in :categories_id');
             $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
             $Qcheck->bindInt(':products_id', $key);
             $Qcheck->bindRaw(':categories_id', '("' . implode('", "', $value['categories']) . '")');
             $Qcheck->execute();
             if ($Qcheck->valueInt('total') < 1) {
                 $products_delete[$key] = $key;
             }
         }
         tep_set_time_limit(0);
         foreach ($categories as $c_entry) {
             tep_remove_category($c_entry['id']);
         }
         foreach ($products_delete as $key => $value) {
             tep_remove_product($key);
         }
         osC_Cache::clear('categories');
         osC_Cache::clear('category_tree');
         osC_Cache::clear('also_purchased');
         $osC_MessageStack->add_session('header', SUCCESS_DB_ROWS_UPDATED, 'success');
     }
     tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search']));
     break;
 case 'move_category_confirm':
     if (isset($_GET['cID']) && $_GET['cID'] != end(explode('_', $_POST['move_to_category_id']))) {
         $path = explode('_', $_POST['move_to_category_id']);
         if (in_array($_GET['cID'], $path)) {
             $osC_MessageStack->add_session('header', ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT, 'error');
         } else {
             $Qupdate = $osC_Database->query('update :table_categories set parent_id = :parent_id, last_modified = now() where categories_id = :categories_id');
开发者ID:itnovator,项目名称:oscommerce_cvs,代码行数:31,代码来源:categories.php

示例6: delete_product

function delete_product($products_model)
{
    $pid_query = tep_db_query('SELECT products_id FROM products WHERE products_model = "' . $products_model . '"');
    while ($pid = tep_db_fetch_array($pid_query)) {
        tep_remove_product($pid['products_id'], $products_model);
    }
}
开发者ID:CristianCCIT,项目名称:shop4office,代码行数:7,代码来源:easypopulate.php

示例7: process_row


//.........这里部分代码省略.........
        $result = tep_db_query($sql_extra_field);
        echo $str_err_report;
        // end (EP for product extra fields Contrib by minhmt DEVSOFTVN) ============
        // /////////////////////
        // or do product deletes
    } elseif ($items[$filelayout['v_status']] == EP_DELETE_IT) {
        // Get the ID
        $sql = "SELECT p.products_id as v_products_id    FROM " . TABLE_PRODUCTS . " as p WHERE p.products_model = '" . $items[$filelayout['v_products_model']] . "'";
        $result = tep_db_query($sql);
        $row = tep_db_fetch_array($result);
        if (tep_db_num_rows($result) == 1) {
            tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $row['v_products_id'] . "'");
            $product_categories_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $row['v_products_id'] . "'");
            $product_categories = tep_db_fetch_array($product_categories_query);
            if ($product_categories['total'] == '0') {
                // gather product attribute data
                $result = tep_db_query("select pov.products_options_values_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on pa.options_values_id=pov.products_options_values_id where pa.products_id = '" . (int) $row['v_products_id'] . "'");
                $remove_attribs = array();
                while ($tmp_attrib = tep_db_fetch_array($result)) {
                    $remove_attribs[] = $tmp_attrib;
                }
                // check each attribute name for links to other products
                foreach ($remove_attribs as $rakey => $ravalue) {
                    $product_attribs_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " where options_values_id = '" . (int) $ravalue['products_options_values_id'] . "'");
                    $product_attribs = tep_db_fetch_array($product_attribs_query);
                    // if no other products linked, remove attribute name
                    if ((int) $product_attribs['total'] == 1) {
                        tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int) $ravalue['products_options_values_id'] . "'");
                    }
                }
                // remove attribute records
                tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int) $row['v_products_id'] . "'");
                // remove product
                tep_remove_product($row['v_products_id']);
            }
            if (USE_CACHE == 'true') {
                tep_reset_cache_block('categories');
                tep_reset_cache_block('also_purchased');
            }
            echo "Deleted product " . $items[$filelayout['v_products_model']] . " from the database<br />";
        } else {
            echo "Did not delete " . $items['v_products_model'] . " since it is not unique<br> ";
        }
        // //////////////////////////////////
        // or do regular product processing
        // //////////////////////////////////
    } else {
        // /////////////////////////////////////////////////////////////////////
        //
        // Start: Support for other contributions in products table
        //
        // /////////////////////////////////////////////////////////////////////
        $ep_additional_select = '';
        if (EP_ADDITIONAL_IMAGES == true) {
            $ep_additional_select .= 'p.products_image_description as v_products_image_description,';
        }
        if (EP_MORE_PICS_6_SUPPORT == true) {
            $ep_additional_select .= 'p.products_subimage1 as v_products_subimage1,p.products_subimage2 as v_products_subimage2,p.products_subimage3 as v_products_subimage3,p.products_subimage4 as v_products_subimage4,p.products_subimage5 as v_products_subimage5,p.products_subimage6 as v_products_subimage6,';
        }
        if (EP_ULTRPICS_SUPPORT == true) {
            $ep_additional_select .= 'products_image_med as v_products_image_med,products_image_lrg as v_products_image_lrg,products_image_sm_1 as v_products_image_sm_1,products_image_xl_1 as v_products_image_xl_1,products_image_sm_2 as v_products_image_sm_2,products_image_xl_2 as v_products_image_xl_2,products_image_sm_3 as v_products_image_sm_3,products_image_xl_3 as v_products_image_xl_3,products_image_sm_4 as v_products_image_sm_4,products_image_xl_4 as v_products_image_xl_4,products_image_sm_5 as v_products_image_sm_5,products_image_xl_5 as v_products_image_xl_5,products_image_sm_6 as v_products_image_sm_6,products_image_xl_6 as v_products_image_xl_6,';
        }
        if (EP_PDF_UPLOAD_SUPPORT == true) {
            $ep_additional_select .= 'p.products_pdfupload as v_products_pdfupload, p.products_fileupload as v_products_fileupload,';
        }
        if (EP_MVS_SUPPORT == true) {
开发者ID:digideskio,项目名称:oscmax2,代码行数:67,代码来源:easypopulate.php

示例8: while

                }
                $Qm = $osC_Database->query('delete from :table_manufacturers where manufacturers_id = :manufacturers_id');
                $Qm->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
                $Qm->bindInt(':manufacturers_id', $_GET['mID']);
                $Qm->execute();
                $Qmi = $osC_Database->query('delete from :table_manufacturers_info where manufacturers_id = :manufacturers_id');
                $Qmi->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
                $Qmi->bindInt(':manufacturers_id', $_GET['mID']);
                $Qmi->execute();
                if (isset($_POST['delete_products']) && $_POST['delete_products'] == 'on') {
                    $Qproducts = $osC_Database->query('select products_id from :table_products where manufacturers_id = :manufacturers_id');
                    $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
                    $Qproducts->bindInt(':manufacturers_id', $_GET['mID']);
                    $Qproducts->execute();
                    while ($Qproducts->next()) {
                        tep_remove_product($Qproducts->valueInt('products_id'));
                    }
                } else {
                    $Qupdate = $osC_Database->query('update :table_products set manufacturers_id = "" where manufacturers_id = :manufacturers_id');
                    $Qupdate->bindTable(':table_products', TABLE_PRODUCTS);
                    $Qupdate->bindInt(':manufacturers_id', $_GET['mID']);
                    $Qupdate->execute();
                }
                osC_Cache::clear('manufacturers');
                $osC_MessageStack->add_session('header', SUCCESS_DB_ROWS_UPDATED, 'success');
            }
            tep_redirect(tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page']));
            break;
    }
}
$page_contents = 'manufacturers.php';
开发者ID:itnovator,项目名称:oscommerce_cvs,代码行数:31,代码来源:manufacturers.php


注:本文中的tep_remove_product函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。