-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit-profile.php
More file actions
82 lines (79 loc) · 6.83 KB
/
Copy pathedit-profile.php
File metadata and controls
82 lines (79 loc) · 6.83 KB
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
<?php
include "connection/koneksi.php";
session_start();
$userid = $_SESSION['userid'];
$sql = mysqli_query($conn, "SELECT * FROM users WHERE username = '$userid'");
$data = mysqli_fetch_array($sql);
?>
<?php
$pageTitle = "Edit User Profile";
include 'cdn.php';
include 'layouts/header.php';
include 'layouts/sidebar.php';
?>
<div class="p-4 sm:ml-64 flex items-center justify-center h-screen">
<div class="relative w-full max-w-lg max-h-full">
<div class="w-full p-6 bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700">
<form class="space-y-6" action="process/editp.php" method="POST" enctype="multipart/form-data">
<input class="hidden" value="<?= $data['userid'] ?>" name="userid" />
<div class="flex flex-col items-center">
<img class="w-24 h-24 mb-3 rounded-full shadow-lg" src="img/profile/<?= $data['profile'] ?>" />
</div>
<div class="grid gap-4 mb-4 grid-cols-3">
<div class="col-span-2 sm:col-span-1">
<label for="nrp" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">NRP</label>
<input type="number" name="nrp" id="nrp" value="<?= $data['nrp'] ?>"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
placeholder="NRP" required>
</div>
<div class="col-span-2 sm:col-span-1">
<label for="name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Name</label>
<input type="text" name="name" id="name" value="<?= $data['name'] ?>"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
placeholder="Name" required>
</div>
<div class="col-span-2 sm:col-span-1">
<label for="email" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Email</label>
<input type="text" name="email" id="email" value="<?= $data['email'] ?>"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
placeholder="Email" required>
</div>
</div>
<div class="grid gap-4 mb-4 grid-cols-2">
<div class="col-span-2 sm:col-span-1">
<label for="place" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Place</label>
<input type="text" name="place" id="place" value="<?= $data['place'] ?>"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
placeholder="Place" required>
</div>
<div class="col-span-2 sm:col-span-1">
<label for="birth" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Birthday</label>
<input type="date" name="birth" id="birth" value="<?= $sata['birth'] ?>"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" required>
</div>
<div class="col-span-2">
<label for="profile" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Upload Picture</label>
<input type="file" name="profile" id="profile"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
placeholder="No file chosen" required>
</div>
<div class="col-span-2 sm:col-span-1">
<label for="username" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Username</label>
<input type="text" name="username" id="username" value="<?= $data['username'] ?>"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
placeholder="Username" required>
</div>
<div class="col-span-2 sm:col-span-1">
<label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Password</label>
<input type="password" name="password" id="password"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
placeholder="Password" required>
</div>
</div>
<button type="submit" class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Save to your profile</button>
</div>
</form>
</div>
<?php include 'layouts/footer.php'; ?>
</div>
</div>