Пример #1
0
                    @unlink($image_location);
                }
            }
            tep_remove_manufacturer($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 = '0' where manufacturers_id = '" . (int) $manufacturers_id . "'");
            }
            if (isset($HTTP_POST_VARS['delete_series']) && $HTTP_POST_VARS['delete_series'] == 'on') {
                $series_query = tep_db_query("select series_id from " . TABLE_SERIES . " where manufacturers_id = '" . (int) $manufacturers_id . "'");
                while ($series = tep_db_fetch_array($series_query)) {
                    tep_remove_serie($series['series_id']);
                }
            } else {
                tep_db_query("update " . TABLE_SERIES . " set manufacturers_id = '0' where manufacturers_id = '" . (int) $manufacturers_id . "'");
            }
            tep_redirect(tep_href_link(FILENAME_MANUFACTURERS, 'search=' . urlencode($search) . '&page=' . $HTTP_GET_VARS['page']));
            break;
    }
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php 
echo HTML_PARAMS;
?>
>
<head>
Пример #2
0
                }
            }
            tep_update_blocks($series_id, 'serie');
            tep_redirect(tep_href_link(FILENAME_SERIES, 'search=' . urlencode($search) . '&page=' . $HTTP_GET_VARS['page'] . '&sID=' . $series_id));
            break;
        case 'deleteconfirm':
            $series_id = tep_db_prepare_input($HTTP_GET_VARS['sID']);
            if (isset($HTTP_POST_VARS['delete_image']) && $HTTP_POST_VARS['delete_image'] == 'on') {
                $serie_query = tep_db_query("select series_image from " . TABLE_SERIES . " where series_id = '" . (int) $series_id . "'");
                $serie = tep_db_fetch_array($serie_query);
                $image_location = DIR_FS_CATALOG . DIR_WS_CATALOG_IMAGES . $serie['series_image'];
                if (file_exists($image_location)) {
                    @unlink($image_location);
                }
            }
            tep_remove_serie($series_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 series_id = '" . (int) $series_id . "'");
                while ($products = tep_db_fetch_array($products_query)) {
                    tep_remove_product($products['products_id']);
                }
            } else {
                tep_db_query("update " . TABLE_PRODUCTS . " set series_id = '' where series_id = '" . (int) $series_id . "'");
            }
            tep_redirect(tep_href_link(FILENAME_SERIES, 'search=' . urlencode($search) . '&page=' . $HTTP_GET_VARS['page']));
            break;
    }
}
$manufacturers_array = array(array('id' => '', 'text' => TEXT_DEFAULT_SELECT));
$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS_INFO . " order by manufacturers_name");
while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {