forked from KesaviAravinthan/QuickFix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchatC1.php
34 lines (28 loc) · 990 Bytes
/
chatC1.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
<?php
include 'classes.php';
// $conn = (new Connection())->createConnection();
session_start();
$hiring_id = $_SESSION["hiring_id"];
$customer_id = $_SESSION["customer_id"];
$hiring_id = str_replace('"', '', $hiring_id);
$row1 = mysqli_fetch_assoc(QueryHandler::query("Select * from hiring WHERE hiring_id = '$hiring_id'"));
$hiringObj = new Hiring();
$hiringObj->read($hiring_id);
$tradesman_id = $hiringObj->getTradesman_id();
$customer_id = $hiringObj->getCustomer_id();
if (isset($_GET['msg'])) {
$msg = $_GET["msg"];
QueryHandler::query("insert into chat (message,sender,receiver,hiring_id) VALUES ('$msg','$customer_id','$tradesman_id','$hiring_id');");
// $id = mysqli_insert_id($conn);
?>
<div class="row d-flex justify-content-between my-3 fw-bold">
<div class="col-4"></div>
<div class="col-8">
<div class="mx-2" id="send_msg"><span><?php echo $msg; ?></span></div>
</div>
</div>
<?php
} else {
echo "NO POSTGET['submit'] created yet!!";
}
?>