-
Notifications
You must be signed in to change notification settings - Fork 0
/
chat.php
70 lines (64 loc) · 2.3 KB
/
chat.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
<?php
session_start();
include_once "php/config.php";
if (!isset($_SESSION['unique_id'])) {
header("location: login.php");
}
?>
<?php include_once "header.php"; ?>
<body>
<div class="wrapper chating">
<section class="chat-area">
<header>
<?php
$user_id = mysqli_real_escape_string($conn, $_GET['user_id']);
$sql = mysqli_query($conn, "SELECT * FROM users WHERE unique_id = {$user_id}");
if (mysqli_num_rows($sql) > 0) {
$row = mysqli_fetch_assoc($sql);
} else {
header("location: users.php");
}
?>
<a href="users.php" class="back-icon"><i class="fas fa-arrow-left"></i></a>
<img src="php/images/<?php echo $row['img']; ?>" alt="">
<div class="details">
<span><?php echo $row['fname'] . " " . $row['lname'] ?></span>
<p><?php echo $row['status']; ?></p>
</div>
<!-- <div class="theme">
<i id="night" class="fas fa-moon"></i>
</div> -->
</header>
<div class="chat-box">
</div>
<form action="#" class="typing-area">
<input type="text" class="incoming_id" name="incoming_id" value="<?php echo $user_id; ?>" hidden>
<input type="text" name="message" class="input-field" placeholder="Type a message here..." autocomplete="off">
<button><i class="fab fa-telegram-plane"></i></button>
</form>
</section>
</div>
<!-- <script>
let moon = document.getElementById("night");
let sun = document.querySelector("#day");
moon.onclick = () => {
moon.classList.add("active");
document.documentElement.style.setProperty('--pink-color', '#263238');
document.querySelector(".chat-area header").style.background = "#37474F";
document.querySelector(".chat-area header").style.color = "#fff";
}
sun.onclick = () => {
moon.classList.remove("active");
document.documentElement.style.setProperty('--pink-color', '#00838F');
document.querySelector(".chat-area header").style.background = "#e3e3e3";
document.querySelector(".chat-area header").style.color = "#eee";
}
// function changeTheme(theme) {
// if (theme == "night") {
// } else {
// }
// }
</script> -->
<script src="javascript/chat.js"></script>
</body>
</html>