2018-03-22 19:32:48 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Copyright (c) 2018.
|
|
|
|
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
|
|
|
* Project name: Battles-Game
|
|
|
|
*/
|
|
|
|
|
|
|
|
session_start();
|
2018-03-23 22:39:39 +00:00
|
|
|
if (!isset($_SESSION['uid'])) header("Location: index.php");
|
|
|
|
//include("config.php");
|
2018-03-22 19:32:48 +00:00
|
|
|
|
2018-03-23 22:39:39 +00:00
|
|
|
//$msg = filter_input(INPUT_POST,'msg');
|
|
|
|
//$uid = $_SESSION['uid'];
|
|
|
|
//if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
|
2018-03-22 19:32:48 +00:00
|
|
|
?>
|
|
|
|
<!doctype html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Окно игры</title>
|
|
|
|
<meta charset="utf-8">
|
2019-06-21 10:22:26 +00:00
|
|
|
<link rel="stylesheet" href="css/main.css">
|
2018-03-22 19:32:48 +00:00
|
|
|
<style>
|
2018-03-24 00:52:07 +00:00
|
|
|
form {
|
2018-03-22 19:32:48 +00:00
|
|
|
width: 100%;
|
2018-03-24 00:56:59 +00:00
|
|
|
text-align: center;
|
2018-03-22 19:32:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
form input {
|
|
|
|
border: 1px solid silver;
|
|
|
|
width: 80%;
|
|
|
|
margin-right: .5%;
|
|
|
|
}
|
|
|
|
|
|
|
|
form input[type="submit"] {
|
|
|
|
width: 15%;
|
|
|
|
}
|
2018-03-24 00:52:07 +00:00
|
|
|
|
2018-03-24 00:19:46 +00:00
|
|
|
body {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.wrap {
|
2018-03-24 00:56:59 +00:00
|
|
|
display: grid;
|
2018-03-24 00:19:46 +00:00
|
|
|
height: 100vh;
|
2018-03-24 00:56:59 +00:00
|
|
|
grid-template-rows: 45px /* Шапка */ 2fr /* Окно игры */ 1fr /* Окно чата*/ 30px; /* Подвал */
|
2018-03-24 00:19:46 +00:00
|
|
|
}
|
|
|
|
|
2018-03-24 00:40:33 +00:00
|
|
|
header {
|
|
|
|
text-align: right;
|
2018-03-24 00:52:07 +00:00
|
|
|
box-shadow: 0 3px 2px -2px slategray;
|
2018-03-24 00:31:53 +00:00
|
|
|
}
|
|
|
|
|
2018-03-24 00:56:59 +00:00
|
|
|
footer {
|
|
|
|
margin: 5px;
|
|
|
|
}
|
|
|
|
|
2018-03-24 00:40:33 +00:00
|
|
|
#game, #chat {
|
|
|
|
overflow: auto;
|
2018-03-24 00:56:59 +00:00
|
|
|
box-shadow: 0 3px 2px -2px slategray;
|
|
|
|
padding: 5px;
|
2018-03-24 00:31:53 +00:00
|
|
|
}
|
|
|
|
|
2018-03-24 00:40:33 +00:00
|
|
|
a img {
|
|
|
|
border: 1px solid #fff;
|
|
|
|
transition: box-shadow 0.5s ease;
|
|
|
|
margin: 5px;
|
2018-03-24 00:31:53 +00:00
|
|
|
}
|
2018-03-24 00:56:59 +00:00
|
|
|
|
2018-03-24 00:40:33 +00:00
|
|
|
a img:hover {
|
|
|
|
box-shadow: 0 0 7px slategray;
|
2018-03-24 00:31:53 +00:00
|
|
|
}
|
2018-03-24 00:19:46 +00:00
|
|
|
</style>
|
2018-03-23 23:02:31 +00:00
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
2018-03-22 19:32:48 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2018-03-24 00:19:46 +00:00
|
|
|
<div class="wrap">
|
|
|
|
<header>
|
|
|
|
<a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32/33ff33?text=A"/></a>
|
|
|
|
<a href="/friend.php" title="Друзья" target="main"><img src="http://placehold.it/32x32/33ff33?text=F"/></a>
|
|
|
|
<a href="/main.php?edit=1" title="Инвентарь" target="main"><img src="http://placehold.it/32x32/33ff33?text=I"/></a>
|
|
|
|
<a href="/relikt.php?edit=1" title="Реликты" target="main"><img src="http://placehold.it/32x32?text=R"/></a>
|
2019-06-21 14:35:09 +00:00
|
|
|
<a href="/clan.php" title="Клан" target="main"><img src="http://placehold.it/32x32/33ff33?text=K"/></a>
|
2018-03-24 00:56:59 +00:00
|
|
|
<a href="/orden.php" title="Особые умения" target="main"><img
|
|
|
|
src="http://placehold.it/32x32/33ff33?text=O"/></a>
|
2018-03-24 00:19:46 +00:00
|
|
|
<a href="/moderators.php" title="Модераторы" target="main"><img src="http://placehold.it/32x32/33ff33?text=M"/></a>
|
|
|
|
<a href="/forum.php" title="Форум" target="main"><img src="http://placehold.it/32x32?text=F"/></a>
|
2018-03-24 01:15:54 +00:00
|
|
|
<a href="javascript:$('#game').load('/forum.php')"><img src="http://placehold.it/32x32?text=F"/></a>
|
2018-03-24 00:19:46 +00:00
|
|
|
</header>
|
2018-03-24 00:40:33 +00:00
|
|
|
<div id="game"></div>
|
|
|
|
<div id="chat"></div>
|
2018-03-24 00:19:46 +00:00
|
|
|
<footer>
|
|
|
|
<form action="chat.php" method="post" target="chat">
|
|
|
|
<input id="msg" name="msg" size="100" placeholder="Введите сообщение...">
|
|
|
|
<input type="submit" value="Отправить">
|
|
|
|
</form>
|
|
|
|
</footer>
|
2018-03-22 19:38:45 +00:00
|
|
|
</div>
|
2018-03-23 23:02:31 +00:00
|
|
|
<script>
|
2018-03-24 00:56:59 +00:00
|
|
|
$("#game").load("main.php");
|
2018-03-24 01:15:54 +00:00
|
|
|
|
|
|
|
function loadlink(){
|
2018-03-24 01:21:32 +00:00
|
|
|
$('#chat').load('chat.php');
|
2018-03-24 01:15:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
loadlink(); // This will run on page load
|
|
|
|
setInterval(function(){
|
|
|
|
loadlink() // this will run after every 5 seconds
|
|
|
|
}, 5000);
|
2018-03-23 23:02:31 +00:00
|
|
|
</script>
|
2018-03-22 19:32:48 +00:00
|
|
|
</body>
|
2018-03-23 22:39:39 +00:00
|
|
|
</html>
|