-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
107 lines (94 loc) · 4.82 KB
/
profile.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
<?php
session_start();
if (isset($_SESSION['useremail'])) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYMHOLIC</title>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://kit.fontawesome.com/7108b832d3.js" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="css/forget.css">
</head>
<body>
<!-- Navigation Bar-->
<nav class="navbar navbar-expand-md navbar-light bg-light">
<a class="navbar-brand" href="#"><img src="img/name.jpg" alt="">YMHOLIC</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item ">
<a class="nav-link" href="page2.php">Back <span class="sr-only"></span></a>
</li>
</ul>
</div>
</nav>
<!-- php code for name and info -->
<?php
require 'includes/condb.php';
$email = $_SESSION['useremail'];
$id = $_SESSION['userId'];
$sql = "SELECT * FROM test1 WHERE Email= ?";
$stmt= mysqli_stmt_init($con);
if (!mysqli_stmt_prepare($stmt, $sql)) {
echo 'mysqlerror';
} else {
mysqli_stmt_bind_param($stmt, "s", $email);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
if ($row = mysqli_fetch_assoc($result)) {
?>
<!-- Profile Form -->
<form action="includes/upload.inc.php" method="POST" enctype="multipart/form-data">
<div class="container">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-lg-6 form-group main-frame-forget-3">
<div class="inner">
<div class=" col-lg-12 user-img text-center">
<?php
if ($row['status'] == 1) {
?>
<input type="file" id="photo-upload" name="file">
<label for="photo-upload" ><img src="img/face.png" alt=""></label>
<?php
} else {
echo '<input type="file" id="photo-upload" name="file">';
echo '<label for="photo-upload" ><img src="upload/profile'.$id.".".'jpg" alt=""></label>';
} ?>
</div>
<div class="col-lg-12">
<small>Click on the image to update your profile photo.</small>
<button type="submit" name="btn-upload" class="btn btn-dark">Upload</button>
<input type="text" name="firstname" class="form-control" placeholder="First Name" value= <?php echo $row['FirstName']; ?>>
<input type="text" name="lastname" class="form-control" placeholder="Last Name" value= <?php echo $row['LastName']; ?>>
<input type="email" name="email" class="form-control" placeholder="Email" value= <?php echo $row['Email']; ?>>
<input type="phone" name="phone" class="form-control" placeholder="Phone No.">
<small class="form-text form-mute">If you want to Restart your workout routine then click the Reset Button below.</small>
<button class="btn btn-danger">Reset</button>
</div>
</div>
</div>
<div class="col-lg-3"></div>
</div>
</div>
</form>
<?php
}
} ?>
</body>
</html>
<?php
}
else{
header("Location: login.php?direct=notallowed");
exit();
}
?>