Esempio n. 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;
    }
}
Esempio n. 2
0
function GetMenteeSubmittedAssignmentsForMentor($email, $id, $menteeId)
{
    $resp = "-1";
    $name = "";
    try {
        $courseId = GetMenteeCourseById($menteeId);
        $query = "select * from SubmissionFeedback where MentorID='{$id}' and MenteeID='{$menteeId}' and CourseID='{$courseId}'";
        $rs = mysql_query($query);
        if (!$rs) {
            $resp = "-1";
        } else {
            if (mysql_num_rows($rs) > 0) {
                $resp = "<select id='ddl-assignment' class='form-control'><option value='-1'> --Select Assignment-- </option>";
                while ($res = mysql_fetch_array($rs)) {
                    $name = GetAssignmentName($res["AssID"]);
                    $resp .= "<option value='" . $res["AssID"] . "' data-submission='" . $res["Submission"] . "' data-feedback='" . $res["Feedback"] . "' >" . $name . "</option>";
                }
                $resp .= "</select>";
            } else {
                $resp = "0";
            }
        }
        echo $resp;
    } catch (Exception $e) {
        $resp = "-1";
        echo $resp;
    }
}