• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP fn_check_company_id函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: fn_update_product_filter

function fn_update_product_filter($filter_data, $filter_id, $lang_code = DESCR_SL)
{
    if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) {
        if (!empty($filter_id) && !fn_check_company_id('product_filters', 'filter_id', $filter_id)) {
            fn_company_access_denied_notification();
            return false;
        }
        if (!empty($filter_id)) {
            unset($filter_data['company_id']);
        }
    }
    // Parse filter type
    if (strpos($filter_data['filter_type'], 'FF-') === 0 || strpos($filter_data['filter_type'], 'RF-') === 0 || strpos($filter_data['filter_type'], 'DF-') === 0) {
        $filter_data['feature_id'] = str_replace(array('RF-', 'FF-', 'DF-'), '', $filter_data['filter_type']);
        $filter_data['feature_type'] = db_get_field("SELECT feature_type FROM ?:product_features WHERE feature_id = ?i", $filter_data['feature_id']);
    } else {
        $filter_data['field_type'] = str_replace(array('R-', 'B-'), '', $filter_data['filter_type']);
        $filter_fields = fn_get_product_filter_fields();
    }
    if (!empty($filter_id)) {
        db_query('UPDATE ?:product_filters SET ?u WHERE filter_id = ?i', $filter_data, $filter_id);
        db_query('UPDATE ?:product_filter_descriptions SET ?u WHERE filter_id = ?i AND lang_code = ?s', $filter_data, $filter_id, $lang_code);
    } else {
        $filter_data['filter_id'] = $filter_id = db_query('INSERT INTO ?:product_filters ?e', $filter_data);
        foreach (fn_get_translation_languages() as $filter_data['lang_code'] => $_d) {
            db_query("INSERT INTO ?:product_filter_descriptions ?e", $filter_data);
        }
    }
    fn_set_hook('update_product_filter', $filter_data, $filter_id, $lang_code);
    return $filter_id;
}
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:product_filters.php


示例2: delete

 public function delete($id)
 {
     $data = array();
     $status = Response::STATUS_NOT_FOUND;
     if (fn_check_company_id('shippings', 'shipping_id', $id)) {
         if (fn_delete_shipping($id)) {
             $status = Response::STATUS_NO_CONTENT;
         }
     }
     return array('status' => $status, 'data' => $data);
 }
开发者ID:askzap,项目名称:ultimate,代码行数:11,代码来源:Shippings.php


示例3: delete

 /**
  * Deletes product tab with related descriptions
  *
  * @param  int  $tab_id Product tab identifier
  * @param  bool $force  Delete tab if it is primary or no
  * @return bool True in case of success, false otherwise
  */
 public function delete($tab_id, $force = false)
 {
     if (!empty($tab_id) && (fn_check_company_id('product_tabs', 'tab_id', $tab_id) || !$this->_company_id)) {
         /**
          * Before delete product tab
          * @param int $tab_id Id of product tab for delete
          */
         fn_set_hook('delete_product_tab_pre', $tab_id);
         if (!$this->isPrimary($tab_id) || $force) {
             db_query("DELETE FROM ?:product_tabs WHERE tab_id = ?i", $tab_id);
             db_query("DELETE FROM ?:product_tabs_descriptions WHERE tab_id = ?i", $tab_id);
             /**
              * After delete product tab
              * @param int $tab_id Id of product tab for delete
              */
             fn_set_hook('delete_product_tab_post', $tab_id);
             return true;
         }
     }
     return false;
 }
开发者ID:askzap,项目名称:ultimate,代码行数:28,代码来源:ProductTabs.php


示例4: delete

 /**
  * Deletes product tab with reliated descriptions
  * @static
  * @param  integer $menu_id ID of tab for delete
  * @return bool
  */
 public static function delete($menu_id)
 {
     if (!empty($menu_id) && fn_check_company_id('menus', 'menu_id', $menu_id)) {
         /**
          * Before delete product tab
          * @param int $menu_id Id of product tab for delete
          */
         fn_set_hook('delete_menu_pre', $menu_id);
         db_query("DELETE FROM ?:menus WHERE menu_id = ?i", $menu_id);
         db_query("DELETE FROM ?:menus_descriptions WHERE menu_id = ?i", $menu_id);
         // Remove data from static data
         $static_datas = db_get_array("SELECT param_id FROM ?:static_data WHERE param_5 = ?i AND section = 'A'", $menu_id);
         foreach ($static_datas as $static_data) {
             fn_delete_static_data($static_data['param_id']);
         }
         /**
          * After delete product tab
          * @param int $menu_id Id of product tab for delete
          */
         fn_set_hook('delete_menu_post', $menu_id);
         return true;
     }
     return false;
 }
开发者ID:askzap,项目名称:ultimate,代码行数:30,代码来源:Menu.php


示例5: fn_delete_payment

/**
 * Delete installed payment
 *
 * @param int $payment_id Payment id to be deleted
 * @return bool True if payment was successfully deleted, false otherwise
 */
function fn_delete_payment($payment_id)
{
    $result = true;
    $payment_id = (int) $payment_id;
    if (empty($payment_id) || !fn_check_company_id('payments', 'payment_id', $payment_id)) {
        return false;
    }
    fn_set_hook('delete_payment_pre', $payment_id, $result);
    $res = db_query("DELETE FROM ?:payments WHERE payment_id = ?i", $payment_id);
    db_query("DELETE FROM ?:payment_descriptions WHERE payment_id = ?i", $payment_id);
    fn_delete_image_pairs($payment_id, 'payment');
    $result = $result && $res;
    fn_set_hook('delete_payment_post', $payment_id, $result);
    /**
     * Delete the certificate file (if exists).
     */
    fn_rm(Registry::get('config.dir.certificates') . $payment_id);
    return $result;
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:25,代码来源:fn.common.php


示例6: fn_delete_banner_by_id

/**
 * Deletes banner and all related data
 *
 * @param int $banner_id Banner identificator
 */
function fn_delete_banner_by_id($banner_id)
{
    if (!empty($banner_id) && fn_check_company_id('banners', 'banner_id', $banner_id)) {
        db_query("DELETE FROM ?:banners WHERE banner_id = ?i", $banner_id);
        db_query("DELETE FROM ?:banner_descriptions WHERE banner_id = ?i", $banner_id);
        fn_set_hook('delete_banners', $banner_id);
        Block::instance()->removeDynamicObjectData('banners', $banner_id);
        $banner_images_ids = db_get_fields("SELECT banner_image_id FROM ?:banner_images WHERE banner_id = ?i", $banner_id);
        foreach ($banner_images_ids as $banner_image_id) {
            fn_delete_image_pairs($banner_image_id, 'promo');
        }
        db_query("DELETE FROM ?:banner_images WHERE banner_id = ?i", $banner_id);
    }
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:19,代码来源:func.php


示例7: die

* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
$_REQUEST['promotion_id'] = empty($_REQUEST['promotion_id']) ? 0 : $_REQUEST['promotion_id'];
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    fn_trusted_vars('promotion_data', 'promotions');
    $suffix = '';
    //
    // Update promotion
    //
    if ($mode == 'update') {
        if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) {
            if (!empty($_REQUEST['promotion_id']) && !fn_check_company_id('promotions', 'promotion_id', $_REQUEST['promotion_id'])) {
                fn_company_access_denied_notification();
                return array(CONTROLLER_STATUS_OK, 'promotions.update?promotion_id=' . $_REQUEST['promotion_id']);
            }
            if (!empty($_REQUEST['promotion_id'])) {
                unset($_REQUEST['promotion_data']['company_id']);
            }
        }
        $promotion_id = fn_update_promotion($_REQUEST['promotion_data'], $_REQUEST['promotion_id'], DESCR_SL);
        $suffix = ".update?promotion_id={$promotion_id}";
    }
    //
    // Delete selected promotions
    //
    if ($mode == 'm_delete') {
        if (!empty($_REQUEST['promotion_ids'])) {
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:promotions.php


示例8: fn_ult_check_store_permission_profiles

function fn_ult_check_store_permission_profiles($params, $table, $key, $key_id)
{
    if (Registry::get('runtime.company_id')) {
        $auth = $_SESSION['auth'];
        $result = fn_check_company_id($table, $key, $key_id) || !empty($params['area']);
        $result = $result || fn_check_company_id($table, $key, $key_id, 0) && $auth['user_id'] == $key_id;
        if (!$result && Registry::get('settings.Stores.share_users') == 'Y') {
            $company_customers_ids = db_get_fields("SELECT user_id FROM ?:orders WHERE company_id = ?i", Registry::get('runtime.company_id'));
            $result = in_array($key_id, $company_customers_ids);
        }
    } else {
        $result = true;
    }
    return $result;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:15,代码来源:fn.ultimate.php


示例9: fn_delete_gift_certificate

function fn_delete_gift_certificate($gift_cert_id, $extra = array())
{
    if (!empty($gift_cert_id) && fn_check_company_id('gift_certificates', 'gift_cert_id', $gift_cert_id)) {
        $gift_data = db_get_row("SELECT gift_cert_code, order_ids FROM ?:gift_certificates WHERE gift_cert_id = ?i", $gift_cert_id);
        if (!empty($gift_data['order_ids'])) {
            fn_set_notification('W', __('warning'), __('text_gift_cert_cannot_delete', array('[code]' => $gift_data['gift_cert_code'], '[ids]' => $gift_data['order_ids'])));
            return false;
        }
        db_query("DELETE FROM ?:gift_certificates WHERE gift_cert_id = ?i", $gift_cert_id);
        db_query("DELETE FROM ?:gift_certificates_log WHERE gift_cert_id = ?i", $gift_cert_id);
        fn_set_hook('delete_gift_certificate', $gift_cert_id, $extra);
        return true;
    } else {
        return false;
    }
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:16,代码来源:func.php


示例10: fn_update_product_filter

function fn_update_product_filter($filter_data, $filter_id, $lang_code = DESCR_SL)
{
    if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) {
        if (!empty($filter_id) && !fn_check_company_id('product_filters', 'filter_id', $filter_id)) {
            fn_company_access_denied_notification();
            return false;
        }
        if (!empty($filter_id)) {
            unset($filter_data['company_id']);
        }
    }
    // Parse filter type
    if (strpos($filter_data['filter_type'], 'FF-') === 0 || strpos($filter_data['filter_type'], 'RF-') === 0 || strpos($filter_data['filter_type'], 'DF-') === 0) {
        $filter_data['feature_id'] = str_replace(array('RF-', 'FF-', 'DF-'), '', $filter_data['filter_type']);
        $filter_data['feature_type'] = db_get_field("SELECT feature_type FROM ?:product_features WHERE feature_id = ?i", $filter_data['feature_id']);
    } else {
        $filter_data['field_type'] = str_replace(array('R-', 'B-'), '', $filter_data['filter_type']);
        $filter_fields = fn_get_product_filter_fields();
    }
    if (isset($filter_data['display_more_count']) && isset($filter_data['display_count']) && $filter_data['display_more_count'] < $filter_data['display_count']) {
        $filter_data['display_more_count'] = $filter_data['display_count'];
    }
    if (!empty($filter_id)) {
        db_query('UPDATE ?:product_filters SET ?u WHERE filter_id = ?i', $filter_data, $filter_id);
        db_query('UPDATE ?:product_filter_descriptions SET ?u WHERE filter_id = ?i AND lang_code = ?s', $filter_data, $filter_id, $lang_code);
    } else {
        $filter_data['filter_id'] = $filter_id = db_query('INSERT INTO ?:product_filters ?e', $filter_data);
        foreach (fn_get_translation_languages() as $filter_data['lang_code'] => $_d) {
            db_query("INSERT INTO ?:product_filter_descriptions ?e", $filter_data);
        }
    }
    $delete_all_ranges = false;
    // if filter has ranges
    if (!empty($filter_data['feature_type']) && strpos('ODN', $filter_data['feature_type']) !== false || !empty($filter_data['field_type']) && !empty($filter_fields[$filter_data['field_type']]['is_range'])) {
        $range_ids = array();
        foreach ($filter_data['ranges'] as $k => $range) {
            if (!empty($filter_data['feature_type']) && $filter_data['feature_type'] == 'D') {
                $range['to'] = fn_parse_date($filter_data['dates_ranges'][$k]['to']);
                $range['from'] = fn_parse_date($filter_data['dates_ranges'][$k]['from']);
            }
            $range['filter_id'] = $filter_id;
            if (!empty($filter_data['feature_id'])) {
                $range['feature_id'] = $filter_data['feature_id'];
            }
            if (!empty($range['range_id'])) {
                db_query("UPDATE ?:product_filter_ranges SET ?u WHERE range_id = ?i", $range, $range['range_id']);
                db_query('UPDATE ?:product_filter_ranges_descriptions SET ?u WHERE range_id = ?i AND lang_code = ?s', $range, $range['range_id'], $lang_code);
            } elseif ((!empty($range['from']) || !empty($range['to'])) && !empty($range['range_name'])) {
                $range['range_id'] = db_query("INSERT INTO ?:product_filter_ranges ?e", $range);
                foreach (fn_get_translation_languages() as $range['lang_code'] => $_d) {
                    db_query("INSERT INTO ?:product_filter_ranges_descriptions ?e", $range);
                }
            }
            if (!empty($range['range_id'])) {
                $range_ids[] = $range['range_id'];
            }
        }
        if (!empty($range_ids)) {
            $deleted_ranges = db_get_fields("SELECT range_id FROM ?:product_filter_ranges WHERE filter_id = ?i AND range_id NOT IN (?n)", $filter_id, $range_ids);
            if (!empty($deleted_ranges)) {
                db_query("DELETE FROM ?:product_filter_ranges WHERE range_id IN (?n)", $deleted_ranges);
                db_query("DELETE FROM ?:product_filter_ranges_descriptions WHERE range_id IN (?n)", $deleted_ranges);
            }
        } else {
            $delete_all_ranges = true;
        }
    } else {
        $delete_all_ranges = true;
    }
    if ($delete_all_ranges) {
        $deleted_ranges = db_get_fields("SELECT range_id FROM ?:product_filter_ranges WHERE filter_id = ?i", $filter_id);
        db_query("DELETE FROM ?:product_filter_ranges WHERE filter_id = ?i", $filter_id);
        db_query("DELETE FROM ?:product_filter_ranges_descriptions WHERE range_id IN (?n)", $deleted_ranges);
    }
    fn_set_hook('update_product_filter', $filter_data, $filter_id, $lang_code);
    return $filter_id;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:77,代码来源:product_filters.php


示例11: fn_delete_feature

/**
 * Removes product feature
 *
 * @param int $feature_id Feature identifier
 * @return boolean Always true
 */
function fn_delete_feature($feature_id)
{
    $feature_deleted = true;
    if (fn_allowed_for('ULTIMATE')) {
        if (!fn_check_company_id('product_features', 'feature_id', $feature_id)) {
            fn_company_access_denied_notification();
            return false;
        }
    }
    /**
     * Adds additional actions before product feature deleting
     *
     * @param int $feature_id Feature identifier
     */
    fn_set_hook('delete_feature_pre', $feature_id);
    $feature_type = db_get_field("SELECT feature_type FROM ?:product_features WHERE feature_id = ?i", $feature_id);
    fn_set_hook('delete_product_feature', $feature_id, $feature_type);
    if ($feature_type == 'G') {
        $fids = db_get_fields("SELECT feature_id FROM ?:product_features WHERE parent_id = ?i", $feature_id);
        if (!empty($fids)) {
            foreach ($fids as $fid) {
                fn_delete_feature($fid);
            }
        }
    }
    $affected_rows = db_query("DELETE FROM ?:product_features WHERE feature_id = ?i", $feature_id);
    db_query("DELETE FROM ?:product_features_descriptions WHERE feature_id = ?i", $feature_id);
    if ($affected_rows == 0) {
        fn_set_notification('E', __('error'), __('object_not_found', array('[object]' => __('feature'))), '', '404');
        $feature_deleted = false;
    }
    $variant_ids = fn_delete_product_feature_variants($feature_id);
    if (!fn_allowed_for('ULTIMATE:FREE')) {
        $filter_ids = db_get_fields("SELECT filter_id FROM ?:product_filters WHERE feature_id = ?i", $feature_id);
        foreach ($filter_ids as $_filter_id) {
            fn_delete_product_filter($_filter_id);
        }
    }
    /**
     * Adds additional actions after product feature deleting
     *
     * @param int   $feature_id  Deleted feature identifier
     * @param array $variant_ids Deleted feature variants
     */
    fn_set_hook('delete_feature_post', $feature_id, $variant_ids);
    return $feature_deleted;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:53,代码来源:fn.catalog.php


示例12: fn_import_feature

function fn_import_feature($data, &$processed_data, &$skip_record, $category_delimiter = '///')
{
    static $new_groups = array();
    $skip_record = true;
    $feature = reset($data);
    $langs = array_keys($data);
    $main_lang = reset($langs);
    if (Registry::get('runtime.company_id')) {
        $company_id = Registry::get('runtime.company_id');
    } else {
        if (!empty($feature['company'])) {
            $company_id = fn_get_company_id_by_name($feature['company']);
        } else {
            $company_id = isset($feature['company_id']) ? $feature['company_id'] : Registry::get('runtime.company_id');
        }
    }
    if (!empty($feature['feature_id'])) {
        $feature_id = db_get_field('SELECT ?:product_features.feature_id FROM ?:product_features WHERE feature_id = ?i', $feature['feature_id']);
    }
    $parent_id = fn_exim_get_product_feature_group_id($feature['parent_id'], $company_id, $new_groups, $main_lang);
    if (empty($feature_id)) {
        $condition = db_quote("WHERE description = ?s AND lang_code = ?s AND feature_type = ?s", $feature['description'], $main_lang, $feature['feature_type']);
        $condition .= db_quote(" AND parent_id = ?i", $parent_id);
        $feature_id = db_get_field('SELECT ?:product_features.feature_id FROM ?:product_features_descriptions ' . 'LEFT JOIN ?:product_features ON ?:product_features.feature_id = ?:product_features_descriptions.feature_id ' . $condition);
    }
    unset($feature['feature_id']);
    $feature['company_id'] = $company_id;
    $feature['parent_id'] = $parent_id;
    $feature['variants'] = array();
    if (!empty($feature['Variants'])) {
        $variants = str_getcsv($feature['Variants'], ',', "'");
        array_walk($variants, 'fn_trim_helper');
        list($origin_variants) = fn_get_product_feature_variants(array('feature_id' => $feature_id), 0, $main_lang);
        $feature['original_var_ids'] = implode(',', array_keys($origin_variants));
        foreach ($variants as $variant) {
            $feature['variants'][]['variant'] = $variant;
        }
    }
    $skip = false;
    if (empty($feature_id)) {
        $feature_id = fn_update_product_feature($feature, 0, $main_lang);
        $processed_data['N']++;
        fn_set_progress('echo', __('updating') . ' features <b>' . $feature_id . '</b>. ', false);
    } else {
        if (!fn_check_company_id('product_features', 'feature_id', $feature_id)) {
            $processed_data['S']++;
            $skip = true;
        } else {
            // Convert categories from Names to C_IDS: Electronics,Processors -> 3,45
            $_data = $feature;
            $_data['categories_path'] = fn_exim_get_features_convert_category_path($feature, $main_lang, $category_delimiter);
            fn_update_product_feature($_data, $feature_id, $main_lang);
            if (in_array($feature_id, $new_groups)) {
                $processed_data['N']++;
            } else {
                $processed_data['E']++;
                fn_set_progress('echo', __('creating') . ' features <b>' . $feature_id . '</b>. ', false);
            }
        }
    }
    if (!$skip) {
        fn_exim_set_product_feature_categories($feature_id, $feature, $main_lang, $category_delimiter);
        foreach ($data as $lang_code => $feature_data) {
            unset($feature_data['feature_id']);
            db_query('UPDATE ?:product_features_descriptions SET ?u WHERE feature_id = ?i AND lang_code = ?s', $feature_data, $feature_id, $lang_code);
        }
        if (fn_allowed_for('ULTIMATE')) {
            if (!empty($company_id)) {
                fn_exim_update_share_feature($feature_id, $company_id);
            }
        }
    }
    return $feature_id;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:74,代码来源:features.functions.php


示例13: fn_mve_clone_page_pre

function fn_mve_clone_page_pre(&$page_id, &$data)
{
    if (!fn_check_company_id('pages', 'page_id', $page_id)) {
        fn_company_access_denied_notification();
        unset($data);
    }
}
开发者ID:askzap,项目名称:ask-zap,代码行数:7,代码来源:fn.multivendor.php


示例14: fn_get_taxes

    Registry::get('view')->assign('taxes', fn_get_taxes());
    Registry::get('view')->assign('usergroups', fn_get_usergroups('C', DESCR_SL));
    // Show all shipping methods
} elseif ($mode == 'manage') {
    $company_id = Registry::ifGet('runtime.company_id', null);
    Registry::get('view')->assign('shippings', fn_get_available_shippings($company_id));
    Registry::get('view')->assign('usergroups', fn_get_usergroups('C', DESCR_SL));
    // Delete shipping method
} elseif ($mode == 'delete') {
    if (!empty($_REQUEST['shipping_id']) && fn_check_company_id('shippings', 'shipping_id', $_REQUEST['shipping_id'])) {
        fn_delete_shipping($_REQUEST['shipping_id']);
    }
    return array(CONTROLLER_STATUS_REDIRECT, "shippings.manage");
    // Delete selected rate
} elseif ($mode == 'delete_rate_value') {
    if (fn_check_company_id('shippings', 'shipping_id', $_REQUEST['shipping_id'])) {
        fn_delete_rate_values(array($_REQUEST['rate_type'] => array($_REQUEST['amount'] => 'Y')), $_REQUEST['shipping_id'], $_REQUEST['destination_id']);
    }
    return array(CONTROLLER_STATUS_REDIRECT, "shippings.update?shipping_id={$_REQUEST['shipping_id']}&destination_id={$_REQUEST['destination_id']}&selected_section=shipping_charges");
}
function fn_delete_rate_values($delete_rate_data, $shipping_id, $destination_id)
{
    $rate_values = db_get_field("SELECT rate_value FROM ?:shipping_rates WHERE shipping_id = ?i AND destination_id = ?i", $shipping_id, $destination_id);
    if (!empty($rate_values)) {
        $rate_values = unserialize($rate_values);
    }
    foreach ((array) $rate_values as $rate_type => $rd) {
        foreach ((array) $rd as $amount => $data) {
            if (isset($delete_rate_data[$rate_type][$amount]) && $delete_rate_data[$rate_type][$amount] == 'Y') {
                unset($rate_values[$rate_type][$amount]);
            }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:shippings.php


示例15: fn_delete_page

/**
 *  Delete page and its subpages
 *
 * @param int $page_id Page ID
 * @param bool $recurse Delete page recursively or not
 * @return array Returns ids of deleted pages or false if function can't delete page
 */
function fn_delete_page($page_id, $recurse = true)
{
    $page_id = (int) $page_id;
    if (!empty($page_id) && fn_check_company_id('pages', 'page_id', $page_id)) {
        // Delete all subpages
        if ($recurse == true) {
            $id_path = db_get_field("SELECT id_path FROM ?:pages WHERE page_id = ?i", $page_id);
            $page_ids = db_get_fields("SELECT page_id FROM ?:pages WHERE page_id = ?i OR id_path LIKE ?l", $page_id, "{$id_path}/%");
        } else {
            $page_ids = array($page_id);
        }
        foreach ($page_ids as $v) {
            // Deleting page
            db_query("DELETE FROM ?:pages WHERE page_id = ?i", $v);
            db_query("DELETE FROM ?:page_descriptions WHERE page_id = ?i", $v);
            fn_set_hook('delete_page', $v);
            Block::instance()->removeDynamicObjectData('pages', $v);
        }
        return $page_ids;
        // Returns ids of deleted pages
    } else {
        return false;
    }
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:31,代码来源:fn.cms.php


示例16: fn_set_company_id

                     fn_set_company_id($v);
                 }
                 fn_update_category($v, $k, DESCR_SL);
             }
         }
     }
     $suffix = ".manage";
 }
 //
 // Processing deleting of multiple category elements
 //
 if ($mode == 'm_delete') {
     if (isset($_REQUEST['category_ids'])) {
         $category_deletion_queue = fn_filter_redundant_deleting_category_ids((array) $_REQUEST['category_ids']);
         foreach ($category_deletion_queue as $category_id) {
             if (fn_allowed_for('MULTIVENDOR') || fn_allowed_for('ULTIMATE') && fn_check_company_id('categories', 'category_id', $category_id)) {
                 fn_delete_category($category_id, true);
             }
         }
     }
     unset($_SESSION['category_ids']);
     fn_set_notification('N', __('notice'), __('text_categories_have_been_deleted'));
     $suffix = ".manage";
 }
 //
 // Store selected fields for using in 'm_update' mode
 //
 if ($mode == 'store_selection') {
     if (!empty($_REQUEST['category_ids'])) {
         $_SESSION['category_ids'] = $_REQUEST['category_ids'];
         $_SESSION['selected_fields'] = $_REQUEST['selected_fields'];
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:categories.php


示例17: fn_clone_page

function fn_clone_page($page_id)
{
    if (!fn_check_company_id('pages', 'page_id', $page_id)) {
        fn_company_access_denied_notification(false);
        return false;
    }
    // Clone main data
    $data = db_get_row("SELECT * FROM ?:pages WHERE page_id = ?i", $page_id);
    unset($data['page_id']);
    $data['status'] = 'D';
    $new_page_id = db_query("INSERT INTO ?:pages ?e", $data);
    // Update parent-child deps
    $id_path = explode('/', $data['id_path']);
    array_pop($id_path);
    $id_path[] = $new_page_id;
    db_query("UPDATE ?:pages SET id_path = ?s WHERE page_id = ?i", implode('/', $id_path), $new_page_id);
    // Clone descriptions
    $data = db_get_array("SELECT * FROM ?:page_descriptions WHERE page_id = ?i", $page_id);
    foreach ($data as $v) {
        $v['page_id'] = $new_page_id;
        if ($v['lang_code'] == CART_LANGUAGE) {
            $orig_name = $v['page'];
            $new_name = $v['page'] . ' [CLONE]';
        }
        $v['page'] .= ' [CLONE]';
        db_query("INSERT INTO ?:page_descriptions ?e", $v);
    }
    fn_clone_block_links('pages', $page_id, $new_page_id);
    fn_set_hook('clone_page', $page_id, $new_page_id);
    return array('page_id' => $new_page_id, 'orig_name' => $orig_name, 'page' => $new_name);
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:pages.php


示例18: fn_delete_promotions

function fn_delete_promotions($promotion_ids)
{
    if (!is_array($promotion_ids)) {
        $promotion_ids = array($promotion_ids);
    }
    if (fn_allowed_for('ULTIMATE')) {
        foreach ($promotion_ids as $promotion_id => $promotion) {
            if (!fn_check_company_id('promotions', 'promotion_id', $promotion)) {
                fn_set_notification('E', __('error'), __('access_denied'));
                unset($promotion_ids[$promotion_id]);
            }
        }
    }
    foreach ($promotion_ids as $pr_id) {
        db_query("DELETE FROM ?:promotions WHERE promotion_id = ?i", $pr_id);
        db_query("DELETE FROM ?:promotion_descriptions WHERE promotion_id = ?i", $pr_id);
    }
}
开发者ID:askzap,项目名称:ultimate,代码行数:18,代码来源:fn.promotions.php


示例19: fn_delete_news

/**
* Deletes news by its ID
*
* @param int $news_id - News Identifier
*/
function fn_delete_news($news_id)
{
    $news_deleted = false;
    if (!empty($news_id)) {
        if (fn_check_company_id('news', 'news_id', $news_id)) {
            // Log news deletion
            fn_log_event('news', 'delete', array('news_id' => $news_id));
            Block::instance()->removeDynamicObjectData('news', $news_id);
            $affected_rows = db_query("DELETE FROM ?:news WHERE news_id = ?i", $news_id);
            db_query("DELETE FROM ?:news_descriptions WHERE news_id = ?i", $news_id);
            if ($affected_rows != 0) {
                $news_deleted = true;
            } else {
                fn_set_notification('E', __('error'), __('object_not_found', array('[object]' => __('news'))), '', '404');
            }
            fn_set_hook('delete_news', $news_id);
        } else {
            fn_company_access_denied_notification();
        }
    }
    return $news_deleted;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:27,代码来源:func.php


示例20: fn_set_notification

                 fn_set_notification('W', __('warning'), __('access_denied'));
                 return array(CONTROLLER_STATUS_REDIRECT, 'product_options.manage');
             }
         }
         $_REQUEST['option_data'] = array_merge($option_data, $_REQUEST['option_data']);
         fn_set_company_id($_REQUEST['option_data']);
     }
     $option_id = fn_update_product_option($_REQUEST['option_data'], $_REQUEST['option_id'], DESCR_SL);
     if (!empty($_REQUEST['object']) && $_REQUEST['object'] == 'product') {
         // FIXME (when assigning page and current url will be removed from ajax)
         return array(CONTROLLER_STATUS_OK, $_SERVER['HTTP_REFERER'] . '&selected_section=options');
     }
     $suffix = ".manage";
 }
 if ($mode == 'delete') {
     if (!empty($_REQUEST['option_id']) && fn_check_company_id('product_options', 'option_id', $_REQUEST['option_id']) || !empty($_REQUEST['product_id']) && fn_check_company_id('products', 'product_id', $_REQUEST['product_id'])) {
         $p_id = db_get_field("SELECT product_id FROM ?:product_options WHERE option_id = ?i", $_REQUEST['option_id']);
         if (!empty($_REQUEST['product_id']) && empty($p_id)) {
             // we're deleting global option from the product
             db_query("DELETE FROM ?:product_global_option_links WHERE product_id = ?i AND option_id = ?i", $_REQUEST['product_id'], $_REQUEST['option_id']);
         } else {
             fn_delete_product_option($_REQUEST['option_id']);
         }
         if (empty($_REQUEST['product_id']) && empty($p_id)) {
             // we're deleting global option itself
             db_query("DELETE FROM ?:product_global_option_links WHERE option_id = ?i", $_REQUEST['option_id']);
         }
     }
     if (!empty($_REQUEST['product_id'])) {
         $_options = fn_get_product_options($_REQUEST['product_id']);
         if (empty($_options)) {
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:31,代码来源:product_options.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fn_check_payment_script函数代码示例发布时间:2022-05-15
下一篇:
PHP fn_change_order_status函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap