本文整理汇总了PHP中do_update函数的典型用法代码示例。如果您正苦于以下问题:PHP do_update函数的具体用法?PHP do_update怎么用?PHP do_update使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了do_update函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removerTerreno
public function removerTerreno($id_personagem, $id_cidade, $terreno)
{
$query = "\n UPDATE personagem_terreno SET\n terreno = terreno - " . do_escape($terreno) . "\n WHERE id_personagem = '" . do_escape($id_personagem) . "'\n AND id_cidade = '" . do_escape($id_cidade) . "'\n ";
do_update($query);
$query = "\n DELETE FROM personagem_terreno \n WHERE id_personagem = '" . do_escape($id_personagem) . "'\n AND id_cidade = '" . do_escape($id_cidade) . "'\n AND terreno <= 0\n ";
do_update($query);
}
示例2: save_customerwork
function save_customerwork()
{
//cmd/save_customerwork.html
$customerdata = get_session('customerdata');
//customer data
if (!$customerdata) {
//not login
json_output('requireLogin');
return '';
}
//history
preg_match('#[^-]+$#', $_POST['history'], $r);
//final result
$history = array('customer_id' => $customerdata->id, 'company' => $_POST['company'], 'salary' => $_POST['sal'], 'save_history' => $_POST['history'], 'result' => $r[0], 'post_date' => date("Y-m-d"), 'post_time' => date('H:i:s a'), 'loan' => preg_replace('#\\.#', '', $_POST['loan']), 'note' => 'Mục đích sử dụng:' . PHP_EOL . $_POST['usedfor'] . PHP_EOL . ',Thời gian chúng tôi liên hệ:' . $_POST['contacttime']);
if (isset($_POST['modify'])) {
//update history
do_update($history, array('id' => $_POST['modify']), 'vcn_histories');
$hid = $_POST['modify'];
} else {
do_insert($history, 'vcn_histories');
$hid = mysql_insert_id();
//history id
}
//update histories1 that save answer text
$history_text = array();
//multi rows
$historyt = json_decode($_POST['historyt']);
//decode answers_text
foreach ($historyt as $answer_id => $text) {
$history_t = array('answer_id' => $answer_id, 'answer_text' => $text, 'hid' => $hid);
$history_text[] = $history_t;
if (isset($_POST['modify'])) {
//update single answer text
do_update($history_t, array('hid' => $_POST['modify']), 'vcn_histories1');
}
}
if (!isset($_POST['modify'])) {
do_insert($history_text, 'vcn_histories1');
}
json_output($hid);
//return new history
}
示例3: show_level
function show_level()
{
$title = "User Reputation Manager - Overview";
$html = "<p>On this page you can modify the minimum amount required for each reputation level. Make sure you press Update Minimum Levels to save your changes. You cannot set the same minimum amount to more than one level.<br />From here you can also choose to edit or remove any single level. Click the Edit link to modify the Level description (see Editing a Reputation Level) or click Remove to delete a level. If you remove a level or modify the minimum reputation needed to be at a level, all users will be updated to reflect their new level if necessary.</p><br />";
$query = sql_query('SELECT * FROM reputationlevel ORDER BY minimumreputation ASC');
if (!mysql_num_rows($query)) {
do_update('new');
return;
}
$css = "style='font-weight: bold;color: #ffffff;background-color: #0055A4;padding: 5px;'";
$html .= "<h2>User Reputation Manager</h2>";
$html .= "<p><span class='btn'><a href='reputation_ad.php?mode=list'>View comments</a></span></p><br />";
$html .= "<form action='reputation_ad.php' name='show_rep_form' method='post'>\r\n\t\t\t\t<input name='mode' value='doupdate' type='hidden' />";
$html .= "<table cellpadding='3px'><tr>\r\n\t\t<td width='5%' {$css}>ID</td>\r\n\t\t<td width='60%'{$css}>Reputation Level</td>\r\n\t\t<td width='20%' {$css}>Minimum Reputation Level</td>\r\n\t\t<td width='15%' {$css}>Controls</td></tr>";
while ($res = mysql_fetch_assoc($query)) {
$html .= "<tr>\n" . "\t<td>#" . $res['reputationlevelid'] . "</td>\n" . "\t<td>User <b>" . htmlentities($res['level']) . "</b></td>\n" . "\t<td align='center'><input type='text' name='reputation[" . $res['reputationlevelid'] . "]' value='" . $res['minimumreputation'] . "' size='12' /></td>\n" . "\t<td align='center'><span class='btn'><a href='reputation_ad.php?mode=edit&reputationlevelid=" . $res['reputationlevelid'] . "'>Edit</a></span> <span class='btn'><a href='reputation_ad.php?mode=dodelete&reputationlevelid=" . $res['reputationlevelid'] . "'>Delete</a></span></td>\n" . "</tr>\n";
}
$html .= "<tr><td colspan='3' align='center'>\r\n\t\t\t\t\t<input type='submit' value='Update' accesskey='s' class='btn' /> \r\n\t\t\t\t\t<input type='reset' value='Reset' accesskey='r' class='btn' /></td>\r\n\t\t\t\t\t<td align='center'><span class='btn'><a href='reputation_ad.php?mode=add'>Add New</a></span>\r\n\t\t\t\t\t</td></tr>";
$html .= "</table>";
$html .= "</form>";
html_out($html, $title);
}
示例4: falha
private function falha($quest, $grupo, &$mensagem)
{
$regraPersonagem = new Personagem();
foreach ($grupo as $personagem) {
$regraPersonagem->gastarTurno($personagem->id_personagem, $quest->turno);
}
$query = "\n UPDATE quest SET\n cod_situacao = '" . QUEST_FALHA . "'\n WHERE id_quest = '" . do_escape($quest->id_quest) . "'\n ";
do_update($query);
}
示例5: setImagemBase64
public function setImagemBase64($imagem)
{
$query = "\n UPDATE jogador SET\n imagem = '" . do_escape($imagem) . "'\n WHERE id_jogador = '" . do_escape($this->id_jogador) . "'\n ";
do_update($query);
}
示例6: inserir
public static function inserir($feed)
{
$query = "\n INSERT INTO feed (\n id_jogador,\n cod_tipo,\n id_pai,\n id_arte,\n id_campanha,\n id_mapa,\n id_personagem,\n data_inclusao,\n ultima_alteracao,\n id_sessao,\n url,\n comentario\n ) VALUES (\n '" . do_escape(ID_JOGADOR) . "',\n '" . do_escape($feed->cod_tipo) . "',\n " . do_full_escape($feed->id_pai) . ",\n " . do_full_escape($feed->id_arte) . ",\n " . do_full_escape($feed->id_campanha) . ",\n " . do_full_escape($feed->id_mapa) . ",\n " . do_full_escape($feed->id_personagem) . ",\n NOW(),\n NOW(),\n " . do_full_escape($feed->id_sessao) . ",\n " . do_full_escape($feed->url) . ",\n " . do_full_escape($feed->comentario) . "\n )\n ";
$id_feed = do_insert($query);
if (!is_null($feed->id_pai) && $feed->id_pai > 0) {
$query = "\n UPDATE feed SET \n ultima_alteracao = NOW()\n WHERE id_feed = " . do_escape($feed->id_pai) . "\n ";
do_update($query);
}
return $id_feed;
}
示例7: plugin_main
$message .= "<form action='{$_CONF['site_admin_url']}/plugins.php' method='GET'><div>";
$message .= "<input type='hidden' name='pi_name' value='" . $pi_name . "'" . XHTML . ">";
$message .= "<input type='hidden' name='mode' value='delete'" . XHTML . ">";
$message .= "<input type='hidden' name='confirmed' value='1'" . XHTML . ">";
$message .= "<input type='hidden' name='" . CSRF_TOKEN . "' value='" . $token . "'" . XHTML . ">";
$message .= "<input type='submit' value='{$LANG32[25]}'" . XHTML . ">";
$message .= "</div></form><p>";
$display = plugin_main($message, $token);
}
} else {
$display = COM_refresh($_CONF['site_admin_url'] . '/plugins.php');
}
} elseif ($mode == 'updatethisplugin' && SEC_checkToken()) {
// update
$pi_name = COM_applyFilter($_GET['pi_name']);
$display .= do_update($pi_name);
} elseif ($mode == 'info_installed') {
$display .= COM_siteHeader('menu', $LANG32[13]);
$display .= plugin_info_installed(COM_applyFilter($_GET['pi_name']));
$display .= COM_siteFooter();
} elseif ($mode == 'info_uninstalled') {
$display .= COM_siteHeader('menu', $LANG32[13]);
$display .= plugin_info_uninstalled(COM_applyFilter($_GET['pi_name']));
$display .= COM_siteFooter();
} elseif ($mode == 'toggle') {
SEC_checkToken();
$pi_name = '';
if (!empty($_GET['pi_name'])) {
$pi_name = COM_applyFilter($_GET['pi_name']);
}
changePluginStatus($pi_name);
示例8: excluir
public function excluir($id_comentario)
{
$query = "\n UPDATE comentario SET\n cod_situacao = 0\n WHERE id_comentario = '" . do_escape($id_comentario) . "'\n ";
//echo $query;
//exit();
do_update($query);
}
示例9: execute
function execute($vars, $auto_vars)
{
global $not_found;
$vars[$this->name . '-submitted'] = @$_REQUEST['_' . $this->name . '_submit'];
$updates = array();
if ($this->versioned) {
// check to see if any of the specified fields have actually changed
$new_vars = $vars;
$this->add_vars($vars, $new_vars);
if ($not_found) {
return false;
}
$changed = false;
foreach ($this->children as $child) {
if (is_a($child, 'File') and $child->size > 0) {
$changed = true;
//print "<!-- updating because FILE has changed -->\n";
} else {
if (is_a($child, 'Radio') and $child->value($vars) and $child->value($vars) != $new_vars[$child->name]) {
$changed = true;
//print "<!-- updating because radio " . $child->name . " has changed -->\n";
} else {
if (is_a($child, 'InputComponent') and $child->value($vars) != $new_vars[$child->name]) {
$changed = true;
//print "<!-- updating because " . $child->name . " has changed -->\n";
} else {
if (is_a($child, 'Auto') and $child->value($vars) != $new_vars[$child->name]) {
$changed = true;
//print "<!-- updating because " . $child->name . " has changed -->\n";
}
}
}
}
}
} else {
$dummy = array();
$this->add_vars($vars, $dummy);
if ($not_found) {
return false;
}
}
foreach ($this->children as $child) {
if (is_a($child, 'Auto')) {
$updates[$child->name] = $child->value($vars, $auto_vars);
} else {
if (is_a($child, 'File')) {
if (!$child->execute($vars, $auto_vars)) {
if ($child->required) {
return false;
}
} else {
$updates['-file'] = array('filename' => $child->filename, 'size' => $child->size, 'filetype' => $child->filetype, 'localpath' => $child->localpath);
}
} else {
if (is_a($child, 'Password')) {
$value = $child->value($vars);
if (!$value and $child->required) {
return false;
}
if ($value) {
$updates[$child->name] = $value;
}
// don't update the password if it isn't set
} else {
if (is_a($child, 'Radio')) {
$value = $child->value($vars);
if ($value !== NULL) {
$updates[$child->name] = $value;
}
// nb: we don't enforce required radio button here, only in input_check()
} else {
if (is_a($child, 'InputComponent')) {
$value = $child->value($vars);
if (!$value and $child->required) {
return false;
}
$updates[$child->name] = $value;
}
}
}
}
}
}
if (!$this->versioned or $changed) {
if (!do_update($updates, $this->name, $this->type, $vars)) {
return false;
}
// remove values from the $_REQUEST once they've been successfully updated
foreach ($this->children as $child) {
if (is_a($child, 'InputComponent')) {
$param_name = $this->name . '_' . $child->name;
unset($_REQUEST[$param_name]);
}
}
}
$this->add_vars($vars, $vars);
$rval = true;
foreach ($this->children as $child) {
if (is_a($child, 'Scope')) {
$rval = $rval and $child->execute($vars, $auto_vars);
//.........这里部分代码省略.........
示例10: alterar
public function alterar($usuario)
{
$usuario = $this->validar($usuario);
$query = "\n UPDATE usuario SET\n ultima_alteracao = NOW(),\n email = '" . do_escape($usuario->email) . "',\n nome = '" . do_escape($usuario->nome) . "',\n senha = '" . do_escape($usuario->senha) . "',\n WHERE id_usuario = '" . do_escape($usuario->id_usuario) . "',\n ";
do_update($query);
}
示例11: mysql_insert_id
if (mysql_insert_id()) {
$answer['question'] = mysql_insert_id();
}
$answer['answer'] = _POST('answer-' . $i);
$answer['answer_link_question'] = _POST('link2q-answer-' . $i);
$answer['text2next_question'] = _POST('text2nextq-' . $i);
$answer['answer_object_type'] = _POST('answer-obj-type-' . $i) ? 1 : 0;
$answer['link_object_type'] = _POST('link-obj-type-' . $i) ? 1 : 0;
$answers[] = $answer;
//add to answers data
//update answer
if (_POST('modify') && is_numeric(_POST('modify'))) {
$answer['question'] = _POST('modify');
//qid
if (isset($answer_ids[$i])) {
do_update($answer, array('id' => $answer_ids[$i]), 'vcn_answers');
} else {
//new answer to be added
$new_answers[] = $answer;
}
}
}
if (count($new_answers) && _POST('modify') && is_numeric(_POST('modify'))) {
//new answers to be added
do_insert($new_answers, 'vcn_answers');
}
//add answers to question
if (!_POST('modify') || !is_numeric(_POST('modify'))) {
do_insert($answers, 'vcn_answers');
}
//delete answers
示例12: setSessao
public function setSessao($id_sessao)
{
$query = "\n UPDATE personagem SET\n id_sessao = '" . do_escape($id_sessao) . "'\n WHERE id_personagem = '" . do_escape($this->id_personagem) . "'\n ";
do_update($query);
}
示例13: add_item
//case "add_new":
//do_insert_update(1);
//break;
case "add_item":
add_item();
break;
case "do_add_item":
do_update(1);
break;
case "del_item":
do_update(2);
break;
case "do_update":
do_update();
break;
case "do_rest_update":
do_update(3);
break;
case "edit":
do_insert_update(0);
break;
case "delete":
delete();
break;
case "do_delete":
do_delete();
break;
default:
search();
}
require_once "footer.php";
示例14: alterar
public function alterar($usuario)
{
$usuario = $this->validar($usuario);
$query = "\n UPDATE usuario SET\n ultima_alteracao = NOW(),\n email = '" . do_escape($usuario->email) . "',\n nome = '" . do_escape($usuario->nome) . "',\n cod_tipo = '" . do_escape($usuario->cod_tipo) . "',\n cod_situacao = '" . do_escape($usuario->cod_situacao) . "'\n ";
if (!isNullOrEmpty($usuario->senha)) {
$query .= ", senha = '" . do_escape($usuario->senha) . "' ";
}
$query .= " WHERE id_usuario = '" . do_escape($usuario->id_usuario) . "'";
do_update($query);
}
示例15: update_customer
function update_customer($data)
{
if (!get_session('customerdata')) {
return;
}
//not login
$user = get_session('customerdata');
//customer
do_update($data, array('id' => $user->id), 'vcn_customers');
//update user
foreach ($data as $k => $v) {
$user->{$k} = $v;
//update item
}
set_session('customerdata', $user);
//update customer session
}