-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewaccount.php
140 lines (105 loc) · 4.14 KB
/
viewaccount.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
session_start();
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ZUMBA AIR</title>
<link rel="stylesheet" type="text/css" href="zumbacss.css">
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+KR|Pacifico" rel="stylesheet">
<style>
form {display:inline; padding:20px;}
</style>
</head>
<body>
<div id="banner">
<div class="logoimg">
<img src="zumbaairlogo.png" height="140px" width="140px";>
</div>
<div class="logobrand">
<p>THE PRIDE OF AIR TRAVEL</p>
</div>
</div>
<div class="transition"><a href="logout.php"><input type="button" value="Logout"></a></div>
<div>
<?php
echo'<div id = "notes">' ;
echo "<ul style='list-style-type:none;'>";
echo'<li><form action="createaccount.php" method="GET">
<button class="button" type="submit" name="createaccount">Create Account </button>
</form> </li>' ;
echo'<li><form action="viewaccount.php" method="GET">
<button class="button" type="submit" name="viewaccount">View Account </button>
</form> </li>' ;
echo "</ul>";
echo "<br><br><br><br><br><br><br>";
echo "</div>";
?>
<?php
echo'<div id = "welcomepage">' ;
echo "<p class='welcomenote'>Welcome ".$_SESSION['username']."</p>";
include "../../../connection_string.php"; //contains MySQL login information
mysql_select_db("ZumbaAir", $con);
$acctresult = mysql_query("SELECT comid FROM ZumbaAccountTable WHERE comid != 123 ");
echo'<form class="mealrequest" action="viewaccount.php" method="GET"><select name="acctrequest" >';
while($row = mysql_fetch_array($acctresult))
{echo '<option>'.$row['comid']. '</option>';}
echo '</select><button class="button" type="submit" name="acctsearchsubmit">Search</button>';
echo "</form> <br>";
?>
<?php
echo "<br>";
$acctrequest = ($_REQUEST['acctrequest']);
$acctsearchsubmit = ($_REQUEST['acctsearchsubmit']);
if(isset($acctsearchsubmit))
{
echo '<table id="mealtype">';
include "../../../connection_string.php"; //contains MySQL login information
mysql_select_db("ZumbaAir", $con);
$acctsearchresult = mysql_query("SELECT * FROM ZumbaAccountTable WHERE comid = '$acctrequest' ");
while($row = mysql_fetch_array($acctsearchresult))
{
$comid = $row['comid'];
$_SESSION['comid']=$comid;
$fname = $row['fname'];
$_SESSION['fname']=$fname;
$lname = $row['lname'];
$_SESSION['lname']=$lname;
$email = $row['email'];
$_SESSION['email']=$email;
$phone = $row['phone'];
$_SESSION['phone']=$phone;
$password = $row['password'];
$_SESSION['password']=$password;
echo "<tr><td width='120' height='40'>Company Id</td><td> " . $row['comid'] . "</td></tr>
<tr><td width='120' height='40'>First Name</td><td>" . $row['fname'] . "</td></tr>
<tr><td width='120' height='40'>Last Name</td><td>" . $row['lname'] . "</td></tr>
<tr><td width='120' height='40'>Email Address</td><td>" . $row['email'] . "</td></tr>
<tr><td width='120' height='40'>Phone</td><td>" . $row['phone'] . "</td></tr>
<tr><td width='120' height='40'>Password</td><td>" . $row['password'] . "</td></tr></table>";
}
echo'<br><br>';
echo "<td><a onClick=\"javascript: return confirm('Please confirm deletion');\" href='deleteacct.php?id=".$query2['id']."'><center><button class='button'>Delete</button></a></td><tr>"; //use double quotes for js inside php!
echo "<br><br>";
}
echo '</div>';
?>
<?php
/*$deleteaccnt = ($_REQUEST['deleteaccnt']);
$_SESSION['deleteaccnt']=$deleteaccnt;
$acctrequest = ($_REQUEST['acctrequest']);
$_SESSION['acctrequest']=$acctrequest;
if(isset($deleteaccnt))
{
include "../../../connection_string.php"; //contains MySQL login information
mysql_select_db("ZumbaAir", $con);
$insertquery = mysql_query("DELETE FROM ZumbaAccountTable WHERE comid = '".$_SESSION['comid']."'");
echo "<script> if (window.location.href.substr(-2) !== '?r') {window.location = window.location.href + '?r';} </script>";
echo "<center>Account deleted successfully! <br> <br>";
}*/
?>
<div id="footer">
</br>
<b>© Zumba Air| [email protected] | </b></div>
</body>
</html>