-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChat.php
More file actions
173 lines (169 loc) · 5.81 KB
/
Chat.php
File metadata and controls
173 lines (169 loc) · 5.81 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
session_start();
if (!isset($_SESSION['user'])) {
header('Location:Accueil.php');
}
require_once('Connexion.php');
$pdstat = $bd->prepare("SELECT * FROM utilisateurs");
$user = $_SESSION['user'];
$pdstat1 = $bd->prepare("SELECT pseudo FROM utilisateurs pseudo=$user");
$pdstat->execute();
$pdstat1->execute();
$users = $pdstat->fetchAll();
$users1 = $pdstat1->fetchAll();
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="bootstrap.min.css">
<script type="text/javascript" src="jquery-3.5.1.min.js"></script>
<script>
var from=NULL , start=0;
document.ready(function(){
from = prompt('Please enter your name');
alert("Hello "+from);
})
</script>
<title>Chat</title>
<style>
.author{
float: left;
margin-left: 2px;
font-family: 'Times New Roman', Times, serif;
color: black;
font-weight: bold;
background-color: dimgrey;
color: white;
border-radius: 0px 0px 0px 0px;
opacity: 0.7;
height: 80px;
width: 80px;
border-radius: 50px 50px;
text-align: center;
border-color: 1px solid transparent;
padding-top: 25px;
}
.content{
float: right;
color: darkkhaki;
margin-top: 4px;
margin-right: 2px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
.created_at{
background-color: black;
color: cyan;
margin-right: 2px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
.chat{
float: left;
width : 100%;
height: auto;
background-color: white;
border-color: 1px solid transparent;
scroll-margin-right: auto;
margin-left: 3px;
overflow-x: hidden;
overflow-y: scroll;
box-shadow: 0px 3px 3px 0px rgba(122, 117, 117, 0.2);
}
.message{
float: left;
border-radius: 0px 10px 10px 10px;
border-color: 1px solid transparent;
background-color: rgb(230, 225, 225);
color : black;
height: auto;
width: 320px;
padding: 3px 5px;
margin: 5px;
box-shadow: 0px 3px 3px 0px rgba(122, 117, 117, 0.2);
}
body{
background:#eee;
}
h1{
text-align: center;
}
.card{
width: 100%;
}
a{
margin-left: 4px;
}
h3{
color: mediumaquamarine;
height: 90px;
width: 90px;
border-radius: 50px 50px;
text-align: center;
border-color: 1px solid transparent;
padding-top: 25px;
font-family: 'Times New Roman', Times, serif;
font-weight: bold;
background-color: dimgrey;
margin-top: 10px;
}
img{
width: 2.0em;
height: 2.0em;
border-color: 1px solid transparent;
}
.icon{
position: relative;
}
.icon button {
position: absolute;
left: 495px;
top: 0px;
}
.contener-left{
float: left;
width: 500px;
margin-left: 5px;
height: auto;
background-color: white;
margin: 4px;
border: 1px solid transparent;
border-radius: 2px 2px 2px 2px;
box-shadow: 0px 3px 3px 0px rgba(122, 117, 117, 0.2);
}
</style>
</head>
<body>
<div class="container content chat">
<a href="Deconnexion.php" ><img src="images/switch.png" alt="deconnexion"></a>
<div class="row">
<div class="col-xl-6 col-lg-6 col-md-3 col-sm-12 col-12">
<div class="card">
<div class="card-header"><h3><?php echo $_SESSION['user']; ?></h3>en ligne<h1> Wakhtaan Chat</h1></div>
<div class="card-body height3">
<div class="chat-list">
<div class="chat-body">
<div class="chat-message messages">
</div>
</div>
</div>
</div>
<div class="user-inputs">
<form action="Handler.php?task=write" method="post" class="icon">
<input type="text" name="author" id="author" value="<?php echo $_SESSION['user'] ?>" class="form-control rounded-left" hidden>
<input type="text" name="content" id="content" placeholder="Ecrire votre message" class="form-control rounded-left">
<button type="submit"><img src="images/send-message.png" alt="send"></button>
</form>
</div>
</div>
</div>
<div class="contener-left row">
<h3>Les membres en ligne</h3>
</div>
</div>
</div>
</div>
<script src="App.js"></script>
</body>
</html>