-
Notifications
You must be signed in to change notification settings - Fork 11
/
userprofile.php
159 lines (102 loc) · 4.1 KB
/
userprofile.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
158
159
<?php
include_once 'includes/dbh.inc.php';
session_start();
$current_user="superuser";
if(isset($_SESSION["current_user"])){
$current_user=$_SESSION["current_user"];
}
else{
echo "<script> window.location.replace('authentication/login.php'); </script>";
}
// echo $data[1]["orderstatus"];
$sql = "SELECT * FROM user where user_uid='$current_user'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$data[] = $row;
}
} else {
echo "0 results";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Home</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=PT+Serif" rel="stylesheet">
<!-- <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script> -->
<link rel="stylesheet" type="text/css" media="screen" href="public/css/userdashboardmobile.css"/>
</head>
<script>
function myFunction() {
var x = document.getElementById("myLinks");
if (x.style.display === "block") {
x.style.display = "none";
} else {
x.style.display = "block";
}
}
</script>
<body>
<!-- Use any element to open the sidenav -->
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main">
<!-- <div class="mobile-container"> -->
<!-- Top Navigation Menu -->
<div class="topnav">
<a href="index.php" class="active"><i class="fa fa-recycle logoimg" aria-hidden="true"></i> Welcome to Ankur</span> </a>
<div id="myLinks">
<a href="userprofile.php"> User Profile</a>
<a href="dustbin_on_demand.php"> On-demand Dustbin</a>
<a href="collectrequest.php">Collect Request</a>
<a href="locatedustbin.php"> Locate Dustbin</a>
<a href="sendcomplaints.php">Send Complaint</a>
<form method="POST" action="includes/logout.inc.php">
<button type="submit" class="btn userlogoutbtn" name="submit">Logout</button>
</form>
</div>
<a href="javascript:void(0);" class="icon" onclick="myFunction()">
<i class="fa fa-bars"></i>
</a>
</div>
<!-- End smartphone / tablet look -->
<!-- </div> -->
<br>
<div class="jumbotron text-center">
<!-- <h1>User Profile</h1> -->
<p>Welcome to your Profile <br></p>
</div>
<p>Username <b><span id="userinfo"></span></b></p> <br>
<p>Firstname <b><span id="firstname"></span></b></p> <br>
<p>Lastname <b><span id="lastname"></span></b></p> <br>
<p>Wallet Amount <b><span id="wallet_amount"></span></b></p> <br>
</div><!--main end here-->
</body>
<script>
var temp = <?php echo json_encode($data) ?>;
var temp3 = <?php echo json_encode($current_user) ?>;
console.log(temp3);
window.onload = function()
{
var userinfospan = document.getElementById("userinfo");
userinfospan.innerHTML=temp3;
var userinfospan = document.getElementById("firstname");
userinfospan.innerHTML=temp[0]["user_firstname"];
var userinfospan = document.getElementById("lastname");
userinfospan.innerHTML=temp[0]["user_lastname"];
var userinfospan = document.getElementById("wallet_amount");
userinfospan.innerHTML=temp[0]["wallet_money"];
}
</script>
</html>