function send_email_template($template, $data) { $sql = "SELECT * FROM `cs_email_templates` WHERE `et_name` = '{$template}'"; $result = mysql_query($sql) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>"); if (mysql_num_rows($result)) { $emailInfo = mysql_fetch_assoc($result); foreach ($data as $key => $item) { $emailInfo['et_htmlformat'] = str_replace("[" . $key . "]", $item, stripslashes($emailInfo['et_htmlformat'])); $emailInfo['et_textformat'] = str_replace("[" . $key . "]", $item, stripslashes($emailInfo['et_textformat'])); $emailInfo['et_subject'] = str_replace("[" . $key . "]", $item, stripslashes($emailInfo['et_subject'])); } $mail = new PHPMailer(); $mail->From = $emailInfo['et_from']; $mail->FromName = $emailInfo['et_from_title']; $mail->Subject = $emailInfo['et_subject']; $mail->Host = "smtp.etelegate.com"; $mail->Mailer = "smtp"; // HTML body $body = $emailInfo['et_htmlformat']; // Plain text body (for mail clients that cannot read HTML) $text_body = $emailInfo['et_textformat']; $mail->Body = $body; $mail->AltBody = $text_body; $mail->AddAddress($data["email"], $data["full_name"]); if (!$mail->Send()) { echo "There has been a mail error sending to " . $row["email"] . "<br>"; } // Clear all addresses and attachments for next loop $mail->ClearAddresses(); $mail->ClearAttachments(); } else { die('Error: Email Template Not Found'); } }
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"); }
function sites_getSiteInfo($site_id) { $site_id = quote_smart($site_id); $sql = "\n\t\tSELECT\n\t\t\t*\n\t\tFROM\n\t\t\tcs_company_sites\n\t\tWHERE\n\t\t\tcs_id = '{$site_id}';\n\t"; $res = sql_query_read($sql) or dieLog(mysql_error() . "<pre>{$sql}</pre>"); return mysql_fetch_assoc($res); }
function ch_check_previous_decline($transInfo, $hours = 24) { return 0; $sql = "\n\t\tSELECT \n\t\t\t*\n\t\tFROM \n\t\t\t`cs_transactiondetails`\n\t\tWHERE \n\t\t\t`bankaccountnumber` = '" . etelEnc($transInfo['bankaccountnumber']) . "' \n\t\t\tAND transactionDate > DATE_SUB(Now(),Interval {$hours} HOUR)\n\t\t\tAND (`status` != 'A' or `cancelstatus` = 'Y' or `td_is_chargeback`=1) \n\t\t\tAND (`td_bank_recieved` = 'yes' or `td_bank_recieved` = 'fraudscrubbing')\n\t\t"; $result = sql_query_read($sql) or dieLog(mysql_errno() . ": " . mysql_error() . "<pre>{$sql}</pre>"); $numrows = mysql_num_rows($result); return $numrows > 0; }
function get_entity_id_by_name($type, $name) { $type = quote_smart($type); $name = quote_smart($name); $sql = "\n\t\t\tSELECT\n\t\t\t\tet_ID\n\t\t\tFROM\n\t\t\t\tcs_entities\n\t\t\tWHERE\n\t\t\t\tet_type = '{$type}'\n\t\t\t\tAND et_username = '******'\n\t\t"; $res = sql_query_read($sql) or dieLog(mysql_error() . "<pre>{$sql}</pre>"); $r = mysql_fetch_assoc($res); return $r['et_ID']; }
function get_page_summary($date_from, $date_to) { $date_from = date("Y-m-d 00:00:00", $date_from); $date_to = date("Y-m-d 23:59:59", $date_to); $sql = "\n\t\t\tSELECT\t\n\t\t\t\tiv_page_name,\n\t\t\t\tcount(*) AS views\n\t\t\tFROM\n\t\t\t\tcs_ivr_log\n\t\t\tWHERE\n\t\t\t\tiv_datetime BETWEEN '{$date_from}' AND '{$date_to}'\n\t\t\tGROUP BY\n\t\t\t\tiv_page_name\n\t\t\tORDER BY\n\t\t\t\tLOWER(iv_page_name) ASC\n\t\t"; $res = sql_query_read($sql) or dieLog(mysql_error() . "<pre>{$sql}</pre>"); $sum = array(); while ($r = mysql_fetch_assoc($res)) { $sum[] = $r; } return $sum; }
function bank_ChooseSupported($bk_trans_types, $en_ID, $suggested_bank = NULL) { $sql = "SELECT * FROM cs_bank as bk left join cs_company_banks as cb on cb.bank_id = bk.bank_id \n\t\t\tWhere cb.cb_en_ID = '{$en_ID}' and bk.bk_trans_types = '{$bk_trans_types}'\n\t;"; $bank_details = sql_query_read($sql) or dieLog(mysql_error() . "<p>{$sql}</p>"); $list = array(); while ($r = mysql_fetch_assoc($bank_details)) { if ($r['bank_id']) { $chosen_bank = $r['bank_id']; } $list['banks'][$r['bank_id']] = $r; } if ($list['banks'][$suggested_bank]) { $chosen_bank = $suggested_bank; } $list['chosen'] = $chosen_bank; return $list; }
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"); }
function get_merchant_quick_status($id) { $sql = "SELECT cd.userId, companyname, \n\t\tsum( amount*(status='A') ) AS Sales, \n\t\tsum( amount*(status='A' AND transactionDate > now() - interval 1 DAY)) AS Sales_Today, \n\t\tsum( amount*(status='A' AND transactionDate > now() - interval cd_payperiod DAY)) AS Sales_ThisPeriod, \n\t\tsum( amount*(status='A' AND transactionDate between now() - interval cd_payperiod*2 DAY AND now() - interval cd_payperiod DAY )) AS Sales_LastPeriod, \n\t\tsum( amount*(status='A' AND transactionDate between now() - interval cd_payperiod*3 DAY AND now() - interval cd_payperiod*2 DAY )) AS Sales_Last2Period, \n\t\tsum( amount ) AS Total, \n\t\tcount(*) AS Total_Cnt,\n\t\tsum( amount*(cancelstatus='Y') ) AS Refunds, \n\t\tmax( `transactionDate` ) AS last_transaction, \n\t\tmin( `transactionDate` ) AS first_transaction, \n\t\t(UNIX_TIMESTAMP( max( `transactionDate` ) ) - UNIX_TIMESTAMP( min( `transactionDate` ) )) / ( 24 *60 *60 )+1 AS Days_Processing\n\t\t\n\t\tFROM `cs_companydetails` AS cd\n\t\tLEFT JOIN `cs_transactiondetails` AS td ON td.`userId` = cd.`userId`\n\t\twhere cd.`userId` = '{$id}'\n\t\tGROUP BY cd.`userId`\n\t\tLIMIT 1"; $result = mysql_query($sql) or dieLog(mysql_errno() . ": " . mysql_error() . " ~ {$sql}"); $list = mysql_fetch_assoc($result); $score = array(); $score['actual'] = 0; $score['possible'] = 0; $score['summmary'] = "Score Summary:\n"; // Is processing? if ($list['Total_Cnt'] && $list['Days_Processing'] > 0) { $avg = $list['Total'] / $list['Days_Processing']; if ($avg > 0) { $cur_score = $list['Sales_Today'] / $avg; $score['summmary'] .= "Today Company is processing at %" . formatMoney($cur_score * 100) . " of Daily Average.\n"; if ($cur_score > 1) { $cur_score = 1; } $score['possible'] += 30; $score['actual'] += intval(30 * $cur_score); } $tot = $list['Sales_ThisPeriod'] + $list['Sales_LastPeriod'] + $list['Sales_Last2Period']; if ($tot) { $cur_score = $list['Sales_ThisPeriod'] * 3 / ($list['Sales_ThisPeriod'] + $list['Sales_LastPeriod'] + $list['Sales_Last2Period']); $score['summmary'] .= "For This Sales Period, Company is processing at %" . formatMoney($cur_score * 100) . " of 3 Period Average.\n"; if ($cur_score > 1) { $cur_score = 1; } $score['possible'] += 50; $score['actual'] += intval(50 * $cur_score); } } $score['percent'] = 0; if ($score['possible']) { $score['percent'] = 100 * formatMoney($score['actual'] / $score['possible']); } return $score; }
function smart_issueRefund($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') { require_once '../includes/int.refund.php'; $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); $sql = "Select * from `cs_transactiondetails` where transactionId = '" . $callNoteInfo['transaction_id'] . "'"; $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}"); $transInfo = mysql_fetch_assoc($result); $response = execute_refund($transInfo, $callNoteInfo['service_notes'] . ": " . $callNoteInfo['customer_notes']); $error_msg = "success"; if ($response['success'] == false) { $error_msg = "ERROR: Refund Not successful ~ " . $response['errormsg']; } return array("action" => "Transaction ID " . $transInfo['reference_number'] . " refund attempted:", "status" => "{$error_msg}"); } return array("action" => "Transaction ID " . $transInfo['reference_number'] . " refund attempted:", "status" => "failed. insufficient privilages."); }
function get_BillingInfo($wallet_id, $wallet_pass, &$transInfo) { $pass = $this->encrypt_password($pass); if ($this->mode == "Live") { $tran_table = "cs_transactiondetails"; } else { $tran_table = "cs_test_transactiondetails"; } $sql = "\n\t\t\tSELECT\n\t\t\t\tname,\n\t\t\t\tsurname,\n\t\t\t\taddress,\n\t\t\t\tcity,\n\t\t\t\tphonenumber,\n\t\t\t\tstate,\n\t\t\t\tzipcode,\n\t\t\t\tcountry,\n\t\t\t\temail,\n\t\t\t\tMAX(transactiondate)\n\t\t\tFROM\n\t\t\t\t{$tran_table}\n\t\t\tWHERE\n\t\t\t\tLOWER(td_gcard) = LOWER('{$wallet_id}')\n\t\t\t\tAND\tLOWER(td_gcardpass) = LOWER('{$wallet_pass}')\n\t\t\tGROUP BY td_gcard,td_gcardpass\n\t\t"; $res = sql_query_read($sql) or dieLog(mysql_error() . "<pre>{$sql}</pre>"); if ($prev_trans = mysql_fetch_assoc($res)) { $transInfo['firstname'] = $prev_trans['name']; $transInfo['lastname'] = $prev_trans['surname']; $transInfo['address'] = $prev_trans['address']; $transInfo['city'] = $prev_trans['city']; $transInfo['phonenumber'] = $prev_trans['phonenumber']; $transInfo['state'] = $prev_trans['state']; $transInfo['zipcode'] = $prev_trans['zipcode']; $transInfo['country'] = $prev_trans['country']; $transInfo['email'] = $prev_trans['email']; $transInfo['td_gcard'] = $wallet_id; $transInfo['td_gcardpass'] = $wallet_pass; } }
$min_ticket_amt = $arr_qry_company['min_ticket_amt']; $goods_list = $arr_qry_company['goods_list']; $volume_last_month = $arr_qry_company['volume_last_month']; $volume_prev_30days = $arr_qry_company['volume_prev_30days']; $volume_prev_60days = $arr_qry_company['volume_prev_60days']; $totals = $arr_qry_company['totals']; $forecast_volume_1month = $arr_qry_company['forecast_volume_1month']; $forecast_volume_2month = $arr_qry_company['forecast_volume_2month']; $forecast_volume_3month = $arr_qry_company['forecast_volume_3month']; $current_anti_fraud_system = $arr_qry_company['current_anti_fraud_system']; $customer_service_program = $arr_qry_company['customer_service_program']; $customer_service_phone = $arr_qry_company['customer_service_phone']; $refund_policy = $arr_qry_company['refund_policy']; $urls = ""; $sql = "SELECT cs_URL FROM `etel_dbsmain`.`cs_company_sites` WHERE `cs_gatewayId` = " . $_SESSION["gw_id"] . " AND `cs_company_id` = '{$company_id}' AND cs_hide = '0'"; $result = mysql_query($sql, $cnn_cs) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>"); while ($url = mysql_fetch_assoc($result)) { $urls .= "<p><a href='" . $url['cs_URL'] . "' >" . $url['cs_URL'] . "</a></p>"; } $merchant_name = $arr_qry_company['merchantName']; $toll_free_number = $arr_qry_company['tollFreeNumber']; $retrieval_number = $arr_qry_company['retrievalNumber']; $security_number = $arr_qry_company['securityNumber']; $processor = $arr_qry_company['processor']; $billing_descriptor = $arr_qry_company['billingdescriptor']; $charge_back = $arr_qry_company['chargeback']; $credit = $arr_qry_company['credit']; $transaction_fee = $arr_qry_company['transactionfee']; $voice_authorization_fee = $arr_qry_company['voiceauthfee']; $discount_rate = $arr_qry_company['discountrate']; $reserve = $arr_qry_company['reserve'];
exit; } else { $qry_insert_user = "******"; $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 = '******',\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);
// QID, visited, date, question $dData['stylesheet'] = "orca/okb_style.css"; include "orca/okb_lang_en.php"; /* ***** Do not cache this page ******************************* */ header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); /* ***** MySQL Setup ****************************************** */ $dData['tableq'] = $dData['tablename'] . "q"; $dData['tablec'] = $dData['tablename'] . "c"; $db = mysql_connect($dData['hostname'], $dData['username'], $dData['password']) or dieLog("Could not connect to the MySQL server!"); mysql_select_db($dData['database'], $db) or dieLog("Could not connect to the database!"); $create = mysql_query("CREATE TABLE IF NOT EXISTS `{$dData['tableq']}` (\n `category` text,\n `subcategory` text,\n `QID` int(11),\n `date` text,\n `question` text,\n `answer` text,\n `keywords` text,\n `online` tinytext,\n `visited` int(11)\n) TYPE=MyISAM;") or dieLog("Could not create Questions table!"); $create = mysql_query("CREATE TABLE IF NOT EXISTS `{$dData['tablec']}` (\n `category` text,\n `subcategory` text\n) TYPE=MyISAM;") or dieLog("Could not create Categories table!"); /* ***** Functions ******************************************** */ function dateStamp($time) { global $pageEncoding, $lang, $sData; switch ($pageEncoding) { case 1: $timeStr = utf8_encode(strftime($sData['dateformat'], $time)); break; case 2: $timeStr = strftime($sData['dateformat'], $time); break; default: $timeStr = @htmlentities(strftime($sData['dateformat'], $time), ENT_COMPAT, $lang['charset']); break; }
require_once "includes/dbconnection.php"; $headerInclude = "transactions"; include 'includes/header.php'; require_once 'includes/function.php'; include 'includes/function1.php'; $str_currency = ""; $sessionlogin = $companyInfo['userId']; $str_company_id = $companyInfo['userId']; //$show_sql =mysql_query("select * from cs_companydetails where userid=$str_company_id",$cnn_cs); //$companyInfo = mysql_fetch_assoc($show_sql); $updateMsgOne = "This form will create a One Time Payment:"; $updateMsgRecur = "This form will create a Price Point:"; if ($_GET['rd_subName']) { $rd_subName = quote_smart($_GET['rd_subName']); $sql = "SELECT * FROM `cs_rebillingdetails` WHERE `rd_subName` = '{$rd_subName}' AND `company_user_id` = " . $str_company_id; $result = mysql_query($sql, $cnn_cs) or dieLog(mysql_error()); $subAcc = mysql_fetch_assoc($result); if ($subAcc) { $subAccountName = $subAcc['rd_subName']; $updateMsgOne = "This form will update account '{$subAccountName}' as a One Time Payment:"; $updateMsgRecur = "This form will update account '{$subAccountName}':"; } } $str_current_date = func_get_current_date(); $i_to_year = substr($str_current_date, 0, 4); $i_to_month = substr($str_current_date, 5, 2); $i_to_day = substr($str_current_date, 8, 2); ?> <script type="text/javascript" src="<?php echo $etel_domain_path; ?>
document.getElementById('userId').value = <?php echo $userId; ?> ; </script> </td> </tr> <tr> <td colspan="2" height="50" align="center" valign="middle"><input type="image" src="../images/submit.jpg"></td> </tr> </table> <?php endTable("Select Company", ""); if ($userId) { $sql = "select * from cs_companydetails as cd where cd.reseller_id='" . $resellerInfo['reseller_id'] . "' and cd.userId='{$userId}'"; $result = mysql_query($sql) or dieLog($sql); $companyInfo = mysql_fetch_assoc($result); beginTable(); ?> <table width="100%" border="1" cellspacing="2" cellpadding="2"> <tr> <th scope="col"><font size="-1">Rates for <?php echo $companyInfo['companyname']; ?> </font></th> <th scope="col"><font size="-1"> <?php echo $_SESSION['gw_title']; ?> </font></th>
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}"); } }
$stats_list[4]['to'] = $_REQUEST['opt_to_year'] . "-" . $_REQUEST['opt_to_month'] . "-" . $_REQUEST['opt_to_day'] . " 23:59:59"; $stats_list[4]['title'] = $stats_list[4]['from'] . " to " . $stats_list[4]['to']; if ($_REQUEST['opt_from_full']) { $stats_list[4]['from'] = $_REQUEST['opt_from_full']; } if ($_REQUEST['opt_to_full']) { $stats_list[4]['to'] = $_REQUEST['opt_to_full']; } $compSQL = ""; $compID = $sessionlogin; if (!$compID) { $compID = -1; } $compSQL = "AND `userId` = '{$compID}' "; $qry_details = "SELECT * FROM `cs_companydetails` WHERE `userId` = '{$compID}'"; $rst_details = sql_query_read($qry_details) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>Cannot execute query"); $companyInfo = mysql_fetch_assoc($rst_details); $forcomp = ""; if ($companyInfo['companyname']) { $forcomp = " for " . $companyInfo['companyname']; } beginTable(); ?> <form action="" method="POST" name="FrmMerchant" > <?php foreach ($_REQUEST as $name => $value) { echo "<input type=\"hidden\" name=\"{$name}\" value=\"{$value}\">"; }
$report_proj = $report->report_proj; $report_calc = $report->report_calc; /* $report->array_print($report_date); $report->array_print($report_proj); $report->array_print($report_calc); */ $frm_report_name = isset($report_cust['name']) ? $report_cust['name'] : ""; $frm_selected_report = $_POST['frm_selected_report']; beginTable(); ?> <select name='frm_selected_report'> <option value="">New Custom Report</option> <?php $sql = "SELECT rr_report_name FROM cs_risk_report ORDER BY LOWER(rr_report_name)"; $res = sql_query_read($sql) or dieLog(mysql_error()); while ($r = mysql_fetch_assoc($res)) { $selected = strcasecmp($r['rr_report_name'], $frm_selected_report) == 0 ? "selected" : ""; echo "<option {$selected} value='" . $r['rr_report_name'] . "'>" . $r['rr_report_name'] . "</option>"; } ?> </select> <input type="submit" value="Open"/> <?php endTable("Select Custom Report", "risk_custom.php", NULL, NULL, FALSE); beginTable(); echo "<b>Report Name: </b><input name='frm_report_name' type='text' size=30/ value='{$frm_report_name}'><br>"; ?> <script> <!-- Original: CodeLifter.com (support@codelifter.com) --> <!-- Web Site: http://www.codelifter.com -->
addListEmail($companyInfo['reseller_email'], "Company Email is Unsubscribed", $companyInfo['reseller_id'], 'reseller', 'unsubscribe'); } die; $sql = "SELECT * FROM `cs_transactiondetails` WHERE 1"; $result = mysql_query($sql) or dieLog(mysql_error()); while ($transInfo = mysql_fetch_assoc($result)) { die; $P3 = ""; parse_str(trim($transInfo['td_process_result'])); if (!$P3) { $response['td_gcard'] = "NULL"; } else { $response['td_gcard'] = "'" . etelEnc($P3) . "'"; } $sql = "UPDATE `cs_transactiondetails` set td_gcard=" . $response['td_gcard'] . " WHERE transactionId=" . $transInfo['transactionId']; mysql_query($sql) or dieLog(mysql_error()); } /* $sql = "SELECT userId, volumenumber, volume_last_month, volume_prev_30days, volume_prev_60days, forecast_volume_1month,
<?php //******************************************************************// // This file was created/modified by Ari Asulin. // // // //******************************************************************// //include 'includes/sessioncheckuser.php'; require_once "includes/dbconnection.php"; include 'includes/integration.php'; $qrt_insert_details = "select * from `cs_transactiondetails` LIMIT 1"; $result = mysql_query($qrt_insert_details) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>"); $cc = mysql_fetch_assoc($result); foreach ($cc as $c => $k) { echo "\$" . "transInfo['" . $c . "']='';\n"; } die; $cc['userId'] = 350; $cc['name'] = "Name"; $cc['surname'] = "Last Name"; $cc['address'] = "Address"; $cc['city'] = "City"; $cc['state'] = "State"; $cc['zipcode'] = "ZipCode"; $cc['country'] = "Country"; $cc['email'] = "Email"; $cc['amount'] = "123"; $cc['ipaddress'] = "192.168.1.1"; $cc['productdescription'] = "Product Description"; $cc['transaction_tracking_id'] = "456123"; $cc['CCnumber'] = "1234567812345678"; $cc['cvv'] = "123";
function genMerchantContract($userId) { dieLog("genMerchantContract Depreciated"); }
function genCompanyViewTable($redirectOne, $redirectAll, $mode = 'minimal', $submittable = true) { global $etel_completion_array; global $adminInfo; global $adminConfig; global $etel_gw_list; global $bank_sql_limit; global $etel_domain_path; require_once "completion.php"; if ($adminInfo['li_user_view'] == 'hide' && $adminConfig['vList']) { $uview_sql = " AND userId not in (" . implode(",", $adminConfig['vList']) . ")"; } if ($adminInfo['li_user_view'] == 'show' && $adminConfig['vList']) { $uview_sql = " AND userId in (" . implode(",", $adminConfig['vList']) . ")"; } $etel_completion_array[-1]['txt'] = "Old Company [No Status]"; if (!$redirectOne) { $redirectOne = basename($_SERVER['PHP_SELF']); } if (!$redirectAll) { $redirectAll = basename($_SERVER['PHP_SELF']); } $ignore = "cd_ignore=0 "; if ($_GET['showall']) { $ignore = "1"; } if (!$_REQUEST['cp']) { $_REQUEST['cp'] = ''; } ob_start(); ?> <script language="JavaScript"> var company = new Array(); var cs_URL = new Array(); function selectCompany(obj) { obj_element = $('companyname'); obj_element.value = obj.value; } function Displaycompany(){ $('companyname').selectedIndex = 0; $('activename').selectedIndex = 0; $('nonactivename').selectedIndex = 0; } function viewCompany(obj) { var liststr = ""; var curval = ''; var curUserId = 0; var length = $('companyname').length; if($('companyname').value=="") { //alert("Please select the company."); return 0; } for(i=0;i<length;i++) { if($('companyname').value == 'AL' || $('companyname').options[i].selected) { curUserId = $('companyname').options[i].value; if (curUserId == 'A') {curVal='A'; break;} if (!window.redirectTo) { if(curUserId!='AL') { if(!liststr) liststr=curUserId; else liststr += '|'+curUserId; } } else userId[curval] = curUserId; curval++; } } if($('companyname').value == 'A') curval='A'; if($('companyname').value == 'AL') curval='AL'; if (window.redirectTo) redirectTo(userId); if(curval==1) obj.form.action='<?php echo $redirectOne; ?> '; else obj.form.action='<?php echo $redirectAll; ?> '; $('cd_view').value = curval; $('companyname').value = ''; $('batchfield').value = ''; func_remove_all(); $('userIdList').value = liststr; obj.form.submit(); } function cropRemove(crop) { var liststr = ""; var curval = 0; var curUserId = 0; var length = $('companyname').length; if($('companyname').value=="") { //alert("Please select the company."); return 0; } for(i=length-1;i>=0;i--) { var doCrop = false; doCrop = ($('companyname').options[i].selected != crop); if(doCrop) { $('companyname').options[i] = null; } } } function Displaycompanytype() { $('trans_type').value="Submit"; //document.dates.action = "viewCompany.php"; //document.dates.submit(); } function func_fillcompanyname_response(response) { $('query_time').innerHTML = "Updating List..."; //alert(JSON); var data = JSON.parse(response.responseText); if(data['func'] != "getCompanyInfo") { $('query_time').innerHTML = "Error Querying Database. Your session may have expired. Please log in again."; return 0; } obj_element = $('companyname'); cs_URL_select = $('cs_URL'); obj_element.options.length=0; if(data['show_option_all']) { obj_element.options.length=obj_element.options.length+1; obj_element.options[obj_element.options.length-1].value="A"; obj_element.options[obj_element.options.length-1].text="All Companies"; obj_element.options[0].selected=true; } else { obj_element.options.length=obj_element.options.length+1; obj_element.options[obj_element.options.length-1].value="AL"; obj_element.options[obj_element.options.length-1].text="All Companies In List"; obj_element.options[0].selected=true; } var cp_ar = data['completion']; if(data['company_list']) { var len =data['company_list'].length; for (var i = 0;i<len;i++) { if(data['company_list'][i]['ui']) { obj_element.options.length=obj_element.options.length+1; obj_element.options[obj_element.options.length-1].value=data['company_list'][i]['ui']; obj_element.options[obj_element.options.length-1].text=data['company_list'][i]['cn']; if(cp_ar[data['company_list'][i]['cp']]) { if(cp_ar[data['company_list'][i]['cp']]['txt']) obj_element.options[obj_element.options.length-1].title=cp_ar[data['company_list'][i]['cp']]['txt']; if(cp_ar[data['company_list'][i]['cp']]['style']) obj_element.options[obj_element.options.length-1].style.fontWeight=(cp_ar[data['company_list'][i]['cp']]['style']?"bold":""); } } } } cs_URL_select.options.length=0; for (var ci in data['site_list']) { if(data['site_list'][ci]['ci']) { cs_URL_select.options.length=cs_URL_select.options.length+1; cs_URL_select.options[cs_URL_select.options.length-1].value=data['site_list'][ci]['cui']; cs_URL_select.options[cs_URL_select.options.length-1].text=data['site_list'][ci]['cn']; } } $('query_time').innerHTML = "("+data['num_rows']+") Results<BR> in ("+(Math.round(data['duration']*100)/100)+") seconds." updateList(false); } var refresh_timeout = null; function func_fillcompanyname(initialDisplay) { clearInterval(refresh_timeout); refresh_timeout = setTimeout('func_fillcompanyname_sub("'+initialDisplay+'")',500); } function func_fillcompanyname_sub(initialDisplay) { var searchv = $F('search'); var searchby = $F('searchby'); var limit_to = $F('limit_to'); var tt = $F('tt'); var cp = $F('cp'); var gi = $F('gi'); var bi = $F('bi'); var ig = ($('ig').checked==true?1:0); var jl = ($('jl').checked==true?24:0); var url = '<?php echo $etel_domain_path; ?> /admin/admin_JOSN.php'; var pars = 'func=getCompanyInfo&search='+searchv+'&searchby='+searchby+'&tt='+tt+'&cp='+cp+'&bi='+bi+'&limit_to='+limit_to+'&gi='+gi+'&ig='+ig+'&jl='+jl; //document.location.href=url+'?'+pars; //alert(url+'?'+pars); var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: func_fillcompanyname_response }); $('query_time').innerHTML = "Querying Database..."; } function func_remove_all() { obj_element = $('companyname'); obj_element.options.length=0; cs_URL_select = $('cs_URL'); cs_URL_select.options.length=0; } function updateBatch(obj) { var str = ""; if(obj.value != 'A') { for(var i = 0; i<obj.options.length;i++) { if(obj.options[i].selected) { if(str) str+=", "; str += obj.options[i].value; } } } $('batchfield').value = str; } function updateList(alert_result) { obj = $('batchfield'); re = /[^\d]+/; var list = obj.value.split(re); var total = 0; var clist = $('companyname'); if(clist.options.length<2 && 0) func_fillcompanyname(); for(i=0;i<clist.length;i++) { clist[i].selected = false; for(j=0;j<list.length;j++) { if(clist[i].value==list[j]) { total++; clist[i].selected = true; } } } if(total>1 && alert_result) alert(total+" Companys Selected."); if(total==0) clist[0].selected = true; } function togglebatch() { if($('batchfieldtd').style.display == 'none') $('batchfieldtd').style.display = 'table-row'; else $('batchfieldtd').style.display = 'none' } </script> <table border="0" align="center" cellpadding="0" cellspacing="0" width="100%" height="100"> <tr> <td width="50%" valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0"> <tr > <td width="50%" height="25" align="right" valign="middle"><font face="verdana" size="1"> Type </font> </td> <td height="25"><select name="tt" id="tt" style="font-family:verdana;font-size:10px;width: 160px" onChange="func_fillcompanyname();"> <option value="">All Merchant Types</option> <?php echo func_fill_combo_conditionally("select `transaction_type`, CONCAT(`transaction_type`,' (',count(userId),')') as out from cs_companydetails where {$ignore} {$bank_sql_limit} {$uview_sql} GROUP BY `transaction_type`", $_REQUEST['tt'], $cnn_cs); ?> </select> </td> </tr> <tr> <td height="25" align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Status </font> </td> <td height="25"><select name="cp" id="cp" style="font-family:verdana;font-size:10px;width: 160px" onChange="func_fillcompanyname();"> <option value="" >Any Status</option> <?php $sql = "select `cd_completion`, count(*) as cnt from cs_companydetails where {$ignore} {$bank_sql_limit} {$uview_sql} GROUP BY `cd_completion` ORDER BY `cd_completion` DESC"; $result = mysql_query($sql) or dieLog(mysql_error()); while ($cpl = mysql_fetch_assoc($result)) { $key = $cpl['cd_completion']; $data = $etel_completion_array[intval($key)]; if (!$data) { $data = array('txt' => 'Invalid Status'); } echo "<option value='{$key}' style='" . $data['style'] . "' " . ($_REQUEST['cp'] == $key ? "selected" : "") . ">" . $data['txt'] . " (" . $cpl['cnt'] . ")</option>\n"; } ?> </select></td> </tr> <tr style="visibility:<?php echo $mode == 'full' ? "visible" : "hidden"; ?> ;"> <td height="25" align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Bank </font> </td> <td height="25"><select name="bi" id="bi" style="font-family:verdana;font-size:10px;width: 160px" onChange="func_fillcompanyname();"> <option value="" >Any Bank</option> <?php if ($mode == 'full') { func_fill_combo_conditionally("select bank_id, bank_name from cs_bank ORDER BY `bank_id` ASC ", $_REQUEST['bi'], $cnn_cs); } ?> </select></td> </tr> <tr align="left" style="visibility:<?php echo $mode == 'full' ? "visible" : "hidden"; ?> ;"> <td height="25" align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Gateway </font> </td> <td height="25"> <select name='gi' id='gi' style="font-family:verdana;font-size:10px;width: 160px" onChange="func_fillcompanyname();"> <option value="">Any Gateway</option> <?php if ($mode == 'full') { func_fill_combo_conditionally("select gateway_id, concat(gw_title,' - (',count(*),')') from cs_companydetails left join etel_gateways on gw_id = gateway_id where {$ignore} {$bank_sql_limit} {$uview_sql} and gw_database = '" . $_SESSION['gw_database'] . "' GROUP BY `gateway_id` ", $_REQUEST['gi'], $cnn_cs); } ?> </select> </td> </tr> <tr align="left"> <td height="25" align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <input id="ig" name="ig" type="checkbox" value="1" <?php echo $_REQUEST['ig'] ? "checked" : ""; ?> onChange="func_fillcompanyname();"> </font></td> <td height="25"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> Show Ignored Companys</font></td> </tr> <tr align="left" style="visibility:<?php echo $mode == 'full' ? "visible" : "hidden"; ?> ;"> <td height="25" align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <input id="jl" name="jl" type="checkbox" value="1" <?php echo $_REQUEST['jl'] ? "checked" : ""; ?> onChange="func_fillcompanyname();" <?php echo $_REQUEST['jl'] ? "checked" : ""; ?> > </font> </td> <td height="25"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Company Joined in last 24 hours. </font></td> </tr> <tr align="left" style="visibility:<?php echo $mode == 'full' ? "visible" : "hidden"; ?> ;"> <td height="25" align="right"> </td> <td height="25"><font face="verdana" size="1"><a href="javascript:togglebatch()" >Show Batch Companys</a></font></td> </tr> </table> <font face="verdana" size="1"><a href="javascript:togglebatch()" ></a></font> </td> <td width="50%" valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0" width="100%" height="204"> <tr> <td valign="middle" align="right" width="40%"><font face="verdana" size="1">Search With: </font> </td> <td width="60%"><input value="<?php echo $_REQUEST['search']; ?> " type="text" name="search" id="search" size="10" style="font-family:verdana;font-size:10px;width: 160px" onKeyUp="func_fillcompanyname();" > </td> </tr> <tr> <td height="41" valign="middle" align="right" width="40%"><font face="verdana" size="1">Search By: </font> </td> <td width="60%"><select name="searchby" id="searchby" style="font-family:verdana;font-size:10px;width: 160px" onChange="func_fillcompanyname();"> <option value="ca">Any Field</option> <optgroup label="Company Data" > <option value="cn">Merchant Name</option> <option value="ri">Reference ID</option> <option value="id">Merchant ID (CSV List)</option> <option value="mn">Merchant Notes </option> <option value="un">Login UserName</option> <option value="em">Contact Email</option> <option value="bn">Beneficiary Name</option> <option value="an">Account Number</option> <option value="st">Active Status (Yes or No)</option> <option value="ps">Payable Status (Yes or No)</option> <option value="lp">Processed in Last # Days</option> </optgroup> <optgroup label="Website Data"> <option value="wn">Website Name</option> <option value="wr">Website Reference ID</option> <option value="ws">Website Status</option> </optgroup> </select> <script> $('searchby').value = '<?php echo $_REQUEST['searchby'] ? $_REQUEST['searchby'] : 'ca'; ?> '; </script> </td> </tr> <tr> <td valign="middle" align="right" width="40%"><font face="verdana" size="1">Website: </font> </td> <td width="60%"><select name="cs_URL" id="cs_URL" style="font-family:verdana;font-size:10px;width: 160px" onChange="selectCompany(this)" onBlur="selectCompany(this)" onFocus="selectCompany(this)"> </select> </td> </tr> <tr> <td height="30" valign="top" align="right"><p><font face="verdana" size="1">Select Company: </font></p> <p> <input name="" type="button" id="Crop" value="Crop to Selected" style="font-family:verdana;font-size:10px;" onClick="cropRemove(true);"> <br> <input name="" type="button" id="Crop" value="Remove Selected" style="font-family:verdana;font-size:10px;" onClick="cropRemove(false);"> <br> <font face="verdana" size="1">Limit Result:</font><input name="limit_to" type="text" id="limit_to" style="font-family:verdana;font-size:10px;" value="300" size="6" maxlength="4" onKeyUp="func_fillcompanyname();"> <br /> <font face="verdana" size="1"><label id="query_time"></label> </font> </p></td> <td><select name="companyname[]" size="10" multiple id="companyname" style="font-family:verdana;font-size:10px;width: 160px" onChange="updateBatch(this)"> <option value="A" selected>All Companys</option> </select> </td> </tr> </table></td> </tr> <tr id="batchfieldtd" style="display:none"> <td align="left" colspan="2"><textarea name="batchfield" rows="1" wrap="virtual" id="batchfield" style="font-family:verdana;font-size:8px;WIDTH: 550px" onmouseover="this.rows=this.value.length/145+1" onmouseout="this.rows=1" onchange="updateList(true)"><?php echo quote_smart($_REQUEST['batchfield']); ?> </textarea> </tr> <?php if ($submittable) { ?> <tr> <td align="center" colspan="2"> <input type="button" id="viewcompany" src="../images/view.jpg" value="View" onClick="viewCompany(this)"> </tr> <?php } ?> </table> <input type="hidden" value="" id="cd_view" name="cd_view"> <input type="hidden" value="" id="userIdList" name="userIdList"> <script language="javascript"> <!-- func_fillcompanyname(1); --> </script> <?php $form_html = ob_get_clean(); return $form_html; }
$balance = $invoiceInfo['bi_balance'] + 1; // +1 for wireFee $paymentMethod = 5; if ($payout) { $payout .= "\n"; } $payout .= genInvoice(&$invoiceInfo); } } } if ($mi_ID) { $mi_ID_list = explode("|", $mi_ID); foreach ($mi_ID_list as $mi_ID) { $mi_wire_type = 'non-us'; $sql = "SELECT * FROM `cs_merchant_invoice_banksub` as mib \n\t\tleft join cs_bank as bk on bk.bank_id=mib.mib_bank_id\n\t\tleft join cs_merchant_invoice as mi on mi.mi_ID=mib.mib_mi_ID\n\t\tleft join `cs_companydetails` as cs on cs.userId=mib.mib_company_id WHERE `mi_ID` = '{$mi_ID}'"; $inv_details = mysql_query($sql, $cnn_cs) or dieLog(" Cannot execute query. {$sql} Error:" . mysql_error()); if (!mysql_num_rows($inv_details)) { continue; } while ($invoiceInfo = mysql_fetch_assoc($inv_details)) { if ($invoiceInfo['bank_country'] == 'US' || $invoiceInfo['bank_country'] == 'United States') { $mib_wire_type = 'us'; } $thisdate_id = date("Ymd", strtotime($invoiceInfo['mi_paydate'])); $payID = $invoiceInfo['userId'] . "_" . $thisdate_id; $wireFee = $invoiceInfo['bk_fee_us_wire']; if ($invoiceInfo['mib_wire_type'] == 'non-us') { $wireFee = $invoiceInfo['bk_fee_nonus_wire']; } $balance = $invoiceInfo['mib_balance']; //+$wireFee;
$td_tracking_ship_date = date("Y-m-d g:i:s", $ship_timestamp); } if ($ship_est_timestamp > 0) { $td_tracking_ship_est = date("Y-m-d g:i:s", $ship_est_timestamp); } $sql = "update `cs_transactiondetails` set `td_tracking_ship_est` = '{$td_tracking_ship_est}', `td_tracking_ship_date` = '{$td_tracking_ship_date}', `td_tracking_id` = '{$td_tracking_id}', `td_tracking_link` = '{$td_tracking_link}', `td_tracking_company` = '{$td_tracking_company}', td_tracking_info = '{$td_tracking_info}' where transactionId = '{$transactionId}'"; if (($ship_timestamp < time() - 60 * 60 * 24 * 365 || $ship_timestamp > time() + 60 * 60 * 24 * 365) && $ship_timestamp > 0) { $log .= "Invalid Ship Date: {$td_tracking_ship_date} {$ship_timestamp}. Please format YYYY-MM-DD HH:MM:SS.\n"; $failed++; } else { if (($ship_est_timestamp < time() - 60 * 60 * 24 * 365 || $ship_est_timestamp > time() + 60 * 60 * 24 * 365) && $ship_est_timestamp > 0) { $log .= "Invalid Estimation Date: {$td_tracking_ship_est} {$ship_est_timestamp}. Please format YYYY-MM-DD HH:MM:SS.\n"; $failed++; } else { if (!$transactionInfo['td_tracking_id']) { $result = mysql_query($sql, $cnn_cs) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>Cannot update transaction."); $transactionInfo['td_tracking_id'] = $td_tracking_id; $transactionInfo['td_tracking_link'] = $td_tracking_link; $transactionInfo['td_tracking_company'] = $td_tracking_company; $transactionInfo['td_tracking_ship_date'] = $td_tracking_ship_date; $transactionInfo['td_tracking_ship_est'] = $td_tracking_ship_est; // Email if ($td_tracking_id || $td_tracking_ship_date) { $useEmailTemplate = "customer_tracking_confirmation"; $data['site_URL'] = $transactionInfo['cs_URL']; $data['reference_number'] = $transactionInfo['reference_number']; $data['full_name'] = $transactionInfo['surname'] . ", " . $transactionInfo['name']; $data['email'] = $transactionInfo['email']; $data['tracking_ID'] = $transactionInfo['td_tracking_id']; $data['tracking_link'] = $transactionInfo['td_tracking_link']; $data['tracking_info'] = $transactionInfo['td_tracking_info'] ? $transactionInfo['td_tracking_info'] : "None";
function etel_get_clicker_ID(&$data) { $sql_select = " select tk_ID,tk_ref from cs_tracking_clicker "; if ($data['Clicker_Ref']) { $sql .= "{$sql_select} where tk_ref = '" . quote_smart($data['Clicker_Ref']) . "' \n\t\tUNION\n\t\t"; } $sql .= "{$sql_select} where tk_host = '" . quote_smart($data['host_name']) . "'\n\t\tUNION\n\t\t{$sql_select} where tk_IP = INET_ATON( '" . $data['ip_address'] . "' ) "; $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}"); if (mysql_num_rows($result)) { $clicker = mysql_fetch_assoc($result); $data['tc_clicker_ID'] = $clicker['tk_ID']; $data['Clicker_Ref'] = $clicker['tk_ref']; return $clicker['tk_ID']; } $new_tk_ref = substr(md5(serialize($data)), 0, 32); $sql = "INSERT INTO cs_tracking_clicker set \n\t\ttk_IP = INET_ATON( '" . $data['ip_address'] . "' ),\n\t\ttk_host = '" . quote_smart($data['host_name']) . "', \n\t\ttk_ref = '{$new_tk_ref}' \n\t"; $result = sql_query_write($sql) or dieLog(mysql_error() . " ~ {$sql}"); $data['tc_clicker_ID'] = mysql_insert_id(); $data['Clicker_Ref'] = $new_tk_ref; return $data['tc_clicker_ID']; }
if ($company_id == "") { $company_id = isset($HTTP_POST_VARS['userid']) ? quote_smart($HTTP_POST_VARS['userid']) : ""; } if ($company_id == "") { $company_id = isset($_REQUEST['userIdList']) ? quote_smart($_REQUEST['userIdList']) : ""; } if ($company_id == "") { $company_id = isset($HTTP_GET_VARS['companyname']) ? quote_smart($HTTP_GET_VARS['companyname']) : ""; } $companyname = isset($HTTP_GET_VARS['companyname']) ? $HTTP_GET_VARS['companyname'] : ""; $companytype = isset($HTTP_GET_VARS['companymode']) ? $HTTP_GET_VARS['companymode'] : ""; $companytrans_type = isset($HTTP_GET_VARS['companytrans_type']) ? quote_smart($HTTP_GET_VARS['companytrans_type']) : ""; $script_display = ""; $qry_select_companies = "select * from cs_companydetails where userid='{$company_id}' {$bank_sql_limit}"; if ($qry_select_companies != "") { $show_sql = sql_query_read($qry_select_companies) or dieLog(mysql_error() . " ~ {$qry_select_companies}"); } if ($companyInfo = mysql_fetch_array($show_sql)) { if ($companyInfo[7] == "") { $state = str_replace("\n", ",\t", $companyInfo[12]); } else { $state = str_replace("\n", ",\t", $companyInfo[7]); } if ($companyInfo[27] == "tele") { $script_display = "yes"; $sendecommerce_diplay = "none"; } else { $script_display = "none"; $sendecommerce_diplay = "yes"; } if ($companyInfo[84] == 1) {
function step_3($en_ID, $skipIfComplete = true) { // Step 3 $access['SerializedData']['Source'] = 'en_info'; $access['SerializedData']['Data'] = array('Service_List' => array('Processing_Info', 'Service_List'), 'Anti_Fraud_System' => array('Processing_Info', 'Anti_Fraud_System'), 'CS_Program' => array('Processing_Info', 'CS_Program'), 'Refund_Policy' => array('Processing_Info', 'Refund_Policy'), 'Volume_Last_month' => array('Processing_Info', 'Volume_Last_month'), 'Volume_Prev_30Days' => array('Processing_Info', 'Volume_Prev_30Days'), 'Volume_Prev_60Days' => array('Processing_Info', 'Volume_Prev_60Days'), 'Volume_Forcast_1Month' => array('Processing_Info', 'Volume_Forcast_1Month'), 'Volume_Forcast_2Month' => array('Processing_Info', 'Volume_Forcast_2Month'), 'Volume_Forcast_3Month' => array('Processing_Info', 'Volume_Forcast_3Month'), 'Projected_Monthly_Sales' => array('Processing_Info', 'Projected_Monthly_Sales'), 'Chargeback_%' => array('Processing_Info', 'Chargeback_%'), 'Average_Ticket_Price' => array('Processing_Info', 'Average_Ticket_Price'), 'Previous_Processor_Trans_Fee' => array('Processing_Info', 'Previous_Processor_Trans_Fee'), 'Previous_Processor_Disc_Fee' => array('Processing_Info', 'Previous_Processor_Disc_Fee'), 'Previous_Processing' => array('Processing_Info', 'Previous_Processing'), 'Previous_Processor_Reason' => array('Processing_Info', 'Previous_Processor_Reason'), 'Recur_Billing' => array('Processing_Info', 'Recur_Billing'), 'Currently_Processing' => array('Processing_Info', 'Currently_Processing')); $access = getAccessInfo("\r\n\t\r\n\tuserId,\r\n\ten_ID,\r\n\ten_info,\r\n\t\r\n\t'Processing Info' as access_header,\r\n\t'' as Service_List,'' as Anti_Fraud_System,'' as CS_Program,'' as Refund_Policy,\r\n\t'' as Volume_Last_month, '' as Volume_Prev_30Days, '' as Volume_Prev_60Days,\r\n\t'' as Volume_Forcast_1Month, '' as Volume_Forcast_2Month, '' as Volume_Forcast_3Month, '' as Projected_Monthly_Sales, '' as Average_Ticket_Price, '' as 'Chargeback_%',\r\n\t'' as Previous_Processor_Trans_Fee, '' as Previous_Processor_Disc_Fee, '' as Previous_Processing, '' as Previous_Processor_Reason, '' as Recur_Billing, '' as Currently_Processing\r\n\t\r\n\t\r\n\t", "cs_entities left join cs_companydetails on en_type='merchant' and en_type_ID = userId", "en_ID = '{$en_ID}'", array('Size' => 30, 'Rows' => 2, 'HideIfEmpty' => true, 'Valid' => 'req'), $access); if ($access == -1) { dieLog("Invalid Company", "Invalid Company"); } $access['Data']['userId']['Input'] = "hidden"; $access['Data']['userId']['disable'] = 1; $access['Data']['en_ID']['Input'] = "hidden"; $access['Data']['en_ID']['disable'] = 1; $access['Data']['Service_List']['Input'] = 'textarea'; $access['Data']['Anti_Fraud_System']['Input'] = 'textarea'; $access['Data']['CS_Program']['Input'] = 'textarea'; $access['Data']['Refund_Policy']['Input'] = 'textarea'; $access['Data']['Previous_Processor_Trans_Fee']['DisplayName'] = 'Previous Processor Transaction Fee'; $access['Data']['Previous_Processor_Disc_Fee']['DisplayName'] = 'Previous Processor Discount Rate'; $access['Data']['Volume_Last_month']['Input'] = "selectvolume"; $access['Data']['Volume_Last_month']['DisplayName'] = "Last Month's Volume"; $access['Data']['Volume_Prev_30Days']['Input'] = "selectvolume"; $access['Data']['Volume_Prev_30Days']['DisplayName'] = "Volume 2 Months Ago"; $access['Data']['Volume_Prev_60Days']['Input'] = "selectvolume"; $access['Data']['Volume_Prev_60Days']['DisplayName'] = "Volume 3 Months Ago"; $access['Data']['Volume_Forcast_1Month']['Input'] = "selectvolume"; $access['Data']['Volume_Forcast_1Month']['DisplayName'] = "Forcast Volume This Month"; $access['Data']['Volume_Forcast_2Month']['Input'] = "selectvolume"; $access['Data']['Volume_Forcast_2Month']['DisplayName'] = "Forcast Volume Next Month"; $access['Data']['Volume_Forcast_3Month']['Input'] = "selectvolume"; $access['Data']['Volume_Forcast_3Month']['DisplayName'] = "Forcast Volume in two Months"; $access['Data']['Projected_Monthly_Sales']['Input'] = "selectvolume"; $access['Data']['Projected_Monthly_Sales']['DisplayName'] = "Projected Monthly Sales Volume"; $access['Data']['Previous_Processor_Trans_Fee']['DisplayName'] = "Previous Processing"; $access['Data']['Previous_Processing']['DisplayName'] = "Previous Processor"; $access['Data']['Previous_Processor_Reason']['DisplayName'] = "Reason for Leaving Previous Processor"; $access['Data']['Previous_Processor_Reason']['Valid'] = ''; $access['Data']['Recur_Billing']['DisplayName'] = "Recuring Billing"; $access['Data']['Currently_Processing']['DisplayName'] = "Currently Processing"; $access['Data']['Average_Ticket_Price']['DisplayName'] = "Average Ticket Price"; $access['Data']['Chargeback_%']['DisplayName'] = "Chargeback %"; $access['Data']['Service_List']['DisplayName'] = "Please List Your Products and Services"; $access['Data']['Anti_Fraud_System']['DisplayName'] = "Describe your Current Anti Fraud System"; $access['Data']['CS_Program']['DisplayName'] = "Describe your Customer Service Program"; $access['Data']['Refund_Policy']['DisplayName'] = "Describe your Refund Policy"; $access['SubmitValue'] = 'Update Information'; if ($skipIfComplete) { $access['SubmitValue'] = 'Complete Merchant Application'; } $access['SubmitName'] = 'submit_step3'; // Submit $showvalidation = false; if ($_POST[$access['SubmitName']]) { $result = processAccessForm(&$access); $showvalidation = true; } $access['Columns'] = 1; // Validate $valid = true; foreach ($access['Data'] as $key => $data) { if (!$data['Value'] && $data['Valid']) { $valid = false; if ($showvalidation) { $access['Data'][$key]['Highlight'] = true; } } } if (!$valid || !$skipIfComplete) { draw_step_buttons(3, $skipIfComplete); $access['HeaderMessage'] = "Please Complete all required fields to continue."; beginTable(); writeAccessForm(&$access); endTable("Step #3 - Processing Information", ""); include "includes/footer.php"; die; } }
$enddate = $rst_invoicedates[1]; $userid = $rst_invoicedates[2]; $checkorcard = $rst_invoicedates[3]; $approvedstatusdate = $rst_invoicedates[4]; $invoicenetamount = $rst_invoicedates[5]; $cancelstartdate = $rst_invoicedates[6]; $cancelenddate = $rst_invoicedates[7]; $bankid = $rst_invoicedates[8]; //procedure to regenerate the invoice $str_startdate = $startdate . " 00:00:00"; $str_afterdate = $enddate . " 23:59:59"; $qry_transdetails = "SELECT checkorcard, STATUS , cancelstatus, companyname, r_chargeback ,r_credit , r_discountrate , r_transactionfee ,r_reserve , accounttype, cardtype,reason,passstatus,amount,voiceauthfee,gateway_id,reseller_id,admin_approval_for_cancellation,currencytype FROM cs_transactiondetails, cs_companydetails WHERE "; $qry_transdetails .= " cs_transactiondetails.userid ={$userid} and cs_companydetails.userid={$userid} and transactionDate >= '{$str_startdate}' and transactionDate <= '{$str_afterdate}' and cancelstatus='N' and checkorcard='H' and bank_id={$bankid} Order by cs_transactiondetails.userid "; //echo $qry_transdetails; if (!($show_transdetails = mysql_query($qry_transdetails, $cnn_cs))) { dieLog(mysql_errno() . ": " . mysql_error() . "<BR>"); } else { //modified procedure $wirefee = 0; $i_discount_rate = 0; $strReturn = ""; $pending = 0; $pendingAmt = 0; $pendingPer = 0; $approved = 0; $approvedAmt = 0; $approvedPer = 0; $declined = 0; $declinedAmt = 0; $declinedPer = 0; $canceled = 0;
function getTransactionInfo($id, $test = false, $by = 'transactionId', $where_sql = "") { global $cnn_cs; $trans_table_name = "cs_transactiondetails"; if ($test) { $trans_table_name = "cs_test_transactiondetails"; } $sql = "\n\t\t\tSELECT \n\t\t\t\tt.*, DATE_FORMAT(t.transactionDate,'%M %D %Y at %r') as transaction_date_formatted,\n\t\t\t\tsub.*,\n\t\t\t\t\tc.contact_email,\n\t\t\t\t\tc.customer_service_phone,\n\t\t\t\t\tc.cc_billingdescriptor,\n\t\t\t\t\tc.ch_billingdescriptor,\n\t\t\t\t\tc.cc_visa_billingdescriptor,\n\t\t\t\t\tc.cc_master_billingdescriptor,\n\t\t\t\t\tc.we_billingdescriptor, \n\t\t\t\t\tc.cd_recieve_order_confirmations,\n\t\t\t\t\tc.we_billingdescriptor,\n\t\t\t\t\tc.companyname, \n\t\t\t\t\tc.cd_tracking_init_response, \n\t\t\t\t\tc.cd_enable_tracking, \n\t\t\t\t\tc.gateway_id, \n\t\t\t\t\tc.bank_Creditcard,\n\t\t\t\t\ts.*, \n\t\t\t\t\t(r.note_id is not null) as hasRefundRequest,\n\t\t\t\t\t r.call_date_time, \n\t\t\t\t\t r.service_notes \n\t\t\tFROM \n\t\t\t\t{$trans_table_name} as t\n\t\t\tLEFT JOIN `cs_subscription` as sub ON sub.`ss_ID` = t.`td_ss_ID`\n\t\t\tLEFT JOIN `cs_companydetails` as c ON c.`userId` = t.`userId`\n\t\t\tLEFT JOIN `cs_company_sites` as s ON `cs_ID` = `td_site_ID`\n\t\t\tleft join cs_callnotes as r on r.`transaction_id`=t.`transactionId` AND r.cn_type = 'refundrequest' \n\t\t\tWHERE \n\t\t\t\t`{$by}` = '{$id}' \n\t\t\t\t{$where_sql}\n\t\t\t\t"; $result = sql_query_read($sql, $cnn_cs) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>{$sql}<BR>"); if (mysql_num_rows($result) <= 0) { return -1; } $transactionInfo = mysql_fetch_assoc($result); $transactionInfo['CCnumber'] = etelDec($transactionInfo['CCnumber']); $transactionInfo['bankaccountnumber'] = etelDec($transactionInfo['bankaccountnumber']); $transactionInfo['bankaccountnumber'] = "XXXXXX" . substr($transactionInfo['bankaccountnumber'], -4, 4); $transactionInfo['CCnumber_format'] = "XXXXXXXXXXXX" . substr($transactionInfo['CCnumber'], -4, 4); $time = strtotime($transactionInfo['transactionDate']); $subAcc = getRebillInfo($transactionInfo['td_rebillingID'], $time, false); $transactionInfo['userActiveCode'] = UserActivity(&$transactionInfo); $transactionInfo['userRebillCode'] = UserRebill(&$transactionInfo); //Shipping if ($transactionInfo['cd_enable_tracking'] == 'on') { $transactionInfo['Tracking_Deadline'] = $time + $transactionInfo['cd_tracking_init_response'] * 24 * 60 * 60; $transactionInfo['Tracking_Days_Left'] = floor(($transactionInfo['Tracking_Deadline'] - time()) / (24 * 60 * 60)); } if ($transactionInfo['userActiveCode'] == "ACT") { $transactionInfo['userActiveMsg'] = "Account is Active, "; } else { if ($transactionInfo['userActiveCode'] == "INA") { $transactionInfo['userActiveMsg'] = "Account is Inactive, "; } else { if ($transactionInfo['userActiveCode'] == "CAN") { $transactionInfo['userActiveMsg'] = "Account is Cancelled, "; } else { if ($transactionInfo['userActiveCode'] == "CHB") { $transactionInfo['userActiveMsg'] = "Account has been Charged Back, "; } } } } if ($transactionInfo['userRebillCode'] == "ACT") { $transactionInfo['userActiveMsg'] .= "Rebilling is Active."; } else { if ($transactionInfo['userRebillCode'] == "INA") { $transactionInfo['userActiveMsg'] .= "Rebilling is Inactive."; } } if ($transactionInfo['checkorcard'] == 'H') { $transactionInfo['charge_type_info'] = "Credit Card (" . $transactionInfo['cardtype'] . ")"; if ($transactionInfo['cardtype'] == "Visa") { $transactionInfo['billingdescriptor'] = $transactionInfo['cc_visa_billingdescriptor']; } if ($transactionInfo['cardtype'] == "Master") { $transactionInfo['billingdescriptor'] = $transactionInfo['cc_master_billingdescriptor']; } } if ($transactionInfo['checkorcard'] == 'C') { $transactionInfo['charge_type_info'] = "Check Account"; $transactionInfo['billingdescriptor'] = $transactionInfo['ch_billingdescriptor']; } if ($transactionInfo['checkorcard'] == 'W') { $transactionInfo['charge_type_info'] = "Web900 "; $transactionInfo['billingdescriptor'] = $transactionInfo['we_billingdescriptor']; } // Next Payment $transactionInfo['subAccountName'] = $subAcc['rd_subName']; $transactionInfo['chargeAmount'] = $subAcc['chargeAmount']; $transactionInfo['schedule'] = $subAcc['schedule']; $transactionInfo['nextDateInfo'] = $subAcc['nextDateInfo']; $transactionInfo['nextRecurDate'] = $subAcc['nextRecurDate']; if ($transactionInfo['nextRecurDate'] == -1) { $transactionInfo['nextRecurDate'] = "N/A"; } if ($transactionInfo['td_enable_rebill'] == 0) { $transactionInfo['nextRecurDate'] = "No/Canceled Subscription"; } $transactionInfo['td_recur_next_date_next'] = $subAcc['td_recur_next_date']; $transactionInfo['subAcc'] = $subAcc; $recurDate = $subAcc['nextRecurDate']; $transactionInfo['expires'] = 'N/A'; $transactionInfo['expired'] = 'N/A'; if ($transactionInfo['ss_account_status'] == 'inactive') { $transactionInfo['expired'] = "Expired on " . date("F j, Y", strtotime($transactionInfo['ss_account_expire_date'])); } else { if ($transactionInfo['ss_account_status'] == 'active') { $transactionInfo['expires'] = date("F j, Y", strtotime($transactionInfo['ss_account_expire_date'])); } } //Formatting $transactionInfo['phonenumber_format'] = formatPhone($transactionInfo['phonenumber']); $transactionInfo['fullname'] = $transactionInfo['name'] . " " . $transactionInfo['surname']; return $transactionInfo; }