battles/chat.php

60 lines
1.1 KiB
PHP
Raw Normal View History

2018-03-01 23:21:53 +00:00
<?php
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
use Battles\Chat;
use Battles\Database\DBPDO;
use Battles\Template;
2020-06-23 12:22:32 +00:00
require_once "config.php";
$chat = new Chat(new DBPDO());
if (!empty($_POST['msg'])) {
$chat->addMessage($_POST['msg']);
2018-03-01 23:21:53 +00:00
}
2020-06-23 12:22:32 +00:00
Template::header('chat');
echo $chat->getMessages();
2018-03-01 23:21:53 +00:00
?>
<style>
form {
padding: 3px;
position: fixed;
bottom: 0;
width: 100%;
}
form input {
border: 0;
padding: 10px;
width: 80%;
margin-right: .5%;
}
form input[type="submit"] {
width: 15%;
border: none;
padding: 10px;
}
span.chatsys {
color:maroon;
background:#faa;
}
span.chatsms {
color:darkgreen;
background:#afa;
}
span.chatprivate {
background:#efe;
}
</style>
2020-06-23 13:39:22 +00:00
<div>
<?php ?>
2020-06-23 13:39:22 +00:00
</div>
<form action="chat.php" method="post">
<input id="msg" name="msg" size="100" placeholder="Введите сообщение...">
<input type="submit" value="Отправить">
</form>