Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
20_21-J09
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
20_21-J09
20_21-J09
Commits
09965aea
Commit
09965aea
authored
Nov 09, 2020
by
IT17186216_Chamath Ravindu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload chatlist file
parent
dec7a09f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
user/chatlist.php
user/chatlist.php
+70
-0
No files found.
user/chatlist.php
0 → 100644
View file @
09965aea
<div
class=
"col-lg-8"
>
<div
class=
"panel panel-default"
style=
"height:75px;"
>
<span
style=
"font-size:36px; margin-left:100px; position:relative; top:13px;"
><strong><span
class=
"glyphicon glyphicon-list"
></span>
චැට් ලැයිස්තුව
</strong></span>
<div
class=
"pull-right"
style=
"margin-right:10px; margin-top:7px;"
>
<a
href=
"#add_chatroom"
data-toggle=
"modal"
class=
"btn btn-primary"
><span
class=
"glyphicon glyphicon-plus"
></span>
නව
</a>
</div>
</div>
<table
width=
"100%"
class=
"table table-striped table-bordered table-hover"
id=
"chatRoom"
>
<thead>
<tr>
<th>
චැට් රූම්
</th>
<th>
නිර්මාණය කළ දිනය
</th>
<th><span
class=
"glyphicon glyphicon-lock"
></span>
Member
</th>
</tr>
</thead>
<tbody>
<?php
$query
=
mysqli_query
(
$conn
,
"select * from chatroom order by date_created desc"
);
while
(
$row
=
mysqli_fetch_array
(
$query
)){
?>
<tr>
<input
type=
"hidden"
value=
"
<?php
$usera
=
array
();
$m
=
mysqli_query
(
$conn
,
"select * from chat_member where chatroomid='"
.
$row
[
'chatroomid'
]
.
"'"
);
while
(
$mrow
=
mysqli_fetch_array
(
$m
)){
$usera
[]
=
$mrow
[
'userid'
];
}
//1 member
if
(
in_array
(
$_SESSION
[
'id'
],
$usera
)){
echo
"1"
;
}
else
{
//2 not member w/ pass
if
(
!
empty
(
$row
[
'chat_password'
])){
echo
"2"
;
}
else
{
//3 not member w/o pass
echo
"3"
;
}
}
?>
"
id=
"status
<?php
echo
$row
[
'chatroomid'
];
?>
"
>
<td>
<?php
$num
=
mysqli_query
(
$conn
,
"select * from chat_member where chatroomid='"
.
$row
[
'chatroomid'
]
.
"'"
);
?>
<span
class=
"badge"
>
<?php
echo
mysqli_num_rows
(
$num
);
?>
</span>
<?php
echo
$row
[
'chat_name'
];
?>
</td>
<td>
<?php
echo
date
(
'M d, Y - h:i A'
,
strtotime
(
$row
[
'date_created'
]));
?>
</td>
<td><button
value=
"
<?php
echo
$row
[
'chatroomid'
];
?>
"
class=
"btn btn-info join_chat"
><span
class=
"glyphicon glyphicon-comment"
></span>
Join
</button>
<?php
if
(
!
empty
(
$row
[
'chat_password'
])){
echo
'<span class="glyphicon glyphicon-lock"></span> '
;
}
$qq
=
mysqli_query
(
$conn
,
"select * from chat_member where chatroomid='"
.
$row
[
'chatroomid'
]
.
"' and userid='"
.
$_SESSION
[
'id'
]
.
"'"
);
if
(
mysqli_num_rows
(
$qq
)
>
0
){
echo
'<span class="glyphicon glyphicon-user"></span>'
;
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment