本文整理汇总了PHP中doUpdate函数的典型用法代码示例。如果您正苦于以下问题:PHP doUpdate函数的具体用法?PHP doUpdate怎么用?PHP doUpdate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了doUpdate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lockBot
function lockBot($session)
{
global $debug;
if (getSingle("SELECT restbots.lock FROM restbots WHERE restbots.session = '{$session}'") == 1) {
return false;
}
if ($debug) {
logMessage('rest', 3, "Locking session {$session}");
}
if (doUpdate("UPDATE restbots SET restbots.lock = 1, restbots.timestamp = null WHERE restbots.session = '{$session}'") == 1) {
return true;
} else {
return false;
}
}
示例2: doUpdate
doUpdate(array("0" => "maxCharField", "1" => "maxCharMsg"), 1);
break;
case 'security':
doUpdate(array("0" => "floodTime", "1" => "moderateMsg", "2" => "autoCensor", "3" => "checkEmail", "4" => "checkCaptcha", "5" => "reCaptcha", "6" => "reCaptchapubk", "7" => "reCaptchaprvk", "8" => "debug"), 1);
break;
case 'languages':
doUpdate(array("0" => "guestbookLang", "1" => "adminLang"), 1);
break;
case 'visualeffects':
doUpdate(array("0" => "guestbookTheme", "1" => "mobileTheme", "2" => "pagesFormat", "3" => "numPostsPerPage", "4" => "dateFormat", "5" => "timezone"), 1);
break;
case 'gboffline':
doUpdate(array("0" => "offline", "1" => "offlineMessage"), 1);
break;
case 'image':
doUpdate(array("0" => "resizeImg", "1" => "imgWidth", "2" => "imgHeight"), 1);
break;
default:
}
if ($errorField != '') {
echo "<div class=\"msgError\">{$errorField}</div>";
}
}
function showTableRow($name, $type, $var = '')
{
global $lang;
global $config;
$row = '<tr><td>' . $lang['' . $name . ''] . '</td>';
switch ($type) {
case 'yesno':
$row .= '<td><select name="' . $name . '">';
示例3: initOutput
* Created by PhpStorm.
* User: Michael Oehlhof
* Date: 11.10.15
* Time: 14:17
*/
//ini_set('max_execution_time', 0);
//ini_set('implicit_flush', 1);
//ob_implicit_flush(1);
initOutput();
// Get the POST parameter and execute the appropriate action
$cmd = $_POST['cmd'];
$parameter = $_POST['parameter'];
showForm();
switch ($cmd) {
case 'update':
doUpdate();
break;
case 'reset':
doReset();
break;
case 'review':
doReview($parameter);
break;
case 'unittest-master':
doUnitTest('dev-master');
break;
case 'unittest-review':
doUnitTest('review');
break;
default:
}
示例4: lang_get
$assignRolesFor = $args->featureType;
$target->testprojectID = $args->featureID > 0 ? $args->featureID : null;
$featureMgr =& $tprojectMgr;
break;
case "testplan":
$gui->highlight->assign_users_tplan = 1;
$gui->roles_updated = lang_get("test_plan_user_roles_updated");
$gui->not_for_you = lang_get("testplan_roles_assign_disabled");
$assignRolesFor = $args->featureType;
$target->testprojectID = $args->testprojectID;
$featureMgr =& $tplanMgr;
break;
}
if ($args->featureID && $args->doUpdate && $featureMgr) {
if (checkRightsForUpdate($db, $args->user, $args->testprojectID, $args->featureType, $args->featureID)) {
doUpdate($db, $args, $featureMgr);
if ($gui->user_feedback == '') {
$gui->user_feedback = $gui->roles_updated;
}
}
}
// --------------------------------------------------------------------------
// Important:
// Must be done here after having done update, to get current information
$gui->users = tlUser::getAll($db, "WHERE active=1", null, null, tlUser::TLOBJ_O_GET_DETAIL_MINIMUM);
checkSessionValid($db);
$args->user = $_SESSION['currentUser'];
// --------------------------------------------------------------------------
switch ($assignRolesFor) {
case 'testproject':
$info = getTestProjectEffectiveRoles($db, $tprojectMgr, $args, $gui->users);
示例5: getItemTemplateContents
$of->Value = getItemTemplateContents('build_template', $of->InstanceName, $args->notes);
switch ($args->do_action) {
case 'edit':
$op = edit($args, $build_mgr, $date_format_cfg);
$gui->closed_on_date = $args->closed_on_date;
$of->Value = $op->notes;
break;
case 'create':
$op = create($args);
$gui->closed_on_date = $args->closed_on_date;
break;
case 'do_delete':
$op = doDelete($args, $build_mgr);
break;
case 'do_update':
$op = doUpdate($args, $build_mgr, $tplan_mgr, $date_format_cfg);
$of->Value = $op->notes;
$templateCfg->template = $op->template;
break;
case 'do_create':
$op = doCreate($args, $build_mgr, $tplan_mgr, $date_format_cfg);
$of->Value = $op->notes;
$templateCfg->template = $op->template;
break;
}
// BUGID 3716
$dummy = null;
$gui->release_date = isset($op->status_ok) && $op->status_ok && $args->release_date != "" ? localize_dateOrTimeStamp(null, $dummy, 'date_format', $args->release_date) : $args->release_date_original;
$gui->closed_on_date = $args->closed_on_date;
$gui->operation_descr = $op->operation_descr;
$gui->user_feedback = $op->user_feedback;
示例6: openPendingFile
<?php
// this file just takes requests from the links the system has emailed out as pending.
// they are in response to on_demand sheduling.
// this needs to be super secure. fix!
require_once 'functions.inc.php';
// validate!!! fix
$uid = $_GET['uid'];
$decision = $_GET['approved'];
$handle = openPendingFile("r");
while ($line = fgets($handle)) {
if ($uid == $line . substr(0, $uid . length())) {
$data = explode(',', $line);
// if approved
if ($decision = 'y') {
require_once 'monket-calendar/monket-cal-update.php';
// fix?
doUpdate("", $data[1], $data[2], $data[4], $data[5], $data[6]);
} else {
// TODO:
// send email to student notifying them of the rejection
}
// the event was either added or declined. return success.
return true;
}
}
示例7: doInsert
/**
* do database insert
*/
function doInsert()
{
/* refill menu from post data */
/* $this->menu->setMenuValues($_POST); */
/* now test the menu values */
if ($this->prepareForInsert()) {
/* then get the data into the query */
$iq = new InsertQuery($this->dbConn, $this->relation);
$iq->setKeyColumns($this->keyColumns);
$cnames = $this->menu->getColumnNames();
// echo '<br> columnNames'.bvar_dump($cnames).'<br>';
$arr = $this->menu->getColumnValues($cnames);
if ($this->isTransactional) {
$arr['trans_id'] = $this->dbConn->createTransactionId();
}
$iq->setSubmitvalueSet($arr);
$iq->setUpdateSet($arr);
// echo '<span style="color:red">'.bvar_dump($this->menu).'</span>';
if ($iq->areKeyColumnsSet()) {
/* allow insert */
$query = $iq->getQuery();
$this->dbMessage .= 'insert query' . $query;
//echo $query;
$result = doUpdate($this->dbConn, $query, $this->dbMessage);
if ($result < 0) {
$this->dbMessage .= 'STE: Insert Failed with query ' . $query . ' db says: ' . $this->dbMessage;
$this->dbConn->Execute("ROLLBACK");
} else {
$this->dbMessage .= ' added ' . $result . ' record(s) ';
$this->dbConn->transactionEnd();
}
} else {
$this->dbMessage .= 'DB ERROR: Insert failed.<br>Not all keyColumns have been set';
$this->dbConn->Execute("ROLLBACK");
}
}
}
示例8: doCreate
$gui->cfield_is_used = $op->cf_is_used;
$gui->cfield_is_linked = $op->cf_is_linked;
$gui->linked_tprojects = $op->linked_tprojects;
$user_feedback = $op->user_feedback;
$operation_descr = $op->operation_descr;
break;
case 'do_add':
case 'do_add_and_assign':
$op = doCreate($_REQUEST, $cfield_mgr, $args);
$gui->cfield = $op->cf;
$user_feedback = $op->user_feedback;
$templateCfg->template = $op->template;
$operation_descr = '';
break;
case 'do_update':
$op = doUpdate($_REQUEST, $args, $cfield_mgr);
$gui->cfield = $op->cf;
$user_feedback = $op->user_feedback;
$operation_descr = $op->operation_descr;
$templateCfg->template = $op->template;
break;
case 'do_delete':
$op = doDelete($args, $cfield_mgr);
$user_feedback = $op->user_feedback;
$operation_descr = $op->operation_descr;
$templateCfg->template = $op->template;
$do_control_combo_display = 0;
break;
}
if ($do_control_combo_display) {
$keys2loop = $cfield_mgr->get_application_areas();
示例9: PageContainer
include_once "utils.inc";
include_once "ste.php";
$navTitle = "Peerweb testscript " . $PHP_SELF . " on DB " . $db_name;
$page = new PageContainer();
$page->setTitle('Menu');
//$dbConn->setSqlAutoLog(true);
$ste = new SimpleTableEditor($dbConn, $page);
$ste->setFormAction($PHP_SELF);
$ste->setRelation('menu');
$ste->setMenuName('menu');
$ste->setKeyColumns(array('menu_name', 'relation_name'));
$ste->setNameExpression("rtrim(menu_name,' ')||', '||rtrim(relation_name,' ')");
$ste->setOrderList(array('menu_name', 'relation_name'));
$ste->setFormTemplate('templates/menu.html');
$ste->setListRowTemplate(array('menu_name', 'relation_name'));
$page_opening = "Menu";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
if (isset($_POST['Insert'])) {
/* try to insert menu,column_names into menu_items */
$menu_name = $_POST['menu_name'];
$relation_name = $_POST['relation_name'];
$sql = "insert into menu_item (menu_name,column_name,edit_type,capability,item_length) select '{$menu_name}' as menu_name, column_name," . " 'T' as edit_type, 32767 as capability, character_maximum_length" . " from information_schema.columns where table_name='{$relation_name}'";
$dbMessage = '';
$result = doUpdate($dbConn, $sql, $dbMessage);
$page->addBodyComponent(new Component("<fieldset><legend>Create menu_items</legend>\n" . $dbMessage . "\n</fieldset>\n"));
}
$ste->render();
$page->addBodyComponent(new Component('<!-- db_name=$db_name $Id: menu.php 1723 2014-01-03 08:34:59Z hom $ -->'));
$page->addBodyComponent(new Component('<a href="tets.php">tets</a>' . $PHP_SELF));
$page->show();
示例10: doPrintHeader
doPrintHeader();
if (checkConfig()) {
if (isset($_POST['login'])) {
setVars();
doLogin();
} else {
if (isset($_POST['update'])) {
$db = dbConnect();
$version = determineVersion();
if (version_compare($version, "1.0.0") == -1) {
echo '<h5>' . translate('phpScheduleIt Update is only available for versions 1.0.0 or later') . '</h5>';
} else {
if (version_compare($version, "1.2.0") == 0) {
echo '<h5>' . translate('phpScheduleIt is already up to date') . '</h5>';
} else {
doUpdate($version);
}
}
doFinish();
} else {
doPrintForm();
}
}
}
$t->printHTMLFooter();
/**
* Prints html header
* @param none
*/
function doPrintHeader()
{
示例11: getItemTemplateContents
$of->Value = getItemTemplateContents('build_template', $of->InstanceName, $args->notes);
switch ($args->do_action) {
case 'edit':
$op = edit($args, $build_mgr);
$gui->closed_on_date = $args->closed_on_date;
$of->Value = $op->notes;
break;
case 'create':
$op = create($args);
$gui->closed_on_date = $args->closed_on_date;
break;
case 'do_delete':
$op = doDelete($args, $build_mgr);
break;
case 'do_update':
$op = doUpdate($args, $build_mgr, $tplan_mgr);
$of->Value = $op->notes;
$templateCfg->template = $op->template;
break;
case 'do_create':
$op = doCreate($args, $build_mgr, $tplan_mgr);
$of->Value = $op->notes;
$templateCfg->template = $op->template;
break;
}
$gui->release_date = $args->release_date;
$gui->operation_descr = $op->operation_descr;
$gui->user_feedback = $op->user_feedback;
$gui->buttonCfg = $op->buttonCfg;
$gui->mgt_view_events = $_SESSION['currentUser']->hasRight($db, "mgt_view_events");
$gui->editorType = $editorCfg['type'];
示例12: array
$actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate', 'resetPassword' => 'doUpdate');
switch ($args->doAction) {
case "edit":
$gui->highlight->edit_user = 1;
$gui->user = new tlUser($args->user_id);
$gui->user->readFromDB($db);
break;
case "doCreate":
$gui->highlight->create_user = 1;
$gui->op = doCreate($db, $args);
$gui->user = $gui->op->user;
$templateCfg->template = $gui->op->template;
break;
case "doUpdate":
$gui->highlight->edit_user = 1;
$gui->op = doUpdate($db, $args, $_SESSION['currentUser']->dbID);
$gui->user = $gui->op->user;
break;
case "resetPassword":
$gui->highlight->edit_user = 1;
$gui->user = new tlUser($args->user_id);
$gui->user->readFromDB($db);
$gui->op = createNewPassword($db, $args, $gui->user);
break;
case "create":
default:
$gui->highlight->create_user = 1;
$gui->user = new tlUser();
break;
}
$gui->user_feedback = $gui->op->user_feedback;
示例13: doUpdateAll
function doUpdateAll($force = FALSE)
{
global $manifest, $cache, $cliDir;
$xml = simplexml_load_file("{$manifest}");
$me = getOption(array('username', TRUE));
foreach ($xml as $w) {
$dir = trim(`"{$cliDir}/packal.sh" getDir "{$w->bundle}" 2> /dev/null`);
if ($dir === "FALSE") {
continue;
}
if ("{$w->author}" == "{$me}") {
continue;
}
if (file_exists("{$dir}/packal/package.xml")) {
$wf = simplexml_load_file("{$dir}/packal/package.xml");
$wf->updated += 120;
// Compensation for time in the generated packages.
if ("{$w->version}" != "{$wf->version}") {
$updatable[] = array((string) $w->name, (string) $wf->version, (string) $w->version, (string) $w->bundle);
}
} else {
if ($force == FALSE) {
continue;
}
$updatable[] = array((string) $w->name, "Forced Update", (string) $w->version, (string) $w->bundle);
}
}
if (!isset($updatable) || !count($updatable > 0)) {
return FALSE;
}
foreach ($updatable as $u) {
doUpdate($u[3]);
}
}
示例14: require_web_editor
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db, false, false, "checkRights");
$gui = new stdClass();
$templateCfg = templateConfiguration();
$tcase_mgr = new testcase($db);
$args = init_args();
$gui->exec_id = $args->exec_id;
$gui->tcversion_id = $args->tcversion_id;
$gui->tplan_id = $args->tplan_id;
$gui->tproject_id = $args->tproject_id;
$owebeditor = web_editor('notes', $args->basehref, $editorCfg);
switch ($args->doAction) {
case 'edit':
break;
case 'doUpdate':
doUpdate($db, $args, $tcase_mgr, $_REQUEST);
break;
}
$map = get_execution($db, $args->exec_id);
$owebeditor->Value = $map[0]['notes'];
$gui->cfields_exec = $tcase_mgr->html_table_of_custom_field_inputs($args->tcversion_id, null, 'execution', '_cf', $args->exec_id, $args->tplan_id, $args->tproject_id);
$gui->notes = $owebeditor->CreateHTML();
$gui->editorType = $editorCfg['type'];
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
function doUpdate(&$db, &$args, &$tcaseMgr, &$request)
{
updateExecutionNotes($db, $args->exec_id, $args->notes);
$cfield_mgr = new cfield_mgr($db);
$cfield_mgr->execution_values_to_db($request, $args->tcversion_id, $args->exec_id, $args->tplan_id);
示例15: testplan
$tplan_mgr = new testplan($db);
$tcase_mgr = new testcase($db);
$templateCfg = templateConfiguration();
$args = init_args($tplan_mgr);
checkRights($db, $_SESSION['currentUser'], $args);
$gui = initializeGui($db, $args, $tplan_mgr, $tcase_mgr);
$keywordsFilter = null;
if (is_array($args->keyword_id)) {
$keywordsFilter = new stdClass();
$keywordsFilter->items = $args->keyword_id;
$keywordsFilter->type = $gui->keywordsFilterType->selected;
}
switch ($args->doAction) {
case "doUpdate":
case "doBulkUpdateToLatest":
$gui->user_feedback = doUpdate($db, $args);
break;
default:
break;
}
$out = null;
$gui->show_details = 0;
$gui->operationType = 'standard';
$gui->hasItems = 0;
switch ($args->level) {
case 'testcase':
$out = processTestCase($db, $args, $keywordsFilter, $tplan_mgr);
break;
case 'testsuite':
$out = processTestSuite($db, $args, $keywordsFilter, $tplan_mgr, $tcase_mgr);
break;