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 GetMenteeStatusForMentor($mentorId, $mentorEmail)
{
    $resp = "-1";
    $submission = "";
    $feedback = "";
    $mentee = array();
    try {
        $query = "select * from Mentee where MenteeMentor='{$mentorId}'";
        $rs = mysql_query($query);
        if (!$rs) {
            $resp = "-1";
        } else {
            $resp = "";
            if (mysql_num_rows($rs) > 0) {
                while ($res = mysql_fetch_array($rs)) {
                    $mentee = GetMenteeDetails($res["MenteeID"]);
                    $resp .= "<h4>" . $mentee["MenteeName"] . " (" . $mentee["MenteeEmail"] . ")</h4>";
                    $resp .= GetMenteeSubmissionFeedbackInTableFormat($res["MenteeID"]);
                }
            } else {
                $resp = "0";
                // no record exists.
            }
        }
        echo $resp;
    } catch (Exception $e) {
        $resp = "-1";
        echo $resp;
    }
}