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

PHP oledrion_utils类代码示例

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

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



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

示例1: b_oledrion_rated_show

/**
 * Affiche les produits les mieux notés
 */
function b_oledrion_rated_show($options)
{
    // '10|0';	// Voir 10 produits, pour toutes les catégories ou une catégorie particulière
    global $xoopsConfig, $xoopsTpl;
    include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
    $products = $block = array();
    $start = 0;
    $limit = $options[0];
    $categoryId = $options[1];
    $oledrion_shelf_parameters->resetDefaultValues()->setProductsType('bestrated')->setStart($start)->setLimit($limit)->setSort('product_rating')->setOrder('DESC')->setCategory($categoryId);
    $products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
    if (isset($products['lastTitle'])) {
        unset($products['lastTitle']);
    }
    if (count($products) > 0) {
        $url = OLEDRION_URL . 'include/oledrion.css';
        $block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
        $block['block_products'] = $products;
        $xoopsTpl->assign("xoops_module_header", "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\" />");
        return $block;
    } else {
        // La liste des produits est introuvable (on ne trouve pas les produits vendus dans le stock des produits)
        return false;
    }
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:28,代码来源:oledrion_rated.php


示例2: b_oledrion_recomm_show

/**
 * Renvoie la liste des produits recommandés
 */
function b_oledrion_recomm_show($options)
{
    // '10|0';	// Voir 10 produits, pour toutes les catégories ou une catégorie particulière
    global $xoopsConfig, $xoopsTpl;
    include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
    $products = $block = array();
    $start = 0;
    $limit = $options[0];
    $categoyrId = $options[1];
    $oledrion_shelf_parameters->resetDefaultValues()->setProductsType('recommended')->setStart($start)->setLimit($limit)->setSort('product_recommended')->setOrder('DESC')->setCategory($categoyrId);
    $products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
    if ($h_oledrion_products->getRecommendedCount() > $limit) {
        // Il y a plus de produits recommandés dans la BDD que dans le bloc, on affiche donc un lien vers la page des produits recommandés
        $block['showMore'] = true;
    }
    if (isset($products['lastTitle'])) {
        unset($products['lastTitle']);
    }
    if (count($products) > 0) {
        $url = OLEDRION_URL . 'include/oledrion.css';
        $block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
        $block['block_products'] = $products;
        $xoopsTpl->assign("xoops_module_header", "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\" />");
        return $block;
    } else {
        // Pas de produits recommandés
        return false;
    }
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:32,代码来源:oledrion_recommended.php


示例3: b_oledrion_random_show

/**
 * Affiche x produit(s) au hasard
 */
function b_oledrion_random_show($options)
{
    // '10|0|0';	// Voir 10 produits, pour toutes les catégories ou une catégorie particulière, et pour ce mois-ci ou pour tout le temps ?
    global $xoopsConfig, $xoopsTpl;
    include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
    $products = $block = array();
    $start = 0;
    $limit = $options[0];
    $categoryId = $options[1];
    $thisMonthOnly = intval($options[2]);
    $oledrion_shelf_parameters->resetDefaultValues()->setProductsType('random')->setStart($start)->setLimit($limit)->setSort('RAND()')->setCategory($categoryId)->setThisMonthOnly($thisMonthOnly);
    $products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
    if (isset($products['lastTitle'])) {
        unset($products['lastTitle']);
    }
    if (count($products) > 0) {
        $url = OLEDRION_URL . 'include/oledrion.css';
        $block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
        $block['block_products'] = $products;
        $xoopsTpl->assign("xoops_module_header", "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\" />");
        return $block;
    } else {
        return false;
    }
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:28,代码来源:oledrion_random.php


示例4: getCurrentGateway

 /**
  * Retourne la passerelle de paiement en cours d'utilisation
  *
  * @return string	Le nom de la  passerelle de paiement (en fait le nom de son répertoire)
  */
 function getCurrentGateway()
 {
     $return = xoops_trim(oledrion_utils::getModuleOption('used_gateway'));
     if ($return == '') {
         $return = 'paypal';
         // Valeur par défaut
     }
     return $return;
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:14,代码来源:oledrion_gateways.php


示例5: b_sitemap_oledrion

/**
 * oledrion
 *
 * @copyright   The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
 * @version     $Id: oledrion.php 12290 2014-02-07 11:05:17Z beckmi $
 */
function b_sitemap_oledrion()
{
    require '../oledrion/header.php';
    global $sitemap_configs;
    $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
    $table = $xoopsDB->prefix('oledrion_cat');
    $id_name = 'cat_cid';
    $pid_name = 'cat_pid';
    $title_name = 'cat_title';
    $url = 'category.php?cat_cid=';
    $order = 'cat_title';
    include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
    $mytree = new XoopsTree($table, $id_name, $pid_name);
    $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
    $sitemap = array();
    $myts = MyTextSanitizer::getInstance();
    $i = 0;
    $sql = "SELECT `{$id_name}`,`{$title_name}` FROM `{$table}` WHERE `{$pid_name}`=0";
    if ($order != '') {
        $sql .= " ORDER BY `{$order}`";
    }
    $result = $xoopsDB->query($sql);
    while (list($catid, $name) = $xoopsDB->fetchRow($result)) {
        $sitemap['parent'][$i]['id'] = $catid;
        $sitemap['parent'][$i]['title'] = $myts->htmlSpecialChars($name);
        if (oledrion_utils::getModuleOption('urlrewriting') == 1) {
            // On utilise l'url rewriting
            $url = 'category' . '-' . intval($catid) . oledrion_utils::makeSeoUrl($name) . '.html';
        } else {
            // Pas d'utilisation de l'url rewriting
            $url = 'category.php?cat_cid=' . intval($catid);
        }
        $sitemap['parent'][$i]['url'] = $url;
        if (@$sitemap_configs["show_subcategoris"]) {
            $j = 0;
            $child_ary = $mytree->getChildTreeArray($catid, $order);
            foreach ($child_ary as $child) {
                $count = strlen($child['prefix']) + 1;
                $sitemap['parent'][$i]['child'][$j]['id'] = $child[$id_name];
                $sitemap['parent'][$i]['child'][$j]['title'] = $myts->htmlSpecialChars($child[$title_name]);
                $sitemap['parent'][$i]['child'][$j]['image'] = $count > 3 ? 4 : $count;
                if (oledrion_utils::getModuleOption('urlrewriting') == 1) {
                    // On utilise l'url rewriting
                    $url = 'category' . '-' . intval($child[$id_name]) . oledrion_utils::makeSeoUrl($child[$title_name]) . '.html';
                } else {
                    // Pas d'utilisation de l'url rewriting
                    $url = 'category.php?cat_cid=' . intval($child[$id_name]);
                }
                $sitemap['parent'][$i]['child'][$j]['url'] = $url;
                $j++;
            }
        }
        $i++;
    }
    return $sitemap;
}
开发者ID:osw17,项目名称:oledrion,代码行数:64,代码来源:oledrion.php


示例6: __construct

 public function __construct()
 {
     // Get the module's preferences
     $this->_decimalsCount = oledrion_utils::getModuleOption('decimals_count');
     $this->_thousandsSep = oledrion_utils::getModuleOption('thousands_sep');
     $this->_decimalSep = oledrion_utils::getModuleOption('decimal_sep');
     $this->_moneyFull = oledrion_utils::getModuleOption('money_full');
     $this->_moneyShort = oledrion_utils::getModuleOption('money_short');
     $this->_monnaiePlace = oledrion_utils::getModuleOption('monnaie_place');
     $this->_thousandsSep = str_replace('[space]', ' ', $this->_thousandsSep);
     $this->_decimalSep = str_replace('[space]', ' ', $this->_decimalSep);
 }
开发者ID:osw17,项目名称:oledrion,代码行数:12,代码来源:oledrion_currency.php


示例7: b_oledrion_category_lists_edit

/**
 * Edition des paramètres du bloc
 *
 * @param array $options [0] = Nombre maximum de listes à voir, [1] = Type de listes (0 = les 2, 1 = liste cadeaux, 2 = produits recommandés)
 * @return array
 */
function b_oledrion_category_lists_edit($options)
{
    include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
    $form = '';
    $form .= "<table border='0'>";
    $form .= '<tr><td>' . _MB_OLEDRION_LISTS_COUNT . "</td><td><input type='text' name='options[]' id='options' value='" . intval($options[0]) . "' /></td></tr>";
    $listTypes = oledrion_lists::getTypesArray();
    $listTypeSelect = oledrion_utils::htmlSelect('options[]', $listTypes, intval($options[1]), false);
    $form .= '<tr><td>' . _MB_OLEDRION_LISTS_TYPE . "</td><td>" . $listTypeSelect . "</td></tr>";
    $form .= '</table>';
    return $form;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:18,代码来源:oledrion_categoy_lists.php


示例8: b_oledrion_my_lists_show

/**
 * Affiche les listes de l'utilisateur
 *
 * @param array $options [0] = Nombre maximum de listes à voir
 * @return array
 */
function b_oledrion_my_lists_show($options)
{
    require XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
    oledrion_utils::loadLanguageFile('modinfo.php');
    $start = 0;
    $limit = intval($options[0]);
    $uid = oledrion_utils::getCurrentUserID();
    if ($uid == 0) {
        return null;
    }
    $listType = OLEDRION_LISTS_ALL;
    $block = array();
    $handlers = oledrion_handler::getInstance();
    $items = array();
    $items = $handlers->h_oledrion_lists->getRecentLists(new oledrion_parameters(array('start' => $start, 'limit' => $limit, 'sort' => 'list_date', 'order' => 'DESC', 'idAsKey' => true, 'listType' => $listType, 'list_uid' => $uid)));
    if (count($items) > 0) {
        foreach ($items as $item) {
            $block['my_lists'][] = $item->toArray();
        }
    }
    return $block;
}
开发者ID:osw17,项目名称:oledrion,代码行数:28,代码来源:oledrion_my_lists.php


示例9: b_oledrion_recentlysold_show

/**
 * This block shows the products that were recently sold
 * @param array $options    [0] = Nombre maximum de produits à voir
 * @return array
 */
function b_oledrion_recentlysold_show($options)
{
    global $xoopsConfig, $xoTheme;
    require XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
    $categoryId = 0;
    $start = 0;
    $limit = $options[0];
    $oledrion_shelf_parameters->resetDefaultValues()->setProductsType('recentlysold')->setStart($start)->setLimit($limit);
    $products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
    if (isset($products['lastTitle'])) {
        unset($products['lastTitle']);
    }
    if (count($products) > 0) {
        $block = array();
        $block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
        $block['block_products'] = $products;
        $xoTheme->addStylesheet(OLEDRION_URL . 'assets/css/oledrion.css');
        return $block;
    } else {
        return false;
    }
}
开发者ID:osw17,项目名称:oledrion,代码行数:27,代码来源:oledrion_recentlysold.php


示例10: b_oledrion_recentlysold_show

/**
 * This block shows the products that were recently sold
 * @param array $options	[0] = Nombre maximum de produits à voir
 * @return array
 */
function b_oledrion_recentlysold_show($options)
{
    global $xoopsConfig, $xoopsTpl;
    require XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
    $categoryId = 0;
    $start = 0;
    $limit = $options[0];
    $oledrion_shelf_parameters->resetDefaultValues()->setProductsType('recentlysold')->setStart($start)->setLimit($limit);
    $products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
    if (isset($products['lastTitle'])) {
        unset($products['lastTitle']);
    }
    if (count($products) > 0) {
        $url = OLEDRION_URL . 'include/oledrion.css';
        $block = array();
        $block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
        $block['block_products'] = $products;
        $xoopsTpl->assign("xoops_module_header", "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\" />");
        return $block;
    } else {
        return false;
    }
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:28,代码来源:oledrion_recentlysold.php


示例11: b_oledrion_promotion_show

/**
 * Affiche x produit(s) en promotion
 */
function b_oledrion_promotion_show($options)
{
    // '10|0';	// Voir 10 produits, pour toutes les catégories ou une catégorie particulière
    global $xoopsConfig, $xoTheme;
    include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
    $block = $products = array();
    $start = 0;
    $limit = $options[0];
    $categoryId = $options[1];
    $oledrion_shelf_parameters->resetDefaultValues()->setProductsType('promotional')->setStart($start)->setLimit($limit)->setSort('product_submitted DESC, product_title')->setOrder('ASC')->setCategory($categoryId);
    $products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
    if (isset($products['lastTitle'])) {
        unset($products['lastTitle']);
    }
    if (count($products) > 0) {
        $block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
        $block['block_products'] = $products;
        $xoTheme->addStylesheet(OLEDRION_URL . 'assets/css/oledrion.css');
        return $block;
    } else {
        return false;
    }
}
开发者ID:osw17,项目名称:oledrion,代码行数:26,代码来源:oledrion_promotion.php


示例12: b_oledrion_cart_show

/**
 * block to display items in cart
 *
 * @param integer $options[0] Count of items to show (0 = no limit)
 * @return array Block's content
 */
function b_oledrion_cart_show($options)
{
    global $mod_pref, $xoopsConfig;
    include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
    $productsCount = intval($options[0]);
    $cartForTemplate = $block = array();
    $emptyCart = false;
    $shippingAmount = $commandAmount = $vatAmount = $discountsCount = 0;
    $goOn = '';
    $commandAmountTTC = 0;
    $discountsDescription = array();
    // Calcul du montant total du caddy
    $reductions = new oledrion_reductions();
    $reductions->computeCart($cartForTemplate, $emptyCart, $shippingAmount, $commandAmount, $vatAmount, $goOn, $commandAmountTTC, $discountsDescription, $discountsCount);
    $dec = oledrion_utils::getModuleOption('decimals_count');
    if ($emptyCart) {
        return '';
    }
    $block['block_money_full'] = oledrion_utils::getModuleOption('money_full');
    $block['block_money_short'] = oledrion_utils::getModuleOption('money_short');
    $block['block_shippingAmount'] = sprintf("%0." . $dec . 'f', $shippingAmount);
    // Montant des frais de port
    $block['block_commandAmount'] = sprintf("%0." . $dec . 'f', $commandAmount);
    // Montant HT de la commande
    $block['block_vatAmount'] = sprintf("%0." . $dec . 'f', $vatAmount);
    // Montant de la TVA
    $block['block_commandAmountTTC'] = sprintf("%0." . $dec . 'f', $commandAmountTTC);
    // Montant TTC de la commande
    $block['block_discountsDescription'] = $discountsDescription;
    // Liste des réductions accordées
    if ($productsCount > 0 && count($cartForTemplate) > $productsCount) {
        array_slice($cartForTemplate, 0, $productsCount - 1);
    }
    $block['block_caddieProducts'] = $cartForTemplate;
    // Produits dans le caddy
    return $block;
}
开发者ID:osw17,项目名称:oledrion,代码行数:43,代码来源:oledrion_cart.php


示例13: CriteriaCompo

                $configHandler->insertConfig($config);
            }
        }
        if (isset($_POST['product_property10'])) {
            if (oledrion_utils::getModuleOption('product_property10') != $_POST['product_property10']) {
                $criteria = new CriteriaCompo();
                $criteria->add($moduleIdCriteria);
                $criteria->add(new Criteria('conf_name', 'product_property10'));
                $config = $configHandler->getConfigs($criteria);
                $config = $config[0];
                $configValue = array('conf_modid' => $xoopsModule->getVar('mid'), 'conf_catid' => 0, 'conf_name' => 'product_property10', 'conf_value' => $_POST['product_property10'], 'conf_formtype' => 'hidden', 'conf_valuetype' => 'text');
                $config->setVars($configValue);
                $configHandler->insertConfig($config);
            }
        }
        if (isset($_POST['product_property10_title'])) {
            if (oledrion_utils::getModuleOption('product_property10_title') != $_POST['product_property10_title']) {
                $criteria = new CriteriaCompo();
                $criteria->add($moduleIdCriteria);
                $criteria->add(new Criteria('conf_name', 'product_property10_title'));
                $config = $configHandler->getConfigs($criteria);
                $config = $config[0];
                $configValue = array('conf_modid' => $xoopsModule->getVar('mid'), 'conf_catid' => 0, 'conf_name' => 'product_property10_title', 'conf_value' => $_POST['product_property10_title'], 'conf_formtype' => 'hidden', 'conf_valuetype' => 'text');
                $config->setVars($configValue);
                $configHandler->insertConfig($config);
            }
        }
        oledrion_utils::updateCache();
        oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=property', 2);
        break;
}
开发者ID:osw17,项目名称:oledrion,代码行数:31,代码来源:property.php


示例14: getVar

                       $msg['PAYS'] = $countries[$commande->getVar('cmd_country')];
                       $msg['TELEPHONE'] = $commande->getVar('cmd_telephone');
                       $msg['EMAIL'] = $commande->getVar('cmd_email');
                       $msg['URL_BILL'] = OLEDRION_URL . 'invoice.php?id=' . $commande->getVar('cmd_id') . '&pass=' . $commande->getVar('cmd_password');
                       $msg['IP'] = oledrion_utils::IP();
                       if ($commande->getVar('cmd_bill') == 1) {
                           $msg['FACTURE'] = _YES;
                       } else {
                           $msg['FACTURE'] = _NO;
                       }
                       // Send mail to client
                       oledrion_utils::sendEmailFromTpl('command_client.tpl', $commande -> getVar('cmd_email'), sprintf(_OLEDRION_THANKYOU_CMD, $xoopsConfig['sitename']), $msg);
                       // Send mail to admin
                       oledrion_utils::sendEmailFromTpl('command_shop.tpl', oledrion_utils::getEmailsFromGroup(oledrion_utils::getModuleOption('grp_sold')), _OLEDRION_NEW_COMMAND, $msg);
                       */
                    // Send SMS
                    if (oledrion_utils::getModuleOption('sms_checkout')) {
                        $information['to'] = ltrim($commande->getVar('cmd_mobile'), 0);
                        $information['text'] = oledrion_utils::getModuleOption('sms_checkout_text');
                        $sms = oledrion_sms::sendSms($information);
                    }
                }
            } else {
                $ret['status'] = 0;
                $ret['message'] = _OLEDRION_ERROR10;
            }
        }
        $return = json_encode($ret);
        break;
}
echo $return;
开发者ID:osw17,项目名称:oledrion,代码行数:31,代码来源:ajax.php


示例15: array

 *					$options[2] - max font size (px or %)
 *					$options[3] - min font size (px or %)
 */
$modversion['blocks'][] = array('file' => 'oledrion_block_tag.php', 'name' => _MI_OLEDRION_TAG_CLOUD, 'description' => 'Show tag cloud', 'show_func' => 'oledrion_tag_block_cloud_show', 'edit_func' => 'oledrion_tag_block_cloud_edit', 'options' => '100|0|150|80', 'template' => 'oledrion_tag_block_cloud.tpl');
/*
 * $options:
 *					$options[0] - number of tags to display
 *					$options[1] - time duration, in days, 0 for all the time
 *					$options[2] - sort: a - alphabet; c - count; t - time
 */
$modversion['blocks'][] = array('file' => 'oledrion_block_tag.php', 'name' => _MI_OLEDRION_TOP_TAGS, 'description' => 'Show top tags', 'show_func' => 'oledrion_tag_block_top_show', 'edit_func' => 'oledrion_tag_block_top_edit', 'options' => '50|30|c', 'template' => 'oledrion_tag_block_top.tpl');
// Menu
$modversion['hasMain'] = 1;
$cptm = 0;
require_once 'class/oledrion_utils.php';
if (oledrion_utils::getModuleOption('use_price')) {
    $cptm++;
    $modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME1;
    $modversion['sub'][$cptm]['url'] = 'caddy.php';
}
$cptm++;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME3;
$modversion['sub'][$cptm]['url'] = 'category.php';
$cptm++;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME4;
$modversion['sub'][$cptm]['url'] = 'categories-map.php';
$cptm++;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME5;
$modversion['sub'][$cptm]['url'] = 'whoswho.php';
$cptm++;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME6;
开发者ID:osw17,项目名称:oledrion,代码行数:31,代码来源:xoops_version.php


示例16: reloadPersistentCart

 /**
  * Recharge le dernier panier de l'utilisateur
  *
  * @return boolean
  */
 function reloadPersistentCart()
 {
     global $xoopsUser, $h_oledrion_persistent_cart;
     if (oledrion_utils::getModuleOption('persistent_cart') == 0) {
         return false;
     }
     if (is_object($xoopsUser)) {
         $persistent_carts = array();
         $persistent_carts = $h_oledrion_persistent_cart->getUserProducts();
         if (count($persistent_carts) > 0) {
             foreach ($persistent_carts as $persistent_cart) {
                 $this->addProduct($persistent_cart->getVar('persistent_product_id'), $persistent_cart->getVar('persistent_qty'), null);
             }
         }
     }
     return true;
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:22,代码来源:oledrion_caddy.php


示例17: xoops_cp_header

    // ****************************************************************************************************************
    case 'delete':
        // Suppression d'un fabricant
        // ****************************************************************************************************************
        xoops_cp_header();
        $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
        if (empty($id)) {
            oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5);
        }
        $opRedirect = 'manufacturers';
        // On vérifie que ce fabriquant n'est pas relié à des produits
        $cnt = $h_oledrion_manufacturer->getManufacturerProductsCount($id);
        if ($cnt == 0) {
            $item = null;
            $item = $h_oledrion_manufacturer->get($id);
            if (is_object($item)) {
                $res = $h_oledrion_manufacturer->deleteManufacturer($item);
                if ($res) {
                    oledrion_utils::updateCache();
                    oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=' . $opRedirect, 2);
                } else {
                    oledrion_utils::redirect(_AM_OLEDRION_SAVE_PB, $baseurl . '?op=' . $opRedirect, 5);
                }
            } else {
                oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl . '?op=' . $opRedirect, 5);
            }
        } else {
            oledrion_utils::redirect(_AM_OLEDRION_ERROR_5, $baseurl . '?op=' . $opRedirect, 5);
        }
        break;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:manufacturers.php


示例18: xoops_module_update_oledrion

/**
 * oledrion
 *
 * @copyright   The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
 * @author      Hossein Azizabadi ([email protected])
 * @version     $Id: functions_update.php 12290 2014-02-07 11:05:17Z beckmi $
 */
function xoops_module_update_oledrion($module, $version)
{
    global $xoopsDB;
    // Présence des nouvelles tables et nouvelles zones dans la base de données
    // Nouvelle table oledrion_gateways_options
    $tableName = $xoopsDB->prefix('oledrion_gateways_options');
    if (!oledrion_utils::tableExists($tableName)) {
        $sql = "CREATE TABLE " . $tableName . " (\n                `option_id` int(10) unsigned NOT NULL auto_increment,\n                `option_gateway` varchar(50) NOT NULL COMMENT 'nom de la passerelle de paiement',\n                `option_name` varchar(50) NOT NULL,\n                `option_value` text NOT NULL,\n                PRIMARY KEY  (`option_id`),\n                KEY `option_gateway` (`option_gateway`),\n                KEY `option_name` (`option_name`),\n                KEY `option_gateway_name` (`option_gateway`,`option_name`)\n                ) ENGINE=InnoDB";
        $xoopsDB->queryF($sql);
    }
    // Nouveau champ cmd_comment dans oledrion_commands
    $tableName = $xoopsDB->prefix('oledrion_commands');
    if (!oledrion_utils::fieldExists('cmd_comment', $tableName)) {
        oledrion_utils::addField('`cmd_comment` TEXT NOT NULL', $tableName);
    }
    if (!oledrion_utils::fieldExists('cmd_vat_number', $tableName)) {
        oledrion_utils::addField('`cmd_vat_number` VARCHAR( 255 ) NOT NULL', $tableName);
    }
    /**
     * Nouvelle table oledrion_lists
     * @since 2.2.2009.01.29
     */
    $tableName = $xoopsDB->prefix('oledrion_lists');
    if (!oledrion_utils::tableExists($tableName)) {
        $sql = "CREATE TABLE " . $tableName . " (\n                `list_id` int(10) unsigned NOT NULL auto_increment,\n                `list_uid` mediumint(8) unsigned NOT NULL,\n                `list_title` varchar(255) NOT NULL,\n                `list_date` int(10) unsigned NOT NULL,\n                `list_productscount` mediumint(8) unsigned NOT NULL,\n                `list_views` mediumint(8) unsigned NOT NULL,\n                `list_password` varchar(50) NOT NULL,\n                `list_type` tinyint(3) unsigned NOT NULL,\n                `list_description` text NOT NULL,\n                PRIMARY KEY  (`list_id`),\n                KEY `list_uid` (`list_uid`)\n                ) ENGINE=InnoDB";
        $xoopsDB->queryF($sql);
    }
    /**
     * Nouvelle table oledrion_lists
     * @since 2.2.2009.01.29
     */
    $tableName = $xoopsDB->prefix('oledrion_products_list');
    if (!oledrion_utils::tableExists($tableName)) {
        $sql = "CREATE TABLE " . $tableName . " (\n                `productlist_id` int(10) unsigned NOT NULL auto_increment,\n                `productlist_list_id` int(10) unsigned NOT NULL,\n                `productlist_product_id` int(10) unsigned NOT NULL,\n                PRIMARY KEY  (`productlist_id`),\n                KEY `productlist_list_id` (`productlist_list_id`),\n                KEY `productlist_product_id` (`productlist_product_id`)\n                ) ENGINE=InnoDB";
        $xoopsDB->queryF($sql);
    }
    if (!oledrion_utils::fieldExists('productlist_date', $tableName)) {
        oledrion_utils::addField('productlist_date DATE NOT NULL', $tableName);
    }
    /**
     * Nouvelle table oledrion_attributes
     * @since 2.3.2009.03.09
     */
    $tableName = $xoopsDB->prefix('oledrion_attributes');
    if (!oledrion_utils::tableExists($tableName)) {
        $sql = "CREATE TABLE `{$tableName}` (\n              `attribute_id` int(10) unsigned NOT NULL auto_increment,\n              `attribute_weight` mediumint(7) unsigned default NULL,\n              `attribute_title` varchar(255) default NULL,\n              `attribute_name` varchar(255) NOT NULL,\n              `attribute_type` tinyint(3) unsigned default NULL,\n              `attribute_mandatory` tinyint(1) unsigned default NULL,\n              `attribute_values` text,\n              `attribute_names` text,\n              `attribute_prices` text,\n              `attribute_stocks` text,\n              `attribute_product_id` int(11) unsigned default NULL,\n              `attribute_default_value` varchar(255) default NULL,\n              `attribute_option1` mediumint(7) unsigned default NULL,\n              `attribute_option2` mediumint(7) unsigned default NULL,\n              PRIMARY KEY  (`attribute_id`),\n              KEY `attribute_product_id` (`attribute_product_id`),\n              KEY `attribute_weight` (`attribute_weight`)\n            ) ENGINE=InnoDB;";
        $xoopsDB->queryF($sql);
    }
    /**
     * Nouvelle table oledrion_caddy_attributes
     * @since 2.3.2009.03.10
     */
    $tableName = $xoopsDB->prefix('oledrion_caddy_attributes');
    if (!oledrion_utils::tableExists($tableName)) {
        $sql = "CREATE TABLE `{$tableName}` (\n              `ca_id` int(10) unsigned NOT NULL auto_increment,\n              `ca_cmd_id` int(10) unsigned NOT NULL,\n              `ca_caddy_id` int(10) unsigned NOT NULL,\n              `ca_attribute_id` int(10) unsigned NOT NULL,\n              `ca_attribute_values` text NOT NULL,\n              `ca_attribute_names` text NOT NULL,\n              `ca_attribute_prices` text NOT NULL,\n              PRIMARY KEY  (`ca_id`),\n              KEY `ca_cmd_id` (`ca_cmd_id`),\n              KEY `ca_caddy_id` (`ca_caddy_id`),\n              KEY `ca_attribute_id` (`ca_attribute_id`)\n        ) ENGINE=InnoDB;";
        $xoopsDB->queryF($sql);
    }
    /**
     * Augmentation des types numéraires pour accepter le million
     * @since 2.3.2009.04.20
     */
    $definition = oledrion_utils::getFieldDefinition('product_price', $xoopsDB->prefix('oledrion_products'));
    if ($definition != '') {
        if (xoops_trim($definition['Type']) == 'decimal(7,2)') {
            $tablesToUpdates = array('oledrion_products' => array('product_price', 'product_shipping_price', 'product_discount_price', 'product_ecotaxe'), 'oledrion_caddy' => array('caddy_price'), 'oledrion_commands' => array('cmd_shipping'), 'oledrion_discounts' => array('disc_price_degress_l1total', 'disc_price_degress_l2total', 'disc_price_degress_l3total', 'disc_price_degress_l4total', 'disc_price_degress_l5total'));
            foreach ($tablesToUpdates as $tableName => $fields) {
                foreach ($fields as $field) {
                    $sql = 'ALTER TABLE ' . $xoopsDB->prefix($tableName) . ' CHANGE `' . $field . '` `' . $field . '` DECIMAL( 16, 2 ) NOT NULL';
                    $xoopsDB->queryF($sql);
                }
            }
        }
    }
    /**
     * Add product_property
     * @since 2.3.2012.08.03
     */
    $tableName = $xoopsDB->prefix('oledrion_products');
    if (!oledrion_utils::fieldExists('product_property1', $tableName)) {
        oledrion_utils::addField('`product_property1` varchar(255) NOT NULL', $tableName);
    }
    if (!oledrion_utils::fieldExists('product_property2', $tableName)) {
        oledrion_utils::addField('`product_property2` varchar(255) NOT NULL', $tableName);
    }
    if (!oledrion_utils::fieldExists('product_property3', $tableName)) {
        oledrion_utils::addField('`product_property3` varchar(255) NOT NULL', $tableName);
    }
    if (!oledrion_utils::fieldExists('product_property4', $tableName)) {
        oledrion_utils::addField('`product_property4` varchar(255) NOT NULL', $tableName);
    }
    if (!oledrion_utils::fieldExists('product_property5', $tableName)) {
//.........这里部分代码省略.........
开发者ID:osw17,项目名称:oledrion,代码行数:101,代码来源:functions_update.php


示例19: xoops_cp_header

            echo "<tr>\n";
        }
        echo '</table>';
        if (isset($pagenav) && is_object($pagenav)) {
            echo "<div align='right'>" . $pagenav->renderNav() . "</div>";
        }
        include_once OLEDRION_ADMIN_PATH . 'admin_footer.php';
        break;
        // ****************************************************************************************************************
    // ****************************************************************************************************************
    case 'delete':
        // Suppression d'une liste
        // ****************************************************************************************************************
        xoops_cp_header();
        $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
        if (empty($id)) {
            oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl . '?op=' . $operation, 5);
        }
        $list = null;
        $list = $oledrion_handlers->h_oledrion_lists->get($id);
        if (!is_object($list)) {
            oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl . '?op=' . $operation, 5);
        }
        if ($oledrion_handlers->h_oledrion_lists->deleteList($list)) {
            oledrion_utils::updateCache();
            oledrion_utils::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . '?op=' . $operation, 2);
        } else {
            oledrion_utils::redirect(_AM_OLEDRION_SAVE_PB, $baseurl . '?op=' . $operation, 5);
        }
        break;
}
开发者ID:osw17,项目名称:oledrion,代码行数:31,代码来源:lists.php


示例20: getHrefTitle

 /**
  * Rentourne la chaine à envoyer dans une balise <a> pour l'attribut href
  *
  * @return string
  */
 public function getHrefTitle()
 {
     return oledrion_utils::makeHrefTitle($this->getVar('manu_commercialname') . ' ' . $this->getVar('manu_name'));
 }
开发者ID:osw17,项目名称:oledrion,代码行数:9,代码来源:oledrion_manufacturer.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP opConfig类代码示例发布时间:2022-05-23
下一篇:
PHP ocp_tempcode类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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