$EmailMessage = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $EmailMessage);
 $EmailMessage = str_replace("%SITE_NAME%", JB_SITE_NAME, $EmailMessage);
 $EmailMessage = str_replace("%SITE_LOGO_URL%", JB_SITE_LOGO_URL, $EmailMessage);
 $EmailMessage = str_replace("%RESUME_ALERT%", '', $EmailMessage);
 // for compatibility with older version
 $EmailMessage = str_replace("%RESUME_ALERTS%", $resume_alert_list_html, $EmailMessage);
 $EmailMessage = str_replace("%KEYWORDS_LINE%", '', $EmailMessage);
 // for compatibility with older version
 $EmailMessage = str_replace("%EMPLOYER_LINK%", '<a href="' . $_clink . '">' . $_clink . '</a>', $EmailMessage);
 $html_message = $EmailMessage;
 ################
 $lang = $user_row['lang'];
 if ($lang == '') {
     $lang = JB_get_default_lang();
 }
 $e_result = JB_get_email_template(5, $lang);
 $e_row = mysql_fetch_array($e_result);
 $EmailMessage = $e_row['EmailText'];
 $from = $e_row['EmailFromAddress'];
 $from_name = $e_row['EmailFromName'];
 $subject = $e_row['EmailSubject'];
 $resume_alert_line = $e_row['sub_template'];
 ################################################################################
 # Build resume list for each user.
 # Text email
 # Use jb_get_raw_template_value()
 # and then call strip_tags()
 ###
 if ($resume_alert_line != '') {
     // the new way of building the resume lines
     $resume_alert_list_text = '';
Exemple #2
0
function JB_expire_post($post_id)
{
    $post_id = (int) $post_id;
    $sql = "UPDATE posts_table SET expired='Y' where post_id='" . jb_escape_sql($post_id) . "' ";
    JB_mysql_query($sql) or $DB_ERROR = mysql_error();
    JBPLUG_do_callback('expire_post', $post_id);
    // col val is post_id
    if (JB_EMAIL_POST_EXP_SWITCH == 'YES') {
        // Send Expiration email
        $Form = JB_get_DynamicFormObject(1);
        $Form->load($post_id);
        $TITLE = $Form->get_raw_template_value("TITLE");
        $DATE = JB_get_formatted_date($Form->get_template_value("DATE"));
        $POSTED_BY_ID = $Form->get_value('user_id');
        // get the employer
        $sql = "SELECT * FROM employers WHERE ID='" . jb_escape_sql($POSTED_BY_ID) . "' ";
        $emp_result = jb_mysql_query($sql);
        $emp_row = mysql_fetch_array($emp_result);
        // get the email template
        $template_result = JB_get_email_template(210, $emp_row['lang']);
        $t_row = mysql_fetch_array($template_result);
        $to_address = $emp_row['Email'];
        $to_name = JB_get_formatted_name($emp_row['FirstName'], $emp_row['LastName']);
        $subject = $t_row['EmailSubject'];
        $message = $t_row['EmailText'];
        $from_name = $t_row['EmailFromName'];
        $from_address = $t_row['EmailFromAddress'];
        $message = str_replace("%LNAME%", $emp_row['LastName'], $message);
        $message = str_replace("%FNAME%", $emp_row['FirstName'], $message);
        $message = str_replace("%SITE_NAME%", JB_SITE_NAME, $message);
        $message = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $message);
        $message = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $message);
        $message = str_replace("%POST_TITLE%", $TITLE, $message);
        $message = str_replace("%POST_DATE%", $DATE, $message);
        $message = str_replace("%VIEWS%", $Form->get_value('hits'), $message);
        $message = str_replace("%APPS%", $Form->get_value('applications'), $message);
        $message = strip_tags($message);
        // plugin can change the recipient
        JBPLUG_do_callback('expire_post_set_recipient_email', $to_address);
        JBPLUG_do_callback('expire_post_set_recipient_name', $to_name);
        // Place the email on the queue!
        JB_queue_mail($to_address, $to_name, $from_address, $from_name, $subject, $message, '', 210);
    }
}
Exemple #3
0
function email_config_form($email_id)
{
    $result = JB_get_email_template($email_id, $_SESSION['LANG']);
    $row = mysql_fetch_array($result, MYSQL_ASSOC);
    if ($row['EmailFromAddress'] == '') {
        $row['EmailFromAddress'] = JB_SITE_CONTACT_EMAIL;
    }
    if ($row['EmailFromName'] == '') {
        $row['EmailFromName'] = JB_SITE_NAME;
    }
    ?>
	<form method="POST" action="<?php 
    echo htmlentities($_SERVER['PHP_SELF']);
    ?>
">
	<input type="hidden" name="EmailID" value="<?php 
    echo $email_id;
    ?>
">

	<table border="0" cellSpacing="1" cellPadding="3" bgColor="#d9d9d9">
	<tr><td bgColor="#eaeaea"><font size="2"><b>From Address:</b></font></td><td bgColor="#ffffff"><input size="40" type="text" name="EmailFromAddress" value="<?php 
    echo JB_escape_html($row['EmailFromAddress']);
    ?>
"></td></tr>
	<tr><td bgColor="#eaeaea"><font size="2"><b>From Name:</b></font></td ><td bgColor="#ffffff"><input size="40" type="text" name="EmailFromName" value="<?php 
    echo JB_escape_html($row['EmailFromName']);
    ?>
"></td></tr>
	<tr><td bgColor="#eaeaea"><font size="2"><b>Subject:</b></font></td><td bgColor="#ffffff"><input size="40" type="text" name="EmailSubject" <?php 
    if ($email_id == 10) {
        echo ' disabled ';
    }
    ?>
 value="<?php 
    echo JB_escape_html($row['EmailSubject']);
    ?>
"> <?php 
    if ($email_id == 10) {
        echo '<b>Note: The subject of this email will be changed to \'app_receipt_subject\' language phrase which is editable via Admin->Languages : Editing/Translation tool. The \'From address\' and \'from name\' of this email will be changed to what ever is given by the applicant!</b>';
    }
    ?>
(<small>Cannot use template tags here)</small></td></tr>
	<tr><td bgColor="#eaeaea"><font size="2"><b>Email Text:</b></font></td><td bgColor="#ffffff"><textarea name="EmailText" rows="20" cols="80"><?php 
    echo JB_escape_html($row['EmailText']);
    ?>
</textarea></td></tr>
	<?php 
    if ($email_id == 8 || $email_id == 7) {
        // job alerts
        ?>
		<tr><td bgColor="#eaeaea"><font size="2"><b>Job list item template:</b></font></td><td bgColor="#ffffff"><b>%JOB_ALERTS%</b> : The following line will be iterated to produce the list of matching jobs in the %JOB_ALERTS% tag<br><textarea name="sub_template" rows="2" cols="80"><?php 
        echo JB_escape_html($row['sub_template']);
        ?>
</textarea><br><font size="2"><b>You can use the following template tags in the field above:</b><br>
		%FORMATTED_DATE% - Formatted date according to the timezone<br>
		%BASE_HTTP_PATH% - Link to the website, eg http://www.example.com/<br>
		<?php 
        require_once "../include/posts.inc.php";
        $PForm =& JB_get_DynamicFormObject(1);
        $PForm->reset_fields();
        while ($field = $PForm->next_field()) {
            if ($field['field_type'] == 'BLANK' || $field['field_type'] == 'SEPERATOR') {
                continue;
            }
            if ($field['template_tag'] != '' && strlen($field['field_label']) > 0) {
                echo "%" . $field['template_tag'] . "% - " . $field['field_label'] . "<br>";
            }
        }
        ?>
		</font>
		</td></tr>
		<?php 
    }
    ?>
	<?php 
    if ($email_id == 5 || $email_id == 6) {
        // resume alerts
        ?>
		<tr><td bgColor="#eaeaea"><font size="2"><b>Resume list item template:</b></font></td><td bgColor="#ffffff"><b>%RESUME_ALERTS%</b> : The following line will be iterated to produce the list of matching resumes in the %RESUME_ALERTS%<br><textarea name="sub_template" rows="2" cols="80"><?php 
        echo JB_escape_html($row['sub_template']);
        ?>
</textarea><br><font size="2">
		<b>You can use the following template tags in the field above:</b><br>
		%FORMATTED_DATE% - Formatted date according to the timezone<br>
		%RESUME_DB_LINK% - Direct link to the resume / resume database for the employer (<span style="color:red; font-weight:bold;">NEW!</span>)<br>
		<?php 
        require_once "../include/resumes.inc.php";
        $RForm =& JB_get_DynamicFormObject(2);
        $RForm->reset_fields();
        while ($field = $RForm->next_field()) {
            if ($field['field_type'] == 'BLANK' || $field['field_type'] == 'SEPERATOR') {
                continue;
            }
            if ($field['template_tag'] != '' && strlen($field['field_label']) > 0) {
                echo "%" . $field['template_tag'] . "% - " . $field['field_type'] . "<br>";
            }
        }
        ?>
		</font>
		</td></tr>
		<?php 
    }
    ?>
	<tr><td bgColor="#eaeaea"></td><td bgColor="#ffffff"><input type="submit" value="Save Template" name="submit"></td></tr>
	</table>
	</form>
	<?php 
}
function JB_create_new_employer_account()
{
    if ($_REQUEST['lang'] == '') {
        $_REQUEST['lang'] = JB_get_default_lang();
    }
    global $label;
    global $jb_mysql_link;
    $validated = 0;
    if (JB_EM_NEEDS_ACTIVATION == "AUTO" || JB_EM_NEEDS_ACTIVATION == "FIRST_POST") {
        $validated = 1;
    }
    // when inserting, use $assign to overwrite
    // the values which we do not want to fetch from the $_REQUEST
    // (Assuming that values on $_REQUEST already went through validation)
    $assign = array('Validated' => $validated, 'SignupDate' => gmdate("Y-m-d H:i:s"), 'IP' => $_SERVER['REMOTE_ADDR'], 'Newsletter' => (int) $_REQUEST['Newsletter'], 'Notification1' => (int) $_REQUEST['Notification1'], 'Notification2' => (int) $_REQUEST['Notification2'], 'posts_balance' => JB_BEGIN_STANDARD_CREDITS, 'premium_posts_balance' => JB_BEGIN_PREMIUM_CREDITS, 'Password' => md5(stripslashes($_REQUEST['Password'])), 'expired' => 'N');
    $sql = "REPLACE INTO `employers` (" . JB_get_sql_insert_fields(4, $assign) . ") VALUES (" . JB_get_sql_insert_values(4, "employers", "ID", $employer_id, '', $assign) . ") ";
    $result = JB_mysql_query($sql);
    $employer_id = JB_mysql_insert_id();
    if ($employer_id > 0) {
        JBPLUG_do_callback('create_employer_account', $employer_id);
    }
    $result = JB_get_email_template(2, $_SESSION['LANG']);
    $e_row = mysql_fetch_array($result, MYSQL_ASSOC);
    $subject = str_replace("%MEMBERID%", stripslashes($_REQUEST['Username']), $e_row['EmailSubject']);
    $EmailMessage = str_replace("%FNAME%", stripslashes($_REQUEST['FirstName']), $e_row['EmailText']);
    $EmailMessage = str_replace("%LNAME%", stripslashes($_REQUEST['LastName']), $EmailMessage);
    $EmailMessage = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $EmailMessage);
    $EmailMessage = str_replace("%SITE_NAME%", JB_SITE_NAME, $EmailMessage);
    $EmailMessage = str_replace("%MEMBERID%", stripslashes($_REQUEST['Username']), $EmailMessage);
    $EmailMessage = str_replace("%PASSWORD%", stripslashes($_REQUEST['Password']), $EmailMessage);
    $EmailMessage = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $EmailMessage);
    JBPLUG_do_callback('employer_signup_email_msg', $EmailMessage, $employer_id);
    if (!defined('JB_EMAIL_EMP_SIGNUP')) {
        define('JB_EMAIL_EMP_SIGNUP', 'YES');
    }
    if (JB_EMAIL_EMP_SIGNUP == 'YES') {
        $email_id = JB_queue_mail(stripslashes($_REQUEST['Email']), jb_get_formatted_name(stripslashes($_REQUEST['FirstName']), stripslashes($_REQUEST['LastName'])), $e_row['EmailFromAddress'], $e_row['EmailFromName'], $subject, $EmailMessage, '', 2);
        JB_process_mail_queue(1, $email_id);
    }
    $to = JB_SITE_CONTACT_EMAIL;
    if (JB_EMAIL_EMPLOYER_SIGNUP_SWITCH == 'YES') {
        $email_id = JB_queue_mail($to, "Admin", JB_SITE_CONTACT_EMAIL, JB_SITE_NAME, $subject, $EmailMessage, '', 2);
        JB_process_mail_queue(1, $email_id);
    }
    return $employer_id;
}
Exemple #5
0
function JB_expire_subscription(&$invoice_row, $send_email = true)
{
    $now = gmdate("Y-m-d H:i:s");
    $sql = "UPDATE subscription_invoices SET `status`='Expired', subscr_end='{$now}' WHERE invoice_id='" . JB_escape_sql($invoice_row['invoice_id']) . "' ";
    @JB_mysql_query($sql) or JB_mail_error(mysql_error() . $sql);
    $sql = "UPDATE `employers` SET `can_view_blocked`='N', `subscription_can_view_resume`='N', `subscription_can_post`='N', `subscription_can_premium_post`='N', views_quota=0, posts_quota=0, p_posts_quota=0, quota_timestamp=0 WHERE ID='" . JB_escape_sql($invoice_row['employer_id']) . "' ";
    @JB_mysql_query($sql) or JB_mail_error(mysql_error() . $sql);
    if (JB_EMAIL_SUBSCR_EXP_SWITCH == 'YES' && $send_email) {
        $sql = "Select * from employers WHERE ID='" . JB_escape_sql($invoice_row['employer_id']) . "'";
        $result = JB_mysql_query($sql) or JB_mail_error(mysql_error() . $sql);
        $e_row = mysql_fetch_array($result, MYSQL_ASSOC);
        //$invoice_row = JB_get_subscription_invoice_row ($row['invoice_id']); // reload invoice
        $template_r = JB_get_email_template(130, $e_row['lang']);
        $template = mysql_fetch_array($template_r);
        $msg = $template['EmailText'];
        $from = $template['EmailFromAddress'];
        $from_name = $template['EmailFromName'];
        $subject = $template['EmailSubject'];
        $msg = str_replace("%FNAME%", $e_row['FirstName'], $msg);
        $msg = str_replace("%LNAME%", $e_row['LastName'], $msg);
        $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
        $msg = str_replace("%INVOICE_CODE%", "S" . $invoice_row['invoice_id'], $msg);
        $msg = str_replace("%ITEM_NAME%", $invoice_row['item_name'], $msg);
        $msg = str_replace("%SUB_START%", JB_get_formatted_time(JB_get_local_time($invoice_row['subscr_date'])), $msg);
        $msg = str_replace("%SUB_END%", JB_get_formatted_time(JB_get_local_time($invoice_row['subscr_end'])), $msg);
        $msg = str_replace("%SUB_DURATION%", $invoice_row['months_duration'], $msg);
        $msg = str_replace("%INVOICE_AMOUNT%", JB_convert_to_default_currency_formatted($invoice_row['currency_code'], $invoice_row['amount']), $msg);
        $msg = str_replace("%PAYMENT_METHOD%", $invoice_row['payment_method'], $msg);
        $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
        $msg = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $msg);
        $to = $e_row['Email'];
        $to_name = jb_get_formatted_name($e_row['FirstName'], $e_row['LastName']);
        $email_id = JB_queue_mail($to, $to_name, $from, $from_name, $subject, $msg, '', 130);
        JB_process_mail_queue(1, $email_id);
    }
}
function JB_create_new_candidate_account()
{
    global $label;
    if ($_REQUEST['lang'] == '') {
        $_REQUEST['lang'] = JB_get_default_lang();
    }
    $validated = 0;
    if (JB_CA_NEEDS_ACTIVATION == "AUTO") {
        $validated = 1;
    }
    // when inserting, use $assign to overwrite
    // the values which we do not want to fetch from the $_REQUEST
    // (Assuming that values on $_REQUEST already went through validation)
    $assign = array('Validated' => $validated, 'SignupDate' => gmdate("Y-m-d H:i:s"), 'IP' => $_SERVER['REMOTE_ADDR'], 'Newsletter' => (int) $_REQUEST['Newsletter'], 'Notification1' => (int) $_REQUEST['Notification1'], 'Notification2' => (int) $_REQUEST['Notification2'], 'Password' => md5(stripslashes($_REQUEST['Password'])), 'expired' => 'N');
    $sql = "REPLACE INTO `users` ( " . JB_get_sql_insert_fields(5, $assign) . ") VALUES (   " . JB_get_sql_insert_values(5, "users", "ID", $user_id, '', $assign) . ") ";
    JB_mysql_query($sql);
    $user_id = JB_mysql_insert_id();
    if ($user_id > 0) {
        JBPLUG_do_callback('create_candidate_account', $user_id);
    }
    // Here the emailmessage itself is defined, this will be send to your members. Don't forget to set the validation link here.
    $result = JB_get_email_template(1, $_SESSION['LANG']);
    $e_row = mysql_fetch_array($result, MYSQL_ASSOC);
    $EmailMessage = $e_row['EmailText'];
    $from = $e_row['EmailFromAddress'];
    $from_name = $e_row['EmailFromName'];
    $subject = $e_row['EmailSubject'];
    $subject = str_replace("%MEMBERID%", stripslashes($_REQUEST['Username']), $subject);
    $EmailMessage = str_replace("%FNAME%", stripslashes($_REQUEST['FirstName']), $EmailMessage);
    $EmailMessage = str_replace("%LNAME%", stripslashes($_REQUEST['LastName']), $EmailMessage);
    $EmailMessage = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $EmailMessage);
    $EmailMessage = str_replace("%SITE_NAME%", JB_SITE_NAME, $EmailMessage);
    $EmailMessage = str_replace("%MEMBERID%", stripslashes($_REQUEST['Username']), $EmailMessage);
    $EmailMessage = str_replace("%PASSWORD%", stripslashes($_REQUEST['Password']), $EmailMessage);
    $EmailMessage = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $EmailMessage);
    JBPLUG_do_callback('candidate_signup_email_msg', $EmailMessage, $user_id);
    $to = stripslashes($_REQUEST['Email']);
    if (!defined('JB_EMAIL_CAN_SIGNUP')) {
        define('JB_EMAIL_CAN_SIGNUP', 'YES');
    }
    if (JB_EMAIL_CAN_SIGNUP == 'YES') {
        $email_id = JB_queue_mail($to, stripslashes(jb_get_formatted_name(stripslashes($_REQUEST['FirstName']), stripslashes($_REQUEST['LastName']))), $e_row['EmailFromAddress'], $e_row['EmailFromName'], $subject, $EmailMessage, '', 1);
        JB_process_mail_queue(1, $email_id);
    }
    $to = JB_SITE_CONTACT_EMAIL;
    if (JB_EMAIL_CANDIDATE_SIGNUP_SWITCH == 'YES') {
        $email_id = JB_queue_mail($to, "Admin", JB_SITE_CONTACT_EMAIL, JB_SITE_NAME, $subject, $EmailMessage, '', 2);
        JB_process_mail_queue(1, $email_id);
    }
    return $user_id;
}
Exemple #7
0
$message = JB_clean_str(trim($_REQUEST['message']));
if ($submit != '') {
    if ($from == '') {
        $error .= $label["employer_request_details_error_msg1"] . "<br>";
    } elseif (!JB_validate_mail($reply_to)) {
        $error .= $label["employer_request_details_error_msg3"] . "<br> ";
    }
    if ($reply_to == '') {
        $error .= $label["employer_request_details_error_msg2"] . "<br>";
    }
    if (JB_request_was_made($candidate['ID'], $_SESSION['JB_ID']) == false && $error == '') {
        jb_add_new_request($candidate['ID'], $_SESSION['JB_ID'], 'REQUEST', $message);
        JB_mysql_query($sql) or die(mysql_error());
        $result = JB_mysql_query("SELECT * from `employers` where `ID`='" . $_SESSION['JB_ID'] . "' ") or die(mysql_error());
        $employer = mysql_fetch_array($result, MYSQL_ASSOC);
        $result = JB_get_email_template(4, $_SESSION['LANG']);
        $e_row = mysql_fetch_array($result, MYSQL_ASSOC);
        $EmailMessage = $e_row['EmailText'];
        //$from = $e_row[EmailFromAddress];
        //$from_name = $e_row[EmailFromName];
        $subject = $e_row['EmailSubject'];
        $EmailMessage = str_replace("%FNAME%", $candidate['FirstName'], $EmailMessage);
        $EmailMessage = str_replace("%LNAME%", $candidate['LastName'], $EmailMessage);
        $EmailMessage = str_replace("%EMPLOYER_NAME%", JB_clean_str($_REQUEST['from']), $EmailMessage);
        $EmailMessage = str_replace("%REPLY_TO%", JB_clean_str($_REQUEST['reply_to']), $EmailMessage);
        $EmailMessage = str_replace("%PERMIT_LINK%", JB_BASE_HTTP_PATH . JB_CANDIDATE_FOLDER . "permit.php?k=" . $key, $EmailMessage);
        $EmailMessage = str_replace("%SITE_NAME%", JB_SITE_NAME, $EmailMessage);
        $EmailMessage = str_replace("%MESSAGE%", $_REQUEST['message'], $EmailMessage);
        //echo $EmailMessage;
        $label["employer_request_letter_subject"] = str_replace("%SITE_NAME%", JB_SITE_NAME, $label["employer_request_letter_subject"]);
        $subject = $e_row['EmailSubject'];
Exemple #8
0
 $JBMarkup->ok_msg("Job Post #" . jb_escape_html($post_id) . " disapproved!");
 $PForm =& JB_get_DynamicFormObject(1);
 $PForm->load($post_id);
 JB_update_post_category_count($PForm->get_values());
 JB_finalize_post_updates();
 if (JB_EMAIL_POST_DISAPP_SWITCH == "YES") {
     // send out the disapproval notification to the employer
     $TITLE = $PForm->get_raw_template_value("TITLE");
     $DATE = JB_get_formatted_date($PForm->get_template_value("DATE"));
     $POSTED_BY_ID = $PForm->get_value('user_id');
     // get the employer
     $sql = "SELECT * FROM employers WHERE ID='" . jb_escape_sql($POSTED_BY_ID) . "' ";
     $emp_result = jb_mysql_query($sql);
     $emp_row = mysql_fetch_array($emp_result);
     // get the email template
     $template_result = JB_get_email_template(230, $emp_row['lang']);
     $t_row = mysql_fetch_array($template_result);
     $to_address = $emp_row['Email'];
     $to_name = jb_get_formatted_name($emp_row['FirstName'], $emp_row['LastName']);
     $subject = $t_row['EmailSubject'];
     $message = $t_row['EmailText'];
     $from_name = $t_row['EmailFromName'];
     $from_address = $t_row['EmailFromAddress'];
     /*substitute the vars
     
     					%LNAME% - last name of the user
     					%FNAME% - first name of the user
     					%SITE_NAME% - name of your website
     					%SITE_URL% - URL to your site
     					%SITE_CONTACT_EMAIL% - contact email to your site.
     					%POST_TITLE% - The title of the post
Exemple #9
0
    function process_payment_return()
    {
        global $label;
        if ($_REQUEST['order_id'] != '' && $_REQUEST['nhezk5'] != '') {
            $invoice_id = jb_strip_order_id($_REQUEST['order_id']);
            $product_type = substr($invoice_id, 0, 1);
            // 'P' or 'S'
            $invoice_id = substr($invoice_id, 1);
            if ($_SESSION['JB_ID'] == '') {
                echo "Error: You must be logged in to view this page";
                JBPLUG_do_callback('pay_trn_verification_failed', $invoice_id, $product_type);
            } else {
                JBPLUG_do_callback('pay_trn_verification_passed', $invoice_id, $product_type);
                ?>
				
				<div style='background-color: #ffffff; border-color:#C0C0C0; border-style:solid;padding:10px'>
				<p align="center"><center>
				<?php 
                if ($product_type == 'P') {
                    $sql = "SELECT * from package_invoices where invoice_id='" . jb_escape_sql($invoice_id) . "' and employer_id='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
                } elseif ($product_type == 'S') {
                    $sql = "SELECT * from subscription_invoices where invoice_id='" . jb_escape_sql($invoice_id) . "' and employer_id='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
                } elseif ($product_type == 'M') {
                    $sql = "SELECT * from membership_invoices where invoice_id='" . jb_escape_sql($invoice_id) . "' and user_id='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
                }
                $result = JB_mysql_query($sql) or die(mysql_error() . $sql);
                $order_row = mysql_fetch_array($result, MYSQL_ASSOC);
                if (BANK_TAX_RATE > 0) {
                    if (BANK_ADD_TAX != 'Y') {
                        // taxes included in prices
                        // work out the tax paid in the amount
                        $tax = $order_row['amount'] - $order_row['amount'] / (1.0 + BANK_TAX_RATE);
                    } else {
                        $tax = $order_row['amount'] * BANK_TAX_RATE;
                        $order_row['amount'] = $order_row['amount'] + $tax;
                        // update the amount on the invoice row
                        if (!does_field_exist("package_invoices", "invoice_tax")) {
                            $sql = "ALTER TABLE `package_invoices` ADD `invoice_tax` FLOAT NOT NULL DEFAULT '0';";
                            mysql_query($sql) or die($sql . mysql_error());
                            $sql = "ALTER TABLE `subscription_invoices` ADD `invoice_tax` FLOAT NOT NULL DEFAULT '0';";
                            mysql_query($sql) or die($sql . mysql_error());
                            $sql = "ALTER TABLE `membership_invoices` ADD `invoice_tax` FLOAT NOT NULL DEFAULT '0';";
                            mysql_query($sql) or die($sql . mysql_error());
                        }
                        if ($product_type == 'P') {
                            $sql = "UPDATE package_invoices SET invoice_tax='" . (0 - $tax) . "', amount = amount + '" . jb_escape_sql($order_row['amount']) . "' WHERE invoice_id='" . jb_escape_sql($invoice_id) . "' and employer_id='" . jb_escape_sql($_SESSION['JB_ID']) . "' AND invoice_tax != '' ";
                        } elseif ($product_type == 'S') {
                            $sql = "UPDATE subscription_invoices SET invoice_tax='" . (0 - $tax) . "', amount = amount + '" . jb_escape_sql($order_row['amount']) . "' WHERE invoice_id='" . jb_escape_sql($invoice_id) . "' and employer_id='" . jb_escape_sql($_SESSION['JB_ID']) . "' AND invoice_tax != ''";
                        } elseif ($product_type == 'M') {
                            $sql = "UPDATE membership_invoices SET invoice_tax='" . (0 - $tax) . "', amount = amount + '" . jb_escape_sql($order_row['amount']) . "' WHERE invoice_id='" . jb_escape_sql($invoice_id) . "' and user_id='" . jb_escape_sql($_SESSION['JB_ID']) . "' AND invoice_tax != ''";
                        }
                    }
                }
                if (BANK_ADVANCE_CREDIT == 'YES' && strtolower($order_row['status']) != 'pending') {
                    // place the order as 'pending' and advance the credits
                    if ($product_type == 'P') {
                        // posting credits
                        $order_row = JB_pend_package_invoice($invoice_id, $payment_method = 'bank', $pending_reason = 'jb_credit_advanced');
                        // credit the points to the customer's account
                        JB_add_posting_credits($order_row);
                    }
                    if ($product_type == 'S') {
                        // subscription to view resumes
                        $order_row = JB_pend_subscription_invoice($invoice_id, $payment_method = 'bank', $pending_reason = 'jb_credit_advanced');
                        JB_start_employer_subscription($order_row);
                    }
                    if ($product_type == 'M') {
                        // membership
                        $order_row = JB_pend_membership_invoice($invoice_id, $payment_method = 'bank', $pending_reason = 'jb_credit_advanced');
                        JB_start_membership($order_row);
                    }
                    JBPLUG_do_callback('pay_trn_pending', $invoice_id, $product_type);
                }
                $bank_amount = JB_convert_to_currency($order_row['amount'], $order_row['currency_code'], BANK_CURRENCY);
                $bank_amount = JB_format_currency($bank_amount, BANK_CURRENCY, true);
                $label['payment_bank_heading'] = str_replace("%INVOICE_AMOUNT%", $bank_amount, $label['payment_bank_heading']);
                $label['payment_bank_note'] = str_replace("%CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $label['payment_bank_note']);
                $label['payment_bank_note'] = str_replace("%INVOICE_CODE%", $product_type . $invoice_id, $label['payment_bank_note']);
                $label['payment_bank_tax'] = str_replace("%INVOICE_TAX%", JB_format_currency($tax, BANK_CURRENCY, true), $label['payment_bank_tax']);
                if (JB_get_default_currency() != BANK_CURRENCY) {
                    echo JB_convert_to_default_currency_formatted($order_row['currency_code'], $order_row['amount']) . " = " . $bank_amount;
                    echo "<br>";
                }
                ?>
				
				<table width="70%"><tr><td>
				<?php 
                if (BANK_TAX_RATE > 0) {
                    ?>
				<b><?php 
                    echo $label['payment_bank_tax'];
                    ?>
</b><br>
				<?php 
                }
                ?>
				<b><?php 
                echo $label['payment_bank_heading'];
                ?>
</b><br>
				
				<?php 
                if (BANK_NAME != '') {
                    ?>
				<b><?php 
                    echo $label['payment_bank_name'];
                    ?>
</b> <?php 
                    echo BANK_NAME;
                    ?>
<br>
				<?php 
                }
                ?>
				<?php 
                if (BANK_ADDRESS != '') {
                    ?>
				<b><?php 
                    echo $label['payment_bank_addr'];
                    ?>
</b> <?php 
                    echo BANK_ADDRESS;
                    ?>
<br>
				<?php 
                }
                ?>
				<?php 
                if (BANK_ACCOUNT_NAME != '') {
                    ?>
				<b><?php 
                    echo $label['payment_bank_ac_name'];
                    ?>
</b> <?php 
                    echo BANK_ACCOUNT_NAME;
                    ?>
<br>
				<?php 
                }
                ?>
				<?php 
                if (BANK_ACCOUNT_NUMBER != '') {
                    ?>
				<b><?php 
                    echo $label['payment_bank_ac_number'];
                    ?>
</b> <?php 
                    echo BANK_ACCOUNT_NUMBER;
                    ?>
<br>
				<?php 
                }
                ?>
				<?php 
                if (BANK_BRANCH_NUMBER != '') {
                    ?>
				<b><?php 
                    echo $label['payment_bank_branch_number'];
                    ?>
</b> <?php 
                    echo BANK_BRANCH_NUMBER;
                    ?>
<br>
				<?php 
                }
                ?>
				<?php 
                if (BANK_SWIFT != '') {
                    ?>

				<b><?php 
                    echo $label['payment_bank_swift'];
                    ?>
</b> <?php 
                    echo BANK_SWIFT;
                    ?>
<br>

				<?php 
                }
                ?>
				<?php 
                echo $label['payment_bank_note'];
                ?>
				</td></tr>
				</table>
				
				</p>
				</center>
				
				</div>
				<?php 
                if ($order_row['user_type'] == 'C') {
                    $sql = "Select * from users where ID='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
                } else {
                    $sql = "Select * from employers where ID='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
                }
                $result = JB_mysql_query($sql) or die(mysql_error());
                $e_row = mysql_fetch_array($result, MYSQL_ASSOC);
                if ($product_type == 'P') {
                    $template_r = JB_get_email_template(60, $_SESSION['LANG']);
                    $template = mysql_fetch_array($template_r);
                    $msg = $template['EmailText'];
                    $from = $template['EmailFromAddress'];
                    $from_name = $template['EmailFromName'];
                    $subject = $template['EmailSubject'];
                    $to = $e_row['Email'];
                    $to_name = jb_get_formatted_name($e_row['FirstName'], $e_row['LastName']);
                    $msg = str_replace("%INVOICE_TAX%", JB_format_currency($tax, BANK_CURRENCY, true), $msg);
                    $msg = str_replace("%FNAME%", $e_row['FirstName'], $msg);
                    $msg = str_replace("%LNAME%", $e_row['LastName'], $msg);
                    $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
                    $msg = str_replace("%INVOICE_CODE%", "P" . $order_row['invoice_id'], $msg);
                    $msg = str_replace("%QUANTITY%", $order_row['posts_quantity'], $msg);
                    $msg = str_replace("%ITEM_NAME%", $order_row['item_name'], $msg);
                    $msg = str_replace("%INVOICE_AMOUNT%", JB_convert_to_default_currency_formatted($order_row['currency_code'], $order_row['amount']), $msg);
                    $msg = str_replace("%BANK_NAME%", BANK_NAME, $msg);
                    $msg = str_replace("%BANK_ADDRESS%", BANK_ADDRESS, $msg);
                    $msg = str_replace("%BANK_AC_SWIFT%", BANK_SWIFT, $msg);
                    $msg = str_replace("%BANK_AC_CURRENCY%", BANK_CURRENCY, $msg);
                    $msg = str_replace("%BANK_AC_BRANCH%", BANK_AC_BRANCH, $msg);
                    $msg = str_replace("%AC_NAME%", BANK_ACCOUNT_NAME, $msg);
                    $msg = str_replace("%AC_NUMBER%", BANK_ACCOUNT_NUMBER, $msg);
                    $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
                    $msg = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $msg);
                    if (BANK_EMAIL_CONFIRM == 'YES') {
                        $email_id = JB_queue_mail($to, $to_name, $from, $from_name, $subject, $msg, '', 60);
                        JB_process_mail_queue(1, $email_id);
                    }
                } elseif ($product_type == 'S') {
                    // subscription invoice confirmed (id 80)
                    $template_r = JB_get_email_template(80, $_SESSION['LANG']);
                    $template = mysql_fetch_array($template_r);
                    $msg = $template['EmailText'];
                    $from = $template['EmailFromAddress'];
                    $from_name = $template['EmailFromName'];
                    $subject = $template['EmailSubject'];
                    $to = $e_row['Email'];
                    $to_name = jb_get_formatted_name($e_row['FirstName'], $e_row['LastName']);
                    $msg = str_replace("%INVOICE_TAX%", JB_format_currency($tax, BANK_CURRENCY, true), $msg);
                    $msg = str_replace("%FNAME%", $e_row['FirstName'], $msg);
                    $msg = str_replace("%LNAME%", $e_row['LastName'], $msg);
                    $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
                    $msg = str_replace("%INVOICE_CODE%", "S" . $order_row['invoice_id'], $msg);
                    $msg = str_replace("%QUANTITY%", $order_row['posts_quantity'], $msg);
                    $msg = str_replace("%ITEM_NAME%", $order_row['item_name'], $msg);
                    $msg = str_replace("%INVOICE_AMOUNT%", JB_convert_to_default_currency_formatted($order_row['currency_code'], $order_row['amount']), $msg);
                    $msg = str_replace("%BANK_NAME%", BANK_NAME, $msg);
                    $msg = str_replace("%BANK_ADDRESS%", BANK_ADDRESS, $msg);
                    $msg = str_replace("%BANK_AC_SWIFT%", BANK_SWIFT, $msg);
                    $msg = str_replace("%BANK_AC_CURRENCY%", BANK_CURRENCY, $msg);
                    $msg = str_replace("%BANK_AC_BRANCH%", BANK_AC_BRANCH, $msg);
                    $msg = str_replace("%AC_NAME%", BANK_ACCOUNT_NAME, $msg);
                    $msg = str_replace("%AC_NUMBER%", BANK_ACCOUNT_NUMBER, $msg);
                    $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
                    $msg = str_replace("%SUB_DURATION%", $order_row['months_duration'], $msg);
                    if (BANK_EMAIL_CONFIRM == 'YES') {
                        $email_id = JB_queue_mail($to, $to_name, $from, $from_name, $subject, $msg, '', 80);
                        JB_process_mail_queue(1, $email_id);
                    }
                } elseif ($product_type == 'M') {
                    // membership invoice confirmed (id 100)
                    $template_r = JB_get_email_template(100, $_SESSION['LANG']);
                    $template = mysql_fetch_array($template_r);
                    $msg = $template['EmailText'];
                    $from = $template['EmailFromAddress'];
                    $from_name = $template['EmailFromName'];
                    $subject = $template['EmailSubject'];
                    $to = $e_row['Email'];
                    $to_name = jb_get_formatted_name($e_row['FirstName'], $e_row['LastName']);
                    $msg = str_replace("%INVOICE_TAX%", JB_format_currency($tax, BANK_CURRENCY, true), $msg);
                    $msg = str_replace("%FNAME%", $e_row['FirstName'], $msg);
                    $msg = str_replace("%LNAME%", $e_row['LastName'], $msg);
                    $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
                    $msg = str_replace("%INVOICE_CODE%", "M" . $order_row['invoice_id'], $msg);
                    $msg = str_replace("%INVOICE_CODE%", "M" . $order_row['invoice_id'], $msg);
                    $msg = str_replace("%ITEM_NAME%", $order_row['item_name'], $msg);
                    $msg = str_replace("%INVOICE_AMOUNT%", JB_convert_to_default_currency_formatted($order_row['currency_code'], $order_row['amount']), $msg);
                    $msg = str_replace("%BANK_NAME%", BANK_NAME, $msg);
                    $msg = str_replace("%BANK_ADDRESS%", BANK_ADDRESS, $msg);
                    $msg = str_replace("%BANK_AC_SWIFT%", BANK_SWIFT, $msg);
                    $msg = str_replace("%BANK_AC_CURRENCY%", BANK_CURRENCY, $msg);
                    $msg = str_replace("%BANK_AC_BRANCH%", BANK_AC_BRANCH, $msg);
                    $msg = str_replace("%AC_NAME%", BANK_ACCOUNT_NAME, $msg);
                    $msg = str_replace("%AC_NUMBER%", BANK_ACCOUNT_NUMBER, $msg);
                    $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
                    $msg = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $msg);
                    if ($order_row['months_duration'] == '0') {
                        $order_row['months_duration'] = $label['member_not_expire'];
                    }
                    $msg = str_replace("%MEM_DURATION%", $order_row['months_duration'], $msg);
                    if (BANK_EMAIL_CONFIRM == 'YES') {
                        $email_id = JB_queue_mail($to, $to_name, $from, $from_name, $subject, $msg, '', 100);
                        JB_process_mail_queue(1, $email_id);
                    }
                }
                JB_update_payment_method($product_type, $order_row['invoice_id'], "bank");
            }
        } else {
            JBPLUG_do_callback('pay_trn_verification_failed', $invoice_id, $product_type);
        }
    }
Exemple #10
0
function JB_send_request_granted_email($candidate_id, $employer_id)
{
    $user_id = (int) $candidate_id;
    $employer_id = (int) $employer_id;
    $sql = "SELECT FirstName, LastName, Password FROM users where `ID`='" . jb_escape_sql($candidate_id) . "' ";
    $result = jb_mysql_query($sql);
    $candidate_row = mysql_fetch_array($result, MYSQL_ASSOC);
    $sql = "SELECT FirstName, LastName, Email FROM employers where `ID`='" . jb_escape_sql($employer_id) . "' ";
    $result = jb_mysql_query($sql);
    $employer_row = mysql_fetch_array($result, MYSQL_ASSOC);
    // get the resume db link
    $sql = "SELECT resume_id FROM resumes_table WHERE user_id='" . jb_escape_sql($candidate_id) . "' AND `status`='ACT' ";
    $result = JB_mysql_query($sql) or die(mysql_error());
    if (mysql_num_rows($result) > 0) {
        $resume_row = mysql_fetch_array($result, MYSQL_ASSOC);
        $val = substr(md5($resume_row['resume_id'] . $candidate_row['Password'] . $candidate_id), 0, 10);
        $resume_db_link = JB_BASE_HTTP_PATH . JB_EMPLOYER_FOLDER . "search.php?resume_id=" . urlencode($resume_row['resume_id']) . "&id=" . urlencode($candidate_id) . "&key={$val}";
    } else {
        return false;
        // resume does not exist anymore...
    }
    $result = JB_get_email_template(44, $_SESSION['LANG']);
    $e_row = mysql_fetch_array($result, MYSQL_ASSOC);
    $text_message = $e_row['EmailText'];
    $from = $e_row['EmailFromAddress'];
    $from_name = $e_row['EmailFromName'];
    $subject = $e_row['EmailSubject'];
    $candidate_name = JB_get_formatted_name($candidate_row['FirstName'], $candidate_row['LastName']);
    $employer_name = JB_get_formatted_name($employer_row['FirstName'], $employer_row['LastName']);
    $to_name = $employer_name;
    $to_address = $employer_row['Email'];
    $text_message = str_replace("%SITE_NAME%", JB_SITE_NAME, $text_message);
    $text_message = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $text_message);
    $text_message = str_replace("%RESUME_DB_LINK%", $resume_db_link, $text_message);
    $text_message = str_replace("%CAN_NAME%", $candidate_name, $text_message);
    $text_message = str_replace("%EMP_NAME%", $employer_name, $text_message);
    $subject = str_replace("%CAN_NAME%", $candidate_name, $subject);
    $subject = str_replace("%SITE_NAME%", JB_SITE_NAME, $subject);
    JB_queue_mail($to_address, $to_name, $e_row['EmailFromAddress'], $e_row['EmailFromName'], $subject, $text_message, $html_message, $e_row['EmailID']);
}
function JB_send_admin_new_invoice_alert($invoice_type, $invoice_id)
{
    // get the invoice data
    switch ($invoice_type) {
        case 'P':
            $sql = "SELECT * FROM package_invoices WHERE invoice_id='" . jb_escape_sql($invoice_id) . "' ";
            break;
        case 'M':
            $sql = "SELECT * FROM membership_invoices WHERE invoice_id='" . jb_escape_sql($invoice_id) . "' ";
            break;
        case 'S':
            $sql = "SELECT * FROM subscription_invoices WHERE invoice_id='" . jb_escape_sql($invoice_id) . "' ";
            break;
    }
    $result = jb_mysql_query($sql);
    $invoice_row = mysql_fetch_array($result, MYSQL_ASSOC);
    if ($invoice_type == 'M') {
        // memberships
        $user_id = $invoice_row['user_id'];
    } else {
        // postings, subscriptions
        $user_id = $invoice_row['employer_id'];
    }
    // get the user data
    if ($invoice_row['user_type'] == 'C') {
        // memberships can have 'C' for Candidates
        $sql = "Select * from users where ID='" . jb_escape_sql($user_id) . "'";
    } else {
        $sql = "Select * from employers where ID='" . jb_escape_sql($user_id) . "'";
    }
    $result = JB_mysql_query($sql) or die(mysql_error());
    $user_row = mysql_fetch_array($result, MYSQL_ASSOC);
    $template_r = JB_get_email_template(330, $_SESSION['LANG']);
    $template = mysql_fetch_array($template_r);
    $msg = $template['EmailText'];
    $from = $template['EmailFromAddress'];
    $from_name = $template['EmailFromName'];
    $subject = $template['EmailSubject'];
    $to = JB_SITE_CONTACT_EMAIL;
    $to_name = JB_SITE_NAME;
    $subject = str_replace("%SITE_NAME%", JB_SITE_NAME, $subject);
    $msg = str_replace("%LNAME%", $user_row['FirstName'], $msg);
    $msg = str_replace("%FNAME%", $user_row['LastName'], $msg);
    $msg = str_replace("%USER%", $user_row['Username'], $msg);
    $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
    $msg = str_replace("%INVOICE_CODE%", $invoice_type . $invoice_row['invoice_id'], $msg);
    $msg = str_replace("%ITEM_NAME%", $invoice_row['item_name'], $msg);
    $msg = str_replace("%INVOICE_AMOUNT%", JB_convert_to_default_currency_formatted($invoice_row['currency_code'], $invoice_row['amount']), $msg);
    $msg = str_replace("%ADMIN_LINK%", JB_BASE_HTTP_PATH . "admin/", $msg);
    $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
    $msg = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $msg);
    if (JB_EMAIL_ADMIN_NEWORD_SWITCH == 'YES') {
        $email_id = JB_queue_mail(JB_SITE_CONTACT_EMAIL, JB_SITE_NAME, $from, $from_name, $subject, $msg, '', 330);
        JB_process_mail_queue(1, $email_id);
    }
}
Exemple #12
0
    function process_payment_return()
    {
        global $label;
        if ($_REQUEST['order_id'] != '' && $_REQUEST['nhezk5'] != '') {
            $invoice_id = jb_strip_order_id($_REQUEST['order_id']);
            $product_type = substr($invoice_id, 0, 1);
            // 'P' or 'S'
            $invoice_id = substr($invoice_id, 1);
            if ($_SESSION['JB_ID'] == '') {
                JBPLUG_do_callback('pay_trn_verification_failed', $invoice_id, $product_type);
                echo "Error: You must be logged in to view this page";
            } else {
                JBPLUG_do_callback('pay_trn_verification_passed', $invoice_id, $product_type);
                ?>
		

			<div style='background-color: #ffffff; border-color:#C0C0C0; border-style:solid;padding:10px'>
		<p align="center"><center>
				<?php 
                if ($product_type == 'P') {
                    $sql = "SELECT * from package_invoices where invoice_id='" . jb_escape_sql($invoice_id) . "' and employer_id='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
                } elseif ($product_type == 'S') {
                    $sql = "SELECT * from subscription_invoices where invoice_id='" . jb_escape_sql($invoice_id) . "' and employer_id='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
                } elseif ($product_type == 'M') {
                    $sql = "SELECT * from membership_invoices where invoice_id='" . jb_escape_sql($invoice_id) . "' and user_id='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
                }
                $result = JB_mysql_query($sql) or die(mysql_error() . $sql);
                $order_row = mysql_fetch_array($result, MYSQL_ASSOC);
                if (CHECK_TAX_RATE > 0) {
                    if (CHECK_ADD_TAX != 'Y') {
                        // work out the tax paid in the amount
                        $tax = $order_row['amount'] - $order_row['amount'] / (1.0 + CHECK_TAX_RATE);
                    } else {
                        $tax = $order_row['amount'] * CHECK_TAX_RATE;
                        $order_row['amount'] = $order_row['amount'] + $tax;
                    }
                }
                if (CHECK_ADVANCE_CREDIT == 'YES' && strtolower($order_row['status']) != 'pending') {
                    // place the order as 'pending' and advance the credits
                    if ($product_type == 'P') {
                        // posting credits
                        $order_row = JB_pend_package_invoice($invoice_id, $payment_method = 'check', $pending_reason = 'jb_credit_advanced');
                        // credit the points to the customer's account
                        JB_add_posting_credits($order_row);
                    }
                    if ($product_type == 'S') {
                        // subscription to view resumes
                        $order_row = JB_pend_subscription_invoice($invoice_id, $payment_method = 'check', $pending_reason = 'jb_credit_advanced');
                        JB_start_employer_subscription($order_row);
                    }
                    if ($product_type == 'M') {
                        // membership
                        $order_row = JB_pend_membership_invoice($invoice_id, $payment_method = 'check', $pending_reason = 'jb_credit_advanced');
                        JB_start_membership($order_row);
                    }
                    JBPLUG_do_callback('pay_trn_pending', $invoice_id, $product_type);
                }
                $check_amount = JB_convert_to_currency($order_row['amount'], $order_row['currency_code'], CHECK_CURRENCY);
                $check_amount = JB_format_currency($check_amount, CHECK_CURRENCY, true);
                $label['payment_check_sub_head'] = str_replace("%INVOICE_CODE%", $product_type . $_REQUEST['order_id'], $label['payment_check_sub_head']);
                echo $label['payment_check_sub_head'];
                $label['payment_check_heading'] = str_replace("%INVOICE_AMOUNT%", $check_amount, $label['payment_check_heading']);
                $label['payment_check_tax'] = str_replace("%INVOICE_TAX%", JB_format_currency($tax, CHECK_CURRENCY, true), $label['payment_check_tax']);
                if (JB_get_default_currency() != CHECK_CURRENCY) {
                    echo JB_convert_to_default_currency_formatted($order_row['currency_code'], $order_row['amount']) . " = " . $check_amount;
                    echo "<br>";
                }
                ?>
				
				<table width="70%"><tr><td>
				<?php 
                if (CHECK_TAX_RATE > 0) {
                    ?>
				<b><?php 
                    echo $label['payment_check_tax'];
                    ?>
</b><br>
				<?php 
                }
                ?>
				<b><?php 
                echo $label['payment_check_heading'];
                ?>
</b><br>
				<?php 
                if (CHECK_NAME != '') {
                    ?>
				<b><?php 
                    echo $label['payment_check_payable'];
                    ?>
</b><pre><?php 
                    echo CHECK_PAYABLE;
                    ?>
</pre><br>
				<?php 
                }
                ?>
				<?php 
                if (CHECK_ADDRESS != '') {
                    ?>
				<b><?php 
                    echo $label['payment_check_address'];
                    ?>
</b><pre><?php 
                    echo CHECK_ADDRESS;
                    ?>
</pre><br>
				<?php 
                }
                ?>
				<?php 
                /*if ( CHECK_ACCOUNT_NAME != '') { ?>
                		<b><?php echo $label['payment_check_currency'];?></b><pre><?php echo CHECK_CURRENCY; ?></pre><br>
                		<?php } */
                ?>
				
				</td></tr>
				</table>
				
				</p>
				</center>
				
				</div>
				<?php 
                if ($order_row['user_type'] == 'C') {
                    $sql = "Select * from users where ID='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
                } else {
                    $sql = "Select * from employers where ID='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
                }
                $result = JB_mysql_query($sql) or die(mysql_error());
                $e_row = mysql_fetch_array($result, MYSQL_ASSOC);
                if ($product_type == 'S') {
                    $template_r = JB_get_email_template(81, $_SESSION['LANG']);
                    $template = mysql_fetch_array($template_r);
                    $msg = $template['EmailText'];
                    $from = $template['EmailFromAddress'];
                    $from_name = $template['EmailFromName'];
                    $subject = $template['EmailSubject'];
                    $msg = str_replace("%INVOICE_TAX%", JB_format_currency($tax, CHECK_CURRENCY, true), $msg);
                    $msg = str_replace("%FNAME%", $e_row['FirstName'], $msg);
                    $msg = str_replace("%LNAME%", $e_row['LastName'], $msg);
                    $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
                    $msg = str_replace("%INVOICE_CODE%", "S" . $order_row['invoice_id'], $msg);
                    $msg = str_replace("%ITEM_NAME%", $order_row['item_name'], $msg);
                    $msg = str_replace("%SUB_DURATION%", $order_row['months_duration'], $msg);
                    $msg = str_replace("%INVOICE_AMOUNT%", JB_convert_to_default_currency_formatted($order_row['currency_code'], $order_row['amount']), $msg);
                    $msg = str_replace("%PAYEE_NAME%", CHECK_PAYABLE, $msg);
                    $msg = str_replace("%PAYEE_ADDRESS%", CHECK_ADDRESS, $msg);
                    $msg = str_replace("%CHECK_CURRENCY%", CHECK_CURRENCY, $msg);
                    $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
                    $msg = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $msg);
                    //echo $msg;
                    $to = $e_row['Email'];
                    $to_name = jb_get_formatted_name($e_row['FirstName'], $e_row['LastName']);
                    if (CHECK_EMAIL_CONFIRM == 'YES') {
                        $email_id = JB_queue_mail($to, $to_name, $from, $from_name, $subject, $msg, '', 81);
                        JB_process_mail_queue(1, $email_id);
                    }
                } elseif ($product_type == 'M') {
                    $template_r = JB_get_email_template(101, $_SESSION['LANG']);
                    $template = mysql_fetch_array($template_r);
                    $msg = $template['EmailText'];
                    $from = $template['EmailFromAddress'];
                    $from_name = $template['EmailFromName'];
                    $subject = $template['EmailSubject'];
                    $msg = str_replace("%INVOICE_TAX%", JB_format_currency($tax, CHECK_CURRENCY, true), $msg);
                    $msg = str_replace("%FNAME%", $e_row['FirstName'], $msg);
                    $msg = str_replace("%LNAME%", $e_row['LastName'], $msg);
                    $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
                    $msg = str_replace("%INVOICE_CODE%", "S" . $order_row['invoice_id'], $msg);
                    $msg = str_replace("%ITEM_NAME%", $order_row['item_name'], $msg);
                    if ($order_row['months_duration'] == '0') {
                        $order_row['months_duration'] = $label['member_not_expire'];
                    }
                    $msg = str_replace("%MEM_DURATION%", $order_row['months_duration'], $msg);
                    $msg = str_replace("%INVOICE_AMOUNT%", JB_convert_to_default_currency_formatted($order_row['currency_code'], $order_row['amount']), $msg);
                    $msg = str_replace("%PAYEE_NAME%", CHECK_PAYABLE, $msg);
                    $msg = str_replace("%PAYEE_ADDRESS%", CHECK_ADDRESS, $msg);
                    $msg = str_replace("%CHECK_CURRENCY%", CHECK_CURRENCY, $msg);
                    $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
                    $msg = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $msg);
                    //echo $msg;
                    $to = $e_row['Email'];
                    $to_name = jb_get_formatted_name($e_row['FirstName'], $e_row['LastName']);
                    if (CHECK_EMAIL_CONFIRM == 'YES') {
                        $email_id = JB_queue_mail($to, $to_name, $from, $from_name, $subject, $msg, '', 101);
                        JB_process_mail_queue(1, $email_id);
                    }
                } elseif ($product_type == 'P') {
                    $template_r = JB_get_email_template(61, $_SESSION['LANG']);
                    $template = mysql_fetch_array($template_r);
                    $msg = $template['EmailText'];
                    $from = $template['EmailFromAddress'];
                    $from_name = $template['EmailFromName'];
                    $subject = $template['EmailSubject'];
                    $msg = str_replace("%INVOICE_TAX%", JB_format_currency($tax, CHECK_CURRENCY, true), $msg);
                    $msg = str_replace("%FNAME%", $e_row['FirstName'], $msg);
                    $msg = str_replace("%LNAME%", $e_row['LastName'], $msg);
                    $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
                    $msg = str_replace("%INVOICE_CODE%", "P" . $order_row['invoice_id'], $msg);
                    $msg = str_replace("%ITEM_NAME%", $order_row['item_name'], $msg);
                    $msg = str_replace("%QUANTITY%", $order_row['posts_quantity'], $msg);
                    $msg = str_replace("%INVOICE_AMOUNT%", JB_convert_to_default_currency_formatted($order_row['currency_code'], $order_row['amount']), $msg);
                    $msg = str_replace("%PAYEE_NAME%", CHECK_PAYABLE, $msg);
                    $msg = str_replace("%PAYEE_ADDRESS%", CHECK_ADDRESS, $msg);
                    $msg = str_replace("%CHECK_CURRENCY%", CHECK_CURRENCY, $msg);
                    $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
                    $msg = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $msg);
                    //echo $msg;
                    $to = $e_row['Email'];
                    $to_name = jb_get_formatted_name($e_row['FirstName'], $e_row['LastName']);
                    if (CHECK_EMAIL_CONFIRM == 'YES') {
                        $email_id = JB_queue_mail($to, $to_name, $from, $from_name, $subject, $msg, '', 61);
                        JB_process_mail_queue(1, $email_id);
                    }
                }
                JB_update_payment_method($product_type, $order_row['invoice_id'], "check");
            }
        } else {
            JBPLUG_do_callback('pay_trn_verification_failed', $invoice_id, $product_type);
        }
    }