示例#1
0
    $print = $_POST['print'];
    $send = $_POST['send'];
    benfund_connect();
    $newiq = "01 INTO invoice (inv, to_id, from_id, date, desc, total, shipping, tax, notes, terms) VALUES('{$niinvnum}', '{$niclient}', '{$mid}', '{$nidate}', '{$nithetotal}', '{$nigrandtotal}', '{$nitotalshipping}', '{$nitotaltax}', '{$ninotes}', '{$niterms}')";
    echo $newiq;
    mysql_query($newiq) or die(mysql_error());
    if (isset($send)) {
        $to = $email;
        $recipient = $email;
        $from = '*****@*****.**';
        $from_name = 'BenFund New Invoice Notification';
        $subject = 'Your have a new invoice.';
        $html_message_text = '<span style="font-size: 20pt; color: #484848; text-decoration: none; font-weight: bolder; text-align: left; clear: both;">New Account Information</span><hr>With BenFund you can begin paying your account online with three simple steps.<p><span style="font-size: 16pt; color: #484848; text-decoration: none; font-weight: bold; clear: both;">Step 1.</span><br><span style="font-size: 14pt; color: #484848; text-decoration: none; font-weight: bold;">Go to </span><span style="font-size: 14pt; color: #0000CC; text-decoration: none; font-weight: bold;">www.BenFund.com</span><br><span style="font-size: 14pt; color: #484848; text-decoration: none; font-weight: bold;">Click on the "Login" link in the orange box on the left.</span><p><span style="font-size: 16pt; color: #484848; text-decoration: none; font-weight: bold; clear: both;">Step 2.</span><br><span style="font-size: 14pt; color: #484848; text-decoration: none; font-weight: bold;">Login with the Following Information:</span><br><br><div style="margin-left: 10px; padding: 6px; border: 1px solid #2C2C2C; background: #E8E8E8; width: 200px;"><span style="font-size: 14pt; color: #484848; text-decoration: none; font-weight: bold;">Client Number:</span><br><span style="font-size: 14pt; color: #0000CC; text-decoration: none; font-weight: bold;">' . $mid . '-' . $cid . '</span><br><span style="font-size: 14pt; color: #484848; text-decoration: none; font-weight: bold;">Password:</span><br><span style="font-size: 14pt; color: #0000CC; text-decoration: none; font-weight: bold;">' . $password . '</span><p></div><br><span style="font-size: 16pt; color: #484848; text-decoration: none; font-weight: bold; clear: both;">Step 3.</span><br><span style="font-size: 14pt; color: #484848; text-decoration: none; font-weight: bold;">Complete our Simple Online Registration.</span><p>';
        $text_message_text = 'New Invoice Information\\n=======================\\nWith BenFund you can begin paying your account online with three simple steps.\\n\\nStep 1.\\nGo to www.BenFund.com\\nClick on the "Login" link in the orange box on the left.\\n\\nStep 2.\\nLogin as a Client with the Following Information:\\nClient Number: ' . $mid . '-' . $cid . '\\nPassword: '******'\\n\\nStep 3.\\nComplete our Simple Online Registration.\\n\\nWhen your registration is complete you will have access to your account.';
        $text_message = text_email($text_message_text);
        $html_message = html_email($html_message_text);
        // Send
        require_once $ROOT . "/functions/mail.php";
    }
    ?>
		
<div class="action">
	<span class="actionmsg">Invoice Submitted Successfully!</span><img src="https://www.benfund.com/images/elements/blank.gif" <?php 
    if ($print) {
        ?>
onload="javascript:popUp('https://www.benfund.com/acct/invoice_manager/print_invoice.php?inv=<?php 
        echo $niinv;
        ?>
')"<?php 
    }
    ?>
#!/usr/bin/php
<?php 
include 'config.php';
include 'sqlreporter.php';
//Setup Email Subject
$subject = 'Daily Import';
//Color is the color report table, it can be set to be grey, green or blue
$color = 'blue';
//Add a message to the header of the report
$header = '<p><H2>Daily Import Summary</H2></p><p><b>Purpose:</b>. The numbers below represent a summary of imported appointments that have been scheduled today.</p>';
//Add a message to the footer of the report, you can use plain text or html.
$footer = '<p><strong>Disclaimer: </strong>This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.</p>';
//The Database Query to Run - Recommend Testing in SQL / PHPMYADMIN / Other tool beforehand to ensure syntax is correct
$query = 'SELECT `name` AS Provider, COUNT(*) AS Appointments, DATE_FORMAT(import_date,"%c/%d") AS DATE
FROM auto_import INNER JOIN accounts ON auto_import.Branch = accounts.id WHERE DATE(import_date) = CURDATE() GROUP BY Branch ORDER BY `name` ASC';
//Generate the report (Do not change)
$report = generateReport($query, $header, $footer, $color);
//Setup Email Recipient (Who are we sending the report to)
$recipient1 = '*****@*****.**';
$recipient2 = '*****@*****.**';
$recipient3 = '*****@*****.**';
$recipient4 = '*****@*****.**';
//Send the report (if you uncomment out recipients above then ensure you uncomment the corresponding html_email below
html_email($recipient1, $subject, $report);
html_email($recipient2, $subject, $report);
html_email($recipient3, $subject, $report);
html_email($recipient4, $subject, $report);
示例#3
0
                $photo_result = mysql_query("SELECT filename FROM uploaded_images where id = '{$cart->photo_id}'", $db);
                $photo = mysql_fetch_object($photo_result);
            }
            if ($cart->ptype == "s") {
                $sizes_result = mysql_query("SELECT id,size FROM sizes where id = '{$cart->sid}'", $db);
                $sizes = mysql_fetch_object($sizes_result);
            }
            if ($cart->ptype == "d" or $cart->ptype == "s") {
                $body1 .= "File Name: {$photo->filename} \n";
                if ($cart->ptype == "s") {
                    $body1 .= "Size ID: {$sizes->id} \n";
                    $body1 .= "Size: {$sizes->size} \n";
                }
                $body1 .= "---------------------------------- \n";
            } else {
                $body1 .= "\n\nPrints & Products: \n";
                $body1 .= "---------------------------------- \n";
                $print_result = mysql_query("SELECT name FROM prints where id = '{$cart->prid}'", $db);
                $print = mysql_fetch_object($print_result);
                $pg_result = mysql_query("SELECT filename FROM uploaded_images where reference = 'photo_package' and id = '{$cart->photo_id}'", $db);
                $pg = mysql_fetch_object($pg_result);
                $body1 .= "File Name: {$pg->filename} \n";
                $body1 .= "Print: {$print->name} \n";
                $body1 .= "Quantity: {$cart->quantity} \n";
                $body1 .= "---------------------------------- \n";
            }
        }
    }
}
html_email($to, $subject, $body1, $from);
示例#4
0
    $summary_query = 'select description AS "Description", risk_category AS "Risk Category", start_date AS "Portfolio Start Date", starting_capital AS "Starting Capital" from liveportfolio_account where portfolio_id = ' . $pid;
    $summary_report = generateReport($summary_query, $summary_header, $footer, $color);
    $performance_header = '<b>Current Performance</b>';
    $performance_query = 'select liveportfolio_value(' . $pid . ') AS "Current Value", (liveportfolio_value(' . $pid . ') - starting_capital) AS "Current Dollar Return", round((liveportfolio_value(' . $pid . ') - starting_capital)*100/starting_capital, 2) AS "Current Pct Return" from liveportfolio_account where portfolio_id = ' . $pid;
    $poerformance_report = generateReport($performance_query, $performance_header, $footer, $color);
    $sell_header = '<b>Executed Sell Orders</b>';
    $sell_query = 'select a.execute_time as "Executed Time", order_type AS "Order Type", symbol AS "Symbol", shares AS "Shares", a.execute_price as "Executed Price" , liveportfolio_get_purchase_price(' . $pid . ', symbol) AS "Purchase Price", round((a.execute_price-liveportfolio_get_purchase_price(' . $pid . ', symbol))*100/liveportfolio_get_purchase_price(' . $pid . ', symbol), 2) AS "PnL %"  from order_history_queue a, liveportfolio_account b where a.portfolio_id = b.portfolio_id and b.status = "A" and a.portfolio_id = ' . $pid . ' and a.order_type like "%SELL%" and a.execute_date = "' . $today . '" order by a.execute_time';
    $sell_report = generateReport($sell_query, $sell_header, $footer, $color);
    $buy_header = '<b>Executed Buy Orders</b>';
    $buy_query = 'select a.execute_time as "Executed Time", order_type AS "Order Type", symbol AS "Symbol", shares AS "Shares", a.execute_price as "Executed Price" from order_history_queue a, liveportfolio_account b where a.portfolio_id = b.portfolio_id and b.status = "A" and a.portfolio_id = ' . $pid . ' and a.order_type like "%BUY%" and a.execute_date = "' . $today . '" order by a.execute_time';
    $buy_report = generateReport($buy_query, $buy_header, $footer, $color);
    $holding_header = '<b>Current Holdings</b>';
    $holding_query = 'select a.symbol AS "Symbol", a.shares AS "Shares", a.cost_basis AS "Cost Basis", b.close AS "Current Price", round((b.close-a.cost_basis)*100/b.close, 2) AS "Profit %", b.daily_change as "Daily Change", b.pct_change as "Daily % Change" from liveportfolio a, quotes b where portfolio_id = ' . $pid . ' and a.symbol = b.symbol and b.trade_date = "' . $today . '" order by 5 asc';
    $holding_report = generateReport($holding_query, $holding_header, $footer, $color);
    //The Database Query to Run - Recommend Testing in SQL / PHPMYADMIN / Other tool beforehand to ensure syntax is correct
    //$query = 'SELECT firstName AS "First Name", lastName AS "Last Name" FROM userinfo ORDER BY lastName DESC';
    //$query = 'select portfolio_id AS "PID", order_type AS "Order Type", order_date AS "Order Date", symbol AS "Symbol", shares AS "Shares" from order_queue order by 1, 2';
    //$query = 'select a.portfolio_id AS "PID", b.description AS "Description", b.risk_category as "Risk Category",  order_type AS "Order Type", order_date AS "Order Date", symbol AS "Symbol", shares AS "Shares", a.execute_time as "Executed Time", a.execute_price as "Executed Price" from order_history_queue a, liveportfolio_account b where a.portfolio_id = b.portfolio_id and b.status = "A" and a.execute_date = "'.$today.'" order by PID, a.execute_time';
    //Generate the report (Do not change)
    $report = generateReport($query, $header, $footer, $color);
    $final_report .= $summary_report . $poerformance_report . $sell_report . $buy_report . $holding_report;
}
//Setup Email Recipient (Who are we sending the report to)
$recipient1 = '*****@*****.**';
$recipient2 = '*****@*****.**';
//$recipient3 = '*****@*****.**';
//$recipient1 = '*****@*****.**';
//Send the report (if you uncomment out recipients above then ensure you uncomment the corresponding html_email below
html_email($recipient1, $subject, $final_report);
html_email($recipient2, $subject, $final_report);
//html_email($recipient3,$subject,$report);
示例#5
0
    $array = array("\\'" => "'");
    $message = strtr($message, $array);
    $message = '<html><body>' . $message . '</body></html>' . "\r\n\r\n";
    $extra = 'From: ' . $from . ' <' . $replyto . '>' . "\r\n";
    $extra .= 'Content-Type: text/html; charset="ISO-8859-1"' . "\r\n";
    $extra .= 'Content-Transfer-Encoding: quoted-printable' . "\n\r\n";
    mail($recipient, $subject, $message, $extra);
}
// use like this
// specify the address the mail will be sent from
$mail_sender = '*****@*****.**';
// specify the name of the sender
$mail_sender_name = 'Ioannis Papagiannis';
// specify the recipient email address
$mail_recipient = '*****@*****.**';
// specify the subject of the email (no HTML here!)
$mail_subject = 'HTML email test';
// the body of the email - you can use HTML here
$mail_body = '
<h1 style="color: red;">Hello there</h1>
<p>this email should be styled HTML...</p>';
// if email addresses are valid
if (check_email($mail_recipient) && check_email($mail_sender)) {
    // send HTML mail with PHP
    html_email($mail_recipient, $mail_subject, $mail_body, $mail_sender_name, $mail_sender);
    echo '
	<p>the email &quot;' . $mail_subject . '&quot; was successfully sent to ' . $mail_recipient . '</p>';
} else {
    echo '
	<p>invalid email address - email was not sent</p>';
}