$result = "fail" ; */ } // Create/update submission record $submissionTime = time(); $mysqltime = date("Y-m-d H:i:s", $submissionTime); // in case the submission is already submitted, just add another directory for the new one $submissionStatement = "Insert into Submission (StudentID, AssignmentID, SubmissionDate) VALUES (\"{$student}\",{$assignmentId},\"{$mysqltime}\")\n ON DUPLICATE KEY UPDATE SubmissionDate=\"{$mysqltime}\";"; // mysqli_stmt_bind_param($submissionStatement, "sis", $student, $assignment, $mysqltime); echo $student; echo " / " . $_SESSION["username"]; echo " / " . $submissionStatement; if (!mysql_query($submissionStatement)) { echo mysql_error(); error_and_die("There was a problem recording your submission. Please try again or contact your instructor"); } $submissionTimeDelta = $dueDate - $submissionTime; $lateMessage = ""; if ($submissionTimeDelta < 0) { $lateMessage = "\nThe assignment was submitted " . $submissionTimeDelta / 60.0 / 60.0 . " hours late."; } $to = "terescoj@strose.edu," . $student . "@strose.edu"; // change it to the receiver email address $subject = "SubmissionBox confirmation: " . $course . " " . $assignment . ", for " . $student; $body = "SubmissionBox confirmation: " . $assignment . "\" for " . $course . " has been uploaded by " . $student . ".\n\n The following file was submitted: " . $filename . $lateMessage; //$from = $student. "@strose.edu"; // student strose e-mail $from = "*****@*****.**"; $headers = "From:" . $from; // additional parameter to set From, Cc and Bcc if (mail($to, $subject, $body, $headers)) {
*/ } // Create/update submission record $submissionTime = time(); $mysqltime = date("Y-m-d H:i:s", $submissionTime); // in case the submission is already submitted, just add another directory for the new one $submissionStatement = "Insert into Submission (StudentID, AssignmentID, SubmissionDate) VALUES (\"{$student}\",{$assignmentId},\"{$mysqltime}\")\n ON DUPLICATE KEY UPDATE SubmissionDate=\"{$mysqltime}\";"; // mysqli_stmt_bind_param($submissionStatement, "sis", $student, $assignment, $mysqltime); // if (!mysqli_stmt_execute($submissionStatement)) { //echo $student; //echo " / " . $_SESSION["username"]; //echo " / " . $submissionStatement; if (!mysql_query($submissionStatement)) { //echo mysql_error(); error_and_die("There was a problem recording your submission. Please try again or contact your instructor with this information: " . $submissionStatement); } //Calculate the submission time late period. If late, email along late time $submissionTimeDelta = $dueDate - $submissionTime; $lateMessage = ""; if ($submissionTimeDelta < 0) { $lateMessage = "\nThe assignment was submitted " . $submissionTimeDelta / 60.0 / 60.0 . " hours late."; } $to = "terescoj@strose.edu," . $student . "@strose.edu"; // change it to the receiver email address $subject = "SubmissionBox confirmation: " . $course . " " . $assignment . ", for " . $student; $body = "SubmissionBox confirmation: " . $assignment . "\" for " . $course . " has been uploaded by " . $student . ".\n\n The following file was submitted: " . $filename . $lateMessage; $from = "*****@*****.**"; $headers = "From:" . $from; // additional parameter to set From, Cc and Bcc if (mail($to, $subject, $body, $headers)) {