Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Gochat WebApplication
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Suriya Ravichandran
Gochat WebApplication
Commits
aeeedccf
Commit
aeeedccf
authored
1 year ago
by
Suriya Ravichandran
Browse files
Options
Downloads
Patches
Plain Diff
update user list
parent
b917e4d8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
php/data.php
+19
-2
19 additions, 2 deletions
php/data.php
php/search.php
+2
-0
2 additions, 0 deletions
php/search.php
php/users.php
+1
-1
1 addition, 1 deletion
php/users.php
with
22 additions
and
3 deletions
php/data.php
+
19
−
2
View file @
aeeedccf
<?php
while
(
$row
=
mysqli_fetch_assoc
(
$sql
)){
$sql2
=
"SELECT * FROM messages WHERE (incoming_msg_id =
{
$row
[
'unique_id'
]
}
OR outgoing_msg_id =
{
$row
[
'unique_id'
]
}
) AND (outgoing_msg_id =
{
$outgoing_id
}
OR outgoing_msg_id =
{
$outgoing_id
}
) ORDER BY msg_id DESC LIMIT 1"
;
$query2
=
mysqli_query
(
$conn
,
$sql2
);
$row2
=
mysqli_fetch_assoc
(
$query2
);
$you
=
""
;
if
(
$row2
&&
isset
(
$row2
[
'outgoing_msg_id'
]))
{
$result
=
$row2
[
'msg'
];
// adding your text before msg if login id send msg
$you
=
(
$outgoing_id
==
$row2
[
'outgoing_msg_id'
])
?
"You: "
:
""
;
}
else
{
$result
=
"No message available"
;
}
(
strlen
(
$result
)
>
28
)
?
$msg
=
substr
(
$result
,
0
,
28
)
.
'...'
:
$msg
=
$result
;
$output
.
=
'<a href="chat.php?user_id='
.
$row
[
'unique_id'
]
.
'">
<div class="content">
<img src="php/images/'
.
$row
[
'img'
]
.
'" alt="">
<div class="details">
<span>'
.
$row
[
'fname'
]
.
" "
.
$row
[
'lname'
]
.
'</span>
<p>
this is a test message
</p>
<p>
'
.
$you
.
$msg
.
'
</p>
</div>
</div>
<div class="status-dot"><i class="fa fa-circle"></i></div>
</a>'
;
}
?>
\ No newline at end of file
?>
This diff is collapsed.
Click to expand it.
php/search.php
+
2
−
0
View file @
aeeedccf
<?php
session_start
();
include_once
"config.php"
;
$outgoing_id
=
$_SESSION
[
'unique_id'
];
$searchTerm
=
mysqli_real_escape_string
(
$conn
,
$_POST
[
'searchTerm'
]);
$output
=
""
;
$sql
=
mysqli_query
(
$conn
,
"SELECT * FROM users WHERE fname LIKE '%
{
$searchTerm
}
%' OR lname LIKE '%
{
$searchTerm
}
%'"
);
...
...
This diff is collapsed.
Click to expand it.
php/users.php
+
1
−
1
View file @
aeeedccf
<?php
session_start
();
include_once
"config.php"
;
// Include the config file to establish a database connection
$outgoing_id
=
$_SESSION
[
'unique_id'
];
$sql
=
mysqli_query
(
$conn
,
"SELECT * FROM users"
);
$output
=
" "
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment