Beispiel #1
0
function SendAssignmentSubmissionMail($menteeId, $mentorId, $assId, $assPdf, $assCourse)
{
    $resp = "-1";
    $mentee = GetMenteeDetails($menteeId);
    $mentor = GetMentorDetails($mentorId);
    try {
        $subject = "Assignment Submitted by Mentee - Mentored-Research";
        $msg = "Dear " . $mentor["MentorName"] . ", <br /><br />";
        $msg .= "Your mentee " . $mentee["MenteeName"] . "(" . $mentee["MenteeEmail"] . ") has submitted the assignment named " . GetAssignmentName($assId) . " under the course " . GetCourseNameById($assCourse) . ". <br /><br />";
        $msg .= "You can find the uploaded Assignment Solution <a href='http://www.mentored-research.com/courses/" . $assPdf . "' target='_blank' >HERE</a>.";
        $msg .= "Please get in touch with your mentor for further correspondence.<br /><br />";
        $msg .= "Thanks & Regards, <br />";
        $msg .= "Team Mentored-Research<br />";
        $msg .= "info@mentored-research.com<br /><br />";
        $msg .= "Please do not reply to this automated mail.<br /><br />";
        //write the mail sending if else condition here.
        $res = SendMessage($mentor["MentorEmail"], $mentor["MentorName"], "*****@*****.**", "Mentored-Research", $subject, $msg);
        return $res;
    } catch (Exception $e) {
        $resp = "-1";
        return $resp;
    }
}
function GetMentorDetailsOfMentee($email, $id)
{
    $resp = "-1";
    $mentor = array();
    $mentorID = "0";
    try {
        $mentorID = GetMentorIDOfMentee($email, $id);
        if ($mentorID == "0") {
            $resp = "-2";
        } else {
            if ($mentorID == "-1") {
                $resp = "-1";
            } else {
                $mentor = GetMentorDetails($mentorID);
                header('Content-Type: application/json');
                $resp = json_encode($mentor);
            }
        }
        echo $resp;
    } catch (Exception $e) {
        $resp = "-1";
        echo $resp;
    }
}