From 59e65e52e20deab5b79b1af3ccce2846de53db98 Mon Sep 17 00:00:00 2001 From: Vicky Steeves Date: Sat, 17 Feb 2018 20:28:11 -0500 Subject: [PATCH] initial commit --- ClassRoster.php | 136 ++++++++++++++++++++++++++++++++++++++ README.md | 1 + employee.php | 152 +++++++++++++++++++++++++++++++++++++++++++ grade.php | 84 ++++++++++++++++++++++++ includes/footer.html | 11 ++++ includes/header.html | 54 +++++++++++++++ index.php | 20 ++++++ mysqli_connect.php | 20 ++++++ search.php | 150 ++++++++++++++++++++++++++++++++++++++++++ show_roster.php | 70 ++++++++++++++++++++ 10 files changed, 698 insertions(+) create mode 100644 ClassRoster.php create mode 100644 README.md create mode 100644 employee.php create mode 100644 grade.php create mode 100644 includes/footer.html create mode 100644 includes/header.html create mode 100644 index.php create mode 100644 mysqli_connect.php create mode 100644 search.php create mode 100644 show_roster.php diff --git a/ClassRoster.php b/ClassRoster.php new file mode 100644 index 0000000..de3614f --- /dev/null +++ b/ClassRoster.php @@ -0,0 +1,136 @@ + 0) { // If it ran OK, display the records + + // Print how many users there are: + echo "

There is the information for the course you are looking for.

\n"; + + // Table header. + echo ' + '; + + // Fetch and print all the records: + while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { //MYSQLI_ASSOC makes the returned array assortative. + echo ' + '; + } + + echo '
Course NameSemesterStudent Name
' . $row['CouLongName'] . '' . $row['SemesterInf'] . '' . $row['name'] . '
'; // Close the table. + } + else { // If it did not run OK. + + // Public message: + echo '

Error

+

There is no course roster match with the information you provided

'; + + } + } + + mysqli_close($dbc); // Close the database connection. + } // End of the main Submit conditional. +?> + +
+
+ Class Roster +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+
+ +
+
+
+
+ + diff --git a/README.md b/README.md new file mode 100644 index 0000000..ee996fd --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Helping students make their first PHP-MySQL web form diff --git a/employee.php b/employee.php new file mode 100644 index 0000000..f5988bc --- /dev/null +++ b/employee.php @@ -0,0 +1,152 @@ +Thank you! +

You are now in the database.


'; + + } else { // If it did not run OK. + + // Public message: + echo '

System Error

+

You could not be registered due to a system error. We apologize for any inconvenience.

'; + + // Debugging message: + echo '

' . mysqli_error($dbc) . '

Query: ' . $q . '

'; + + } // End of if ($r) IF. + + mysqli_close($dbc); // Close the database connection. + + // Include the footer and quit the script: + include ('includes/footer.html'); + exit(); + + } else { // Report the errors. + + echo '

Error!

+

The following error(s) occurred:
'; + foreach ($errors as $msg) { // Print each error. + echo " - $msg
\n"; + } + echo '

Please try again.


'; + + } // End of if (empty($errors)) IF. + + mysqli_close($dbc); // Close the database connection. + +} // End of the main Submit conditional. +?> + +
+
+ Register + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+
+ +
+
+
+
+ + diff --git a/grade.php b/grade.php new file mode 100644 index 0000000..2be44e6 --- /dev/null +++ b/grade.php @@ -0,0 +1,84 @@ + 0) { // If it ran OK, display the records. + + // Print how many users there are: + echo "

There is the information for the student you are looking for.

\n"; + + // Table header. + echo ' + +'; + + // Fetch and print all the records: + while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { //MYSQLI_ASSOC makes the returned array assortative. + echo ' + '; + } + + echo '
StudentCourseGrade
' . $row['name'] . '' . $row['course'] . '' . $row['grade'] . '
'; // Close the table. + } + else { // If it did not run OK. + + // Public message: + echo '

Error

+

There is no student match with the information you provided

'; + + } + } + + mysqli_close($dbc); // Close the database connection. + } // End of the main Submit conditional. +?> + +
+
+ Search Course Grade by Student Last Name +
+ +
+ +
+
+ + +
+
+ +
+
+
+
+ + diff --git a/includes/footer.html b/includes/footer.html new file mode 100644 index 0000000..3809aef --- /dev/null +++ b/includes/footer.html @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/includes/header.html b/includes/header.html new file mode 100644 index 0000000..97f3e4e --- /dev/null +++ b/includes/header.html @@ -0,0 +1,54 @@ + + + + <?php echo htmlspecialchars($page_title);?> + + + + + + + + + + + + + + + + + +
+

Heading of Your Website

+

catchy slogan...

+
+ +
+ + + + diff --git a/index.php b/index.php new file mode 100644 index 0000000..c8ddce1 --- /dev/null +++ b/index.php @@ -0,0 +1,20 @@ + + +

Big Header

+

This is where you'll put the main page content. This content will differ for each page.

+

This is where you'll put the main page content. This content will differ for each page.

+

This is where you'll put the main page content. This content will differ for each page.

+

This is where you'll put the main page content. This content will differ for each page.

+ +

Subheader

+

This is where you'll put the main page content. This content will differ for each page.

+

This is where you'll put the main page content. This content will differ for each page.

+

This is where you'll put the main page content. This content will differ for each page.

+

This is where you'll put the main page content. This content will differ for each page.

+ + diff --git a/mysqli_connect.php b/mysqli_connect.php new file mode 100644 index 0000000..c47a56b --- /dev/null +++ b/mysqli_connect.php @@ -0,0 +1,20 @@ + + \ No newline at end of file diff --git a/search.php b/search.php new file mode 100644 index 0000000..ba79cbd --- /dev/null +++ b/search.php @@ -0,0 +1,150 @@ + 0) { // If it ran OK, display the records. + + // Print how many users there are: + echo "

There is the information for the student you are looking for.

\n"; + + // Table header. + echo ' + +'; + + // Fetch and print all the records: + while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { //MYSQLI_ASSOC makes the returned array assortative. + echo ' + '; + } + + echo '
NameEmailMobile
' . $row['name'] . '' . $row['StuEmail'] . '' . $row['Mobile'] . '
'; // Close the table. + } + else { // If it did not run OK. + + // Public message: + echo '

Error

+

There is no student match with the information you provided

'; + + } + } + + mysqli_close($dbc); // Close the database connection. + } // End of the main Submit conditional. +?> + +
+
+ Search Students by First Name +
+ +
+ +
+
+ + +
+
+ +
+
+
+
+ + 0) { // If it ran OK, display the records. + + // Print how many lecturers there are: + echo "

There is the information for the lecturer you are looking for.

\n"; + + // Table header. + echo ' + +'; + + // Fetch and print all the records: + while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { //MYSQLI_ASSOC makes the returned array assortative. + echo ' + '; + } + + echo '
NameEmailTelphone
' . $row['lecname'] . '' . $row['LecEmail'] . '' . $row['WTel'] . '
'; // Close the table. + } + else { // If it did not run OK. + + // Public message: + echo '

Error

+

There is no lecturer match with the information you provided

'; + + } + } + + mysqli_close($dbc); // Close the database connection. + } // End of the main Submit conditional. +?> + +
+
+ Search Lecturers by Last Name +
+ +
+ +
+
+ + +
+
+ +
+
+
+
+ + diff --git a/show_roster.php b/show_roster.php new file mode 100644 index 0000000..7c89739 --- /dev/null +++ b/show_roster.php @@ -0,0 +1,70 @@ + 0) { // If it ran OK, display the records. + + // Print how many users there are: + echo "

There is the information for the course you are looking for.

\n"; + + // Table header. + echo ' + '; + + // Fetch and print all the records: + while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { //MYSQLI_ASSOC makes the returned array assortative. + echo ' + '; + } + + echo '
Course NameSemesterStudent Name
' . $row['CouLongName'] . '' . $row['SemesterInf'] . '' . $row['name'] . '
'; // Close the table. + } + else { // If it did not run OK. + + // Public message: + echo '

Error

+

There is no course roster match with the information you provided

'; + + } + } + + mysqli_close($dbc); // Close the database connection. + } // End of the main Submit conditional. +?> +

Class Roster

+
+

Course Name

+

+
+ +