-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaparea.php
More file actions
70 lines (64 loc) · 2.01 KB
/
maparea.php
File metadata and controls
70 lines (64 loc) · 2.01 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
<?php
session_start();
if (!isset($_SESSION["user_id"])){
exit("Page ERROR!");
}
if (!isset($_POST["chatid"])){
?>
<div id="mapchat"><button id="mapnav" onclick="onmap()">Map</button><button id="chatnav" onclick="onchat()">Chat</button></div>
<div id="maplock">
<span id="hidecht" onclick="hidechat()">X</span>
</div>
</div>
<?php
echo "INVALID PERMISSION OR ID ERROR!";
exit("ID ERROR!");
}
require_once("sql_connect.php");
$sql = "SELECT * FROM users WHERE userID='{$_POST["chatid"]}'";
$result = $conn->query($sql);
if(!$result->num_rows > 0){
exit("User not found!");
}
$res = $result->fetch_assoc();
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Message</title>
</head>
<body>
<div id="mapchat"><button id="mapnav" onclick="onmap()">Map</button><button id="chatnav" onclick="onchat()">Chat</button></div>
<div id="maplock">
<span id="hidecht" onclick="hidechat()">X</span>
<?php
$sq4 = "SELECT block_geolocate FROM linked where person1='{$_POST["chatid"]}' AND person2='{$_SESSION["user_id"]}' OR person1='{$_SESSION["user_id"]}' AND person2='{$_POST["chatid"]}'";
$resul4 = $conn->query($sq4);
$u4 = $resul4->fetch_assoc();
if($u4["block_geolocate"] == $_SESSION["user_id"]){
?>
<div style="width:100%;color:red;text-align:center;">PERMISSION DENIED!</div>
<?php
exit;
}else if ($u4["block_geolocate"] == $_POST["chatid"]){
?>
<div style="width:100%;color:red;text-align:center;">LOCATION ACCESS BLOCKED!</div>
<?php
exit;
}
if(!empty($res["maperror"])){
?>
<div style="width:100%;color:red;text-align:center;">LOCATION ERROR!</div>
<?php
exit;
}
?>
<iframe id="mapframe" target="_parent" src="https://maps.google.com/maps?q=<?php echo $res['latitude']?>,<?php echo $res['longitude']?>&z=15&&output=embed" frameborder="0"></iframe>
<?php
?>
</div>
</body>
</html>