-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathview.php
157 lines (138 loc) · 3.24 KB
/
view.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
session_start();
$userName=$_SESSION['userName'];
$name=$_SESSION['name'];
if(!isset($_SESSION['userName']))
{
header("Location:login.php");
}
?>
<html>
<head>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
/* Style the header */
.header {
grid-area: header;
background-color: #E98C53;
padding: 30px;
text-align: center;
font-size: 35px;
}
/* The grid container */
.grid-container {
display: grid;
grid-template-areas:
'header header header header header header'
'left middle middle middle middle middle'
'footer footer footer footer footer footer';
/* grid-column-gap: 10px; - if you want gap between the columns */
}
.left,
.middle,
.right {
padding: 10px;
height: 300px; /* Should be removed. Only for demonstration */
}
/* Style the left column */
.left {
grid-area: left;
}
/* Style the middle column */
.middle {
grid-area: middle;
}
/* Style the right column */
.right {
grid-area: right;
}
/* Style the footer */
.footer {
grid-area: footer;
background-color: #85C1E9;
padding: 10px;
text-align: center;
}
table {
border-collapse: collapse;
width: 100%;
}
th, td {
padding: 8px;
text-align: left;
border-bottom: 1px solid #ddd;
}
tr:hover {background-color:#f5f5f5;}
</style>
</head>
<body>
<div class="grid-container">
<div class="header">
<h2 style="color: #2E4053"; align="left">XCompany <?php
$name=$_SESSION['name'];
?></h2>
</div>
<div class="left" style="background-color:#aaa;">
<ul>
<li><a href="nhome.php">Dashboard</a></li>
<li><a href="view.php?userName=<?php echo $userName; ?>">View Profile</a></li>
<li><a href="edit.php">Edit Profile</a></li>
<li><a href="changepic.php">Change Profile Picture</a></li>
<li><a href="changepass.php">Change Password</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</div>
<div class="middle" style="background-color:#bbb;">
<?php
$con=mysqli_connect("localhost","root","","testdb");
if(!$con)
{
die("Connection Error: ".mysqli_connect_error()."<br/>");
}
$sql="SELECT * FROM customers WHERE userName='$userName'";
$result=mysqli_query($con,$sql);
if(mysqli_num_rows($result)>0)
{
($row=mysqli_fetch_array($result));
$image=$row["picture"];
{
echo "<h4>Profie</h4>";?>
<img src="<?php echo $image;?>" height="80" width="80" />
<?php
echo "<table>";
echo "<tr>";
echo "<td> Name </td>";
echo "<td>".$row["name"]."</td>";
echo "</tr>";
echo "<tr>";
echo "<td> Email </td>";
echo "<td>".$row["email"]."</td>";
echo "</tr>";
echo "<tr>";
echo "<td> Gender </td>";
echo "<td>".$row["gender"]."</td>";
echo "</tr>";
echo "<tr>";
echo "<td> Date of Birth </td>";
echo "<td>".$row["dob"]."</td>";
echo "</tr>";
echo "</table>";
}
}
else
{
echo "No data found.<br/>";
}
?>
</div>
<div class="footer">
<p>Copyright © 2020</p>
</div>
</div>
</body>
</html>