function send_email($address, $full_name, $booking_id)
{
    global $booking;
    if ($booking['email_mode']) {
        require PLUGIN_DIR . 'include/phpmailer/PHPMailerAutoload.php';
        $mail = new PHPMailer();
        $mail->isSMTP();
        $mail->Host = $booking['smtp_host'];
        if ($booking['smtp_auth']) {
            $mail->SMTPAuth = true;
            $mail->Username = $booking['smtp_login']['username'];
            $mail->Password = $booking['smtp_login']['password'];
            if ($booking['smtp_secure'] != 'none') {
                $mail->SMTPSecure = $booking['smtp_secure'];
            }
        } else {
            $mail->SMTPAuth = false;
        }
        $mail->Port = $booking['smtp_port'];
        $mail->setFrom($booking['default_email'], get_bloginfo('name'));
        $mail->addAddress($address, $full_name);
        $mail->isHTML(true);
        $mail->Subject = $booking['email_title'];
        $mail->Body = get_email_template($booking_id);
        if (!$mail->send()) {
            //echo 'Message could not be sent.';
            //echo 'Mailer Error: ' . $mail->ErrorInfo;
            return false;
        } else {
            return true;
        }
    } else {
        add_filter('wp_mail_content_type', 'set_html_content_type');
        $headers = 'From: ' . get_bloginfo("name") . ' <' . $booking['default_email'] . '>' . "\r\n";
        $sent = wp_mail($address, $booking['email_title'], get_email_template($full_name, $booking_id), $headers);
        remove_filter('wp_mail_content_type', 'set_html_content_type');
        if ($sent) {
            return true;
        } else {
            return false;
        }
    }
}
Exemple #2
0
function transfer($transaction_data_array)
{
    $amount = $transaction_data_array['amount'];
    $from_userid = $transaction_data_array['from_userid'];
    $balance_currency = $transaction_data_array['transaction_currency'];
    $to_userid = $transaction_data_array['to_userid'];
    $fees = $transaction_data_array['fee'];
    $batch_number = $transaction_data_array['batch_number'];
    $to_account = $transaction_data_array['to_account'];
    $amount_text = $transaction_data_array['amount_text'];
    $to_account = $transaction_data_array['to_account'];
    $transaction_memo = $transaction_data_array['transaction_memo'];
    $from_account_number = $transaction_data_array['from_account'];
    // deduce balance of the from account
    db_query("UPDATE " . _TABLE_USER_BALANCE . " SET balance=balance- " . $amount . ", last_updated='" . date('YmdHis') . "' WHERE user_id='" . $from_userid . "' and currency_code='" . $balance_currency . "'");
    // add balance to the account
    // check  user's balance currency init ?
    $check_balance = db_fetch_array(db_query("SELECT count(*) as total FROM " . _TABLE_USER_BALANCE . " WHERE user_id='" . $to_userid . "' and currency_code='" . $balance_currency . "'"));
    $current_amount = $amount - $fees;
    if ($check_balance['total'] > 0) {
        db_query("UPDATE " . _TABLE_USER_BALANCE . " SET balance=balance+ " . $current_amount . ", last_updated='" . date('YmdHis') . "' WHERE user_id='" . $to_userid . "' and currency_code='" . $balance_currency . "'");
    } else {
        $balance_data_array = array('user_id' => $to_userid, 'currency_code' => $balance_currency, 'balance' => $current_amount, 'last_updated' => date('YmdHis'));
        db_perform(_TABLE_USER_BALANCE, $balance_data_array);
    }
    // completed
    $transaction_data = array('batch_number' => $batch_number, 'from_account' => $from_account_number, 'to_account' => $to_account, 'amount_text' => $amount_text, 'memo' => $transaction_memo, 'transaction_time' => date('d/m/Y H:i'));
    $step = 'completed';
    // Send Transaction Notify 	Email to User
    $email_info = get_email_template('TRANSFER_EMAIL');
    $user_info = db_fetch_array(db_query("SELECT firstname, email FROM " . _TABLE_USERS . " WHERE user_id='" . $to_userid . "'"));
    $firstname = $user_info['firstname'];
    $msg_subject = $email_info['emailtemplate_subject'];
    //	echo "amount_text = $amount_text <br>";
    $msg_content = str_replace(array('[firstname]', '[amount_text]', '[batch_number]', '[balance_currency]', '[from_account]'), array($firstname, $amount_text, $batch_number, $balance_currency, $from_account_number), $email_info['emailtemplate_content']);
    $msg_content = html_entity_decode($msg_content);
    tep_mail($firstname, $user_info['email'], $msg_subject, $msg_content, SITE_NAME, SITE_CONTACT_EMAIL);
    //admin transfer
    $batch_number_admin = tep_create_random_value(11, 'digits');
    $transaction_data_array_admin = array('from_userid' => $to_userid, 'batch_number' => $batch_number_admin, 'to_userid' => 1, 'amount' => $fees, 'fee' => 0, 'transaction_time' => date('YmdHis'), 'transaction_memo' => 'transaction fees #' . $batch_number, 'from_account' => $to_account, 'to_account' => 'OOKCASH', 'transaction_currency' => $balance_currency, 'amount_text' => $transaction_data_array['fee_text'], 'transaction_status' => 'completed');
    db_perform(_TABLE_TRANSACTIONS, $transaction_data_array);
    transfer_admin($transaction_data_array_admin);
    return $transaction_data;
}
         if (db_num_rows($check_info_query) == 0) {
             // email existed
             $validator->addError('Account Number/E-mail', "Invalid account number/e-mail.");
         }
     }
 } else {
     $validator->addError('Turing Number', ERROR_SECURE_CODE_WRONG);
 }
 if (count($validator->errors) == 0) {
     // found email => send account number to the email
     $account_info = db_fetch_array(db_query($sql_check_info));
     $session_account_number = $account_number;
     $session_email = $email;
     tep_session_register('session_account_number');
     tep_session_register('session_email');
     $email_info = get_email_template('RESET_PASSWORD_CODE');
     $security_question = $account_info['account_info'];
     //$firstname	=	$user_info['firstname'];
     $msg_subject = $email_info['emailtemplate_subject'];
     $reset_code = tep_create_random_value(10, 'digits');
     //-----------------add by donghp 27/03/2012----------------------
     $user_id = $account_info['user_id'];
     $q = db_query("UPDATE  users SET  reset_code =  '" . $reset_code . "' WHERE user_id = {$user_id}");
     //----------------------------------------------------------------
     $msg_content = str_replace(array('[firstname]', '[reset_code]'), array($account_info['firstname'], $reset_code), $email_info['emailtemplate_content']);
     $msg_content = html_entity_decode($msg_content);
     //add by donghp 26/03/2012
     tep_mail($account_info['firstname'] . ' ' . $account_info['lastname'], $email, $msg_subject, $msg_content, SITE_NAME, SITE_CONTACT_EMAIL);
     $resetcode_sent = true;
 } else {
     postAssign($smarty);
Exemple #4
0
 /**
  * Class handling of the global email_to_user Moodle function.
  *
  *
  **/
 public function email_to_user()
 {
     global $USER;
     $subject = $this->subject();
     $body = $this->body();
     // Code added by GWL
     $context = context_system::instance();
     $companytemplate = get_email_template($this->templatename, $this->company->id);
     if ($companytemplate) {
         $body = file_rewrite_pluginfile_urls($body, 'pluginfile.php', $context->id, 'local_email', 'message_body_image', $companytemplate->id);
     }
     // End of Code
     if (isset($this->sender->id)) {
         $supportuser = self::get_user($this->sender->id);
     } else {
         $supportuser = self::get_user(self::get_sender($this->userid));
     }
     if (isset($email->headers)) {
         $supportuser->customheaders = unserialize($email->headers);
         email_to_user($USER, $supportuser, $email->subject, $email->body);
     }
     return email_to_user($this->user, $supportuser, $subject, $body);
 }
Exemple #5
0
         $list_pricepoints .= "</textarea>";
         $list_pricepoints .= "</td></tr>";
     }
     $list_pricepoints .= "</table>";
     $show_val['list_pricepoints'] = $list_pricepoints;
 }
 if ($strMailConfir != "" && $companytype != "reseller") {
     $strMaildata = get_email_template('merchant_welcome_letter', array());
     $str_current_path = "csv/merchant_registrationmail.htm";
     $create_file = fopen($str_current_path, 'w');
     $file_content = $strMaildata;
     fwrite($create_file, $file_content);
     fclose($create_file);
 } else {
     if ($strMailReseller != "") {
         $strResellerMaildata = get_email_template('reseller_welcome_letter', array());
         $str_current_path = "csv/reseller_registrationmail.htm";
         $create_file = fopen($str_current_path, 'w');
         $file_content = $strResellerMaildata;
         fwrite($create_file, $file_content);
         fclose($create_file);
     }
 }
 if ($mail_confirm == 1) {
     unset($emailInfo);
     $emailInfo['et_subject'] = $subject;
     // => Welcome to Etelegate, tech
     $emailInfo['et_htmlformat'] = $txtBody;
     // => html
     foreach ($show_val as $key => $data) {
         if (!$data) {
            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);
            exit;
        }
    }
}
include "includes/footer.php";
?>

// Files:           index.php,home.php,cheque.php,creditcard.php,report.php,reportBottom.php, reportBottomSummary.php,companyEdit.php
//    				config.php,useraccount.php,viewCompany.php,topheader.php,ViewreportPage.php,addcheque.php,blank.php,administration_blank.php,virtualterminal.php,creditcardfb.php,negativedatabase.php
//					viewreportpage_negative.php,batchuploads.php,voicesystem.php,voicesystemreport.php,voicesystemdetails.php,companyAdd.php,companies_blank.php
//					modifycompany.php,companyuser.php,orderemail.php,enquires.php,report_custom.php,service_users.php,export.php,ledger.php
//					labels.php,printemailforms.php,maileditor.php,shipping.php,shippingdetails.php,logout.php
// MerchantURL.php:	The page functions to display the merchants URL.
include "includes/sessioncheck.php";
$nosub = $_GET['nosub'];
if (!$nosub) {
    $headerInclude = "profile";
}
include "includes/header.php";
require_once "../includes/function.php";
$resellerLogin = isset($HTTP_SESSION_VARS["sessionReseller"]) ? $HTTP_SESSION_VARS["sessionReseller"] : "";
$referURL = $_SESSION['gw_domain'] . "/rms.php?ref=" . urlencode($companyInfo['en_ref']);
$bannerInfo = get_email_template("available_banners", NULL);
$banners = $bannerInfo['et_htmlformat'];
?>
	<table border="0" cellpadding="0" cellspacing="0" width="100%" height="55%">
    <tr>
   		 <td width="100%" align="center">

		 <table width="85%" border="0" cellspacing="0" cellpadding="0" height="168" >
<tr>
	<td height="22" align="left" valign="top" width="1%" background="../images/menucenterbg.gif" nowrap><img border="0" src="../images/menutopleft.gif" width="8" height="22"></td>
	        <td height="22" align="center" valign="middle" width="50%" background="../images/menucenterbg.gif" ><span class="whitehd">Links</span></td>
	<td height="22" align="left" valign="top" width="3%" nowrap><img border="0" src="../images/menutopcurve.gif" width="49" height="22"></td>
	<td height="22" align="left" valign="top" width="45%" background="../images/menutoprightbg.gif" ><img alt="" src="../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="../images/menuright.gif" width="10" height="22"></td>
	</tr>
	    <tr align="center">
Exemple #8
0
        }
    }
}
if (!empty($where)) {
    $where = 'WHERE ' . implode(' AND ', $where);
}
if (count($where) == 0) {
    $where = '';
}
$new_fields = ', c.customers_telephone, a.entry_company, a.entry_street_address, a.entry_city, a.entry_postcode, c.customers_authorization, c.customers_referral';
$customers_query_raw = "select distinct c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_pricing, a.entry_country_id, a.entry_company, ci.customers_info_date_of_last_logon, ci.customers_info_date_account_created " . $new_fields . ",\n    cgc.amount\n    from " . TABLE_CUSTOMERS . " c\n    left join " . TABLE_CUSTOMERS_INFO . " ci on c.customers_id= ci.customers_info_id\n    left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . "\n    left join " . TABLE_COUPON_GV_CUSTOMER . " cgc on c.customers_id = cgc.customer_id\n\tleft join customers_send_mail csm ON (csm.customers_id=c.customers_id)\n\t" . $where . " order by {$disp_order}";
if (isset($_POST['send_mail_btn'])) {
    $customer_send_mail = $db->Execute($customers_query_raw);
    while (!$customer_send_mail->EOF) {
        $variable = get_variable_customer($customer_send_mail->fields['customers_id']);
        $mail_tempalte = get_email_template(CONST_SEND_MAIL_NO_ORDER);
        $to_name = $variable['{customers_name}'];
        $to_address = $variable['{customers_email_address}'];
        $from_email_name = $variable['{store_name}'];
        $mail_info = get_mail_random();
        $variable = array_merge($variable, $mail_info);
        $from_email_address = $mail_info['smtp_user'];
        $email_subject = str_ireplace(array_keys($variable), array_values($variable), $mail_tempalte['subject']);
        $email_text = str_ireplace(array_keys($variable), array_values($variable), $mail_tempalte['content']);
        $send_status = jsend_mail($to_name, $to_address, $email_subject, $email_text, $from_email_name, $from_email_address, $variable);
        $temp_result = $db->Execute('SELECT count FROM customers_send_mail WHERE customers_id=' . (int) $customer_send_mail->fields['customers_id'] . ' AND email_template_id=' . (int) $mail_tempalte['email_template_id']);
        if ($temp_result->fields['count'] > 0) {
            zen_db_perform('customers_send_mail', array('count' => (int) $temp_result->fields['count'] + 1), 'update', 'customers_id=' . $customer_send_mail->fields['customers_id'] . ' and email_template_id=' . $mail_tempalte['email_template_id']);
        } else {
            zen_db_perform('customers_send_mail', array('customers_id' => $customer_send_mail->fields['customers_id'], 'email_template_id' => $mail_tempalte['email_template_id'], 'count' => 1));
        }
Exemple #9
0
        $smarty->assign('whosale', $whosale);
        echo $smarty->fetch('users/add.html');
        break;
    case 'active_user':
        $user_id = (int) $_POST['user_id'];
        db_perform(_TABLE_USERS, array('status' => 1), 'update', "user_id='" . db_prepare_input($user_id) . "'");
        $user_data = db_fetch_array(db_query("SELECT * FROM " . _TABLE_USERS . " WHERE user_id='" . $user_id . "'"));
        // send notification email to user
        $email_info = get_email_template('ACTIVE_USER_EMAIL');
        $firstname = $user_data['firstname'];
        $account_number = $user_data['account_number'];
        $msg_subject = $email_info['emailtemplate_subject'];
        $msg_content = str_replace(array('[firstname]', '[account_number]'), array($firstname, $account_number), $email_info['emailtemplate_content']);
        tep_mail($firstname, $user_data['email'], $msg_subject, $msg_content, SITE_NAME, SITE_CONTACT_EMAIL);
        echo 'active';
        break;
    case 'deactive_user':
        $user_id = (int) $_POST['user_id'];
        db_perform(_TABLE_USERS, array('status' => 0), 'update', "user_id='" . db_prepare_input($user_id) . "'");
        $user_data = db_fetch_array(db_query("SELECT * FROM " . _TABLE_USERS . " WHERE user_id='" . $user_id . "'"));
        // send notification email to user
        $email_info = get_email_template('DEACTIVE_USER_EMAIL');
        $firstname = $user_data['firstname'];
        $account_number = $user_data['account_number'];
        $msg_subject = $email_info['emailtemplate_subject'];
        $msg_content = str_replace(array('[firstname]', '[account_number]'), array($firstname, $account_number), $email_info['emailtemplate_content']);
        tep_mail($firstname, $user_data['email'], $msg_subject, $msg_content, SITE_NAME, SITE_CONTACT_EMAIL);
        echo 'Deactive';
        break;
}
die;
function add_new_merchant($companyInfo, $sendmail = true, $getmail = false)
{
    $returnInfo = array('status' => true, 'msg' => 'Company Created Successfully');
    //foreach($companyInfo as $key=>$data)
    //	$companyInfo[$key] = quote_smart($data);
    $res = check_merchant_conflict($companyInfo);
    if (!$res['status']) {
        return $res;
    }
    if ($res['res']['ref']) {
        $companyInfo['en_ref'] = substr(strtoupper(md5(time() + rand(1, 1000000))), 0, 8);
    }
    $qry_insert_user = "******";
    $qry_insert_user .= " values('" . $companyInfo['en_username'] . "','" . $companyInfo['en_password'] . "','" . $companyInfo['en_company'] . "','" . $companyInfo['en_ref'] . "','" . $companyInfo['en_email'] . "','" . $companyInfo['volumenumber'] . "',0,'" . $companyInfo['transaction_type'] . "','" . $companyInfo['how_about_us'] . "',NOW(),'" . $companyInfo['phonenumber'] . "','" . $companyInfo['contact_phone'] . "','" . $companyInfo['cd_contact_im'] . "','" . $companyInfo['en_gateway_ID'] . "','" . $companyInfo['url1'] . "','" . $companyInfo['cd_timezone'] . "')";
    $show_sql = sql_query_write($qry_insert_user) or dieLog(mysql_error() . " ~ {$str_qry}");
    $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, false, 'userId', $user_id);
    $sql = "Insert into cs_entities\r\n\t\t\tset \r\n\t\t\t\ten_username = '******'en_username'] . "',\r\n\t\t\t\ten_password = MD5('" . ($companyInfo['en_username'] . $companyInfo['en_password']) . "'),\r\n\t\t\t\ten_ref = '" . $companyInfo['en_ref'] . "',\r\n\t\t\t\ten_email = '" . $companyInfo['en_email'] . "',\r\n\t\t\t\ten_company = '" . $companyInfo['en_company'] . "',\r\n\t\t\t\ten_gateway_ID = '" . $companyInfo['en_gateway_ID'] . "',\r\n\t\t\t\ten_signup = NOW(),\r\n\t\t\t\ten_type = 'merchant',\r\n\t\t\t\ten_type_id = '" . quote_smart($user_id) . "'\r\n\t\t\t";
    sql_query_write($sql) or dieLog(mysql_error() . " ~ {$str_qry}");
    $en_ID = mysql_insert_id();
    $returnInfo['en_ID'] = $en_ID;
    $sql = "insert into cs_company_banks set cb_en_ID = '{$en_ID}',bank_id=0;";
    $result = sql_query_write($sql) or dieLog(mysql_error() . " ~ {$sql}");
    $cb_ID = mysql_insert_id();
    if ($companyInfo['etel_reseller_ref']) {
        $sql = "SELECT \r\n\t\t\t\ten_ID,en_info from cs_entities where\r\n\t\t\t\ten_ref = '" . $companyInfo['etel_reseller_ref'] . "'";
        $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}");
        $resellerInfo = mysql_fetch_assoc($result);
        $resellerInfo['en_info'] = etel_unserialize($resellerInfo['en_info']);
        $returnInfo['ea_affiliate_ID'] = $resellerInfo['en_ID'];
        set_affiliate($en_ID, $resellerInfo['en_ID'], 'Reseller', array('Disc_Markup' => $resellerInfo['en_info']['Reseller']['Default_Disc_Markup'], 'Trans_Markup' => $resellerInfo['en_info']['Reseller']['Default_Trans_Markup']));
    }
    if ($companyInfo['etel_affiliate_ref']) {
        $sql = "SELECT \r\n\t\t\t\ten_ID from cs_entities where\r\n\t\t\t\ten_ref = '" . $companyInfo['etel_affiliate_ref'] . "'";
        $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}");
        $affiliateMerchantInfo = mysql_fetch_assoc($result);
        set_affiliate($affiliateMerchantInfo['en_ID'], $en_ID, 'Affiliate', array('Disc_Markup' => $companyInfo['discount_markup'], 'Trans_Markup' => $companyInfo['transaction_markup']));
    }
    if ($sendmail || $getmail) {
        $emailData["email"] = $companyInfo['en_email'];
        $emailData["full_name"] = "Merchant";
        $emailData["companyname"] = $companyInfo['en_company'];
        $emailData["username"] = $companyInfo['en_username'];
        $emailData["password"] = $companyInfo['en_password'];
        $emailData["Reference_ID"] = $companyInfo['en_ref'];
        $emailData["gateway_select"] = $companyInfo['en_gateway_ID'];
        $emailData['tmpl_custom_id'] = $companyInfo['en_gateway_ID'];
        $letterTempate = 'merchant_welcome_letter';
    }
    if ($sendmail) {
        send_email_template($letterTempate, $emailData);
    }
    if ($getmail) {
        $returnInfo['email_info'] = get_email_template($letterTempate, $emailData);
    }
    return $returnInfo;
}
        etel_smarty_display('main_footer.tpl');
        exit;
    }
    $user_mailidexist = func_checkEmailExistInAnyTable($email, $cnn_cs);
    if ($user_mailidexist == 1) {
        message("Existing email id. Please Enter a different Email." . $postback, "", "Email", "content.php?show=main_resellers", false);
        etel_smarty_display('main_footer.tpl');
        exit;
    }
    $current_date_time = func_get_current_date_time();
    $user_reference_num = substr(md5(time() + rand(1, 9999)), 0, 8);
    $sql = "Insert into cs_entities\r\n\t\tset \r\n\t\t\ten_ref = '" . $user_reference_num . "',\r\n\t\t\ten_username = '******',\r\n\t\t\ten_password = MD5('" . ($username . $password) . "'),\r\n\t\t\ten_email = '" . quote_smart($email) . "',\r\n\t\t\ten_gateway_ID = '" . quote_smart($rd_gateway_id) . "',\r\n\t\t\ten_type = 'reseller',\r\n\t\t\ten_signup = NOW(),\r\n\t\t\ten_type_id = '" . quote_smart($user_id) . "'\r\n\t\t";
    sql_query_write($sql) or dieLog(mysql_error() . " ~ {$sql}");
    //$email_from = "*****@*****.**";
    $email_subject = "Registration Confirmation";
    $email_message = $msgtodisplay;
    $email_to = $email;
    $emailData["email"] = $email;
    $emailData["full_name"] = $contactname;
    $emailData["companyname"] = $companyname;
    $emailData["username"] = $username;
    $emailData["password"] = $password;
    $emailData["gateway_select"] = $companyInfo['rd_gateway_id'];
    $emailContents = get_email_template("reseller_welcome_letter", $emailData);
    send_email_template("reseller_welcome_letter", $emailData);
    print $emailContents['et_htmlformat'];
    etel_smarty_display('main_footer.tpl');
}
?>

Exemple #12
0
 function get_Merchant_Contract($en_ID)
 {
     $thisdate = time();
     if (is_array($en_ID)) {
         $en_ID = intval($en_ID['en_ID']);
     }
     $sql = "\r\n\t\t\tselect\r\n\t\t\t\t*\r\n\t\t\tfrom\r\n\t\t\t\tcs_entities\r\n\t\t\tWhere\r\n\t\t\t\ten_ID = '{$en_ID}';\r\n\t\t\t";
     $result = sql_query_read($sql) or dieLog(mysql_error() . " ~{$sql}");
     $companyInfo = mysql_fetch_assoc($result);
     $companyInfo['en_info'] = @unserialize($companyInfo['en_info']);
     $PaySchedule = en_get_payout_schedule($companyInfo);
     $str_qry = "\r\n\t\t\tselect \r\n\t\t\t\t* \r\n\t\t\tfrom \r\n\t\t\t\tcs_company_sites \r\n\t\t\twhere \r\n\t\t\t\tcs_en_ID = '" . $companyInfo['en_ID'] . "'\r\n\t\t\t";
     $sql_select_val = sql_query_read($str_qry) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>~{$str_qry}");
     while ($site = mysql_fetch_assoc($sql_select_val)) {
         $websites[] = $site['cs_URL'];
     }
     if (sizeof($websites) < 1) {
         $websites[] = "No Sites";
     }
     $ratesInfo = $this->get_MerchantRates($companyInfo['en_ID']);
     $disp_array = array('banks1' => array('type' => 'banks'), 'trans' => array('type' => 'trans', 'disp' => 'Transaction Fee', 'before' => '$'), 'disct' => array('type' => 'disct', 'disp' => 'Discount Rate', 'after' => ' %'), 'decln' => array('type' => 'decln', 'disp' => 'Decline Fee', 'before' => '$'), 'cstsv' => array('type' => 'cstsv', 'disp' => 'Customer Service Fee', 'before' => '$'), 'banks2' => array('type' => 'banks'), 'refnd' => array('type' => 'refnd', 'disp' => 'Refund Fee', 'before' => '$'), 'chgbk' => array('type' => 'chgbk', 'disp' => 'Chargeback Fee', 'before' => '$'), 'hold' => array('type' => 'hold', 'disp' => 'Payment Hold', 'after' => ' Days'), 'rserv' => array('type' => 'rserv', 'disp' => 'Reserve Rate', 'after' => ' %'), 'rservhold' => array('type' => 'rservhold', 'disp' => 'Reserve Hold Duration', 'after' => ' Days'));
     $contract_rates_table = '';
     $contract_rates_table .= "<table class='invoice' border='1' width='100%'>";
     $contract_rates_table .= "<tr class='infoHeader' align='center'><td><b>Transaction Rates and Fees</b></td></tr>";
     $contract_rates_table .= "<tr><td><table class='report' border='1' width='100%'>";
     $rates_array = array('Default' => null, 'Visa' => null, 'Mastercard' => null, 'Check' => null, 'Discover' => null);
     foreach ($ratesInfo as $key => $banks) {
         if ($key && $banks['trans_type']) {
             $rates_array[$banks['trans_type']] = $banks;
         }
     }
     if ($ratesInfo[0]) {
         $rates_array['Default'] = $ratesInfo[0];
         $rates_array['Default']['trans_type'] = "Default *";
         foreach ($rates_array as $type => $banks) {
             if (!$banks) {
                 $rates_array[$type] = $ratesInfo[0];
             }
         }
         $data['wire_fee'] = "\$" . formatMoney($rates_array['Default']['default']['Processor']['wirefee']);
         $data['ach_fee'] = "\$" . formatMoney($rates_array['Default']['default']['Processor']['achfee']);
         $data['monthly_fee'] = "\$" . formatMoney($rates_array['Default']['default']['Processor']['monthly']);
         $data['transaction_fee'] = "\$" . formatMoney($companyInfo['cc_merchant_trans_fees']);
         $data['refund_fee'] = "\$" . formatMoney($companyInfo['cc_discountrate']);
         $data['chargebackover_fee'] = "\$" . formatMoney($companyInfo['cc_overchargeback']);
         $data['chargebackunder_fee'] = "\$" . formatMoney($companyInfo['cc_underchargeback']);
         $data['setup_fee'] = "\$" . formatMoney($rates_array['Default']['default']['Processor']['setup']);
     }
     foreach ($disp_array as $display) {
         $contract_rates_table .= "<tr  class='row" . $this->gen_row(1) . "' ><td><b>" . $display['disp'] . "&nbsp;</b></td>";
         if ($display['type'] == 'banks') {
             foreach ($rates_array as $type => $banks) {
                 $contract_rates_table .= "<td align='center'><b>" . $type . "</b></td>";
             }
         } else {
             foreach ($rates_array as $banks) {
                 $total = $banks['default']['Processor'][$display['type']] + $banks['default']['Reseller'][$display['type']];
                 if (is_array($banks)) {
                     $contract_rates_table .= "<td align='center'>" . $display['before'] . formatMoney($total) . $display['after'] . " </td>";
                 } else {
                     $contract_rates_table .= "<td align='center' > - </td>";
                 }
             }
         }
         $contract_rates_table .= "</tr>";
     }
     $contract_rates_table .= "</table ></td></tr>";
     $contract_rates_table .= "<tr  class='small' ><td><b>* The default Rates and fees for any future payment methods that become available are marked under 'Default'</b></td></tr>";
     $contract_rates_table .= "</table >";
     $companyInfo['websites'] = implode(", ", $websites);
     $data['email'] = $companyInfo['en_email'];
     $data['fax_number'] = $companyInfo['en_info']['General_Info']['Contact_Fax'];
     $data['phone_number'] = $companyInfo['en_info']['General_Info']['Contact_Phone'];
     $data['companyname'] = $companyInfo['en_company'];
     $data['full_name'] = $companyInfo['en_firstname'] . " " . $companyInfo['en_lastname'];
     $data['date'] = "the " . date("jS", $thisdate) . " day of " . date("F", $thisdate) . ", the year " . date("Y", $thisdate);
     $data['address'] = $companyInfo['en_info']['General_Info']['Address'] . "," . $companyInfo['en_info']['General_Info']['City'] . "," . $companyInfo['en_info']['General_Info']['State'] . $companyInfo['en_info']['General_Info']['Country'] . $companyInfo['en_info']['General_Info']['Zip_Code'];
     $data['reference_number'] = $companyInfo['en_ref'];
     $data['contract_rates_table'] = $contract_rates_table;
     $data['days_behind'] = $PaySchedule['Schedule'];
     $data['tmpl_custom_id'] = $companyInfo['en_type_ID'];
     $contract = get_email_template('merchant_contract', $data);
     return $contract;
 }
Exemple #13
0
         }
     }
     if (strlen(trim($account_name)) == 0) {
         $validator['account_name'] = 'Acount name not null';
     } else {
         $sql_check = "SELECT * FROM " . _TABLE_USERS . " WHERE account_name='{$account_name}' ";
         if (db_num_rows(db_query($sql_check)) > 0) {
             // email existed
             $validator['account_name'] = 'This Acount name already exists in our database';
         }
     }
     if (count($validator) == 0) {
         $user_data_array = array('firstname' => db_prepare_input($firstname), 'lastname' => db_prepare_input($lastname), 'email' => db_prepare_input($email), 'mobile' => $mobile, 'phone' => $phone, 'additional_information' => $additional_information, 'security_question' => db_prepare_input($security_question), 'security_answer' => db_prepare_input($security_answer), 'language' => 'en', 'status' => 1, 'account_number' => $account_number, 'login_pin' => $login_pin, 'master_key' => $master_key, 'password' => encrypt_password($password), 'account_type' => 'user', 'account_name' => $account_name, 'signup_date' => date('YmdHis'));
         db_perform(_TABLE_USERS, $user_data_array);
         // send notification email to user
         $email_info = get_email_template('SIGNUP_EMAIL_ADMIN');
         $firstname = $user_data_array['firstname'];
         $msg_subject = $email_info['emailtemplate_subject'];
         $msg_content = str_replace(array('[firstname]', '[account_number]', '[login_pin]', '[master_key]', '[password]', '[security_question]', '[security_answer]'), array($firstname, $account_number, $login_pin, $master_key, $password, $security_question, $security_answer), $email_info['emailtemplate_content']);
         tep_mail($firstname, $user_data_array['email'], $msg_subject, $msg_content, SITE_NAME, SITE_CONTACT_EMAIL);
         $smarty->assign('feedback_message', 'User(#' . $account_number . ') information have been add successfully!');
     } else {
         $smarty->assign('feedback_err', $validator);
         $smarty->assign('user_data_array', $_POST);
     }
     break;
 case 'process_search':
     $account_number = db_prepare_input($_POST['account_number']);
     $keyword = db_prepare_input($_POST['keyword']);
     if (tep_not_null($account_number)) {
         $where_filter .= " AND account_number\t=\t'" . $account_number . "' ";
    $dobDay = db_prepare_input($_POST['dobDay']);
    if ($dobYear == 0 || $dobMonth == 0 || $dobDay == 0) {
        $validator->addError('Date of Birth', 'Please select your DOB.');
    }
    if (count($validator->errors) == 0) {
        // create new user
        // generate account secure informations
        $password = tep_create_random_value(7);
        $login_pin = tep_create_random_value(5, 'digits');
        $master_key = tep_create_random_value(3, 'digits');
        $account_number = generate_account_number();
        // create user data
        $signup_data_array = array('firstname' => $signup_info['firstname'], 'lastname' => $signup_info['lastname'], 'email' => $signup_info['email'], 'security_question' => $signup_info['security_question'], 'security_answer' => $signup_info['security_answer'], 'welcome_message' => $signup_info['welcome_message'], 'account_name' => $account_name, 'company' => $company_name, 'address' => $address, 'city' => $city, 'state' => $state, 'country' => $country_id, 'dob' => $dobYear . '-' . $dobMonth . '-' . $dobDay, 'phone' => $phone, 'mobile' => $mobile, 'language' => 'en', 'status' => 0, 'account_number' => $account_number, 'login_pin' => $login_pin, 'master_key' => $master_key, 'password' => encrypt_password($password), 'account_type' => 'user', 'signup_date' => date('YmdHis'));
        db_perform(_TABLE_USERS, $signup_data_array);
        // send notification email to user
        $email_info = get_email_template('SIGNUP_EMAIL');
        $firstname = $signup_info['firstname'];
        $msg_subject = $email_info['emailtemplate_subject'];
        $msg_content = str_replace(array('[firstname]', '[account_number]'), array($firstname, $account_number), $email_info['emailtemplate_content']);
        tep_mail($firstname, $signup_info['email'], $msg_subject, $msg_content, SITE_NAME, SITE_CONTACT_EMAIL);
        // end of email sending
        $signup_finished = true;
    } else {
        postAssign($smarty);
    }
}
if (!$signup_finished) {
    //bof: DOB
    $this_year = date('Y');
    $months_array[0] = '--';
    for ($i = 1; $i < 13; $i++) {
         // deduce balance of the from account
         db_query("UPDATE " . _TABLE_USER_BALANCE . " SET balance=balance- " . $amount . ", last_updated='" . date('YmdHis') . "' WHERE user_id='" . $login_userid . "' and currency_code='" . $balance_currency . "'");
         // add balance to the account
         // check  user's balance currency init ?
         $check_balance = db_fetch_array(db_query("SELECT count(*) as total FROM " . _TABLE_USER_BALANCE . " WHERE user_id='" . $to_userid . "' and currency_code='" . $balance_currency . "'"));
         if ($check_balance['total'] > 0) {
             db_query("UPDATE " . _TABLE_USER_BALANCE . " SET balance=balance+ " . $amount . ", last_updated='" . date('YmdHis') . "' WHERE user_id='" . $to_userid . "' and currency_code='" . $balance_currency . "'");
         } else {
             $balance_data_array = array('user_id' => $to_userid, 'currency_code' => $balance_currency, 'balance' => $amount, 'last_updated' => date('YmdHis'));
             db_perform(_TABLE_USER_BALANCE, $balance_data_array);
         }
         // completed
         $transaction_data = array('batch_number' => $batch_number, 'from_account' => $login_account_number, 'to_account' => $to_account, 'amount_text' => $amount_text, 'memo' => $transaction_memo, 'transaction_time' => date('d/m/Y H:i'));
         $smarty->assign('transaction_data', $transaction_data);
         // Send Transaction Notify 	Email to User
         $email_info = get_email_template('TRANSFER_EMAIL');
         $user_info = db_fetch_array(db_query("SELECT firstname, email FROM " . _TABLE_USERS . " WHERE user_id='" . $to_userid . "'"));
         $firstname = $user_info['firstname'];
         $msg_subject = $email_info['emailtemplate_subject'];
         //	echo "amount_text = $amount_text <br>";
         $msg_content = str_replace(array('[firstname]', '[amount_text]', '[batch_number]', '[balance_currency]', '[from_account]'), array($firstname, $amount_text, $batch_number, $balance_currency, $login_account_number), $email_info['emailtemplate_content']);
         $msg_content = html_entity_decode($msg_content);
         //add by donghp 26/03/2012
         //echo $email_info['emailtemplate_content']."<br>-------------------<br>";
         //	echo $msg_content."<br>";
         tep_mail($firstname, $user_info['email'], $msg_subject, $msg_content, SITE_NAME, SITE_CONTACT_EMAIL);
         $stepValue = 'complate';
         tep_redirect(get_href_link(PAGE_SCI_TRANSFER_COMPLETE, 'transaction=' . $history_id));
     }
 } else {
     $transaction_memo = db_prepare_input($_POST['transaction_memo']);
        $email = db_prepare_input($_POST['email']);
        if ($validator->validateEmail('Email', $email, ERROR_EMAIL_ADDRESS)) {
            $sql_check_email = "SELECT user_id, firstname,  account_number\tFROM " . _TABLE_USERS . " WHERE email='" . $email . "'";
            $check_email_query = db_query($sql_check_email);
            if (db_num_rows($check_email_query) == 0) {
                // email existed
                $validator->addError('Email', "Invalid e-mail. Email doesn't exist. ");
            }
        }
    } else {
        $validator->addError('Turing Number', ERROR_SECURE_CODE_WRONG);
    }
    if (count($validator->errors) == 0) {
        // found email => send account number to the email
        $account_info = db_fetch_array($check_email_query);
        $email_info = get_email_template('ACCOUNT_REMINDER');
        $msg_subject = $email_info['emailtemplate_subject'];
        $msg_content = str_replace(array('[firstname]', '[account_number]'), array($account_info['firstname'], $account_info['account_number']), $email_info['emailtemplate_content']);
        tep_mail($account_info['firstname'], $email, $msg_subject, $msg_content, SITE_NAME, SITE_CONTACT_EMAIL);
        $account_sent = true;
    } else {
        postAssign($smarty);
    }
}
if (!$account_sent) {
    $smarty->assign('validerrors', $validator->errors);
    $_html_main_content = $smarty->fetch('home/account_remind.html');
} else {
    $smarty->assign('email', $email);
    $_html_main_content = $smarty->fetch('home/account_remind_sent.html');
}
Exemple #17
0
function genResellerContract($companyInfo)
{
    global $weekdays;
    $thisdate = time();
    $data['email'] = $companyInfo['reseller_email'];
    $data['fax_number'] = $companyInfo['reseller_faxnumber'];
    $data['phone_number'] = $companyInfo['reseller_phone'];
    $data['companyname'] = $companyInfo['reseller_companyname'];
    $data['full_name'] = $companyInfo['reseller_contactname'];
    $data['title'] = $companyInfo['reseller_jobtitle'];
    $data['date'] = "the " . date("jS", $thisdate) . " day of " . date("F", $thisdate) . ", the year " . date("Y", $thisdate);
    //$data['address'] = 			$companyInfo['address'].",".$companyInfo['city'].",".$companyInfo['state'].$companyInfo['country'].$companyInfo['zipcode'];
    $data['tmpl_custom_id'] = $companyInfo['reseller_id'];
    $contract = get_email_template('reseller_contract', $data);
    return $contract;
}
                    $email_to = "*****@*****.**";
                    $email_subject = "Registration Confirmation";
                    $transactiontype = func_get_merchant_name($transaction_type);
                    $email_message = func_getreplymailbody_admin($companyname, $username, $password, $user_reference_num, $transactiontype, $how_about_us, $voulmeNumber);
                    if (!func_send_mail($email_from, $email_to, $email_subject, $email_message)) {
                        print "An error encountered while sending the mail.";
                    }
                    if ($mail_sent == 1) {
                        $emailData["full_name"] = $ResellerCompanyName;
                        $emailData["email"] = $email;
                        $emailData["resellername"] = $ResellerCompanyName;
                        $emailData["companyname"] = $companyname;
                        $emailData["username"] = $username;
                        $emailData["password"] = $password;
                        $emailData["gateway_select"] = $companyInfo['gateway_id'];
                        $emailContents = get_email_template("merchant_referral_letter", $emailData);
                        send_email_template("merchant_referral_letter", $emailData);
                        $msgtodisplay = $emailContents['et_htmlformat'];
                    }
                }
            }
            // is suceess ends here
        }
    }
}
//print func_getreplymailbody_htmlformat($companyname,$username,$password);
print $msgtodisplay;
etel_smarty_display("main_footer.tpl");
function func_reseller_merchant_loginletter_htmlformat()
{
    $str_mail_string = "<html><head><title>::eTelegate.com::</title><style>";
Exemple #19
0
         tep_session_register('login_useremail');
         // set cookies for autologin
         if ($_POST['remember_me']) {
             tep_setcookie("account_number", $account_number, time() + 60 * 60 * 24 * 100, HTTP_COOKIE_PATH, HTTP_COOKIE_DOMAIN);
             tep_setcookie("password", $login_password, time() + 60 * 60 * 24 * 100, HTTP_COOKIE_PATH, HTTP_COOKIE_DOMAIN);
         }
         $current_ip = get_client_ip();
         $mss_flag = false;
         if ($user_info['verification_status'] == 1 && $current_ip != $user_info['verification_ip']) {
             $mss_flag = true;
         }
         if ($mss_flag) {
             $verification_key = tep_create_random_value(10, 'digits');
             $signup_data_array['verification_key'] = $verification_key;
             db_perform(_TABLE_USERS, $signup_data_array, 'update', " user_id='" . $user_info['user_id'] . "' ");
             $email_info = get_email_template('VERIFYCATION_KEY');
             $msg_subject = $email_info['emailtemplate_subject'];
             $msg_content = str_replace(array('[firstname]', '[verification_key]'), array($user_info['firstname'], $verification_key), $email_info['emailtemplate_content']);
             $msg_content = html_entity_decode($msg_content);
             tep_mail($user_info['firstname'] . ' ' . $user_info['lastname'], $user_info['email'], $msg_subject, $msg_content, SITE_NAME, SITE_CONTACT_EMAIL);
         }
         if (sizeof($navigation->snapshot) > 0) {
             $origin_href = get_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
             $navigation->clear_snapshot();
             tep_redirect($origin_href, '', 'SSL');
         } else {
             tep_redirect(get_href_link(PAGE_LOGIN_CONFIRM, '', 'SSL'));
         }
     }
 } else {
     $validator->addError(ERROR_FIELD_LOGIN, ERROR_INVALID_ACCOUNT);
Exemple #20
0
 $express_id = $result->fields['express_delivery_id'];
 if ($express_id <= 0) {
     $output['errmsg'] = '快递号出错';
     $output['errno'] = 1;
     exit(json_encode($output));
 }
 $result = $db->Execute('select count(*) as total from orders_delivery where orders_id=' . $orders_id);
 if ($result->fields['total'] > 0) {
     $db->Execute('update orders_delivery set express_delivery_id=' . $express_id . ', track_number=\'' . zen_db_prepare_input($track_number) . "' where orders_id=" . $orders_id);
 } else {
     $db->Execute("insert into orders_delivery(orders_id, express_delivery_id, track_number)values({$orders_id}, {$express_id}, '{$track_number}');");
 }
 $output['cnt'] = '保存完成';
 if ($send_delivery_mail) {
     $variable = get_variable_order($orders_id);
     $mail_tempalte = get_email_template(CONST_SEND_MAIL_DELIVERY);
     $to_name = $variable['{customers_name}'];
     $to_address = $variable['{customers_email_address}'];
     $from_email_name = $variable['{store_name}'];
     $mail_info = get_mail_random();
     $variable = array_merge($variable, $mail_info);
     $from_email_address = $mail_info['smtp_user'];
     $email_subject = str_ireplace(array_keys($variable), array_values($variable), $mail_tempalte['subject']);
     $email_text = str_ireplace(array_keys($variable), array_values($variable), $mail_tempalte['content']);
     $send_status = jsend_mail($to_name, $to_address, $email_subject, $email_text, $from_email_name, $from_email_address, $variable);
     $temp_result = $db->Execute('SELECT count FROM orders_send_mail WHERE orders_id=' . (int) $orders_id . ' AND email_template_id=' . (int) $mail_tempalte['email_template_id']);
     if ($temp_result->fields['count'] > 0) {
         zen_db_perform('orders_send_mail', array('count' => (int) $temp_result->fields['count'] + 1), 'update', 'orders_id=' . $orders_id . ' and email_template_id=' . $mail_tempalte['email_template_id']);
     } else {
         zen_db_perform('orders_send_mail', array('orders_id' => $orders_id, 'email_template_id' => $mail_tempalte['email_template_id'], 'count' => 1));
     }