//.$File_Ext; //new file name
 // get the cookies here.
 $email = "-1";
 $id = "-1";
 $assId = "-1";
 $assCourse = "-1";
 if (isset($_COOKIE["assIdUpdate"])) {
     $assId = $_COOKIE["assIdUpdate"];
 }
 if (isset($_COOKIE["email"])) {
     $email = $_COOKIE["email"];
 }
 if (isset($_COOKIE["id"])) {
     $id = $_COOKIE["id"];
 }
 $assCourse = GetMenteeCourse($email);
 if ($assId == "-1" || $assCourse == "-1" || $email == "-1" || $id == "-1") {
     die("Oops! We encountered an error while submitting your solution. Please go back and try again.");
 } else {
     if (move_uploaded_file($_FILES['fileUpdateSolution']['tmp_name'], $UploadDirectory . $NewFileName)) {
         // save the link to the database.
         $mentorId = GetMentorIDOfMentee($email, $id);
         $resp = updateSubmission($id, $mentorId, $assId, $assCourse, $UploadDirectory . $NewFileName);
         if ($resp == "1") {
             echo "Submission Updated Successfully.";
         } else {
             echo "Oops! We encountered an error in updating your submission. Please try again.";
         }
     } else {
         die('error uploading File!');
     }
function GetCalender($menteeEmail)
{
    $resp = "-1";
    $courseID = GetMenteeCourse($menteeEmail);
    $calender = "";
    try {
        if ($courseID == "-1" || $courseID == "0") {
            $resp = "-2";
        } else {
            $query = "select * from Calender where CourseID='{$courseID}'";
            $rs = mysql_query($query);
            if (!$rs) {
                $resp = "-1";
            } else {
                if (mysql_num_rows($rs) > 0) {
                    while ($res = mysql_fetch_array($rs)) {
                        $calender = $res["Calender"];
                    }
                    $resp = "http://mentored-research.com/courses/" . $calender;
                } else {
                    $resp = "0";
                }
            }
        }
        echo $resp;
    } catch (Exception $e) {
        $resp = "-1";
        echo $resp;
    }
}