-
Notifications
You must be signed in to change notification settings - Fork 5
/
msg.php
106 lines (97 loc) · 2.53 KB
/
msg.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
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
<?php
include('session.php');
$_SESSION['pageStore'] = "msg.php";
if(!isset($_SESSION['login_id'])){
header("location: index.php"); // Redirecting To Home Page
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Your Home Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="js/jquery.js"></script>
<link rel="stylesheet" href="css/w3.css">
<link rel="stylesheet" href="css/bootstrap.css">
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
//UpDate table with new dateTime every minutes
setInterval(() => { fetch('checkOnline/active.php?user_id=' + <?php echo $session_id ?>)}, 60000);
</script>
<style type="text/css">
.row {
margin-right: 5px;
margin-left: 5px;
margin-top: 10px;
}
.col-lg-3, .col-lg-4, .col-lg-6, .col-sm-12 {
padding-right: 5px;
padding-left: 5px;
}
input[type="text"]:focus {
box-shadow: 0 0 0 0.15rem rgba(134,142,150,.5);
}
</style>
</head>
<body class="bg-light">
<!Menu Heading>
<?php include 'menuHead.php'; ?>
<!Body Div>
<div class="row" >
<!Friend Div>
<div class="col-lg-2 col-sm-12">
<?php include 'msg/MsgFrnList.php'; ?>
</div>
<!Message box Div>
<div class="col-lg-8 col-sm-12">
<?php include 'msg/MsgMain.php'; ?>
</div>
<!Friend request send Div>
<div class="col-lg-2 col-sm-12" style="height: 570px;overflow: auto;">
<form method="POST">
<div class="input-group" id="search">
<input type="text" class="form-control" name="msgBox" id="searchFrn" placeholder="Search for new friends" required>
<div class="input-group-btn">
<button type="submit" id="frnBtn" class="btn btn-secondary" value="chat"><i id="SearchIcon" class="icon fa-search"></i></button>
</div>
</div>
</form>
<div id="frnList" style="height:245px;overflow:auto;"></div>
</div>
</div>
<script>
function myFunction() {
var x = document.getElementById("demo");
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
} else {
x.className = x.className.replace(" w3-show", "");
}
}
$(function() {// For saving data on database
// For searching friend
$("#frnBtn").click(function() {
var textcontent = $("#searchFrn").val();
if(textcontent=='')
{
alert("Enter your friend name");
$("#searchFrn").focus();
}
else
{
$.ajax({
type: "POST",
url: "msg/searchFrn.php",
data: {q: textcontent},
cache: true,
success: function(response){
document.getElementById("frnList").innerHTML = response;
}
});
}
return false;
});
});
</script>
</body>
</html>