Final: Делаем подарки.

This commit is contained in:
Igor Barkov [iwork] 2019-01-28 19:56:21 +02:00
parent 1a5a33537b
commit 4480a432a5

38
inf.php
View File

@ -3,20 +3,19 @@ session_start();
require_once 'functions.php';
$login = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
$uid = isset($_SESSION['uid']) ? $_SESSION['uid'] : NULL;
$uid = isset($_SESSION['uid']) ? $_SESSION['uid'] : null;
$user = db::c()->query('SELECT `id`,`login`,`married`,`win`,borndate,`align`,`admin`,`realname`,`info`,`prof1`,`prof2`,`email`,`ip`,`exp`,`stats`,`money`,`room`,`doblest`
FROM `users`
WHERE `login` = "?s" OR `id` = "?s"', $login, $login)->fetch_assoc();
$own = db::c()->query('SELECT `align`,`admin` FROM `users` WHERE `id` = "?s"', $uid)->fetch_assoc();
$presents = db::c()->query('SELECT `img`,`present` FROM `inventory` WHERE type = 200 AND `present`<>"?s" AND `owner` = ?i', '', $user['id']);
$presents_new = db::c()->query('SELECT img, sender FROM `users_presents` WHERE owner = ?i',$user['id']);
$presents = db::c()->query('SELECT img, sender FROM `users_presents` WHERE expiration_date >= "?s" AND owner = ?i', date('Y-m-d'), $user['id']);
if (empty($user['id'])): ?>
<html>
<head>
<meta charset="utf-8">
<title>Ошибка</title></head>
<title>Ошибка</title>
</head>
<body style="color: #666; background-color: #d5d5d5; text-align: center; font-family: Consolas,monospace;">
Ошибка: персонаж<?= ($login ? "&nbsp;<em>" . $login . "</em>" : ""); ?> не найден...
<p><a style="color: #99f" href="javascript:window.history.go(-1);">←назад</a></p>
@ -29,7 +28,6 @@ if (empty($user['id'])): ?>
<title>Информация о <?= $user['login'] ?></title>
<meta charset=UTF-8"/>
<link href="css/main.css" rel="stylesheet">
<link href="css/tooltip.css" rel="stylesheet">
</head>
<BODY onload="<?= topsethp() ?>">
<?php if ($user['admin'] == 1 AND $own['admin'] != 1 AND file_exists('customuserdata/' . $user['id'])) die(file_get_contents('customuserdata/' . $user['id'])); ?>
@ -37,10 +35,10 @@ if (empty($user['id'])): ?>
<tr>
<td style="width: 250px; vertical-align: top;">
<?= showinf_pers($user['id']);
if (!empty($user['married']))
echo '<br><a href="inf.php?' . $user['married'] . '" target=_blank><img src="i/married.gif" class="tooltip" title="В браке с ' . $user['married'] . '"></a>';
?>
if (!empty($user['married'])): ?>
<a href="inf.php?<?= $user['married'] ?>" target=_blank><img src="i/married.gif"
title="В браке с <?= $user['married'] ?>"></a>";
<?php endif; ?>
</td>
<td style="vertical-align: top; width: 100px; text-align: center;">
<img src="i/zodiac/<?= star_sign(substr($user['borndate'], 3, 2), substr($user['borndate'], 0, 2)); ?>.png">
@ -60,27 +58,18 @@ if (!empty($user['realname'])) echo "Имя: " . $user['realname'] . "<br>";
<div>
<legend>Подарки</legend>
<?php
while ($row = $presents->fetch_assoc())
echo "<img src=i/sh/{$row['img']} class='tooltip' title='Подарок от {$row['present']}'>";
?>
</div>
<?php endif; ?>
<?php if ($presents_new->getNumRows()): ?>
<div>
<legend>Подарки+</legend>
<?php
while ($row = $presents_new->fetch_assoc()): ?>
while ($row = $presents->fetch_assoc()): ?>
<img src="<?= $row['img'] ?>" title="<?= $row['sender'] ?>" alt="<?= $row['sender'] ?>">
<?php endwhile;?>
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php if (!empty($user['prof1']) OR !empty($user['prof2'])): ?>
<div>
<legend>Лицензии</legend>
<?php
if ($user['prof2'] == 21) echo ' <img src="i/prof21.png" class="tooltip" title="Лицензия наемника"> ';
if ($user['prof2'] == 22) echo ' <img src="i/prof22.png" class="tooltip" title="Лицензия лекаря"> ';
if ($user['prof1'] == 1) echo ' <img src="i/prof1.png" class="tooltip" title="Лицензия кузнеца"> ';
if ($user['prof2'] == 21) echo ' <img src="i/prof21.png" title="Лицензия наемника"> ';
if ($user['prof2'] == 22) echo ' <img src="i/prof22.png" title="Лицензия лекаря"> ';
if ($user['prof1'] == 1) echo ' <img src="i/prof1.png" title="Лицензия кузнеца"> ';
?>
</div>
<?php endif; ?>
@ -132,7 +121,6 @@ if ($own['admin'] == 1) {
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/showthing.js"></script>
<script src="js/tooltip.js"></script>
<script>
$(function () {
$(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 0, fadeIn: 300, fadeOut: 500});