Example #1
0
 function mailSendingHtml($From, $To, $email, $Subject, $header, $message, $attachment, $templet, $html, $tag, $card_info)
 {
     require_once "includes/mailsender.php";
     if ($this->usersublevel != READ_ONLY_LEVEL) {
         $r = mailSender($From, $To, $email, $Subject, $header, $message, $attachment, $templet, $html, $tag, $card_info);
     }
     if (!empty($r)) {
         return 1;
     }
     return 0;
 }
    $confirmation_message = "<html><body><p>To {$step1['fname']} {$step1['lname']},</p><p>Congrulations on completing your Harley Flack Web Portal Profile. " . "The Harley Flack Student Mentoring Program will use this information for the sole purpose of matching you with someone who possess similar qualities to maximize the mentor/mentee experience." . " As of now, access to your own profile and the web portal in general is restricted while renovations are underway. When completed, you will be notified by the department to access your profile.</p>" . "If you have any questions or concerns, plesae contact Temple Jordan (<a href=\"mailto:jordan@rowan.edu\">jordan@rowan.edu</a>).</p><p>Dr Harley E. Flack Student Mentoring Program</p></body></html>";
    $components_confirmation = array();
    $components_confirmation['to'] = $step1['email'];
    $components_confirmation['from'] = array('*****@*****.**' => 'HarleyFlackWebPortal');
    $components_confirmation['subject'] = 'Harley Flack Web Portal Profile Confirmation';
    $components_confirmation['body'] = $confirmation_message;
    $sent = mailSender($components_confirmation);
    if ($sent > 0) {
        $msg = '<p>Congratulations! You have successfully created your Harley Flack Profile. You may return to your profile at any time to make corrections when you log in to the Web Portal.</p>' . PHP_EOL;
        $notify_message = "<html><body><p>To Administration,</p><p>This automated message is to notify you that {$fname}  {$lname} has created a Harley Flack Web Portal Profile." . " To view this profile, follow this link.</p><p>Harley Flack Web Portal Technical Support</p></body></html>";
        $components_notify = array();
        $components_notify['to'] = array('*****@*****.**' => 'Temple Jordan');
        $components_notify['from'] = array('*****@*****.**' => 'HarleyFlackWebPortal');
        $components_notify['subject'] = 'Notice of New Harley Flack Web Portal Profile';
        $components_notify['body'] = $notify_message;
        $sent = mailSender($components_notify);
    }
} catch (Exception $ex) {
    $msg = 'Could not execute query: ' . $ex->getMessage();
}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Web Portal - Dr Harley Flack Student Mentoring Program</title>

    <!-- Bootstrap -->
    $reservation->setNbrPassengers(getValidatedPassager());
    $tarif = getTarif($_POST['passager'], $station_depart->getName(), $station_destination->getName());
    if (is_object($tarif)) {
        if ($_POST['retour'] == "Aller-Retour") {
            $reservation->setPriceTotal($tarif->getTarif() * 2);
        } else {
            $reservation->setPriceTotal($tarif->getTarif());
        }
    }
    if (isset($_POST['extra'])) {
        $reservation->setExtra($_POST['extra']);
    }
    EManager::getEntityManager()->persist($reservation);
    EManager::getEntityManager()->flush();
    if (error_get_last() == null) {
        mailSender($consumer, '*****@*****.**', 'Reservation réussie, Merci à vous :)');
        $_SESSION['success'] = "Votre Reservation est enregistrée avec succès";
        Redirect("reservation.php", false);
    }
}
function Redirect($url, $permanent = false)
{
    header('Location: ' . $url, true, $permanent ? 301 : 302);
    exit;
}
function getStationObjByName($name)
{
    $repo = EManager::getEntityManager()->getRepository('Station');
    $station_depart = $repo->findBy(array('name' => $name));
    if (count($station_depart) != 1) {
        $_SESSION['aERROR'] = "la station entrée n'existe pas !! ";
<?php

include '../includes/connect.php';
include '../includes/mailsender.php';
date_default_timezone_set('America/New_York');
$data = array();
$filter_args = array('mentor' => FILTER_SANITIZE_STRING, 'mentee' => FILTER_SANITIZE_STRING, 'q1' => FILTER_SANITIZE_STRING, 'q1explain' => FILTER_SANITIZE_STRING, 'q2' => FILTER_SANITIZE_STRING, 'q2explain' => FILTER_SANITIZE_STRING, 'q3' => FILTER_SANITIZE_STRING, 'q3explain' => FILTER_SANITIZE_STRING, 'q4' => FILTER_SANITIZE_STRING, 'q4explain' => FILTER_SANITIZE_STRING, 'q5' => FILTER_SANITIZE_STRING, 'q5explain' => FILTER_SANITIZE_STRING);
$filtered_input = filter_input_array(INPUT_POST, $filter_args);
$checkin_date = date('Y-m-d');
$db = mysql_connection();
$mentor_name = $db->query("SELECT CONCAT_WS(' ',fname,lname) AS name FROM profiles WHERE user = '******'mentor']}'")->fetchColumn();
$mentee_name = $db->query("SELECT CONCAT_WS(' ',fname,lname) AS name FROM profiles WHERE user = '******'mentee']}'")->fetchColumn();
try {
    $db->exec("INSERT INTO midsemesterreport(checkin_date,mentor,mentee,q1,q1explain,q2,q2explain,q3,q3explain,q4,q4explain,q5,q5explain) VALUES('{$checkin_date}','{$filtered_input['mentor']}','{$filtered_input['mentee']}','{$filtered_input['q1']}','{$filtered_input['q1explain']}','{$filtered_input['q2']}','{$filtered_input['q2explain']}','{$filtered_input['q3']}','{$filtered_input['q3explain']}','{$filtered_input['q4']}','{$filtered_input['q4explain']}','{$filtered_input['q5']}','{$filtered_input['q5explain']}')");
    $components = array();
    $components['from'] = 'Insert email address(es) here';
    $components['to'] = 'Insert email address(es) here';
    $components['subject'] = 'New Peer Mentor Mid-Semester Check In Report';
    $components['body'] = '<html><body><p>To administration,</p><p>This is an automated message informing you that ' . $mentor_name . ' has submitted a Mid-Semester Check In Report for their mentee ' . $mentee_name . '.</p><p>Earl Huff,M.S.</p></body></html>';
    if (mailSender($components) > 0) {
        $data['success'] = TRUE;
        $data['message'] = 'Your mid-semester report has been successfully submitted';
    }
} catch (Exception $ex) {
    $data['success'] = FALSE;
    $data['message'] = $ex->getMessage();
}
echo json_encode($data);