-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreview.php
More file actions
114 lines (100 loc) · 4.28 KB
/
preview.php
File metadata and controls
114 lines (100 loc) · 4.28 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Client Dashboard</title>
<link href="dashboards/styles.css" rel="stylesheet">
</head>
<body>
<div id="top-bar">
<a href="../index.php" style="text-decoration: none; vertical-align: middle; margin: 10px;"><h1 style="color: #05b4ac;">if0_35316583_Setram</h1>
<h4 style="color: #d4fffd; transition: opacity 0.5s ease-in-out;">Acteur de modality</h4></a>
</div>
<div id="left-panel">
<div class="objects">
<h3 class="link-sections">Profile</h3>
<hr>
<a href="?content=profile" class="page-link">- View Profile</a>
<a href="?content=edit" class="page-link">- Profile Management</a>
<a href="?content=docs" class="page-link">- Personnel Docs</a>
<h3 class="link-sections">Subscription</h3>
<hr>
<a href="?content=demand" class="page-link">- Demand Subscription </a>
<a href="?content=status" class="page-link">- Subscription Status</a>
<h3 class="link-sections">Other</h3>
<hr>
<a href="?content=lostCard" class="page-link">- Lost Card</a>
<a href="?content=contact" class="page-link">- Contact Admin</a>
</div>
<div class="misc" style="margin-bottom: 10%";>
<a href="?content=settings" class="link-sections">Settings</a>
<a href="?content=logout" class="link-sections">Log Out</a>
</div>
</div>
<?php
if (isset($_COOKIE['session'])) {
$clientID = $_COOKIE['session'];
try {
$servername = "sql212.infinityfree.com;port=3306";
$username = "if0_35316583";
$password = "95vhnfp7";
$dbname = "if0_35316583_Setram";
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "SELECT `Full name`, `Client ID`, `Date of birth`, `phone number`, email, address, Category, `Profile Picture` FROM clients WHERE `Client ID` = :clientID";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':clientID', $clientID, PDO::PARAM_INT);
$stmt->execute();
if ($stmt->rowCount() > 0) {
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if (isset($_GET['content'])) {
$selectedContent = $_GET['content'];
if($selectedContent == "profile")
echo '<div id="main-content">
<div class="content-section">
<div class="profile-container">
<div class="header" style="display: flex;">
<img src="' . $row['Profile Picture'] . '" width="40%" alt="Profile Picture">
<div class="title" style="margin: 65px 0px;">
<h2>' . $row['Full name'] . '</h2>
<label style="margin-left: 20px;" for="clientID">Client ID:</label>
<p id="clientID">' . $row['Client ID'] . '</p>
</div>
</div>
<div class="profile-data">
<label for="dateOfBirth">Date of Birth:</label>
<p id="dateOfBirth">' . $row['Date of birth'] . '</p>
</div>
<div class="profile-data">
<label for="phoneNumber">Phone Number:</label>
<p id="phoneNumber">' . $row['phone number'] . '</p>
</div>
<div class="profile-data">
<label for="email">Email:</label>
<p id="email">' . $row['email'] . '</p>
</div>
<div class="profile-data">
<label for="address">Address:</label>
<p id="address">' . $row['address'] . '</p>
</div>
<div class="profile-data">
<label for="category">Category:</label>
<p id="category">' . $row['Category'] . '</p>
</div>
</div>
</div>
</div>';
}
}
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
} finally {
$conn = null;
}
} else {
echo 'Session cookie not set.';
}
?>
</body>
</html>