Файл: stripbar/index.php
Строк: 104
<?php
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
$set['title'] = 'Стрип Бар';
include_once '../sys/inc/thead.php';
title();
aut();
if(isset($_GET['ok'])) {
$bar = $_POST['bar'];
$mon = $_POST['mon'];
if ($mon > $user[money])$err='Не достаточно монет';
if (!isset($err)) {
if($bar==0){
mysql_query('UPDATE `user` SET `bar` = "'.($user['bar']-$user['bar']).'" WHERE `id` = "'.$user['id'].'"');
}else{
mysql_query('UPDATE `user` SET `bar` = "'.($user['bar']+$bar).'" WHERE `id` = "'.$user['id'].'"');
}
mysql_query('UPDATE `user` SET `money` = "'.($user['money']-$mon).'" WHERE `id` = "$user[id]" LIMIT 1');
if($bar==0){
$_SESSION['message'] = 'Аспирин принят';
}else{
$_SESSION['message'] = 'Напиток выпит';
}
header("Location: index.php");
}}
err();
echo' <img src="img/ego.jpg" width="350" height="100" alt="sb"> </img> <br>';
if (isset($user)){
echo' <img src="img/bar.jpg" width="50" height="50" alt="sb"><b>Бармен</b></img> <br>';
echo '<div class="st_1"></div>';
echo '<div class="st_2"> Здравствуйте ! Меня зовут Екатерина . Что будете заказывать ?</div>';
echo ' <img src="img/kon.png" alt="sb"><b> Коньяк </b></img><form method="post" action="?ok"><input type="hidden" name="bar" value="3"><input type="hidden" name="mon" value="30"> <input value="30 монет" type="submit"></form><br>';
echo ' <img src="img/viski.png" alt="sb"><b> Виски </b></img><form method="post" action="?ok"><input type="hidden" name="bar" value="3"><input type="hidden" name="mon" value="45"> <input value="45 монет" type="submit"></form><br>';
echo ' <img src="img/vodka2.png" alt="sb"><b> Водка </b></img><form method="post" action="?ok"><input type="hidden" name="bar" value="4"><input type="hidden" name="mon" value="20"> <input value="20 монет" type="submit"></form><br>';
echo ' <img src="img/tropin.png" alt="sb"><b> Коктель </b></img><form method="post" action="?ok"><input type="hidden" name="bar" value="3"><input type="hidden" name="mon" value="40"> <input value="40 монет" type="submit"></form><br>';
echo ' <img src="img/asperin.png" alt="sb"><b> Аспирин </b></img><form method="post" action="?ok"><input type="hidden" name="bar" value="0"><input type="hidden" name="mon" value="50"> <input value="50 монет" type="submit"></form><br>';
}else{
header("Location: /index.php");
}
echo'<div class="copy"><center> © DogMat 2015 </center></div>';
include_once '../sys/inc/tfoot.php';
?>