Finalize
This commit is contained in:
99
chat.php
99
chat.php
@@ -1,49 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ChatLine - Real-time Messaging App</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<link rel="stylesheet" href="css/style.css" />
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<section class="chat-area">
|
||||
<header>
|
||||
<a href="#" class="back-icon"><i class="fas fa-arrow-left"></i></a>
|
||||
<img src="assets/default.png" alt="Profile photo" />
|
||||
<div class="details">
|
||||
<span>User</span>
|
||||
<p>Active now</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="chat-box">
|
||||
<div class="chat post">
|
||||
<div class="details">
|
||||
<p>
|
||||
This is an outgoing message. Lorem ipsum dolor sit amet consectetur adipisicing elit. Ullam facilis fugiat reiciendis adipisci iste assumenda error nemo quos nisi asperiores officiis voluptatibus, cumque laudantium. Praesentium aperiam rerum quisquam voluptate tempore!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat get">
|
||||
<img src="assets/default.png" alt="Profile photo" />
|
||||
<div class="details">
|
||||
<p>
|
||||
This is an incoming message. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem consectetur illo nam! Veritatis odio consectetur delectus doloribus dolores rem, hic, id molestias odit cupiditate laboriosam, facere commodi eius officia repudiandae?
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
session_start();
|
||||
include_once "php/config.php";
|
||||
if (!isset($_SESSION["unique_id"])) {
|
||||
header("location: start.php");
|
||||
}
|
||||
?>
|
||||
|
||||
<?php include_once "header.php"; ?>
|
||||
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<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) {
|
||||
$selected_user = mysqli_fetch_assoc($sql);
|
||||
}
|
||||
?>
|
||||
<a href="home.php" class="back-icon"><i class="fas fa-arrow-left"></i></a>
|
||||
<img src="php/assets/<?php if ($selected_user["img"]) {
|
||||
echo $selected_user["img"];
|
||||
} else {
|
||||
echo "default.png";
|
||||
} ?>" alt="Profile photo">
|
||||
<div class="details">
|
||||
<span>
|
||||
<?php echo $selected_user['first_name'] . " " . $selected_user['last_name'] ?>
|
||||
</span>
|
||||
<p>
|
||||
<?php echo $selected_user["status"]; ?>
|
||||
</p>
|
||||
</div>
|
||||
<form action="#" class="message-input">
|
||||
<input type="text" placeholder="Send a message..." />
|
||||
<button type="submit"><i class="fab fa-telegram-plane"></i></button>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</header>
|
||||
<div class="chat-box">
|
||||
</div>
|
||||
<form action="#" class="message-input">
|
||||
<input type="text" class="selected-id" name="selected_id" value="<?php echo $user_id; ?>" hidden>
|
||||
<input type="text" class="message-text" name="message_text" placeholder="Send a message..." />
|
||||
<button type="submit"><i class="fab fa-telegram-plane"></i></button>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
<script src="js/chat.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user