Exemple #1
0
         $Content .= '<strong>Thank you for booking at Pacific Sailing School</strong></p>';
         $Content .= '<p><h2>YOUR BOOKING TIMES</h2></p><table width="800" border="1"><tr><td width="300"><h3>Course</h3></td><td width="200"><h3>Lesson</h3></td><td width="200"><h3>Course Date/Time</h3></td><td width="100"><h3>Balance</h3></td></tr>';
     }
     if ($row["Course_Date"] == null) {
         $Course_Date = "OPEN";
     } else {
         $Course_Date = $row["Course_Date"];
     }
     $Content .= '<tr><td>' . $row["Course"] . '</td><td>' . $row["Lesson"] . '</td><td>' . $Course_Date . '</td><td align="right">' . $row["Course_Balance"] . '</td></tr>';
     $Total_Balance = $Total_Balance + $row["Course_Balance"];
 }
 if ($data_found != 0) {
     $Content .= '<tr></tr><tr><td>Balance</td><td></td><td></td><td align="right">' . number_format(round((double) $Total_Balance, 2), 2) . '</td></tr></table>';
     $Signature = getAdditional_Content('SIG');
     $Conditions = getAdditional_Content('BSC');
     $Terms = getAdditional_Content('TRM');
     $Content .= '<p>' . $Terms . '</p><p>' . $Conditions . '</p><p>' . $Signature;
     //echo $Content;
     $mail = new PHPMailer(true);
     $mail->IsSMTP();
     $mail->CharSet = 'UTF-8';
     $mail->Host = "mail.sunwindwater.com.au";
     // SMTP server example
     $mail->SMTPDebug = 0;
     // enables SMTP debug information (for testing)
     $mail->SMTPAuth = true;
     // enable SMTP authentication
     $mail->Port = 25;
     // set the SMTP port for the GMAIL server
     $mail->Username = "******";
     // SMTP account username example
 if (isset($_REQUEST["type"]) && trim($_REQUEST["type"]) == 'LIST') {
     $query = "SELECT * FROM Email_Content order by ID";
     $result = mysql_query($query) or die("SQL Error 1: " . mysql_error());
     while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
         $source[] = array('ID' => $row['ID'], 'Description' => $row['Description'], 'Content' => $row['Content']);
     }
     echo json_encode($source);
 } else {
     if (isset($_REQUEST["type"]) && trim($_REQUEST["type"]) == 'SEND') {
         $StudentNo = $_REQUEST['StudentNo'];
         $Email = $_REQUEST['Email_Address'];
         $Subject = $_REQUEST['Subject'];
         $Content = '<p>' . nl2br($_REQUEST['Content']) . '</p>';
         $Additional_Code = $_REQUEST['Additional_Content'];
         $Additional_Content = getAdditional_Content($Additional_Code);
         $Signature = getAdditional_Content('SIG');
         $Content .= $Additional_Content . '<p></p>' . $Signature;
         $mail = new PHPMailer(true);
         $mail->IsSMTP();
         $mail->CharSet = 'UTF-8';
         $mail->Host = "mail.sunwindwater.com.au";
         // SMTP server example
         $mail->SMTPDebug = 0;
         // enables SMTP debug information (for testing)
         $mail->SMTPAuth = true;
         // enable SMTP authentication
         $mail->Port = 25;
         // set the SMTP port for the GMAIL server
         $mail->Username = "******";
         // SMTP account username example
         $mail->Password = "******";