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


PHP Currency::update方法代码示例

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


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

示例1: postProcess

 public function postProcess()
 {
     global $currentIndex;
     if (isset($_GET['delete' . $this->table])) {
         if ($this->tabAccess['delete'] === '1') {
             if (Validate::isLoadedObject($object = $this->loadObject())) {
                 if ($object->id == Configuration::get('PS_CURRENCY_DEFAULT')) {
                     $this->_errors[] = $this->l('You can\'t delete the default currency');
                 } elseif ($object->delete()) {
                     Tools::redirectAdmin($currentIndex . '&conf=1' . '&token=' . $this->token);
                 } else {
                     $this->_errors[] = Tools::displayError('an error occurred during deletion');
                 }
             } else {
                 $this->_errors[] = Tools::displayError('an error occurred while deleting object') . ' <b>' . $this->table . '</b> ' . Tools::displayError('(cannot load object)');
             }
         } else {
             $this->_errors[] = Tools::displayError('You do not have permission to delete here.');
         }
     } elseif (Tools::getValue('submitOptions' . $this->table)) {
         foreach ($this->_fieldsOptions as $key => $field) {
             Configuration::updateValue($key, $field['cast'](Tools::getValue($key)));
             if ($key == 'PS_CURRENCY_DEFAULT') {
                 $currency = new Currency($field['cast'](Tools::getValue($key)));
                 $currency->conversion_rate = 1;
                 $currency->update();
             }
         }
         Tools::redirectAdmin($currentIndex . '&conf=6' . '&token=' . $this->token);
     } elseif (Tools::isSubmit('submitExchangesRates')) {
         if (!($this->_errors[] = Currency::refreshCurrencies())) {
             Tools::redirectAdmin($currentIndex . '&conf=6' . '&token=' . $this->token);
         }
     } else {
         parent::postProcess();
     }
 }
开发者ID:sealence,项目名称:local,代码行数:37,代码来源:AdminCurrencies.php

示例2: PostVar

$iCurrencyID = PostVar("iCurrencyID");
$actionfile = GetVar("file");
/** This is for Check Duplicate Record-------------------------------------------*/
$generalobj->getRequestVars();
$redirect_file = "index.php?file={$file}&view={$view}&iCurrencyID={$iCurrencyID}";
$generalobj->checkDuplicate('iCurrencyID', PRJ_DB_PREFIX . "_currency_master", array('vCode' => $Data['vCode']), $redirect_file, COUNTRY_ALREADY_EXISTS, $iCurrencyID);
if ($view == "add") {
    //prints($Data);exit;
    $currencyObj->setAllVar($Data);
    $id = $currencyObj->insert();
    if ($id) {
        $var_msg = "Record Added Successfully.";
    } else {
        $var_msg = "Eror-in Add.";
    }
} else {
    if ($view == "edit") {
        $arr = $currencyObj->select($iCurrencyID);
        $currencyObj->setAllVar($arr);
        $currencyObj->setAllVar($Data);
        $where = " iCurrencyID = '" . $iCurrencyID . "'";
        $id = $currencyObj->update($where);
        if ($id) {
            $var_msg = "Record Updated Successfully.";
        } else {
            $var_msg = "Eror-in Update.";
        }
    }
}
header("Location:index.php?file=" . $actionfile . "&view=index&AX=Yes&var_msg={$var_msg}");
exit;
开发者ID:nstungxd,项目名称:F2CA5,代码行数:31,代码来源:addcurrency_a.php

示例3: storeCurrencies

 /**
  * Stores the Currencies as present in the POST request
  *
  * See {@see Currency::delete()},
  * {@see Currency::add()}, and
  * {@see Currency::update()}.
  */
 static function storeCurrencies()
 {
     //DBG::log("start of storeCurrencies: ".self::$success.", changed: ".self::$changed);
     $result = Currency::delete();
     if (isset($result)) {
         self::$changed = true;
         self::$success &= $result;
     }
     //DBG::log("after delete: ".self::$success.", changed: ".self::$changed);
     $result = Currency::add();
     if (isset($result)) {
         self::$changed = true;
         self::$success &= $result;
     }
     //DBG::log("after add: ".self::$success.", changed: ".self::$changed);
     $result = Currency::update();
     if (isset($result)) {
         self::$changed = true;
         self::$success &= $result;
     }
     //DBG::log("after update: ".self::$success.", changed: ".self::$changed);
     if (self::$changed) {
         // Remember to reinit the Currencies, or the User
         // won't see changes instantly
         Currency::reset();
     }
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:34,代码来源:ShopSettings.class.php

示例4: update_order_settings

 public static function update_order_settings()
 {
     $id = Core::validate(self::getVar('id'));
     $fieldName = Core::validate(self::getVar('fieldName'));
     $value = Core::validate(self::getVar('value'));
     $goodInput = false;
     switch ($fieldName) {
         case 'min_order_amount':
             if ($value != null && Core::isDouble($value) && $value >= 0) {
                 $goodInput = true;
             }
             break;
         default:
             break;
     }
     if ($goodInput == true) {
         $currency = new Currency();
         $currency->setId($id);
         $currency->update(array($fieldName => $value));
         Core::printSuccessJson($fieldName . " " . $value);
     } else {
         Core::printErrorJson('Invalid input: ' . $value);
     }
 }
开发者ID:Christian1998,项目名称:php_btc_exchange,代码行数:24,代码来源:adminController.php


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