File manager - Edit - /home/custbahd/irungikitchen.com/admin/chat/chat/index.php
Back
<?php session_start(); include_once "../../db/config.php"; if(!isset($_SESSION['user_id'])){ } ?> <?php include_once "../header.php"; ?> <body class="body_gradient"> <div class="wrapper"> <section class="chat-area"> <header> <?php $id = mysqli_real_escape_string($conn, $_GET['id']); $sql = mysqli_query($conn, "SELECT * FROM users WHERE user_id = '$id'"); if(mysqli_num_rows($sql) > 0){ $row = mysqli_fetch_assoc($sql); }else{ header("location: ../../"); } $sql2 = mysqli_query($conn, "SELECT * FROM users WHERE user_id = '$_SESSION[user_id]'"); if(mysqli_num_rows($sql2) > 0){ $row2 = mysqli_fetch_assoc($sql2); } if ($row['user_id'] == $id) { $link = "chat_seen/?id=". $id .""; } else { $link = "chat_seen/?id=". $row['user_id'] .""; } ?> <a href="<?php echo $link; ?>"><img src="../../images/logo.png" class="logo_img float-bounce"></a> <a href="<?php echo $link; ?>" class="back-icon"><i class="fa fa-arrow-left"></i></a> <?php if ($row['user_image'] == '') { echo '<svg id="icon-user1" xmlns="http://www.w3.org/2000/svg" class="text-primary ml-2 mr-2" width="35" height="35" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>'; } else { echo '<img src="../../'.$row['user_image'] .'" alt="'.$row['user_name'].'">'; } ?> <div class="details mt-3"> <span class="text-primary"><?php echo $row['user_name'] ?></span> <?php if ($row['status']=='Offline') { echo '<p class="fs-12 text-secondary"><i class="fa fa-power-off" style="margin-right: 0.8px;"></i>ffline</p>'; } elseif ($row['status']=='Online') { echo '<p class="fs-12 text-success"><i class="fa fa-power-off" style="margin-right: 0.8px;"></i>nline</p>'; } ?> </div> </header> <div class="chat-box"> </div> <div class="chat-unread"> </div> <form action="#" class="typing-area"> <?php echo ' <input type="hidden" name="user_id" class="form-control" value="'.$row["user_id"].'"> <input type="hidden" name="user_name" class="form-control" value="'.$row["user_name"].'"> <input type="hidden" name="user_email" class="form-control" value="'.$row["user_email"].'"> <input type="hidden" name="user_phone" class="form-control" value="'.$row["user_phone"].'"> <input type="hidden" name="user_role" class="form-control" value="'.$row["user_role"].'"> <input type="hidden" name="user_image" class="form-control" value="'.$row["user_image"].'"> <input type="hidden" name="sender_id" class="form-control" value="'.$row2["user_id"].'"> <input type="hidden" name="sender_name" class="form-control" value="'.$row2["user_name"].'"> <input type="hidden" name="sender_email" class="form-control" value="'.$row2["user_email"].'"> <input type="hidden" name="sender_phone" class="form-control" value="'.$row2["user_phone"].'"> <input type="hidden" name="sender_role" class="form-control" value="'.$row2["user_role"].'"> <input type="hidden" name="sender_image" class="form-control" value="'.$row2["user_image"].'"> '; ?> <div class="incoming-msg-box"> </div> <input type="text" class="incoming_id" name="incoming_id" value="<?php echo $id; ?>" hidden> <input type="text" name="message" class="input-field" placeholder="Type a message here..." autocomplete="off"> <button><i class="fa fa-telegram"></i></button> </form> </section> </div> <script src="../javascript/chat.js"></script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 1.4 |
proxy
|
phpinfo
|
Settings