当前位置: 首页>>代码示例>>PHP>>正文


PHP sql_query_write函数代码示例

本文整理汇总了PHP中sql_query_write函数的典型用法代码示例。如果您正苦于以下问题:PHP sql_query_write函数的具体用法?PHP sql_query_write怎么用?PHP sql_query_write使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sql_query_write函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: smart_updateMarkup

function smart_updateMarkup($values, $action)
{
    global $companyInfo;
    $userid = $values['append'];
    $res_disc = $_POST['res_disc_' . $userid];
    $res_trans = $_POST['res_trans_' . $userid];
    $sql = "select merchant_contract_agree,cb_ID\n\t\t\tFROM \n\t\t\t\tcs_companydetails as cd\n\t\t\tLEFT JOIN \n\t\t\t\tcs_entities as ce ON (cd.userId = ce.en_type_ID  AND ce.en_type = 'merchant')\n\t\t\tLEFT JOIN \n\t\t\t\tcs_entities_affiliates as ea ON (ea.ea_en_ID = ce.en_ID)\n\t\t\tLEFT JOIN \n\t\t\t\tcs_company_banks as cb ON (cb.userId = cd.userId AND cb.bank_id = 0)\n\t\t\tWHERE\n\t\t\t\tea.ea_affiliate_ID = '" . $companyInfo['en_ID'] . "' and cd.userId = '{$userid}'";
    $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}");
    if (!mysql_num_rows($result)) {
        return array("action" => "Merchant Not Found.", "status" => "fail");
    }
    $markupInfo = mysql_fetch_assoc($result);
    if ($markupInfo['merchant_contract_agree']) {
        return array("action" => "Merchant Already Signed Contract. If you would like more information, please contact the Sales Department.", "status" => "fail");
    }
    if (!$markupInfo['cb_ID']) {
        $sql = "insert into cs_company_banks set userId = '" . intval($userid) . "',bank_id=0;";
        $result = sql_query_write($sql) or dieLog(mysql_error() . " ~ {$sql}");
        $cb_ID = mysql_insert_id();
    } else {
        $cb_ID = $markupInfo['cb_ID'];
    }
    $update = array('default' => array('Processor' => array('disct' => $res_disc, 'trans' => $res_trans)));
    if (etel_update_serialized_field('cs_company_banks', 'cb_config', " cb_ID = '{$cb_ID}'", $update)) {
        return array("action" => "Merchant Rates Updated Successfully.", "status" => "success");
    }
    return array("action" => "Error, Please contact support.", "status" => "fail");
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:28,代码来源:Portfolio2.php

示例2: add_entity

 function add_entity($type, $user, $pass, $table_id)
 {
     $type = quote_smart($type);
     $user = quote_smart($user);
     $pass = quote_smart($pass);
     $table_id = quote_smart($table_id);
     if (!isset($this->entities[$type])) {
         return -1;
     }
     $sql = "\n\t\t\tINSERT INTO\n\t\t\t\tcs_entities\n\t\t\tSET\n\t\t\t\tet_type = '{$type}',\n\t\t\t\tet_username = '{$user}',\n\t\t\t\tet_password = '{$pass}',\n\t\t\t\tet_table_ID = '{$table_id}'\n\t\t\t";
     sql_query_write($sql);
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:12,代码来源:entities.class.php

示例3: smart_deleteRefund

function smart_deleteRefund($values, $action)
{
    global $adminInfo;
    $sql = "Select * FROM `cs_callnotes` WHERE note_id = '" . $values['append'] . "'";
    $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}");
    $callNoteInfo = mysql_fetch_assoc($result);
    if ($adminInfo['li_level'] == 'full') {
        $sql = "DELETE FROM `cs_callnotes` WHERE note_id = '" . $values['append'] . "'";
        $result = sql_query_write($sql, $cnn_cs) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>Cannot execute query");
        return array("action" => "Transaction ID " . $callNoteInfo['transaction_id'] . " no longer being refunded.", "status" => "success");
    }
    return array("action" => "Transaction ID " . $callNoteInfo['transaction_id'] . " no longer being refunded.", "status" => "failed.  insufficient privilages.");
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:13,代码来源:refundrequests_Smart.php

示例4: smart_updateMarkup

function smart_updateMarkup($values, $action, $updateall = false)
{
    global $curUserInfo;
    $en_ID = $values['append'];
    if ($updateall) {
        $res_disc = $_POST['default_disc'];
        $res_trans = $_POST['default_trans'];
    } else {
        $res_disc = $_POST['res_disc_' . $userid];
        $res_trans = $_POST['res_trans_' . $userid];
    }
    $sql = "select cb_ID,cb_config\n\t\t\tFROM \n\t\t\t\tcs_entities as ce\n\t\t\tLEFT JOIN \n\t\t\t\tcs_entities_affiliates as ea ON (ea.ea_en_ID = ce.en_ID)\n\t\t\tLEFT JOIN \n\t\t\t\tcs_company_banks as cb ON (ce.en_ID = cb.cb_en_ID AND cb.bank_id = 0)\n\t\t\tWHERE\n\t\t\t\tea.ea_affiliate_ID = '" . $curUserInfo['en_ID'] . "'";
    if ($en_ID || !$updateall) {
        $sql .= " and ce.en_ID = '{$en_ID}'";
    }
    $markupResult = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}");
    if (!mysql_num_rows($markupResult)) {
        return array("action" => "Affiliate(s) Not Found.", "status" => "fail");
    }
    while ($markupInfo = mysql_fetch_assoc($markupResult)) {
        if (!$markupInfo['cb_ID']) {
            $sql = "insert into cs_company_banks set cb_en_ID = '" . intval($markupInfo['merchant_en_ID']) . "',bank_id=0;";
            $result = sql_query_write($sql) or dieLog(mysql_error() . " ~ {$sql}");
            $cb_ID = mysql_insert_id();
        } else {
            $cb_ID = $markupInfo['cb_ID'];
            $markupInfo['cb_config'] = etel_unserialize($markupInfo['cb_config']);
        }
        $update = array('default' => array('Reseller' => array('disct' => $res_disc, 'trans' => $res_trans, 'en_ID' => $curUserInfo['en_ID'])));
        if ($updateall && $markupInfo['cb_config']['default']['Reseller']) {
            $update = NULL;
        }
        if ($update) {
            $updated = etel_update_serialized_field('cs_company_banks', 'cb_config', " cb_ID = '{$cb_ID}'", $update);
            if (!$updateall) {
                if ($updated) {
                    return array("action" => "Merchant Rates Updated Successfully.", "status" => "success");
                }
                return array("action" => "Error, Please contact support.", "status" => "fail");
            }
        }
    }
    return array("action" => "Merchant(s) Rates Updated Successfully.", "status" => "success");
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:44,代码来源:manage_affiliate.php

示例5: transaction_update_user_pass

function transaction_update_user_pass($trans_id, $user, $pass)
{
    $query = "\t\n\t\tUPDATE \n\t\t\t`cs_transactiondetails`\n\t\tSET \n\t\t\ttd_username = '" . $user . "',\n\t\t\ttd_password = '" . $pass . "'\n\t\tWHERE \n\t\t\t`transactionId` = '{$trans_id}'\n\t";
    sql_query_write($query) or dieLog(mysql_error() . "<pre>{$query}</pre>");
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:5,代码来源:db.transaction.php

示例6: quote_smart

    $contactmethod = quote_smart($_REQUEST['contactmethod']);
    if ($_SESSION['no_more_where'] != "true") {
        $where = $_SESSION['where'] . " AND sub.`ss_subscription_ID` = '{$ss_subscription_ID}'";
    } else {
        $where = $_SESSION['where'];
    }
    ///////////////////////////////////bad
    //	$results = $lookup->find_transaction_query($where);
    //	$row=mysql_fetch_array($results);
    ///////////////////////////////////bad
    $results = $lookup->find_transaction_query($where);
    foreach ($results as $outer_key => $row) {
        $_SESSION['no_more_where'] = "true";
        $transactionId = $row['transactionId'];
        $sql = "INSERT INTO `cs_callnotes` (`transaction_id` , `call_date_time` , `service_notes` , `cancel_status` , `customer_notes` , `solved` , `is_bill_date_changed` , `call_duration` , `customer_service_id` , `prev_bill_date` , `dnc`, `cn_type`, `cn_contactmethod` )\n\t\t\t\tVALUES ('{$transactionId}', NOW() , 'User Requests Refund', '', '{$customer_notes}', '' , '', '', '', '', '', 'refundrequest', '{$contactmethod}');";
        sql_query_write("{$sql}");
        $ss_subscription_ID = $row['ss_subscription_ID'];
        if ($row[ss_rebill_status] == "active") {
            subscription_cancel($ss_subscription_ID, NULL, $ss_account_notes, $ss_rebill_status_text);
        }
        echo "<big><big><big><center>Processing...</big></big></big></center>";
    }
} elseif ($_REQUEST[action] == "cancel") {
    $reference_number = quote_smart($_REQUEST['reference_number']);
    $ss_account_notes = quote_smart(trim($_REQUEST['ss_account_notes']));
    $ss_rebill_status_text = quote_smart($_REQUEST['ss_rebill_status_text']);
    if ($_SESSION['no_more_where'] != "true") {
        $where = $_SESSION['where'] . " AND td.`reference_number` = '{$reference_number}'";
    } else {
        $where = $_SESSION['where'];
    }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:transaction_lookup.php

示例7: send_email_template

    if ($_POST['Email_Contract_Notification'] && $access['Data']['send_mail']['Value'] == 1) {
        send_email_template('contract_notification_email', $data);
    }
    if ($_POST['Email_Active_Notification'] && $access['Data']['send_mail']['Value'] == 1) {
        send_email_template('active_notification_email', $data);
    }
    if ($_POST['cd_custom_contract'] && !$access['Data']['cd_custom_contract']['Value']) {
        $Rates = new rates_fees();
        $contract = $Rates->get_Merchant_Contract($en_ID);
        $sql = "insert into cs_email_templates \n\t\t\tset et_name='merchant_contract', \n\t\t\tet_custom_id='" . $company_id . "', \n\t\t\tet_title='" . quote_smart($access['Data']['en_company']['Value']) . " Contract', \n\t\t\tet_access='admin', \n\t\t\tet_to_title='" . quote_smart($access['Data']['en_company']['Value']) . "', \n\t\t\tet_subject='Custom Merchant Contract for " . quote_smart($access['Data']['en_company']['Value']) . "', \n\t\t\tet_htmlformat='" . quote_smart($contract['et_htmlformat']) . "', \n\t\t\tet_catagory='Merchant'";
        $result = sql_query_write($sql) or dieLog(mysql_error() . " ~ sql");
        $_POST['cd_custom_contract'] = mysql_insert_id();
    } else {
        if (!$_POST['cd_custom_contract'] && $access['Data']['cd_custom_contract']['Value']) {
            $sql = "delete from cs_email_templates where et_name='merchant_contract' and et_custom_id='" . $company_id . "'";
            $result = sql_query_write($sql) or dieLog(mysql_error() . " ~ sql");
            $access['Data']['cd_custom_contract']['AddHtml'] = NULL;
        }
    }
}
$res = check_merchant_conflict($_POST, $en_ID);
if (!$res['status']) {
    $access['HeaderMessage'] .= nl2br($res['msg']);
    foreach ($res['res'] as $key => $val) {
        if ($val) {
            $_POST[$key] = $access['Data'][$key]['Value'];
            $access['Data'][$key]['Highlight'] = true;
        }
    }
}
// Submit
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:editCompanyProfileRates.php

示例8: cs_companydetails

     exit;
 } else {
     $qry_insert_user = " insert into cs_companydetails (username,password,companyname,email,volumenumber,activeuser,transaction_type,how_about_us,reseller_other,reseller_id,date_added,send_ecommercemail,url1,gateway_id,block_virtualterminal)";
     $qry_insert_user .= " values('{$username}','{$password}','{$companyname}','{$email}','{$volumeNumber}',0,'{$transaction_type}','rsel','{$resellerName}',{$resellerLogin},'{$current_date_time}',{$send_ecommercemail},'{$url}','{$gateway_id}',{$block_virtual_terminal})";
     //	print $qry_insert_user;
     if (!($show_sql = mysql_query($qry_insert_user))) {
         print mysql_errno() . ": " . mysql_error() . "<BR>";
         print "Cannot execute query <br>";
         exit;
     } else {
         $is_success = 0;
         $user_id = mysql_insert_id();
         $user_reference_num = func_User_Ref_No($user_id);
         $is_success = func_update_single_field('cs_companydetails', 'ReferenceNumber', $user_reference_num, NULL, 'userId', $user_id, $cnn_cs);
         $sql = "Insert into cs_entities\n\t\t\t\tset \n\t\t\t\t\ten_username = '" . $username . "',\n\t\t\t\t\ten_password = MD5('" . ($username . $password) . "'),\n\t\t\t\t\ten_email = '" . quote_smart($email) . "',\n\t\t\t\t\ten_gateway_ID = '" . quote_smart($gateway_id) . "',\n\t\t\t\t\ten_type = 'merchant',\n\t\t\t\t\ten_signup = NOW(),\n\t\t\t\t\ten_type_id = '" . quote_smart($user_id) . "'\n\t\t\t\t";
         sql_query_write($sql) or dieLog(mysql_error() . " ~ {$str_qry}");
         $letterTempate = 'merchant_referral_letter';
         $emailData["email"] = $email_to;
         $emailData["reselleremail"] = $resellerInfo['reseller_email'];
         $emailData["full_name"] = "Merchant";
         $emailData["companyname"] = $companyname;
         $emailData["resellername"] = $resellerInfo['reseller_companyname'];
         $emailData["username"] = $username;
         $emailData["password"] = $password;
         $emailData["Reference_ID"] = $user_reference_num;
         send_email_template($letterTempate, $emailData);
         $emailInfo = get_email_template($letterTempate, $emailData);
         /*************************************************************************/
         $msgtodisplay = "New merchant registered successfully. Confirmation Email sent to '" . $email . "'";
         $outhtml = "Y";
         message($msgtodisplay, $outhtml, $headerInclude);
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:updateMerchant.php

示例9: sql_query_write

        }
        $update = "registered ";
        if (!$rd_recur_enabled) {
            $i_recur_day = 0;
        }
        if ($i_recur_day > 0 && $i_trial_days == 0) {
            $i_trial_days = 3;
        }
        if ($rd_ibill_landing_html && $chk_enable_landing) {
            $rd_ibill_landing_html = "'" . $rd_ibill_landing_html . "'";
        } else {
            $rd_ibill_landing_html = 'NULL';
        }
        $sql_fields = "\n\t\t\t`recur_day` = '{$i_recur_day}', \n\t\t\t`recur_charge` = '{$i_recur_charge}', \n\t\t\t`company_user_id` = '{$company_user_id}', \n\t\t\t`rd_en_ID` = '" . $companyInfo['en_ID'] . "', \n\t\t\t`rd_initial_amount` = '{$i_trial_amount}', \n\t\t\t`rd_trial_days` = '{$i_trial_days}', \n\t\t\t`rd_description`  = '{$i_txt_description}',\n\t\t\t`rd_hide`  = 0,\n\t\t\t`rd_recur_enabled` = '{$rd_recur_enabled}',\n\t\t\t`rd_ibill_landing_html`  = {$rd_ibill_landing_html},\n\t\t\t`rd_subName` = '{$rd_subName}'";
        $qry_insert_details = "\n\t\tINSERT INTO `cs_rebillingdetails` \n\t\tset {$sql_fields} on duplicate key update {$sql_fields}\n\t\t";
        $rst_insert = sql_query_write($qry_insert_details, $cnn_cs) or die(mysql_error());
        $subAccount = mysql_insert_id($cnn_cs);
        if ($rd_subaccount) {
            $subAccount = $rd_subaccount;
        }
        $subAccountName = $subAcc['rd_subName'];
        $msgtodisplay = "<br>Sub Account '{$rd_subName}' Updated successfully.<br>To use this subaccount, make sure to include the entire subaccount name '{$rd_subName}' in your integration form.<br> ";
        print "<table align='center' width='100%'><tr height='20'><td  align='center'><font face='verdana' size='1'>&nbsp;{$msgtodisplay}</td></tr><tr>\n\t</tr></table>";
    }
    endTable('Recurring Transaction', NULL, true, true);
    die;
}
$sql = "SELECT * FROM `cs_rebillingdetails` WHERE `rd_hide` = 0 AND `rd_en_ID` = '{$en_ID}' ORDER BY `rd_subaccount` DESC ";
if (!($result = sql_query_read($sql, $cnn_cs))) {
    print mysql_errno() . ": " . mysql_error() . "<BR>";
    print $qry_update . "<br>";
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:recurTransProcessing.php

示例10: createNewTicket

function createNewTicket($emailInfo, $tickets_users_username, $tickets_thread, $tickets_category = 1)
{
    $ticket = array();
    $ticket['tickets_reference'] = 'NULL';
    if (!$tickets_thread['tickets_id']) {
        $ticket['tickets_reference'] = "'" . strtoupper(substr(md5(time() . rand(0, 10000000)), 0, 16)) . "'";
    }
    $tickets_subject = str_replace("Re: ", "", $emailInfo['Subject']);
    $sql = "\r\n\t\tInsert ignore Into `tickets_tickets`\r\n\t\tset tickets_username = '{$tickets_users_username}',\r\n\t\ttickets_child = '" . $tickets_thread['tickets_id'] . "',\r\n\t\ttickets_subject = '{$tickets_subject}',\r\n\t\ttickets_reference = " . $ticket['tickets_reference'] . ",\r\n\t\ttickets_name = '" . quote_smart($emailInfo['FromEmail']) . "',\r\n\t\ttickets_email = '" . quote_smart($emailInfo['FromEmail']) . "',\r\n\t\ttickets_question = '" . quote_smart($emailInfo['body']) . "',\r\n\t\ttickets_category = '" . quote_smart($tickets_category) . "',\r\n\t\ttickets_timestamp = '" . time() . "'";
    $result = sql_query_write($sql) or dieLog(mysql_error());
    $ticket['id'] = mysql_insert_id();
    if ($tickets_thread['tickets_id'] > 0) {
        sql_query_write("update `tickets_tickets` set tickets_status='Open' where tickets_id = '" . $tickets_thread['tickets_id'] . "'") or dieLog(mysql_error());
    }
    if ($tickets_thread['tickets_id']) {
        $ticket['tickets_reference'] = $tickets_thread['tickets_reference'];
    }
    return $ticket;
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:19,代码来源:email.php

示例11: func_update_single_field

function func_update_single_field($tablename, $fieldname, $fieldvalue, $cnn, $comparefield, $comparefieldvalue, $cnn_cs = false)
{
    $sql = "update {$tablename} set {$fieldname}='{$fieldvalue}' where {$comparefield}={$comparefieldvalue}";
    if (!sql_query_write($sql, 1)) {
        //echo $qryUpdate;
        dieLog(mysql_error() . " {$sql}");
    }
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:8,代码来源:function.php

示例12: update_account_status

 function update_account_status()
 {
     $ss_account_status = 'active';
     if (strtotime($this->row['subscriptionTable']['ss_account_expire_date']) < time()) {
         $ss_account_status = 'inactive';
     }
     $ss_account_notes = "\n\n" . date('Y-m-d G:i:s') . ": Account " . ucfirst($ss_account_status);
     $upd = "UPDATE\n\t\t\t\t\tcs_subscription\n\t\t\t\t\tSET\n\t\t\t\t\tss_account_status = '{$ss_account_status}',\n\t\t\t\t\tss_account_notes = CONCAT(`ss_account_notes`, '{$ss_account_notes}' )\n\t\t\t\t\tWHERE\n\t\t\t\t\tss_ID = {$this->row['subscriptionTable']['ss_ID']}";
     sql_query_write($upd) or dieLog(mysql_error() . "<pre>{$upd}</pre>");
     $this->row['subscriptionTable']['ss_account_status'] = $ss_account_status;
     $this->row['subscriptionTable']['ss_account_notes'] .= $ss_account_notes;
     if ($ss_account_status == 'inactive') {
         return Process_Transaction($this->row['subscriptionTable']['ss_transaction_id'], "expiration", $this->test, "transactionId");
     }
     return Process_Transaction($this->row['subscriptionTable']['ss_transaction_id'], "approve", $this->test, "transactionId");
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:16,代码来源:transaction.class.php

示例13: process_transactions


//.........这里部分代码省略.........
                 $update = true;
                 $status = 'D';
                 break;
             case "cancelled":
                 $update = true;
                 $status = 'D';
                 break;
             case "bo exception":
                 $update = true;
                 $status = 'D';
                 break;
             case "downloaded":
                 $update = false;
                 break;
             case "credit originated":
                 $update = false;
                 break;
             case "credit downloaded":
                 $update = false;
                 break;
             case "credit return":
                 $update = true;
                 $status = 'D';
                 $chargeback = true;
                 break;
             case "credit funded":
                 $update = true;
                 $status = 'A';
                 break;
         }
         $refid = substr($tran['ExternalClientID'], 0, 50);
         if (!$refid) {
             continue;
         }
         $sql = "\n\t\t\t\tselect * from \n\t\t\t\t\tcs_transactiondetails left join \n\t\t\t\t\tcs_subscription on \n\t\t\t\t\ttd_ss_ID = ss_ID\n\t\t\t\tWHERE\n\t\t\t\t\treference_number = '{$refid}'\n\t\t\t\t\tAND checkorcard='C'\t\t\n\t\t\t\tLIMIT 1\n\t\t\t";
         $tranResult = mysql_query($sql) or dieLog(mysql_error() . " ~ {$sql}");
         $transInfo = mysql_fetch_assoc($tranResult);
         $transId = $transInfo['transactionId'];
         if ($transInfo['status'] != 'P' && $update == true) {
             $update = false;
         }
         if (!$transId) {
             $log .= " Transaction ID Not Found!! " . print_r($tran, true);
             toLog('erroralert', 'misc', "Transaction ID Not Found!! {$transId} {$sql}");
             $update = false;
         }
         if ($update) {
             $log .= " Found Response Type (" . $tran['ResponseType'] . ") For ({$refid}):\n";
             $notify = 'decline';
             $bank_transid = $tran['TransID'];
             if ($tran['ResponseDate']) {
                 $billingDate = date('Y-m-d', strtotime($tran['ResponseDate']));
             } else {
                 $billingDate = "";
             }
             if ($chargeback) {
                 //is_chargeback
                 $sql = "\n\t\t\t\t\t\tUPDATE\n\t\t\t\t\t\t\tcs_transactiondetails left join \n\t\t\t\t\t\t\tcs_subscription on \n\t\t\t\t\t\t\ttd_ss_ID = ss_ID\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\tstatus='A',\n\t\t\t\t\t\t\ttd_is_chargeback = 1,\n\t\t\t\t\t\t\ttd_bank_transaction_id = '{$bank_transid}',\n\t\t\t\t\t\t\tbillingDate = '{$billingDate}',\n\t\t\t\t\t\t\ttd_merchant_deducted=0,\n\t\t\t\t\t\t\tss_rebill_status = 'inactive',\n\t\t\t\t\t\t\tss_rebill_status_text = 'Subscription Inactive due to Chargeback'\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\ttransactionId = '{$transId}'\n\t\t\t\t\t\t\tAND checkorcard='C'\t\t\n\t\t\t\t\t";
                 $log .= "  This transaction is a chargeback.\n";
                 $notify = 'chargeback';
                 $r = $RF->update_transaction_profit($transId);
             } else {
                 if ($refund) {
                     // cancel_status = y, cancel subscription
                     $sql = "\n\t\t\t\t\t\tUPDATE\n\t\t\t\t\t\t\tcs_transactiondetails left join \n\t\t\t\t\t\t\tcs_subscription on \n\t\t\t\t\t\t\ttd_ss_ID = ss_ID\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\tstatus='A',\n\t\t\t\t\t\t\tcancelstatus = 'Y',\n\t\t\t\t\t\t\ttd_bank_transaction_id = '{$bank_transid}',\n\t\t\t\t\t\t\tbillingDate = '{$billingDate}',\n\t\t\t\t\t\t\ttd_merchant_deducted=0,\n\t\t\t\t\t\t\tss_rebill_status = 'inactive',\n\t\t\t\t\t\t\tss_rebill_status_text = 'Subscription Inactive due to Refund'\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\ttransactionId = '{$transId}'\n\t\t\t\t\t\t\tAND checkorcard='C'\t\t\t\n\t\t\t\t\t";
                     $log .= "  This transaction is a refund.\n";
                     $notify = 'refund';
                     $r = $RF->update_transaction_profit($transId);
                 } else {
                     $ss_rebill_status_sql = $status == 'D' ? "ss_rebill_status = 'inactive', " : '';
                     $ss_rebill_status_text = $status == 'D' ? 'Subscription Inactive due to decline (' . $this->ach_status[$tran['ResponseType']] . ')' : 'Subscription Active';
                     $sql = "\n\t\t\t\t\t\tUPDATE\n\t\t\t\t\t\t\tcs_transactiondetails left join \n\t\t\t\t\t\t\tcs_subscription on \n\t\t\t\t\t\t\ttd_ss_ID = ss_ID\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\ttd_bank_transaction_id = '{$bank_transid}',\n\t\t\t\t\t\t\tstatus = '{$status}',\n\t\t\t\t\t\t\tbillingDate = '{$billingDate}',\n\t\t\t\t\t\t\ttd_merchant_deducted=0,\n\t\t\t\t\t\t\ttd_merchant_paid=0,\n\t\t\t\t\t\t\t{$ss_rebill_status_sql}\n\t\t\t\t\t\t\tss_rebill_status_text = '{$ss_rebill_status_text}'\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\ttransactionId = '{$transId}'\n\t\t\t\t\t\t\tAND checkorcard='C'\tAND status='P'\t\n\t\t\t\t\t";
                     $log .= "  This transaction's status is (" . $this->ach_status[$tran['ResponseType']] . ").\n";
                     $r = $RF->update_transaction_profit($transId);
                 }
             }
             sql_query_write($sql) or dieLog(mysql_error() . "<pre>{$sql}</pre>");
             $affected = mysql_affected_rows();
             if ($status != 'A') {
                 $return_affected_rows += $affected;
             } else {
                 $approve_affected_rows += $affected;
             }
             if ($status == 'A') {
                 if ($transInfo['td_is_a_rebill']) {
                     $notify = 'rebill';
                 } else {
                     $notify = 'approve';
                 }
             }
             if ($affected) {
                 Process_Transaction($transId, $notify, 0, 'transactionId');
             }
         } else {
             $log .= "  Ignoring Transaction.\n";
         }
     }
     $log .= "CheckGateway Result: ({$return_affected_rows}) Returns, ({$approve_affected_rows}) Approves.\n";
     return $log;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:banks.checkgateway.php

示例14: session_destroy

    if (!$index) {
        $index = $config_default_index;
    }
    session_destroy();
    header("location:" . $index . "?login_redir=" . base64_encode($_SERVER['REQUEST_URI']));
    exit;
}
if ($companyInfo['en_gateway_ID'] && $companyInfo['en_gateway_ID'] != $_SESSION["gw_id"]) {
    $_SESSION["gw_switch"] = $companyInfo['en_gateway_ID'];
}
if (!$_SESSION["gw_switch"]) {
    $_SESSION["gw_switch"] = $gateway_db_select;
}
if ($_SESSION["gw_user_en_debug"] && !isset($etel_debug_mode)) {
    if (ip2long($etel_current_ip) != $gwInfo['gw_debug_ip']) {
        sql_query_write("update etel_dbsmain.etel_gateways set gw_debug_ip = '" . ip2long($etel_current_ip) . "' where gw_id = '" . $gwInfo['gw_id'] . "'");
    }
    $etel_debug_mode = 1;
}
if (ip2long($etel_current_ip) == $gwInfo['gw_debug_ip'] && $_COOKIE['etel_debug_enable'] == 2 && !isset($etel_debug_mode)) {
    $etel_debug_mode = 1;
}
// Debug Mode
if ($etel_debug_mode == 1 && !$printable_version) {
    error_reporting(E_ALL ^ E_NOTICE);
    print "<span style='font-size: 10px;'>";
    print_r($_REQUEST);
    print "<br>";
    print_r($_SESSION);
    print "</span>";
} else {
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:dbconnection.php

示例15: time

//$etel_debug_mode = 1;
$etel_disable_https = 1;
include "includes/dbconnection.php";
$timelimit = 60;
$time = time();
for ($i = 0; $i <= 20; $i++) {
    $found = 0;
    $sleep = 10;
    $result = sql_query_read('SHOW PROCESSLIST ');
    while ($list = mysql_fetch_assoc($result)) {
        preg_match('/\\/\\* TIMEOUT=([0-9]*) \\*\\//', $list['Info'], $matches);
        $limit = intval($matches[1]);
        if ($limit >= 5 || intval($list['Time']) >= 300 && strpos(strtolower($list['Info']), 'select') !== false) {
            if (intval($list['Time']) >= $limit) {
                $sql = "KILL " . $list['Id'] . "\n";
                sql_query_write($sql);
                echo $sql;
                $found = 1;
            }
            $sleep = 1;
        }
    }
    if (!$found) {
        echo date('G:i:s') . ": No Processes to Kill<br>";
    }
    flush();
    if ($time + $timelimit < time()) {
        die;
    }
    sleep($sleep);
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:processMysqlLimit.php


注:本文中的sql_query_write函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。