本文整理汇总了PHP中Setting::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::update方法的具体用法?PHP Setting::update怎么用?PHP Setting::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::update方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showSettingsPSP
/**
* Show setttings psp page
*
* @access private
*/
private function showSettingsPSP()
{
global $_ARRAYLANG;
$arrYellowpay['pspid'] = '';
$arrYellowpay['sha_in'] = '';
$arrYellowpay['sha_out'] = '';
$arrYellowpay['operation'] = '';
$arrYellowpay['testserver'] = '';
if (isset($_POST['submit'])) {
$arrYellowpay['pspid'] = !empty($_POST['yellowpay']['pspid']) ? contrexx_input2raw($_POST['yellowpay']['pspid']) : '';
$arrYellowpay['sha_in'] = !empty($_POST['yellowpay']['sha_in']) ? contrexx_input2raw($_POST['yellowpay']['sha_in']) : '';
$arrYellowpay['sha_out'] = !empty($_POST['yellowpay']['sha_out']) ? contrexx_input2raw($_POST['yellowpay']['sha_out']) : '';
$arrYellowpay['operation'] = !empty($_POST['yellowpay']['operation']) ? contrexx_input2raw($_POST['yellowpay']['operation']) : '';
$arrYellowpay['testserver'] = !empty($_POST['yellowpay']['testserver']) ? contrexx_input2raw($_POST['yellowpay']['testserver']) : '';
if ($this->objSettingsYellowpay->update($arrYellowpay)) {
$this->arrStatusMessages['ok'][] = $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_CHANGES_SAVED_SUCCESSFULLY'];
} else {
$this->arrStatusMessages['alert'][] = $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_CHANGES_COULD_NOT_BE_SAVED'];
}
} else {
$arrYellowpay = $this->objSettingsYellowpay->get();
}
$yellowpayOperationOptions = '
<option value="SAL"' . ($arrYellowpay['operation'] == 'SAL' ? ' selected="selected"' : '') . '>Verkauf</option>
<option value="RES"' . ($arrYellowpay['operation'] == 'RES' ? ' selected="selected"' : '') . '>Authorisierung</option>
';
$yellowpayTestserverChecked = !empty($arrYellowpay['testserver']) ? 'checked="checked"' : '';
$this->objTemplate->addBlockfile('CHECKOUT_SETTINGS_CONTENT', 'settings_content', 'module_checkout_settings_psp.html');
$this->objTemplate->setVariable(array('TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TITLE' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TITLE'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_PSPID' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_PSPID'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_PSPID_INFO' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_PSPID_INFO'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_SHA_IN' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_SHA_IN'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_SHA_OUT' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_SHA_OUT'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_OPERATION' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_OPERATION'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TESTSERVER' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TESTSERVER'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TESTSERVER_INFO' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_TESTSERVER_INFO'], 'TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_MORE_INFORMATION' => $_ARRAYLANG['TXT_CHECKOUT_SETTINGS_PSP_YELLOWPAY_MORE_INFORMATION'], 'CHECKOUT_YELLOWPAY_PSPID' => $arrYellowpay['pspid'], 'CHECKOUT_YELLOWPAY_SHA_IN' => $arrYellowpay['sha_in'], 'CHECKOUT_YELLOWPAY_SHA_OUT' => $arrYellowpay['sha_out'], 'CHECKOUT_YELLOWPAY_OPERATION_OPTIONS' => $yellowpayOperationOptions, 'CHECKOUT_YELLOWPAY_TESTSERVER_CHECKED' => $yellowpayTestserverChecked, 'TXT_CORE_SAVE' => $_ARRAYLANG['TXT_SAVE']));
$this->objTemplate->parse('settings_content');
}
示例2: save
public function save()
{
$setting = new Setting();
if (isset($_POST["btn_save"])) {
$keys = array("company_name", "address", "phone", "fax", "email", "city", "no_npwp", "logo");
foreach ($keys as $k) {
$v = $this->input->post($k);
$setting->update($k, $v);
}
// upload logo routine
$config['upload_path'] = 'assets/upload';
$config['allowed_types'] = 'gif|jpg|png|bmp';
$this->load->library("upload", $config);
if ($this->upload->do_upload("logo")) {
$data = $this->upload->data();
$setting->update("logo", $data['file_name']);
} else {
echo $this->upload->display_errors();
}
redirect("settings/index");
}
}
示例3: array
$json = array("status" => 0, "msg" => $errorArr);
$dbObj->close();
//Close Database Connection
header('Content-type: application/json');
echo json_encode($json);
}
}
if (filter_input(INPUT_POST, "addNewSetting") != NULL && filter_input(INPUT_POST, "addNewSetting") == "editSetting") {
$postVars = array('value', 'name');
// Form fields names
foreach ($postVars as $postVar) {
switch ($postVar) {
default:
$settingObj->{$postVar} = filter_input(INPUT_POST, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, $postVar)) : '';
if ($settingObj->{$postVar} === "") {
array_push($errorArr, "Please enter {$postVar} ");
}
break;
}
}
if (count($errorArr) < 1) {
echo $settingObj->update();
} else {
$json = array("status" => 0, "msg" => $errorArr);
$dbObj->close();
//Close Database Connection
header('Content-type: application/json');
echo json_encode($json);
}
}
}
示例4: seo_post
public function seo_post()
{
$this->form_validation->set_rules('website_metatag', 'SEO標籤', 'required');
if ($this->form_validation->run() === TRUE) {
$website_metatag = $this->input->post('website_metatag', TRUE);
$Setting = new Setting();
$Setting->construct(array('keyword_Str' => 'website_metatag', 'value_Str' => $website_metatag));
$Setting->update();
// $SettingList = new SettingList();
// $SettingList->construct(array(
// 'construct_Arr' => array(
// array(
// 'keyword_Str' => 'website_metatag',
// 'value_Str' => $website_metatag
// )
// )
// ));
// $SettingList->update();
//送出成功訊息
$this->load->model('Message');
$this->Message->show(array('message' => '設定成功', 'url' => 'admin/base/global/global/seo'));
} else {
$validation_errors_Str = validation_errors();
$validation_errors_Str = !empty($validation_errors_Str) ? $validation_errors_Str : '設定錯誤';
$this->load->model('Message');
$this->Message->show(array('message' => $validation_errors_Str, 'url' => 'admin/base/global/global/seo'));
}
}
示例5: User
<?php
$user = new User();
if (Input::exists()) {
if (Token::check(Input::get('token'))) {
$val = new Validation();
$validate = $val->check($_POST, array('title' => array('required' => true, 'max' => '64'), 'motd' => array('max' => '128'), 'theme' => array('required' => true)));
if ($validate->passed()) {
$debug = Input::get('debug') == 'on' ? 'On' : 'Off';
if (Setting::update('title', Input::get('title')) && Setting::update('motd', Input::get('motd')) && Setting::update('bootstrap-theme', Input::get('theme')) && Setting::update('debug', $debug)) {
Session::flash('complete', 'You have updated the site!');
Redirect::to('/admin');
} else {
//Session::flash('error', 'Something wrong updating this site!');
//Redirect::to('?page=settings');
}
}
} else {
die('Not exists');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php
require 'inc/templates/head.php';
?>
</head>
<body>
<?php
示例6: VALUES
} else {
$pass = sha1(md5(sha1($_POST['adm_pass1'])));
$SQL = "INSERT INTO us01users (us01username,us01password,us01us00uin) VALUES ('{$_POST['adm_name']}','{$pass}',100)";
if (Query($SQL)) {
echo '<div class="headline1">Admin Created Successfully !</div>';
} else {
//echo $SQL;
echo '<div class="headline1"> Admin not Created !!</div>';
}
}
} else {
echo '<div class="headline1">New Password and Confirm Password doesnt match !</div>';
}
} elseif ($action == 'setting') {
$db = new Setting();
$result = $db->update(1, $_POST);
if ($result) {
$objMsg->set('Setting updated Successfully !');
} else {
$objMsg->set(' Setting not updated !!');
}
} else {
}
forceRedirect(getCurrentURL());
}
include_once ADMIN_TPL_MODULE . 'includes/message.php';
?>
<div class="top_bar">
<a href="home.php?module=setting&action=setting"><img src="../css/img/settings.png" height="32px" width="32px"/>Site Setting</a>
<a href="home.php?module=setting&action=addcontrol"><img src="../css/img/add.png" height="32px" width="32px"/>Add Site Admin</a>