本文整理汇总了PHP中Table::Update_table方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::Update_table方法的具体用法?PHP Table::Update_table怎么用?PHP Table::Update_table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table::Update_table方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: abs
$amount = abs($Customer['credit']+$lastpostpaid_amount);
$total = $total + $amount;
$total_vat =$total_vat + round($amount *(1+($vat/100)),2);
$field_insert = " id_invoice, price, vat, description, id_ext, type_ext";
$instance_table = new Table("cc_invoice_item", $field_insert);
$value_insert = " '$id_invoice', '$amount','$vat','$description','" . $id_billing . "','POSTPAID'";
$instance_table->Add_table($A2B->DBHandle, $value_insert, null, null, "id");
if ($verbose_level >= 2)
echo "\n Add Invoice Item :> " . $value_insert;
}
}
if (!empty($last_invoice)) {
$param_update_billing = "id_invoice = '".$last_invoice."'";
$clause_update_billing = " id= ".$id_billing;
$billing_table ->Update_table($A2B->DBHandle,$param_update_billing,$clause_update_billing);
if ($verbose_level >= 2)
echo "\n Update Billing :> " . $param_update_billing . " WHERE " . $clause_update_billing;
}
// Send a mail for invoice to pay
if (!empty($last_invoice)) {
$total = round($total,2);
try {
$mail = new Mail(Mail::$TYPE_INVOICE_TO_PAY, $card_id);
$mail->replaceInEmail(Mail::$INVOICE_REFERENCE_KEY, $invoice_reference);
$mail->replaceInEmail(Mail::$INVOICE_TITLE_KEY, $invoice_title);
$mail->replaceInEmail(Mail::$INVOICE_DESCRIPTION_KEY, $invoice_description);
$mail->replaceInEmail(Mail::$INVOICE_TOTAL_KEY, $total);
$mail->replaceInEmail(Mail::$INVOICE_TOTAL_VAT_KEY, $total_vat);
$mail->send();
示例2: Table
if (!USE_REALTIME) {
$key = "sip_changed";
}
} else {
$friend_param_update = " iax_buddy='1' ";
if (!USE_REALTIME) {
$key = "iax_changed";
}
}
if (!USE_REALTIME) {
$who = Notification::$AGENT;
$who_id = $_SESSION['agent_id'];
NotificationsDAO::AddNotification($key, Notification::$HIGH, $who, $who_id);
}
$instance_table_friend = new Table('cc_card');
$instance_table_friend->Update_table($HD_Form->DBHandle, $friend_param_update, "id='{$id_cc_card}'", $func_table = null);
if ($form_action == "add_sip") {
$TABLE_BUDDY = 'cc_sip_buddies';
} else {
$TABLE_BUDDY = 'cc_iax_buddies';
}
$instance_table_friend = new Table($TABLE_BUDDY, '*');
$list_friend = $instance_table_friend->Get_list($HD_Form->DBHandle, "id_cc_card='{$id_cc_card}'", null, null, null, null);
if (is_array($list_friend) && count($list_friend) > 0) {
Header("Location: " . $HD_Form->FG_GO_LINK_AFTER_ACTION);
exit;
}
$form_action = "add";
$_POST['accountcode'] = $_POST['username'] = $_POST['name'] = $_POST['cardnumber'] = $cardnumber;
$_POST['allow'] = FRIEND_ALLOW;
$_POST['context'] = FRIEND_CONTEXT;
示例3: Header
include '../lib/admin.module.access.php';
include '../lib/Form/Class.FormHandler.inc.php';
include '../lib/admin.smarty.php';
if (!has_rights(ACX_INVOICING)) {
Header("HTTP/1.0 401 Unauthorized");
Header("Location: PP_error.php?c=accessdenied");
die;
}
/***********************************************************************************/
$DBHandle = DbConnect();
if ($form_action == "ask-modif") {
getpost_ifset(array('company_name', 'address', 'zipcode', 'country', 'city', 'phone', 'fax', 'email', 'vat', 'web', 'display_account'));
$table_invoice_conf = new Table("cc_invoice_conf");
$param_update_conf = "value ='" . $company_name . "'";
$clause_update_conf = "key_val = 'company_name'";
$table_invoice_conf->Update_table($DBHandle, $param_update_conf, $clause_update_conf, $func_table = null);
$param_update_conf = "value ='" . $address . "'";
$clause_update_conf = "key_val = 'address'";
$table_invoice_conf->Update_table($DBHandle, $param_update_conf, $clause_update_conf, $func_table = null);
$param_update_conf = "value ='" . $zipcode . "'";
$clause_update_conf = "key_val = 'zipcode'";
$table_invoice_conf->Update_table($DBHandle, $param_update_conf, $clause_update_conf, $func_table = null);
$param_update_conf = "value ='" . $country . "'";
$clause_update_conf = "key_val = 'country'";
$table_invoice_conf->Update_table($DBHandle, $param_update_conf, $clause_update_conf, $func_table = null);
$param_update_conf = "value ='" . $city . "'";
$clause_update_conf = "key_val = 'city'";
$table_invoice_conf->Update_table($DBHandle, $param_update_conf, $clause_update_conf, $func_table = null);
$param_update_conf = "value ='" . $phone . "'";
$clause_update_conf = "key_val = 'phone'";
$table_invoice_conf->Update_table($DBHandle, $param_update_conf, $clause_update_conf, $func_table = null);
示例4: gettext
if (is_array($result_agent) && is_numeric($result_agent[0]['commission']) && $result_agent[0]['commission']>0) {
$field_insert = "id_payment, id_card, amount,description,id_agent";
$commission = a2b_round($addcredit * ($result_agent[0]['commission']/100));
$description_commission = gettext("GENERATED COMMISSION OF AN CUSTOMER REFILLED BY AN AGENT!");
$description_commission.= "\nID CARD : ".$id;
$description_commission.= "\nID REFILL : ".$id_refill;
$description_commission.= "\REFILL AMOUNT: ".$addcredit;
$description_commission.= "\nCOMMISSION APPLIED: ".$result_agent[0]['commission'];
$value_insert = "'-1', '$id', '$commission','$description_commission','$id_agent'";
$commission_table = new Table("cc_agent_commission", $field_insert);
$id_commission = $commission_table -> Add_table ($HD_Form -> DBHandle, $value_insert, null, null,"id");
$table_agent = new Table('cc_agent');
$param_update_agent = "com_balance = com_balance + '".$commission."'";
$clause_update_agent = " id='".$id_agent."'";
$table_agent -> Update_table ($HD_Form -> DBHandle, $param_update_agent, $clause_update_agent, $func_table = null);
}
if (!$id_refill ) {
$update_msg ="<b>".$instance_sub_table -> errstr."</b>";
}
} else {
$currencies_list = get_currencies();
if (!isset($currencies_list[strtoupper($agent_info [0][1])][2]) || !is_numeric($currencies_list[strtoupper($agent_info [0][1])][2]))
$mycur = 1;
else
$mycur = $currencies_list[strtoupper($agent_info [0][1])][2];
示例5: die
}
echo "false";
die();
}
echo "false";
die();
break;
case 'down':
if(is_numeric($id_msg)){
$DBHandle = DbConnect();
$clause = "id = $id_msg";
$instance_table = new Table("cc_message_agent","*");
$result=$instance_table -> Get_list($DBHandle, $clause);
if(is_array($result) && sizeof($result)>0){
$order = $result[0]['order_display'];
$instance_table->Update_table($DBHandle, "order_display = order_display - 1", "id_agent = '".$id."' AND order_display =".($order+1));
$instance_table->Update_table($DBHandle, "order_display = order_display + 1", "id_agent = '".$id."' AND order_display =".($order)." AND id =$id_msg");
echo "true";
die();
}
echo "false";
die();
}
echo "false";
die();
break;
}
}
//load home message agent
if(empty($action)) $action="add";
示例6: change_card_lock
static public function change_card_lock()
{
global $A2B;
$FormHandler = FormHandler::GetInstance();
$processed = $FormHandler->getProcessed();
$instance_sub_table = new Table("cc_card", "block");
$FG_TABLE_CLAUSE_CARD = "id = ".$processed['id'];
$card_info = $instance_sub_table -> Get_list ($FormHandler -> DBHandle, $FG_TABLE_CLAUSE_CARD, null, null, null, null, null, null);
if (is_array($result) && !empty($result[0][0])) {
$card_lock_info = $card_info[0][0];
if ($card_lock_info != $processed['block'] && $processed['block'] == 1) {
$param_update_card = "lock_date = NOW()";
$clause_update_card = "id = ".$processed['id'];
$instance_sub_table -> Update_table ($FormHandler->DBHandle, $param_update_card, $clause_update_card, $func_table = null);
}
}
}
示例7: generate_invoice_reference
function generate_invoice_reference()
{
$handle = DbConnect();
$year = date("Y");
$invoice_conf_table = new Table('cc_invoice_conf', 'value');
$conf_clause = "key_val = 'count_{$year}'";
$result = $invoice_conf_table->Get_list($handle, $conf_clause, 0);
if (is_array($result) && !empty($result[0][0])) {
$count = $result[0][0];
if (!is_numeric($count)) {
$count = 0;
}
$count++;
$param_update_conf = "value ='" . $count . "'";
$clause_update_conf = "key_val = 'count_{$year}'";
$invoice_conf_table->Update_table($handle, $param_update_conf, $clause_update_conf, $func_table = null);
} else {
//insert newcount
$count = 1;
$QUERY = "INSERT INTO cc_invoice_conf (key_val ,value) VALUES ( 'count_{$year}', '1');";
$invoice_conf_table->SQLExec($handle, $QUERY);
}
$reference = $year . sprintf("%08d", $count);
return $reference;
}
示例8: gettext
Header("Location: A2B_receipt_edit.php?" . "id=" . $id);
break;
case 'update':
if (!empty($idc) && is_numeric($idc)) {
if (empty($date) || strtotime($date) === FALSE) {
$error_msg .= gettext("Date inserted is invalid, it must respect a date format YYYY-MM-DD HH:MM:SS (time is optional).<br/>");
}
if (empty($price) || !is_numeric($price)) {
$error_msg .= gettext("Amount inserted is invalid, it must be a number. Check the format.");
}
if (!empty($error_msg)) {
break;
}
$DBHandle = DbConnect();
$instance_sub_table = new Table("cc_receipt_item", "*");
$instance_sub_table->Update_table($DBHandle, "date='{$date}',description='{$description}',price='{$price}'", "id = {$idc}");
Header("Location: A2B_receipt_edit.php?" . "id=" . $id);
}
break;
}
}
$receipt = new Receipt($id);
$items = $receipt->loadItems();
$smarty->display('main.tpl');
?>
<table class="invoice_table" >
<tr class="form_invoice_head">
<td width="75%" colspan="2"><font color="#FFFFFF"><?php
echo gettext("RECEIPT: ");
?>
</font><font color="#FFFFFF"><b><?php
示例9: update_translation
function update_translation($id, $languages, $subject, $mailtext)
{
if (empty($handle)) {
$handle = DbConnect();
}
$instance_table = new Table();
$param_update = "subject = '{$subject}', messagetext = '{$mailtext}'";
$clause = "id = {$id} and id_language = '{$languages}'";
$func_table = 'cc_templatemail';
$update = $instance_table->Update_table($handle, $param_update, $clause, $func_table);
return $update;
}
示例10:
if (!$fit_expression[$i]){
$VALID_SQL_REG_EXP = false;
$form_action="ask-edit";
}
}
if ($FG_DEBUG == 1) echo "<br>$fields_name : ".$$fields_name;
if ($i>0) $param_update .= ", ";
$param_update .= "$fields_name = '".addslashes(trim($$fields_name))."'";
}
}
if ($FG_DEBUG == 1) echo "<br><hr> $param_update";
if ($VALID_SQL_REG_EXP) $instance_table -> Update_table ($DBHandle, $param_update, $FG_EDITION_CLAUSE, $func_table = null);
if ( ($VALID_SQL_REG_EXP) && (isset($FG_GO_LINK_AFTER_ACTION))){
Header ("Location: $FG_GO_LINK_AFTER_ACTION".$id);
}
}
if ($form_action == "delete"){
$res_delete = $instance_table -> Delete_table ($DBHandle, $FG_EDITION_CLAUSE, $func_table = null);
if (!$res_delete){ echo gettext("error deletion");
}else{
示例11: DbConnect
function Reservation_Card($security_key, $transaction_code, $card_id, $cardnumber)
{
// Activate the card
$FG_TABLE = "cc_card";
$DBHandle = DbConnect();
$instance_sub_table = new Table($FG_TABLE);
$status_reserved = 4;
$param_update = "status = {$status_reserved}";
if (is_numeric($card_id) && $card_id > 0) {
$clause = " id = {$card_id} ";
} else {
$clause = " username = '{$cardnumber}' ";
}
$QUERY = "SELECT count(*) FROM {$FG_TABLE} WHERE " . $clause;
$result = $instance_sub_table->SQLExec($DBHandle, $QUERY);
if (!is_array($result) || $result[0][0] <= 0) {
// FAIL FOUND CARD
write_log(LOG_WEBSERVICE, basename(__FILE__) . ' line:' . __LINE__ . "[" . date("Y/m/d G:i:s", mktime()) . "] " . " ERROR SELECT -> QUERY");
sleep(2);
return array($transaction_code, 'result=500', ' ERROR - SELECT DB NO CARD WITH THIS ID OR CARDNUMBER');
}
$update = $instance_sub_table->Update_table($DBHandle, $param_update, $clause);
if (!is_array($update) && count($update) == 0) {
// FAIL SELECT
write_log(LOG_WEBSERVICE, basename(__FILE__) . ' line:' . __LINE__ . "[" . date("Y/m/d G:i:s", mktime()) . "] " . " ERROR SELECT -> \n QUERY=" . $update);
sleep(2);
return array($transaction_code, 'result=500', " ERROR - Update : card_id={$card_id} ; cardnumber={$cardnumber}");
} else {
if (empty($card_id) && $card_id <= 0) {
$clause = " username = '{$cardnumber}' ";
$QUERY = "SELECT id FROM {$FG_TABLE} WHERE " . $clause;
$result = $instance_sub_table->SQLExec($DBHandle, $QUERY);
$card_id = $result[0][0];
}
$field_insert = "status, id_cc_card";
$value_insert = "'{$status_reserved}', '{$card_id}'";
$instance_status_table = new Table("cc_status_log", $field_insert);
$result_query = $instance_status_table->Add_table($DBHandle, $value_insert, null, null);
}
return array($transaction_code, 'result=200', " - Card Reserved : card_id={$card_id} ; cardnumber={$cardnumber}");
}
示例12: trim
/**
* Function to save_content
* @public
*/
function perform_update_content($sub_action,$id,$valcon)
{
$processed = $this->getProcessed();
$table_split = preg_split("/:/", $this->FG_TABLE_EDITION[$sub_action][14]);
if(array_key_exists($table_split[1].'_hidden', $processed)){
$value = trim($processed[$table_split[1].'_hidden']);
} else {
$value = trim($processed[$table_split[1]]);
}
$instance_sub_table = new Table($table_split[0]);
$SPLIT_FG_UPDATE_SET = $table_split[16]."='".$valcon."'";
$SPLIT_FG_UPDATE_CLAUSE = $table_split[1]."='".$value."' AND ".$table_split[5]."='".trim($id)."'";
$instance_sub_table -> Update_table ($this->DBHandle, $SPLIT_FG_UPDATE_SET, $SPLIT_FG_UPDATE_CLAUSE, $func_table = null);
}
示例13: gettext
case 'update':
if(!empty($idc) && is_numeric($idc)){
if(empty($date) || strtotime($date)===FALSE){
$error_msg.= gettext("Date inserted is invalid, it must respect a date format YYYY-MM-DD HH:MM:SS (time is optional).<br/>");
}
if( !is_numeric($vat)){
$error_msg.= gettext("VAT inserted is invalid, it must be a number. Check the format.<br/>");
}
if(empty($price) || !is_numeric($price)){
$error_msg .= gettext("Amount inserted is invalid, it must be a number. Check the format.");
}
if(!empty($error_msg)) break;
$DBHandle = DbConnect();
$instance_sub_table = new Table("cc_invoice_item", "*");
$instance_sub_table -> Update_table($DBHandle,"date='$date',description='$description',price='$price',vat='$vat'", "id = $idc" );
Header ("Location: A2B_invoice_edit.php?"."id=".$id);
}
break;
}
}
$invoice = new invoice($id);
$table_card = new Table("cc_card","vat");
$result_vat = $table_card->Get_list(DbConnect(),"id=".$invoice->getCard());
$card_vat = $result_vat[0][0];
$items = $invoice->loadItems();
示例14: addslashes
}
}
if ($FG_DEBUG == 1) {
echo "<br>{$fields_name} : " . ${$fields_name};
}
if ($i > 0) {
$param_update .= ", ";
}
$param_update .= $sp . "{$fields_name}" . $sp . " = '" . addslashes(trim(${$fields_name})) . "'";
}
}
if ($FG_DEBUG == 1) {
echo "<br><hr> {$param_update}";
}
if ($VALID_SQL_REG_EXP) {
$instance_table->Update_table($DBHandle, $param_update, $FG_EDITION_CLAUSE, $func_table = null);
}
if ($VALID_SQL_REG_EXP && isset($FG_GO_LINK_AFTER_ACTION)) {
Header("Location: {$FG_GO_LINK_AFTER_ACTION}" . $id);
}
}
if ($form_action == "delete") {
$res_delete = $instance_table->Delete_table($DBHandle, $FG_EDITION_CLAUSE, $func_table = null);
if (!$res_delete) {
echo gettext("error deletion");
} else {
}
$FG_INTRO_TEXT_DELETION = str_replace("%id", "{$id}", $FG_INTRO_TEXT_DELETION);
$FG_INTRO_TEXT_DELETION = str_replace("%table", "{$FG_TABLE_NAME}", $FG_INTRO_TEXT_DELETION);
if (isset($FG_GO_LINK_AFTER_ACTION)) {
Header("Location: {$FG_GO_LINK_AFTER_ACTION_DELETE}" . $id);
示例15: sprintf
$QUERY = " id = %u";
$QUERY = sprintf($QUERY, $paymentMethodID);
$DBHandle = DbConnect();
$return = $instance_sub_table->Get_list($DBHandle, $QUERY, 0);
$paymentMethod = substr($return[0][0], 0, strrpos($return[0][0], '.'));
$instance_sub_table = new Table("cc_configuration", "payment_filename");
$QUERY = " active = 't'";
$return = null;
if (tep_not_null($action)) {
switch ($action) {
case 'save':
while (list($key, $value) = each($configuration)) {
if ($key == 'MODULE_PAYMENT_PLUGNPAY_ACCEPTED_CC') {
$value = join($value, ', ');
}
$instance_sub_table->Update_table($DBHandle, "configuration_value = '" . $value . "'", "configuration_key = '" . $key . "'");
}
tep_redirect("A2B_entity_payment_settings.php?" . 'method=' . $paymentMethod . "&id=" . $id . "&result=success");
break;
}
}
$payment_modules = new payment($paymentMethod);
$GLOBALS['paypal']->enabled = true;
$GLOBALS['moneybookers']->enabled = true;
$GLOBALS['authorizenet']->enabled = true;
$GLOBALS['worldpay']->enabled = true;
$GLOBALS['plugnpay']->enabled = true;
//$GLOBALS['iridium']->enabled = true;
$module_keys = $payment_modules->keys();
$keys_extra = array();
$instance_sub_table = new Table("cc_configuration", "configuration_title, configuration_value, configuration_description, use_function, set_function");