コード例 #1
0
ファイル: paypalIPN.php プロジェクト: vinothtimes/dchqtest
function pp_subscr_manual_approve($invoice_id)
{
    global $label;
    $sql = "UPDATE `subscription_invoices` set status='Pending',  reason='" . jb_escape_sql('reviewing') . "', `payment_method`='PayPal' WHERE invoice_id='" . jb_escape_sql($invoice_id) . "' ";
    JB_mysql_query($sql) or JB_pp_mail_error(mysql_error());
    $invoice_row = JB_get_subscription_invoice_row($invoice_id);
    $sql = "Select * FROM employers WHERE ID='" . jb_escape_sql($invoice_row['employer_id']) . "'";
    $result = JB_mysql_query($sql) or die(mysql_error());
    $e_row = mysql_fetch_array($result, MYSQL_ASSOC);
    $email = $label['paypal_subscr_manual_review'];
    $email = str_replace('%NAME%', $e_row['FirstName'] . ' ' . $e_row['LastName'], $email);
    $email = str_replace('%SITE_NAME%', JB_SITE_NAME, $email);
    $email = str_replace('%SITE_EMAIL%', JB_SITE_CONTACT_EMAIL, $email);
    $email = str_replace('%INVOICE_ID%', $invoice_id, $email);
    $email_id = JB_queue_mail($e_row['Email'], $e_row['FirstName'] . ' ' . $e_row['LastName'], JB_SITE_CONTACT_EMAIL, JB_SITE_NAME, $label['paypal_subscr_manual_sbj'], $email, '', 677);
    JB_process_mail_queue(1, $email_id);
    // copy to Admin
    $email = $label['paypal_subscr_manual_admin'] . $email;
    $email_id = JB_queue_mail(JB_SITE_CONTACT_EMAIL, 'Admin', JB_SITE_CONTACT_EMAIL, JB_SITE_NAME, $label['paypal_subscr_manual_sbj'], $email, '', 678);
    JB_process_mail_queue(1, $email_id);
}
コード例 #2
0
ファイル: functions.php プロジェクト: vinothtimes/dchqtest
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);
    }
}
コード例 #3
0
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;
}
コード例 #4
0
ファイル: request.php プロジェクト: vinothtimes/dchqtest
        $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'];
        //$label["employer_request_letter_subject"];
        $to = $candidate['Email'];
        $reply_to = stripslashes($reply_to);
        $from = stripslashes($from);
        $email_id = JB_queue_mail($to, jb_get_formatted_name($candidate['FirstName'], $candidate['LastName']), $reply_to, $from, $subject, $EmailMessage, '', 4);
        JB_process_mail_queue(1, $email_id);
        $JBMarkup->ok_msg($label['employer_request_sent']);
    }
}
if ($_REQUEST['user_id'] != '' && $EmailMessage == '') {
    $sql = "SELECT * from `employers` where `ID`='" . jb_escape_sql($_SESSION['JB_ID']) . "' ";
    $result = JB_mysql_query($sql) or die(mysql_error());
    $row = mysql_fetch_array($result, MYSQL_ASSOC);
    //echo $sql." ".$row[Email];
    if ($from == '') {
        $from = $row['CompName'];
    }
    if ($reply_to == '') {
        $reply_to = $row['Email'];
    }
コード例 #5
0
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;
}
コード例 #6
0
ファイル: ra.php プロジェクト: vinothtimes/dchqtest
                    					%SITE_CONTACT_EMAIL% - contact email to your site.
                    					%POST_TITLE% - The title of the post
                    					%POST_DATE% - The date of the post
                    					%REASON% - The reason for the disapproval
                    					
                    					*/
                    $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("%REASON%", stripslashes($reason), $message);
                    // Place the email on the queue!
                    JB_queue_mail($to_address, $to_name, $from_address, $from_name, $subject, $message, '', 230);
                }
                echo "<hr>";
            }
        }
        if ($_REQUEST['delete_post'] != '') {
            JB_delete_post($post_id);
            JB_finalize_post_updates();
            $JBMarkup->ok_msg('Job Post #' . $post_id . ' deleted.');
            echo "<hr>";
        }
        ?>
		<h2>Remote Admin - Job Post #<?php 
        echo htmlentities($post_id);
        ?>
</h2>
コード例 #7
0
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);
    }
}
コード例 #8
0
ファイル: newsletter.php プロジェクト: vinothtimes/phpdoc
 echo "Processing new list<br><br>";
 echo mysql_num_rows($result) . " emails to send in this list to:" . $letter_row['to'] . "<br>";
 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
     echo "Sending to: " . JB_get_formatted_name($row['FirstName'], $row['LastName']) . " <br>";
     if (JB_validate_mail($row['Email'])) {
         // send the sucker
         $msg = str_replace("%name%", JB_get_formatted_name($row['FirstName'], $row['LastName']), $letter_row['message']);
         $msg = str_replace("%username%", $row['Username'], $msg);
         $msg = str_replace("%email%", $row['Email'], $msg);
         $subject = $letter_row['subject'];
         $msg = str_replace("%CANDIDATE_LINK%", JB_BASE_HTTP_PATH . JB_CANDIDATE_FOLDER . "alerts.php?id=" . $row['ID'] . "&key={$val}", $msg);
         $msg = str_replace("%EMPLOYER_LINK%", JB_BASE_HTTP_PATH . JB_EMPLOYER_FOLDER . "alerts.php?id=" . $row['ID'] . "&key={$val}", $msg);
         $to = $row['Email'];
         $from = JB_SITE_CONTACT_EMAIL;
         // Enter your email adress here
         JB_queue_mail($to, JB_get_formatted_name($row['FirstName'], $row['LastName']), $from, JB_SITE_NAME, $subject, $msg, '', 30);
         echo "<hr>Email to:" . jb_escape_html($row['Email']) . " placed on queue<br>";
         $now = gmdate("Y-m-d H:i:s");
         $sql = "UPDATE {$table} SET `newsletter_last_run`='{$now}' WHERE `ID`='" . jb_escape_sql($row['ID']) . "' ";
         JB_mysql_query($sql) or die(mysql_error());
     } else {
         echo "Invalid email " . jb_escape_html($row['Email']) . "<br>";
     }
 }
 /*
 // run the above query again to see if we processed all the recipients.
 $sql = "SELECT * FROM $table WHERE `Newsletter`='1' AND '".$letter_row['create_time']."' > `newsletter_last_run` ";
 $result_check = JB_mysql_query($sql) or die(mysql_error());
 if (mysql_num_rows($result_check)==0) {
 	// newsletter sent!
 	$sql = "UPDATE `newsletters` SET `status`=1 WHERE `letter_id`='".$letter_row[letter_id]."' ";
コード例 #9
0
ファイル: apply_iframe.php プロジェクト: vinothtimes/dchqtest
         $CandidateEmailMessage = $EmailMessage;
         // take a copy - the $CandidateEmailMessage does not have a link to the resume db
         $EmailMessage = str_replace("%RESUME_DB_LINK%", "{$resume_db_link}", $EmailMessage);
         if (JB_EMAIL_ADMIN_RECEIPT_SWITCH == "YES") {
             $message = $EmailMessage;
             $message .= $sig;
             $subject = $APM->get_admin_receipt_email_subject($app_name);
             // $label['app_receipt_subject']." ($app_name)";
             JB_queue_mail(JB_SITE_CONTACT_EMAIL, "Admin", JB_SITE_NAME, JB_SITE_CONTACT_EMAIL, $subject, $message, '', 10);
         }
         if (JB_EMAIL_CANDIDATE_RECEIPT_SWITCH == "YES") {
             $CandidateEmailMessage = str_replace("%RESUME_DB_LINK%", JB_BASE_HTTP_PATH, $CandidateEmailMessage);
             $message = $CandidateEmailMessage;
             $message .= $sig_html;
             $subject = $APM->get_receipt_email_subject($TITLE, $DATE);
             JB_queue_mail($app_email, $app_name, JB_SITE_CONTACT_EMAIL, JB_SITE_NAME, $subject, $message, '', 10);
         }
         $APM->success_start();
         $APM->success_row($label['app_confirm_name'], $app_name);
         $APM->success_row($label['app_confirm_email'], $app_email);
         $APM->success_row($label['app_confirm_subject'], $app_subject);
         $APM->success_row($label['app_confirm_lettter'], $app_letter);
         $APM->success_row($label['app_confirm_att1'], $_FILES['att1']['name']);
         $APM->success_row($label['app_confirm_att2'], $_FILES['att2']['name']);
         $APM->success_row($label['app_confirm_att3'], $_FILES['att3']['name']);
         JBPLUG_do_callback('apply_success_row', $mail_id);
         $APM->success_end();
         $success = 1;
     }
 }
 // End Apply button  pressed
コード例 #10
0
ファイル: email_iframe.php プロジェクト: vinothtimes/dchqtest
        $c_email = stripslashes($c_email);
        $to_name = $c_name;
        $to_address = $c_email;
        // load and assign the template
        $t_result = JB_get_email_template(11, $_SESSION['LANG']);
        // load the template
        $t_row = mysql_fetch_array($t_result, MYSQL_ASSOC);
        $msg = $t_row['EmailText'];
        $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
        $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
        $msg = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $msg);
        $msg = str_replace("%MESSAGE%", $email_letter, $msg);
        $msg = str_replace("%SENDER_IP%", $_SERVER['REMOTE_ADDR'], $msg);
        $msg = str_replace("%USER_ID%", $_SESSION['JB_ID'], $msg);
        $msg = str_replace("%EMPLOYER_NAME%", $EMPLOYER_NAME, $msg);
        $email_id = JB_queue_mail($to_address, $to_name, $EMPLOYER_EMAIL, $EMPLOYER_NAME, $email_subject, $msg, '', 11);
        JB_process_mail_queue(1, $email_id);
        $JBMarkup->ok_msg($label['email_sent_ok']);
        echo $label['em_confirm_title'];
        ?>

		<table border="0" width="80%">
		<tr><td><b><?php 
        echo $label['em_confirm_name'];
        ?>
 </b></td><td><?php 
        echo JB_escape_html($c_name);
        ?>
</td></tr>
		<tr><td><b><?php 
        echo $label['em_confirm_email'];
コード例 #11
0
ファイル: candidates.php プロジェクト: vinothtimes/dchqtest
if ($_REQUEST['action'] == 'Send Email') {
    if (!is_array($_REQUEST['users'])) {
        $JBMarkup->error_msg('ERROR! No Users Selected. Use the check-boxes to select the users that you want to email.');
    } else {
        echo "sending email...<br>";
        for ($i = 0; $i < sizeof($_REQUEST['users']); $i++) {
            $sql = "SELECT * from `users` WHERE `ID`='" . jb_escape_sql($_REQUEST['users'][$i]) . "'";
            $result = JB_mysql_query($sql) or die(mysql_error());
            $row = mysql_fetch_array($result, MYSQL_ASSOC);
            $msg = str_replace("%name%", JB_get_formatted_name($row['FirstName'], $row['LastName']), stripslashes($_REQUEST['message']));
            $msg = str_replace("%username%", $row['Username'], $msg);
            $msg = str_replace("%email%", $row['Email'], $msg);
            $to = $row['Email'];
            $from = JB_SITE_CONTACT_EMAIL;
            // Enter your email adress here
            $email_id = JB_queue_mail($to, JB_get_formatted_name($row['FirstName'], $row['LastName']), JB_SITE_CONTACT_EMAIL, JB_SITE_NAME, stripslashes($_REQUEST['subject']), $msg, '', 9);
            $JBMarkup->ok_msg("Email queued to:" . JB_escape_html($row['Email']));
            JB_process_mail_queue(1, $email_id);
        }
    }
}
if ($_REQUEST['action'] == 'edit') {
    if ($_REQUEST['form'] != "") {
        // saving
        $employer_id = $CandidateForm->save($admin = true);
        //JB_insert_candidate_data();
        $JBMarkup->ok_msg('Candidate data updated.');
    } else {
        $CandidateForm->load($_REQUEST['user_id']);
        $CandidateForm->display_form('edit', true);
    }
コード例 #12
0
ファイル: forgot.php プロジェクト: vinothtimes/dchqtest
            $result = JB_get_email_template(3, $_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%", $Username, $subject);
            $EmailMessage = str_replace("%FNAME%", $row['FirstName'], $EmailMessage);
            $EmailMessage = str_replace("%LNAME%", $row['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%", $row['Username'], $EmailMessage);
            $EmailMessage = str_replace("%PASSWORD%", $pass, $EmailMessage);
            $to = stripslashes($email);
            $message = $EmailMessage;
            $email_id = JB_queue_mail($to, jb_get_formatted_name($row['FirstName'], $row['LastName']), $from, $from_name, $subject, $message, '', 3);
            JB_process_mail_queue(1, $email_id);
            $_SESSION['PASS_SENT_TO'] = $_REQUEST['email'];
            // remember the email it was sent to
        }
        $label["c_forgot_changed"] = str_replace("%SEND_TO%", $_REQUEST['email'], $label["c_forgot_changed"]);
        echo "<p><center><b>" . $label["c_forgot_changed"] . " <a href='" . JB_BASE_HTTP_PATH . JB_CANDIDATE_FOLDER . "'>" . JB_BASE_HTTP_PATH . JB_CANDIDATE_FOLDER . "  </a></b></center></p>";
    } else {
        echo "<center>" . $label["c_forgot_not_found"] . "</center>";
    }
}
?>
<center><a href="../index.php"><?php 
echo $label["c_forgot_continue"];
?>
</a></center>
コード例 #13
0
ファイル: employers.php プロジェクト: vinothtimes/dchqtest
        echo "sending email...<br>";
        for ($i = 0; $i < sizeof($users); $i++) {
            $sql = "SELECT * from `employers` WHERE `ID`='" . jb_escape_sql($users[$i]) . "'";
            $result = JB_mysql_query($sql) or die(mysql_error());
            $row = mysql_fetch_array($result, MYSQL_ASSOC);
            // stripslashes() to be removed in the future
            $msg = stripslashes($msg);
            $subject = stripslashes($subject);
            $msg = str_replace("%name%", JB_get_formatted_name($row['FirstName'], $row['LastName']), $message);
            $msg = str_replace("%username%", $row['Username'], $msg);
            $msg = str_replace("%email%", $row['Email'], $msg);
            $to = $row['Email'];
            //$users[$i];
            $from = JB_SITE_CONTACT_EMAIL;
            // Enter your email adress here
            $email_id = JB_queue_mail($to, JB_get_formatted_name($row['FirstName'], $row['LastName']), JB_SITE_CONTACT_EMAIL, JB_SITE_NAME, $subject, $msg, '', 8);
            $JBMarkup->ok_msg("Email queued to:" . JB_escape_html($row['Email']));
            JB_process_mail_queue(1, $email_id);
        }
    }
}
if ($action == 'Activate') {
    for ($i = 0; $i < sizeof($users); $i++) {
        $sql = "UPDATE `employers` SET `validated`='1' WHERE `ID`='" . jb_escape_sql($users[$i]) . "'";
        JB_mysql_query($sql);
        $sql = "SELECT * from `employers` WHERE `ID`='" . jb_escape_sql($users[$i]) . "'";
        $result = JB_mysql_query($sql) or die(mysql_error());
        $row = mysql_fetch_array($result, MYSQL_ASSOC);
        $JBMarkup->ok_msg("Activated username: <b>" . JB_escape_html($row['Username']) . "</b> (" . JB_escape_html(JB_get_formatted_name($row['FirstName'], $row['LastName'])) . ")");
    }
    ?>
コード例 #14
0
ファイル: posts.inc.php プロジェクト: vinothtimes/dchqtest
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);
    }
}
コード例 #15
0
ファイル: resumes.inc.php プロジェクト: vinothtimes/phpdoc
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']);
}
コード例 #16
0
                    // re-used name
                    $score++;
                }
                if (strpos($row['message'], $your_email) !== false) {
                    // re-used email
                    $score++;
                }
            }
            $score = $score / $max_score;
            if ($score >= 0.5) {
                $discard = true;
                // silently discard this message
            }
        }
        if (!$discard) {
            $email_id = JB_queue_mail($to, $to_name, JB_SITE_CONTACT_EMAIL, JB_SITE_NAME, $subject, $msg, '', 46);
            JB_process_mail_queue(1, $email_id);
        }
        ?>

		 <hr><?php 
        echo $label['taf_email_sent'];
        ?>
 <?php 
        echo jb_escape_html($to_email);
        ?>
<b/><br>
		 <p style="text-align:center;"><input onclick="window.location='<?php 
        echo htmlentities($_SERVER['PHP_SELF']) . "?post_id={$post_id}";
        ?>
'" type='button' value='<?php 
コード例 #17
0
ファイル: bank.php プロジェクト: vinothtimes/dchqtest
    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);
        }
    }
コード例 #18
0
ファイル: resumealerts.php プロジェクト: vinothtimes/dchqtest
            $EmailMessage = str_replace("%SITE_NAME%", JB_SITE_NAME, $EmailMessage);
            $EmailMessage = str_replace("%SITE_LOGO_URL%", JB_SITE_LOGO_URL, $EmailMessage);
            $EmailMessage = str_replace("%RESUME_ALERTS%", $resume_alert_list_text, $EmailMessage);
            $EmailMessage = str_replace("%RESUME_ALERT%", '', $EmailMessage);
            // for compatibility with older version
            $EmailMessage = str_replace("%KEYWORDS_LINE%", $resume_alert_list_text, $EmailMessage);
            // deprecated, use %RESUME_ALERTS% instead
            $EmailMessage = str_replace("%EMPLOYER_LINK%", $_clink, $EmailMessage);
            $text_message = html_entity_decode($EmailMessage);
            $text_message = strip_tags($text_message);
            // send the sucker...
            if ($DO_SEND == "YES") {
                // mark as sent
                $now = gmdate("Y-m-d H:i:s");
                $sql = "UPDATE `employers` SET `alert_last_run`='{$now}' WHERE `ID`='" . jb_escape_sql($user_row['ID']) . "'";
                JB_mysql_query($sql) or die(mysql_error() . $sql);
                if (JB_mysql_affected_rows() > 0) {
                    // place on the queue
                    JB_queue_mail($to_address, $to_name, $e_row['EmailFromAddress'], $e_row['EmailFromName'], $subject, $text_message, $html_message, $e_row['EmailID']);
                }
            }
        }
        // end IF $msg_body
    }
    // if valid email
}
// close while loop
if ($_REQUEST['from_admin'] && strpos($_SERVER['PHP_SELF'], 'admin') !== false) {
    echo "The execution of the 'admin/resumealerts.php' script completed. You may check the <a href='email_queue.php'>outgoing mail queue</a>";
    $DO_SEND = "YES";
}
コード例 #19
0
ファイル: checkorder.php プロジェクト: vinothtimes/dchqtest
    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);
        }
    }