本文整理汇总了PHP中fixer::input方法的典型用法代码示例。如果您正苦于以下问题:PHP fixer::input方法的具体用法?PHP fixer::input怎么用?PHP fixer::input使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fixer
的用法示例。
在下文中一共展示了fixer::input方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* update an address.
*
* @param int $id
* @access public
* @return void
*/
public function update($id)
{
$product = new stdclass();
$address = fixer::input('post')->add('account', $this->app->user->account)->get();
$this->dao->update(TABLE_ADDRESS)->data($address)->where('id')->eq($id)->beginIf(RUN_MODE == 'front')->andWhere('account')->eq($this->app->user->account)->fi()->batchCheck($this->config->address->require->edit, 'notempty')->exec();
return !dao::isError();
}
示例2: gererateCustomField
public function gererateCustomField($type = 'info', $method = 'add')
{
$this->app->loadClass('infoextdao', $static = true);
//echo $_REQUEST['Null'][0]."\n";
$oldField = '';
if (empty($_REQUEST['Field']) && $_REQUEST['Field'] != '0') {
echo js::alert($this->lang->custom->fieldEmpty);
return false;
}
if (!(empty($_REQUEST['oldField']) && $_REQUEST['oldField'] != '0')) {
$oldField = $_REQUEST['oldField'];
$oldField = infoextdao::backquote($this->config->customFieldPrefix . $oldField);
//echo js::alert($oldField);
}
$custom = fixer::input('post')->setDefault('Collation', 'utf8_general_ci')->setDefault('Attribute', '')->setDefault('Extra', false)->get();
$field_primary = array();
//var_dump($custom);
$definition = ' ' . strtoupper($method) . ' ' . $oldField . ' ' . infoextdao::generateFieldSpec($this->config->customFieldPrefix . $custom->Field, $custom->Type, $custom->Length, $custom->Attribute, $custom->Collation, isset($_REQUEST['NULL'][0]) ? $_REQUEST['NULL'][0] : 'NOT NULL', $custom->DefaultType, $custom->DefaultValue, $custom->Extra, $custom->Comment, $field_primary, 0);
$table = $this->config->custom->typeToTable[$type];
$sql_query = 'ALTER TABLE ' . infoextdao::backquote($table) . ' ' . $definition;
//echo js::alert($sql_query);
try {
$result = $this->app->dbh->query($sql_query);
} catch (Exception $e) {
//echo 'Message: ' .$e->getMessage();
echo js::alert(addslashes($sql_query));
echo js::alert($this->lang->custom->alterTableFailed);
return false;
}
return true;
}
示例3: deleteSunyard
/**
* Delete all data for Sunyard
*
* @access public
* @return void
*/
public function deleteSunyard()
{
$deleteProjects = fixer::input('post')->get();
foreach ($deleteProjects->projects as $projectID) {
$this->dao->delete()->from(TABLE_SUNEFFORTEVERYDAY)->where('project')->eq($projectID)->exec();
$this->dao->delete()->from(TABLE_SUNPROJECTESTIMATE)->where('project')->eq($projectID)->exec();
}
}
示例4: update
/**
* Update a release.
*
* @param int $releaseID
* @access public
* @return void
*/
public function update($releaseID)
{
$oldRelease = $this->getByID($releaseID);
$release = fixer::input('post')->stripTags('name')->setDefault('stories', '')->setDefault('bugs', '')->join('stories', ',')->join('bugs', ',')->get();
$this->dao->update(TABLE_RELEASE)->data($release)->autoCheck()->batchCheck($this->config->release->edit->requiredFields, 'notempty')->check('name', 'unique', "id != {$releaseID}")->where('id')->eq((int) $releaseID)->exec();
$this->dao->update(TABLE_STORY)->set('stage')->eq('released')->where('id')->in($release->stories)->exec();
if (!dao::isError()) {
return common::createChanges($oldRelease, $release);
}
}
示例5: update
/**
* Update a product.
*
* @param int $productID
* @access public
* @return void
*/
public function update($productID)
{
$oldProduct = $this->getByID($productID);
$product = fixer::input('post')->add('editedBy', $this->app->user->account)->add('editedDate', helper::now())->get();
$this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck()->batchCheck($this->config->product->require->edit, 'notempty')->where('id')->eq($productID)->exec();
if (dao::isError()) {
return false;
}
return commonModel::createChanges($oldProduct, $product);
}
示例6: lang
/**
* Set lang.
*
* @param string $module
* @param string $field
* @access public
* @return void
*/
public function lang($module, $field, $appName = '')
{
$clientLang = $this->app->getClientLang();
if (empty($appName)) {
$appName = $this->app->getAppName();
}
$this->app->loadLang($module, $appName);
if ($module == 'user' and $field == 'roleList' and $appName == 'sys') {
$this->lang->menuGroups->setting = 'user';
}
if (!empty($_POST)) {
if ($module == 'common' and $field == 'currencyList') {
$setting = fixer::input('post')->join('currency', ',')->setDefault('currency', '')->get();
$this->setting->setItems('system.sys.setting', $setting);
if (dao::isError()) {
$this->send(array('result' => 'fail', 'message' => dao::getError()));
}
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('lang', "module={$module}&field={$field}&appName={$appName}")));
}
$lang = $_POST['lang'];
$appendField = isset($this->config->setting->appendLang[$module][$field]) ? $this->config->setting->appendLang[$module][$field] : '';
$this->setting->deleteItems("lang={$lang}&app={$appName}&module={$module}§ion={$field}", $type = 'lang');
if ($appendField) {
$this->setting->deleteItems("lang={$lang}&app={$appName}&module={$module}§ion={$appendField}", $type = 'lang');
}
foreach ($_POST['keys'] as $index => $key) {
$value = $_POST['values'][$index];
if (!$value or !$key) {
continue;
}
$system = $_POST['systems'][$index];
$this->setting->setItem("{$lang}.{$appName}.{$module}.{$field}.{$key}.{$system}", $value, $type = 'lang');
/* Save additional item. */
if ($appendField) {
$this->setting->setItem("{$lang}.{$appName}.{$module}.{$appendField}.{$key}.{$system}", $_POST[$appendField][$index], $type = 'lang');
}
}
if (dao::isError()) {
$this->send(array('result' => 'fail', 'message' => dao::getError()));
}
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('lang', "module={$module}&field={$field}&appName={$appName}")));
}
$dbFields = $this->setting->getItems("lang={$clientLang},all&app={$appName}&module={$module}§ion={$field}", 'lang');
$systemField = array();
foreach ($dbFields as $dbField) {
$systemField[$dbField->key] = $dbField->system;
}
$this->view->fieldList = $module == 'common' ? $this->lang->{$field} : $this->lang->{$module}->{$field};
$this->view->module = $module;
$this->view->field = $field;
$this->view->clientLang = $clientLang;
$this->view->systemField = $systemField;
$this->view->appName = $appName;
$this->display();
}
示例7: update
/**
* Update a company.
*
* @access public
* @return void
*/
public function update()
{
$company = fixer::input('post')->get();
if ($company->website == 'http://') {
$company->website = '';
}
if ($company->backyard == 'http://') {
$company->backyard = '';
}
$companyID = $this->app->company->id;
$this->dao->update(TABLE_COMPANY)->data($company)->autoCheck()->batchCheck($this->config->company->edit->requiredFields, 'notempty')->batchCheck('name', 'unique', "id != '{$companyID}'")->where('id')->eq($companyID)->exec();
}
示例8: save
/**
* Save params
*
* @param int $index
* @param string $type
* @param string $appName
* @param int $blockID
* @access public
* @return void
*/
public function save($index, $type = 'system', $appName = 'sys', $blockID = 0)
{
$data = fixer::input('post')->add('account', $this->app->user->account)->add('order', $index)->add('app', $appName)->add('hidden', 0)->setIF($type != 'system', 'block', $type)->setIF($blockID, 'id', $blockID)->setDefault('grid', '4')->setDefault('source', $appName)->setDefault('params', array())->get();
if ($type != 'system') {
$data->source = '';
}
if ($type == 'html') {
$data->params['html'] = $data->html;
unset($data->html);
}
$data->params = helper::jsonEncode($data->params);
$this->dao->replace(TABLE_BLOCK)->data($data, 'uid')->exec();
}
示例9: link
/**
* Set link for a tag.
*
* @param int $tagID
* @access public
* @return void
*/
public function link($tagID)
{
if ($_POST) {
$link = fixer::input('post')->stripTags('link', $this->config->allowedTags->admin)->get();
$this->dao->update(TABLE_TAG)->data($link)->autoCheck()->where('id')->eq($tagID)->exec();
if (!dao::isError()) {
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
}
$this->send(array('result' => 'fail', 'message' => dao::getError()));
}
$this->view->title = "<i class='icon-edit'></i> " . $this->lang->tag->editLink;
$this->view->tag = $this->dao->select('*')->from(TABLE_TAG)->where('id')->eq($tagID)->fetch();
$this->display();
}
示例10: set
/**
* Custom
*
* @param string $module
* @param string $field
* @access public
* @return void
*/
public function set($module = 'story', $field = 'priList')
{
if ($module == 'user' and $field == 'priList') {
$field = 'roleList';
}
$currentLang = $this->app->getClientLang();
$this->app->loadLang($module);
$this->app->loadConfig('story');
$fieldList = $this->lang->{$module}->{$field};
if ($module == 'bug' and $field == 'typeList') {
unset($fieldList['designchange']);
unset($fieldList['newfeature']);
unset($fieldList['trackthings']);
}
if (!empty($_POST)) {
if ($module == 'story' && $field == 'review') {
$this->loadModel('setting')->setItem('system.story.needReview', fixer::input('post')->get()->needReview);
} else {
$lang = $_POST['lang'];
$this->custom->deleteItems("lang={$lang}&module={$module}§ion={$field}");
foreach ($_POST['keys'] as $index => $key) {
$value = $_POST['values'][$index];
if (!$value or !$key) {
continue;
}
$system = $_POST['systems'][$index];
/* the length of role is 20, check it when save. */
if ($module == 'user' and $field == 'roleList' and strlen($key) > 20) {
die(js::alert($this->lang->custom->notice->userRole));
}
$this->custom->setItem("{$lang}.{$module}.{$field}.{$key}.{$system}", $value);
}
}
if (dao::isError()) {
die(js::error(dao::getError()));
}
die(js::reload('parent'));
}
$this->view->title = $this->lang->custom->common . $this->lang->colon . $this->lang->{$module}->common;
$this->view->position[] = $this->lang->custom->common;
$this->view->position[] = $this->lang->{$module}->common;
$this->view->needReview = $this->config->story->needReview;
$this->view->fieldList = $fieldList;
$this->view->dbFields = $this->custom->getItems("lang={$currentLang},all&module={$module}§ion={$field}");
$this->view->field = $field;
$this->view->module = $module;
$this->view->currentLang = $currentLang;
$this->view->canAdd = strpos($this->config->custom->canAdd[$module], $field) !== false;
$this->display();
}
示例11: setBasic
/**
* set company basic info.
*
* @access public
* @return void
*/
public function setBasic()
{
if (!empty($_POST)) {
$now = helper::now();
$company = fixer::input('post')->add('setDate', $now)->stripTags('desc,content', $this->config->allowedTags->admin)->remove('uid')->get();
$result = $this->loadModel('setting')->setItems('system.common.company', $company);
if ($result) {
$this->send(array('result' => 'success', 'message' => $this->lang->setSuccess));
}
$this->send(array('result' => 'fail', 'message' => $this->lang->fail));
}
$this->view->title = $this->lang->company->setBasic;
$this->display();
}
示例12: setBasic
/**
* set company basic info.
*
* @access public
* @return void
*/
public function setBasic()
{
if (!empty($_POST)) {
$now = helper::now();
$company = fixer::input('post')->stripTags('content', $this->config->allowedTags->admin)->get();
$company = $this->loadModel('file')->processEditor($company, $this->config->company->editor->setbasic['id']);
$result = $this->loadModel('setting')->setItems('system.sys.common.company', $company);
if ($result) {
$this->send(array('result' => 'success', 'message' => $this->lang->setSuccess));
}
$this->send(array('result' => 'fail', 'message' => $this->lang->fail));
}
$this->view->title = $this->lang->company->setBasic;
$this->display();
}
示例13: create
/**
* Create an consulting.
*
* @param string $type
* @access public
* @return int|bool
*/
public function create()
{
$now = helper::now();
$consulting = fixer::input('post')->setDefault('addedDate', $now)->get();
$consult = $this->dao->select('*')->from(TABLE_CONSULTING)->where('realname')->eq($consulting->realname)->andWhere('mobile')->eq($consulting->mobile)->andWhere('email')->eq($consulting->email)->fetch();
if ($consult) {
return array('result' => 'fail', 'message' => '请不要重复提交!<a href="javascript:history.back();">返回</a>');
} else {
$this->dao->insert(TABLE_CONSULTING)->data($consulting)->exec();
$consultingID = $this->dao->lastInsertID();
if (dao::isError()) {
return array('result' => 'fail', 'message' => dao::getError());
}
return array('result' => 'success', 'message' => '提交成功!');
}
}
示例14: update
/**
* Update a slide.
*
* @param int $id
* @access public
* @return bool
*/
public function update($id)
{
$image = $this->uploadImage();
$slide = fixer::input('post')->stripTags('summary', $this->config->allowedTags->front)->setIf(!empty($image), 'image', $image)->remove('files')->get();
if ($slide->backgroundType == 'color') {
$this->dao->insert('slide')->data($slide, 'label,buttonClass,buttonUrl,buttonTarget')->batchCheck($this->config->slide->require->edit, 'notempty')->check('height', 'ge', 100);
if (dao::isError()) {
return false;
}
}
$slide->label = array_values($slide->label);
$slide->buttonClass = array_values($slide->buttonClass);
$slide->buttonUrl = array_values($slide->buttonUrl);
$slide->buttonTarget = array_values($slide->buttonTarget);
$slide->createdDate = time();
$this->dao->update(TABLE_CONFIG)->set('value')->eq(helper::jsonEncode($slide))->where('id')->eq($id)->exec();
return !dao::isError();
}
示例15: copy
/**
* Copy a group.
*
* @param int $groupID
* @access public
* @return void
*/
public function copy($groupID)
{
$group = fixer::input('post')->remove('options')->get();
$this->dao->insert(TABLE_GROUP)->data($group)->check('name', 'unique')->check('name', 'notempty')->exec();
if ($this->post->options == false) {
return;
}
if (!dao::isError()) {
$newGroupID = $this->dao->lastInsertID();
$options = join(',', $this->post->options);
if (strpos($options, 'copyPriv') !== false) {
$this->copyPriv($groupID, $newGroupID);
}
if (strpos($options, 'copyUser') !== false) {
$this->copyUser($groupID, $newGroupID);
}
}
}