diff --git a/QAC_All_Ideas.php b/QAC_All_Ideas.php index ab8313d..ca55e11 100644 --- a/QAC_All_Ideas.php +++ b/QAC_All_Ideas.php @@ -92,19 +92,19 @@ class="rounded-circle me-2"
+ -
Download Documents + class="btn btn-primary">Download + Documents diff --git a/QAC_Idea_By_Department.php b/QAC_Idea_By_Department.php index 2c4bf33..011e963 100644 --- a/QAC_Idea_By_Department.php +++ b/QAC_Idea_By_Department.php @@ -92,19 +92,19 @@ class="rounded-circle me-2"
+ -
Download Documents + class="btn btn-primary">Download Documents diff --git a/QAC_Topic_Detail.php b/QAC_Topic_Detail.php index 0180b1c..ca55e11 100644 --- a/QAC_Topic_Detail.php +++ b/QAC_Topic_Detail.php @@ -250,7 +250,8 @@ class="rounded-circle me-2" ?> Download Documents + class="btn btn-primary">Download + Documents diff --git a/QAM_Department.php b/QAM_Department.php index 552c08c..ecf4086 100644 --- a/QAM_Department.php +++ b/QAM_Department.php @@ -5,296 +5,306 @@ header("Location: index.php"); } else { ?> - - + + - - - - - - - - - - - - Quality Assurance Manager - - - - - + + + + + + + + + + + + Quality Assurance Manager + - -
-
- - - - - - + - - - - - - - - + + + + + + - + + - + \ No newline at end of file diff --git a/QAM_Download_All_Ideas_Of_Topics.php b/QAM_Download_All_Ideas_Of_Topics.php new file mode 100644 index 0000000..3ffb816 --- /dev/null +++ b/QAM_Download_All_Ideas_Of_Topics.php @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/QAM_Download_File_Upload_By_Topics.php b/QAM_Download_File_Upload_By_Topics.php new file mode 100644 index 0000000..bf95a92 --- /dev/null +++ b/QAM_Download_File_Upload_By_Topics.php @@ -0,0 +1,58 @@ +alert("No files uploaded for this topic.");'; + echo ''; +} else { + // Create a temporary file to store the compressed archive + $zip_file = tempnam($upload_dir, 'zip'); + + // Create a new ZipArchive object + $zip = new ZipArchive(); + + + // Open the temporary file in write mode + if ($zip->open($zip_file, ZipArchive::CREATE) !== TRUE) { + // Display an alert if the archive cannot be created + echo ''; + echo ''; + } + + + // Loop through the files and add them to the archive + while ($row = mysqli_fetch_assoc($result)) { + $file_path = $upload_dir . '/' . str_replace('uploads/', '', $row['DocumentPath']); + if (file_exists($file_path)) { + $zip->addFile($file_path, $row['DocumentPath']); + } + } + + + // Close the archive + $zip->close(); + + // Download the archive + header('Content-Type: application/zip'); + header('Content-Disposition: attachment; filename="uploaded_files_topic_' . $topic_id . '.zip";'); + header('Content-Length: ' . filesize($zip_file)); + + // Read the file to the browser + readfile($zip_file); + + // Delete the temporary file + unlink($zip_file); +} +?> diff --git a/QAM_Ideas.php b/QAM_Ideas.php index 2f67118..c7bc2c9 100644 --- a/QAM_Ideas.php +++ b/QAM_Ideas.php @@ -32,7 +32,6 @@ -
- +
- -
-
- -
- avatar -
-

Marris Nguyen

- July 17 at 1:23 pm + + 0) { ?> +
+ 0) { ?> +
+ +
+ +
+ +
+ avatar +
+

+ diff($post_time); + if ($diff->y > 0) { + echo $diff->y . " year" . ($diff->y > 1 ? "s" : "") . " ago"; + } else if ($diff->m > 0) { + echo $diff->m . " month" . ($diff->m > 1 ? "s" : "") . " ago"; + } else if ($diff->d > 0) { + echo $diff->d . " day" . ($diff->d > 1 ? "s" : "") . " ago"; + } else if ($diff->h > 0) { + echo $diff->h . " hour" . ($diff->h > 1 ? "s" : "") . " ago"; + } else if ($diff->i > 0) { + echo $diff->i . " minute" . ($diff->i > 1 ? "s" : "") . " ago"; + } else if ($diff->s > 0) { + echo $diff->s . " second" . ($diff->s > 1 ? "s" : "") . " ago"; + } + ?> +
+
+ + + + +
+
+
Topic Name:
+
Idea Title:
+
+ +
+

+ 0) { + // Build a zip file containing all the documents for this idea + $zip = new ZipArchive(); + $zipName = "documents-" . $row['IdeaID'] . ".zip"; + $zipPath = "uploads/" . $zipName; + if ($zip->open($zipPath, ZipArchive::CREATE) !== TRUE) { + echo "Error: Could not create zip file"; + } + while ($row_download = mysqli_fetch_assoc($result_download)) { + $filePath = $row_download['DocumentPath']; + $fileName = basename($filePath); + $zip->addFile($filePath, $fileName); + } + $zip->close(); + ?> + + Download Documents + + +
+ +
+
+ + +
+ + +
+ + + +
+ 0) { ?> + + +
+ +
+ + avatar +
+ +

+ + diff($comment_time); + if ($diff->y > 0) { + echo $diff->y . " year" . ($diff->y > 1 ? "s" : "") . " ago"; + } else if ($diff->m > 0) { + echo $diff->m . " month" . ($diff->m > 1 ? "s" : "") . " ago"; + } else if ($diff->d > 0) { + echo $diff->d . " day" . ($diff->d > 1 ? "s" : "") . " ago"; + } else if ($diff->h > 0) { + echo $diff->h . " hour" . ($diff->h > 1 ? "s" : "") . " ago"; + } else if ($diff->i > 0) { + echo $diff->i . " minute" . ($diff->i > 1 ? "s" : "") . " ago"; + } else if ($diff->s > 0) { + echo $diff->s . " second" . ($diff->s > 1 ? "s" : "") . " ago"; + } + ?> + + +

+
+
+
+ + + $closure_date && $current_date > $final_closure_date) { + echo ""; + } else if ($current_date > $closure_date && $current_date < $final_closure_date) { ?> + + +
+
+ + +
+ + +
+ +
+ + +
+ + +
+
+ + + +
+
+ + +
+ + +
+ +
+ + +
+ + +
+
+ +
+
+
-
-
- -
-

Lorem ipsum dolor sit amet consectetur adipisicing elit. Possimus provident totam - velit optio, - reprehenderit in impedit quidem, doloremque esse eos officiis, voluptas nobis maxime - minima? - Perspiciatis soluta enim veritatis neque!

+
+ + -
-
- - - - -
-
+ $sql = "INSERT INTO Comment (CommentContent, StaffID, IdeaID, is_anonymous, CommentDate) VALUES ('$content', '$staffID', '$ideaID', '$isAnonymous', '$commentDate')"; + if (mysqli_query($conn, $sql)) { + // The author of an idea receives an automatic email notification whenever a comment is submitted to any of their ideas. + $sql2 = "SELECT * FROM Idea WHERE IdeaID = '$ideaID'"; + $result2 = mysqli_query($conn, $sql2); + $row2 = mysqli_fetch_assoc($result2); + $authorID = $row2['StaffID']; + $sql3 = "SELECT * FROM Staff WHERE StaffID = '$authorID'"; + $result3 = mysqli_query($conn, $sql3); + $row3 = mysqli_fetch_assoc($result3); + $authorEmail = $row3['Email']; + $authorName = $row3['StaffName']; + $to = $authorEmail; + $subject = "New comment on your idea"; + $message = "Dear " . $row3['StaffName'] . ",

A new comment has been submitted to your idea $row2[Title].

"; + $message .= 'Comment: ' . $content . '

'; + $message .= 'Please login to your account to view the comment.

'; + $message .= 'Thank you,
Greenwich Quality Assurance Manager'; -
+ // Set up the email headers + $mail = new PHPMailer\PHPMailer\PHPMailer(); + + try { + // Server settings + $mail->SMTPDebug = 0; + $mail->isSMTP(); + $mail->Host = 'smtp.gmail.com'; + $mail->SMTPAuth = true; + $mail->Username = 'greenwich.qa@gmail.com'; + $mail->Password = 'iebdmpqvvkpjglec'; + $mail->SMTPSecure = 'tls'; + $mail->Port = 587; + + // Recipients + $mail->setFrom('greenwich.qa@gmail.com', 'Greenwich QA'); + $mail->addAddress($to, $authorName); + + // Content + $mail->isHTML(true); + $mail->Subject = $subject; + $mail->Body = $message; + $mail->send(); + echo ""; + echo ""; + } catch (Exception $e) { + echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; + } + } else { + echo ""; + } + } + ?>
@@ -217,11 +580,99 @@ class="rounded-circle me-2" crossorigin="anonymous"> + - \ No newline at end of file + \ No newline at end of file diff --git a/QAM_Role.php b/QAM_Role.php index b4887a9..d592a4f 100644 --- a/QAM_Role.php +++ b/QAM_Role.php @@ -179,6 +179,7 @@ class="d-flex align-items-center text-decoration-none text-dark" id="manage-topi ID Role Name + Account Count Action @@ -187,6 +188,12 @@ class="d-flex align-items-center text-decoration-none text-dark" id="manage-topi + - @@ -564,10 +560,9 @@ class="far fa-clock"> data-id-delete="" > Delete - + View + Ideas diff --git a/Staff.php b/Staff.php index 74a8456..1e14c74 100644 --- a/Staff.php +++ b/Staff.php @@ -241,7 +241,7 @@ class="rounded-circle me-2" $zip->close(); ?> Download Documents + class="btn btn-primary">Download Documents diff --git a/Staff_Hot.php b/Staff_Hot.php index eb11b21..5016c07 100644 --- a/Staff_Hot.php +++ b/Staff_Hot.php @@ -250,7 +250,7 @@ class="rounded-circle me-2" $zip->close(); ?> Download Documents + class="btn btn-primary">Download Documents diff --git a/Staff_Last.php b/Staff_Last.php index 0c22ca4..c18558a 100644 --- a/Staff_Last.php +++ b/Staff_Last.php @@ -241,7 +241,7 @@ class="rounded-circle me-2" $zip->close(); ?> Download Documents + class="btn btn-primary">Download Documents diff --git a/Staff_MyPost.php b/Staff_MyPost.php index 73f6ca6..0c050a1 100644 --- a/Staff_MyPost.php +++ b/Staff_MyPost.php @@ -221,7 +221,7 @@ class="rounded-circle me-2" $zip->close(); ?> Download Documents + class="btn btn-primary">Download Documents diff --git a/Staff_PostIdeas.php b/Staff_PostIdeas.php index d7a2f13..b3bd58e 100644 --- a/Staff_PostIdeas.php +++ b/Staff_PostIdeas.php @@ -459,7 +459,7 @@ class="rounded-circle me-2" $zip->close(); ?> Download Documents + class="btn btn-primary">Download Documents diff --git a/header.php b/header.php index cad4bfc..e62bd06 100644 --- a/header.php +++ b/header.php @@ -5,7 +5,9 @@
- University of Greenwich + + University of Greenwich +