<html> <head> <title>Call Back Setting</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#F2F2F2"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" height="100%"> <tr> <td align="center"> <?php $iTransactionId = isset($HTTP_GET_VARS["id"]) ? Trim($HTTP_GET_VARS["id"]) : ""; if ($iTransactionId != "") { $qryGetUser = "******" . $iTransactionId; $iUserId = funcGetValueByQuery($qryGetUser, $cnn_cs); $qryGetUserName = "******" . $iUserId; $iUserName = funcGetValueByQuery($qryGetUserName, $cnn_cs); $strCurrentDateTime = func_get_current_date_time(); $qryInsert = "insert into cs_callback (userid,transactionid,dateandtime) values ("; $qryInsert .= "'{$iUserId}','{$iTransactionId}','{$strCurrentDateTime}')"; if (!mysql_query($qryInsert)) { print "Can not execute query"; exit; } ?> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">A call back message is set for <?php echo $iUserName; ?> </font> <br><br> <input type="button" value="Close" onClick="window.close();">
$sex = $arr_qry_company['ssex']; $user_address = $arr_qry_company['saddress']; $user_zipcode = $arr_qry_company['spostcode']; $contact_email = $arr_qry_company['contact_email']; $contact_phone = $arr_qry_company['contact_phone']; $job_title = $arr_qry_company['job_title']; $user_residence_number = $arr_qry_company['sresidencetelephone']; $user_fax_number = $arr_qry_company['sfax']; $how_about_us = $arr_qry_company['how_about_us']; if ($how_about_us == "other") { $how_about_us = $arr_qry_company['reseller_other']; } else { if ($how_about_us == "rsel") { if ($arr_qry_company['reseller_id'] != "") { $show_sql = "select reseller_name from cs_resellerdetails where reseller_id = " . $arr_qry_company['reseller_id']; $how_about_us = funcGetValueByQuery($show_sql, $cnn_cs); } } } $package_name = $arr_qry_company['telepackagename']; $package_service = $arr_qry_company['telepackageprod']; $package_price = $arr_qry_company['telepackageprice']; $script_refund_policy = $arr_qry_company['telerefundpolicy']; $package_description = $arr_qry_company['teledescription']; $company_bank = $arr_qry_company['company_bank']; $other_bank = $arr_qry_company['other_company_bank']; if ($company_bank == "other") { $company_bank = $other_bank; } $beneficiary_name = $arr_qry_company['beneficiary_name']; $name_on_account = $arr_qry_company['bank_account_name'];
function funcSendMail($iCompanyId, $qryCondition, $cnn_cs, $iTemplatId) { //*********** Opening the mail template content *********** $show_sql = "select template_content from cs_mailtemplate where template_id = " . $iTemplatId; $file_content = funcGetValueByQuery($show_sql, $cnn_cs); /* if(!($file = fopen("csv/mailtemplate.htm", "r"))) { print("Can not open file"); exit(); } $content = fread($file, filesize("csv/mailtemplate.htm")); $content = explode("\r\n", $content); fclose($file); $file_content = ""; for($i=0;$i<count($content);$i++) { $file_content .= $content[$i]; } */ //************* ends here ********************************* $qry_email_template = "SELECT merchantName,tollFreeNumber,retrievalNumber,securityNumber,processor FROM cs_companydetails where userid =" . $iCompanyId; if (!($rst_email_template = mysql_query($qry_email_template, $cnn_cs))) { print "Can not execute query"; exit; } $str_merchant_name = ""; $str_toll_free_number = ""; $str_retrieval_number = ""; $str_security_number = ""; $str_processor = ""; if (mysql_num_rows($rst_email_template) > 0) { $str_merchant_name = mysql_result($rst_email_template, 0, 0); $str_toll_free_number = mysql_result($rst_email_template, 0, 1); $str_retrieval_number = mysql_result($rst_email_template, 0, 2); $str_security_number = mysql_result($rst_email_template, 0, 3); $str_processor = mysql_result($rst_email_template, 0, 4); } $file_content = str_replace("[MerchantName]", $str_merchant_name . ",", $file_content); $file_content = str_replace("[MerchantTollFreeNumber]", $str_toll_free_number, $file_content); $file_content = str_replace("[RetrievalNumber]", $str_retrieval_number, $file_content); $file_content = str_replace("[SecurityCode]", $str_security_number, $file_content); $file_content = str_replace("[Processor]", $str_processor, $file_content); $qrySelect = $qryCondition; // print($qrySelect); if (!($show_sql = mysql_query($qrySelect, $cnn_cs))) { print "<br>"; print "Can not execute select query"; print "<br>"; exit; } for ($i_loop = 0; $i_loop < mysql_num_rows($show_sql); $i_loop++) { $str_date_of_sale = mysql_result($show_sql, $i_loop, 0); $str_date_of_sale = funcFormatDate($str_date_of_sale); $str_customer_first_name = mysql_result($show_sql, $i_loop, 1); $str_customer_last_name = mysql_result($show_sql, $i_loop, 2); $str_curstomer_name = $str_customer_first_name . " " . $str_customer_last_name; $charge_type = mysql_result($show_sql, $i_loop, 3); if ($charge_type == "H") { $charge_type = "credit card"; } if ($charge_type == "C") { $charge_type = "check"; } $str_telephone = mysql_result($show_sql, $i_loop, 4); $str_charge = mysql_result($show_sql, $i_loop, 5); $str_voice_code = mysql_result($show_sql, $i_loop, 6); $str_email_content = $file_content; $str_email_content = str_replace("[Dateofsale]", $str_date_of_sale, $str_email_content); $str_email_content = str_replace("[CustomerName]", $str_curstomer_name, $str_email_content); $str_email_content = str_replace("[ChargeType]", $charge_type, $str_email_content); $str_email_content = str_replace("[CustomerTelephoneNumber]", $str_telephone, $str_email_content); $str_email_content = str_replace("[Charge]", formatMoney($str_charge), $str_email_content); $str_email_content = str_replace("[VoiceCode]", $str_voice_code, $str_email_content); print $str_email_content; ?> <span style='font-size:12.0pt;font-family:"Times New Roman";mso-fareast-font-family:"Times New Roman";mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA'><br clear=all style='mso-special-character:line-break;page-break-before:always'></span> <?php } }
$str_order_status = "Canceled Before Billed"; } else { if ($strApprovalStatus == "Approved") { $str_order_status = "Billed then Canceled"; } else { if ($strApprovalStatus == "Declined") { $str_order_status = "Canceled After Bill Date - Declined"; } else { $str_order_status = "Canceled After Bill Date - Pending Approval"; } } } } $qrySelect = "select co.retrievalNumber from cs_companydetails co,cs_transactiondetails tr where "; $qrySelect .= " co.userId = tr.userId and tr.transactionId =" . $strTransactionID; $strRetrivalNumber = funcGetValueByQuery($qrySelect, $cnn_cs); $strCurrentDateTime = func_get_current_date_time(); //********* Logging the entry ******************** /*$strCurrentDate1 = func_get_current_date(); $strCurrentDate1 .= " 00:00:00"; $strCurrentDate2 = func_get_current_date(); $strCurrentDate2 .= " 23:59:59"; $qry_select = "SELECT * FROM cs_callnotes WHERE call_date_time >='$strCurrentDate1' and call_date_time<='$strCurrentDate2' and transaction_id=$strTransactionID"; if(!($rst_select = mysql_query($qry_select,$cnn_cs))) { print("Can not execute select query"); exit(); } if(mysql_num_rows($rst_select)>0) { $iNoteId = mysql_result($rst_select,0,0);
function funcCallBack($cnn_cs, $iTransactionId) { if ($iTransactionId != "") { $qryGetUser = "******" . $iTransactionId; $iUserId = funcGetValueByQuery($qryGetUser, $cnn_cs); $qryGetUserName = "******" . $iUserId; $iUserName = funcGetValueByQuery($qryGetUserName, $cnn_cs); $strCurrentDateTime = func_get_current_date_time(); $qryInsert = "insert into cs_callback (userid,transactionid,dateandtime) values ("; $qryInsert .= "'{$iUserId}','{$iTransactionId}','{$strCurrentDateTime}')"; if (!mysql_query($qryInsert)) { print "Can not execute query"; exit; } } }
/images/top6.jpg" width="138" height="63"></td> </tr> </table> <!--header ends here--> <br> <table border="0" cellpadding="0" width="100%" cellspacing="0" height="70%" align="center"> <tr> <td width="95%" valign="top" align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="22" align="left" valign="top" width="1%" background="../images/menucenterbg.gif" nowrap><img border="0" SRC="<?php echo $tmpl_dir; ?> /images/menutopleft.gif" width="8" height="22"></td> <td height="22" align="center" valign="middle" width="50%" background="../images/menucenterbg.gif" ><span class="whitehd"><?php echo funcGetValueByQuery("select companyname from cs_companydetails where userId = {$iCompanyId}", $cnn_cs); ?> </span></td> <td height="22" align="left" valign="top" width="3%" nowrap><img border="0" SRC="<?php echo $tmpl_dir; ?> /images/menutopcurve.gif" width="49" height="22"></td> <td height="22" align="left" valign="top" width="45%" background="../images/menutoprightbg.gif" ><img alt="" SRC="<?php echo $tmpl_dir; ?> /images/spacer.gif" width="1" height="1"></td> <td height="22" align="right" valign="top" background="../images/menutoprightbg.gif" width="1%" nowrap><img border="0" SRC="<?php echo $tmpl_dir; ?> /images/menuright.gif" width="10" height="22"></td> </tr>
<?php include "includes/sessioncheck.php"; require_once "includes/dbconnection.php"; require_once 'includes/function.php'; include "includes/header.php"; $headerInclude = "blank"; include "includes/topheader.php"; $sessionlogin = isset($HTTP_SESSION_VARS["sessionlogin"]) ? $HTTP_SESSION_VARS["sessionlogin"] : ""; $setup_amount = 0; $strCompanyType = funcGetValueByQuery("select transaction_type from cs_companydetails where userId={$sessionlogin}", $cnn_cs); $setup_amount = funcGetValueByQuery("select setupfee from cs_setupfee where company_type_short='{$strCompanyType}'", $cnn_cs); $setup_amount = number_format($setup_amount, 2, ".", ","); ?> <link href="styles/text.css" rel="stylesheet" type="text/css"> <table border="0" cellpadding="0" cellspacing="0" width="100%" height="60%"> <tr> <td width="100%" valign="top" align="center"><br> <table border="0" cellpadding="0" cellspacing="0" width="85%" class="disbd"> <tr> <td width="100%" valign="top" align="center" bgcolor="#448A99" height="20"> <img border="0" src="images/spacer.gif" width="1" height="1"> </td> </tr> <tr> <td width="100%" valign="top" align="center" bgcolor="#2F5F68" height="5"><img border="0" src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td width="100%" valign="top" align="center">
> </td> </tr> <tr> <td width="233" height="30" align="right" valign="center" bgcolor="#CCCCCC" class='cl1'><font face="verdana" size="1" color="#FFFFFF"><strong>Users</strong> </font></td> <td height="30" class='cl1' align="left"> </td> </tr> <tr height='30'> <td height="30" align='left' class='cl1' width="54%"><font face='verdana' size='1'><b> 3 VT Users</b></font></td> <td height="30" align='left' class='cl1'><font face='verdana' size='1'> <a href="javascript:funcOpen3VT(<?php echo $showval[0]; ?> )">Show Users</a></font></td> </tr> <?php $sTransactionType = funcGetValueByQuery("select transaction_type from cs_companydetails where userId = {$showval['0']}", $cnn_cs); if ($sTransactionType == "tele") { ?> <tr height='30'> <td height="30" align='left' class='cl1' width="54%"><font face='verdana' size='1'><b> Call Center user and TSR</b></font></td> <td height="30" align='left' class='cl1'><font face='verdana' size='1'> <a href="javascript:funcOpenTSR(<?php echo $showval[0]; ?> )">Show Users</a></font> </td> </tr> <?php } if ($sTransactionType != "tele") { ?> <tr height='30'>
</tr> <?php for ($iLoop = 0; $iLoop < mysql_num_rows($rstSelect); $iLoop++) { $iTransactionId = mysql_result($rstSelect, $iLoop, 0); $strFirstName = mysql_result($rstSelect, $iLoop, 1); $strLastName = mysql_result($rstSelect, $iLoop, 2); $strType = mysql_result($rstSelect, $iLoop, 3); if ($strType == "C") { $strType = "Check"; } else { $strType = "Credit Card"; } $strAmount = mysql_result($rstSelect, $iLoop, 4); $strAmount = formatMoney($strAmount); $strCompany = mysql_result($rstSelect, $iLoop, 5); $strCompany = funcGetValueByQuery(" select companyname from cs_companydetails where userId={$strCompany} ", $cnn_cs); $strPendingStatus = mysql_result($rstSelect, $iLoop, 6); $strCancelled = mysql_result($rstSelect, $iLoop, 7); $strCancellReason = mysql_result($rstSelect, $iLoop, 8); $strCancellOther = mysql_result($rstSelect, $iLoop, 9); $strVoiceAuthorisation = mysql_result($rstSelect, $iLoop, 10); ?> <tr height='30' > <td align='center' class='cl1'><a href="javascript:func_submit('<?php echo $iTransactionId; ?> ');" class="link1"><font face='verdana' size='1'> <?php echo $strVoiceAuthorisation; ?> </font></a></td> <td align='left' class='cl1'><font face='verdana' size='1'> <?php
$qry_reseller_fees = "select reseller_trans_fees from cs_companydetails where userid={$i_userId}"; $i_reseller_transfee = funcGetValueByQuery($qry_reseller_fees, $cnn_cs); $qry_reseller_discount = "select reseller_discount_rate from cs_companydetails where userid={$i_userId}"; $i_reseller_discountrate = funcGetValueByQuery($qry_reseller_discount, $cnn_cs); $qry_approved_transaction = "select count(*) from cs_transactiondetails where userid={$i_userId} and status='A' and cancelstatus='N'"; $i_approved_count = funcGetValueByQuery($qry_approved_transaction, $cnn_cs); $qry_approved_transamount = "select sum(amount) from cs_transactiondetails where userid={$i_userId} and status='A' and cancelstatus='N'"; //$i_approved_amount = funcGetValueByQuery($qry_approved_transamount,$cnn_cs); $qry_total_transaction = "select count(*) from cs_transactiondetails where userid={$i_userId}"; //$i_total_transactions = funcGetValueByQuery($qry_total_transaction,$cnn_cs); $qry_total_amount = "select sum(amount) from cs_transactiondetails where userid={$i_userId}"; //$i_total_amount = funcGetValueByQuery($qry_total_amount,$cnn_cs); $qry_cancelled_trans = "select count(*) from cs_transactiondetails where userid={$i_userId} and cancelstatus='Y'"; $i_cancelled_count = funcGetValueByQuery($qry_cancelled_trans, $cnn_cs); $qry_chargeback_trans = "select chargeback from cs_companydetails where userid={$i_userId}"; $chargeback_amount = funcGetValueByQuery($qry_chargeback_trans, $cnn_cs); //$i_discount_amount = ((($i_approved_amount * $i_reseller_discountrate)/100)- ($i_cancelled_count * $chargeback_amount) ); $i_discount_amount = $discountamount - $cancelcharge; //$i_commission_amount = $i_approved_count * $i_reseller_transfee; ?> <tr height="25"> <td valign="middle" class='cl1'><font face="verdana" size="1"> <?php echo $i + 1; ?> </font></td> <td valign="middle" class="cl1"><font face="verdana" size="1"> <?php echo $str_company_name; ?> </font></td> <td valign="middle" class="cl1"><font face="verdana" size="1"> <?php echo nl2br($str_email);
function func_export_details($qrt_select_details, $cnn_cs, $exportlist, $trans_entry) { $i = 0; $data = ""; $value = ""; $header = ""; if (!($qrt_select_run = mysql_query($qrt_select_details, $cnn_cs))) { dieLog(mysql_errno() . ": " . mysql_error() . "<BR>"); } else { if (mysql_num_rows($qrt_select_run) == 0) { $msgtodisplay = "No transactions for this period"; } } if ($exportlist) { for ($i_loop = 0; $i_loop < count($exportlist); $i_loop++) { $export_select_list = $exportlist[$i_loop]; $list_header_val = func_set_header($exportlist[$i_loop], $trans_entry); if ($header == "") { $header = '"' . "{$list_header_val}" . '"'; } else { $header = "{$header} ," . '"' . "{$list_header_val}" . '"'; } } $header = "{$header} \t"; } while ($show_select_val = mysql_fetch_array($qrt_select_run)) { $export_value = ""; $value1 = ""; if ($exportlist) { for ($i_loop = 0; $i_loop < count($exportlist); $i_loop++) { $export_value = $show_select_val["{$exportlist[$i_loop]}"]; if ($exportlist[$i_loop] == "userId") { $qrt_select_company = "Select companyname from cs_companydetails where userid = {$export_value}"; $export_value = funcGetValueByQuery($qrt_select_company, $cnn_cs); } if ($export_value == "PE" || $export_value == "P") { $export_value = "Pending"; } elseif ($export_value == "PA") { $export_value = "Pass"; } elseif ($export_value == "NP") { $export_value = "Non Pass"; } elseif ($export_value == "A") { $export_value = "Approved"; } elseif ($export_value == "D") { $export_value = "Declined"; } elseif ($export_value == "Y") { $export_value = "Cancelled"; } elseif ($export_value == "N") { $export_value = "Not Cancelled"; } elseif ($export_value == "C") { $export_value = "Check"; } elseif ($export_value == "H") { $export_value = "Credit Card"; } // Checking whether the value is number or not, is an ascii check. if (func_check_isnumberdot($export_value)) { $export_value = "^ " . $export_value; } $export_value = str_replace(",", "", $export_value); if ($value1 == "") { $value1 = '"' . $export_value . '"'; } else { $value1 = $value1 . "," . '"' . $export_value . '"'; } } } $value = $value1 . '"' . "\t"; if (!isset($value) || $value == "") { $value = "\t"; } else { $value = '"' . $value . '"' . "\t"; } $line = '"' . $value; $data .= trim($line) . "\n"; } $data = str_replace("\r", "", $data); $data = str_replace('"', "", $data); if ($data == "") { $data = "\n No matching records found\n"; } # this line is needed because returns embedded in the data have "\r" # and this looks like a "box character" in Excel $data = str_replace("\t", "", $data); $header = str_replace("\t", "", $header); $str_current_path = "csv/report.csv"; // print $str_current_path; $create_file = fopen($str_current_path, 'w'); // print $create_file; $file_content = $header . "\n" . $data; fwrite($create_file, $file_content); fclose($create_file); # Nice to let someone know that the search came up empty. # Otherwise only the column name headers will be output to Excel. # This line will stream the file to the user rather than spray it across the screen // header("Content-type: application/octet-stream"); // header("Content-Disposition: attachment; filename=excelfile.htm"); // header("Pragma: no-cache"); // header("Expires: 0"); // echo $header."\n".$data; if (!($file = fopen("csv/report.csv", "r"))) { print "Can not open file"; exit; } /* $content = fread($file, filesize("csv/excelfile.htm")); $content = explode("\r\n", $content); fclose($file); $file_content = ""; for($i=0;$i<count($content);$i++) { $file_content .= $content[$i]; } print($file_content); if( file_exists($str_current_path)) { //unlink($str_current_path); } */ }