-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewChat.php
More file actions
27 lines (20 loc) · 778 Bytes
/
viewChat.php
File metadata and controls
27 lines (20 loc) · 778 Bytes
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
<?php
require 'api/callApi.php';
include 'front/req_header.php';
include 'front/temp_header.php';
session_start();
if(sizeof($_SESSION)==0){
header('Location: '.'/LocalNetworkChat');
}
$_SESSION['companionUserId']=$_GET['companionId'];
$response=callGetUserFromId($_SESSION['companionUserId']);
checkResponse($response);
$_SESSION['companionName']=$response->user->name;
include 'front/temp_viewChat_main.php';
include 'front/temp_newChat.php';
if(isset($_POST['sendBtn'])){
$response=callSendMsg($_SESSION['myUserId'],$_SESSION['companionUserId'],$_POST['msg']);
checkResponse($response);
echo json_encode($response);
header('Location: '.'/LocalNetworkChat/viewChat.php?companionId='.$_SESSION['companionUserId']);
}