Стили - к стилям

This commit is contained in:
lopar 2020-08-29 19:30:11 +03:00
parent 7919712919
commit a718553a84
2 changed files with 117 additions and 110 deletions

View File

@ -1,5 +1,4 @@
<?php /** @noinspection ALL */ <?php
/** @noinspection SqlResolve */
/** /**
* Copyright (c) 2018. * Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com> * Author: Igor Barkov <lopar.4ever@gmail.com>
@ -9,69 +8,12 @@
session_start(); session_start();
//require_once '../functions.php'; //require_once '../functions.php';
if (empty($user['admin'])) { if (empty($user['admin'])) {
//echo "<!DOCTYPE HTML><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL {$_SERVER['SCRIPT_NAME']} was not found on this server.</p><hr><address>Apache/2.2.22 (@RELEASE@) Server at Hetzner Datacenter 426</address></body></html>";
header("HTTP/1.0 404 Not Found"); header("HTTP/1.0 404 Not Found");
exit; exit;
} }
?> header("Cache-Control: no-cache");
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ᐰdmin</title>
</head>
<link type="text/css" rel="stylesheet" href="../css/main.css">
<style type="text/css">
body {
background: silver;
margin: 25px;
}
legend, legend a, .legend {
color: dimgray;
font-family: consolas, sans-serif;
font-size: 18px;
margin-top: 10px;
}
table.additem input {
width: 200px;
}
table.additem select {
width: 206px;
}
.abils {
background: #CFCFC4;
margin: 5px 0;
padding: 5px;
}
.appblock {
background: gold;
border-radius: 5px;
/* float: left;*/
margin: 10px;
max-width: 300px;
position: absolute;
top: 100px;
left: 100px;
}
div.appblock form, div.appblock legend {
margin: 5px;
}
</style>
<body>
<h1>Работает через жопу! Я предупредиль!</h1>
<?php
$al = db::c()->query('SELECT * FROM `aligns` WHERE `align` = "?s" LIMIT 1', $user['align'])->fetch_assoc(); $al = db::c()->query('SELECT * FROM `aligns` WHERE `align` = "?s" LIMIT 1', $user['align'])->fetch_assoc();
// $registeredUsers = db::c()->query('SELECT COUNT(*) FROM `users` WHERE `block` = 0 AND `admin` = 0');
// echo "В игре зарегистровано ".$registeredUsers." человек";
header("Cache-Control: no-cache");
function statsat($nu) function statsat($nu)
{ /*in admin.php*/ { /*in admin.php*/
@ -82,13 +24,15 @@ function statsat($nu)
$money = 0; $money = 0;
foreach ($exptable as $k => $v) { foreach ($exptable as $k => $v) {
if ($k == $nu) break; if ($k == $nu) {
break;
}
$stats += $v[0]; $stats += $v[0];
$master += $v[1]; $master += $v[1];
$vinos += $v[2]; $vinos += $v[2];
$money += $v[3]; $money += $v[3];
} }
return array("stats" => $stats + 12, "master" => $master + 1, "vinos" => $vinos + 3, "money" => $money); return ["stats" => $stats + 12, "master" => $master + 1, "vinos" => $vinos + 3, "money" => $money];
} }
function imp($array) function imp($array)
@ -106,8 +50,11 @@ function expa($str)
for ($i = 0; $i <= count($array) - 2; $i = $i + 2) { for ($i = 0; $i <= count($array) - 2; $i = $i + 2) {
$rarray[$array[$i]] = $array[$i + 1]; $rarray[$array[$i]] = $array[$i + 1];
} }
if (isset($rarray)) return $rarray; if (isset($rarray)) {
else return []; return $rarray;
} else {
return [];
}
} }
if ($_POST['ali']) { //Что делает эта штука? if ($_POST['ali']) { //Что делает эта штука?
@ -115,15 +62,14 @@ if ($_POST['ali']) { //Что делает эта штука?
array_shift($accs); array_shift($accs);
array_shift($accs); array_shift($accs);
array_shift($accs); array_shift($accs);
db::c()->query('INSERT INTO `aligns` (`align`,`img`,`name`,`accses`) VALUES ("?s","?s","?s","?s") ON DUPLICATE KEY UPDATE `img` = "?s", `name` = "?s", `accses` = "?s"',$_POST['ali'],$_POST['im'],$_POST['txt'],imp($accs),$_POST['im'],$_POST['txt'],imp($accs)); db::c()->query('INSERT INTO `aligns` (`align`,`img`,`name`,`accses`) VALUES ("?s","?s","?s","?s") ON DUPLICATE KEY UPDATE `img` = "?s", `name` = "?s", `accses` = "?s"', $_POST['ali'], $_POST['im'], $_POST['txt'], imp($accs), $_POST['im'], $_POST['txt'], imp($accs));
#mysql_query("INSERT INTO `aligns` (`align`,`img`,`name`,`accses`) values ('{$_POST['ali']}','{$_POST['im']}','{$_POST['txt']}','" . imp($accs) . "') ON DUPLICATE KEY UPDATE `img` = '{$_POST['im']}', `name` = '{$_POST['txt']}', accses = '" . imp($accs) . "';");
} }
if ($_POST['sbr_par']) { if ($_POST['sbr_par']) {
$sb_pers = db::c()->query('SELECT `id`, `nextup`, `level` FROM `users` WHERE `login` = "?s" LIMIT 1', $_POST['sbr_par'])->fetch_assoc_array(); $sb_pers = db::c()->query('SELECT `id`, `nextup`, `level` FROM `users` WHERE `login` = "?s" LIMIT 1', $_POST['sbr_par'])->fetch_assoc_array();
undressall($sb_pers['id']); undressall($sb_pers['id']);
$levelstats = statsat($sb_pers['nextup']); $levelstats = statsat($sb_pers['nextup']);
//TODO Ох боюсь я за этот запрос! //Ох боюсь я за этот запрос!
db::c()->query(' db::c()->query('
UPDATE `users` UPDATE `users`
SET `stats` = ?i, `sila` = ?i, `lovk` = ?i, `inta` = ?i, `intel` = ?i, `vinos` = ?i, SET `stats` = ?i, `sila` = ?i, `lovk` = ?i, `inta` = ?i, `intel` = ?i, `vinos` = ?i,
@ -133,25 +79,33 @@ if ($_POST['sbr_par']) {
($levelstats['stats'] - 9), 3, 3, 3, 0, $levelstats['vinos'], ($levelstats['vinos'] * 6), $levelstats['master'], 0, 0, 0, 0, 0, 0, 0, $sb_pers['id']); ($levelstats['stats'] - 9), 3, 3, 3, 0, $levelstats['vinos'], ($levelstats['vinos'] * 6), $levelstats['master'], 0, 0, 0, 0, 0, 0, 0, $sb_pers['id']);
echo "<span class='success'>Все прошло удачно. Персонаж может перераспределить параметры.</span>"; echo "<span class='success'>Все прошло удачно. Персонаж может перераспределить параметры.</span>";
} }
$aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `align`');
?> ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel=stylesheet href="/css/main.css">
<link rel=stylesheet href="/css/admin.css">
<title>ᐰdmin</title>
</head>
<body>
<form action='admin.php' method='post'> <form action='admin.php' method='post'>
<fieldset> <fieldset>
<legend><a href='#' onclick='show("sk")'>Склонности</a></legend> <legend><a href='#' onclick='show("sk")'>Склонности</a></legend>
<div id=sk style='display:none;'> <div id=sk style='display:none;'>
<table> <table>
<?php <?php while ($row = $aligns->fetch_assoc()): ?>
// $aligns = mysql_query("SELECT * FROM `aligns` ORDER BY `align`"); <tr class=row
// while($row = mysql_fetch_array($aligns)) { onclick='document.all.im.value="<?= $row['img'] ?>"; document.all.ali.value="<?= $row['align'] ?>"; document.all.txt.value="<?= $row['name'] ?>";'>
$aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `align`'); <td><img src="/i/<?= $row['img'] ?>"></td>
while ($row = $aligns->fetch_assoc()): ?> <td><?= $row['align'] ?></td>
<tr class=row onclick='document.all.im.value="<?=$row['img']?>"; document.all.ali.value="<?=$row['align']?>"; document.all.txt.value="<?=$row['name']?>";'> <td><?= $row['name'] ?></td>
<td><img src="/i/<?=$row['img']?>"></td>
<td><?=$row['align']?></td>
<td><?=$row['name']?></td>
</tr> </tr>
<?php endwhile ?> <?php endwhile ?>
<tr> <tr>
<td colspan=3><b>Добавить</b></td> <td colspan=3><b>Добавить</b></td>
</tr> </tr>
@ -164,26 +118,31 @@ if ($_POST['sbr_par']) {
<td colspan=3> <td colspan=3>
<table valign=middle> <table valign=middle>
<tr> <tr>
<td><input type='checkbox' name='sleep' class='input'><img src='../i/magic/sleep.gif'></td> <td><input type='checkbox' name='sleep' class='input'><img src='../i/magic/sleep.gif'>
</td>
<td><input type='checkbox' name='sleepf' class='input'><img src='../i/magic/sleepf.gif'> <td><input type='checkbox' name='sleepf' class='input'><img src='../i/magic/sleepf.gif'>
</td> </td>
<td><input type='checkbox' name='sleep_off' class='input'><img <td><input type='checkbox' name='sleep_off' class='input'><img
src='../i/magic/sleep_off.gif'></td> src='../i/magic/sleep_off.gif'></td>
<td><input type='checkbox' name='sleepf_off' class='input'><img <td><input type='checkbox' name='sleepf_off' class='input'><img
src='../i/magic/sleepf_off.gif'></td> src='../i/magic/sleepf_off.gif'></td>
<td><input type='checkbox' name='haos' class='input'><img src='../i/magic/haos.gif'></td> <td><input type='checkbox' name='haos' class='input'><img src='../i/magic/haos.gif'>
</td>
<td><input type='checkbox' name='haos_off' class='input'><img <td><input type='checkbox' name='haos_off' class='input'><img
src='../i/magic/haos_off.gif'></td> src='../i/magic/haos_off.gif'></td>
<td><input type='checkbox' name='death' class='input'><img src='../i/magic/death.gif'></td> <td><input type='checkbox' name='death' class='input'><img src='../i/magic/death.gif'>
</td>
<td><input type='checkbox' name='death_off' class='input'><img <td><input type='checkbox' name='death_off' class='input'><img
src='../i/magic/death_off.gif'></td> src='../i/magic/death_off.gif'></td>
<!--<td><input type='checkbox' name='pal_buttons' class='input'><img src='i/magic/pal_buttons.gif'></td>--> <!--<td><input type='checkbox' name='pal_buttons' class='input'><img src='i/magic/pal_buttons.gif'></td>-->
<td><input type='checkbox' name='check' class='input'><img src='../i/magic/check.gif'></td> <td><input type='checkbox' name='check' class='input'><img src='../i/magic/check.gif'>
</td>
</tr> </tr>
<tr> <tr>
<td><input type='checkbox' name='attack' class='input'><img src='../i/magic/attack.gif'> <td><input type='checkbox' name='attack' class='input'><img src='../i/magic/attack.gif'>
</td> </td>
<td><input type='checkbox' name='attackb' class='input'><img src='../i/magic/attackb.gif'> <td><input type='checkbox' name='attackb' class='input'><img
src='../i/magic/attackb.gif'>
</td> </td>
<td><input type='checkbox' name='hidden' class='input'><img src='../i/magic/hidden.gif'> <td><input type='checkbox' name='hidden' class='input'><img src='../i/magic/hidden.gif'>
</td> </td>
@ -191,29 +150,41 @@ if ($_POST['sbr_par']) {
src='../i/magic/teleport.gif'></td> src='../i/magic/teleport.gif'></td>
<td><input type='checkbox' name='travma' class='input'><img src='../i/magic/travma.gif'> <td><input type='checkbox' name='travma' class='input'><img src='../i/magic/travma.gif'>
</td> </td>
<td><input type='checkbox' name='cure' class='input'><img src='../i/magic/cure.gif'></td> <td><input type='checkbox' name='cure' class='input'><img src='../i/magic/cure.gif'>
</td>
<td><input type='checkbox' name='vampir' class='input'><img src='../i/magic/vampir.gif'> <td><input type='checkbox' name='vampir' class='input'><img src='../i/magic/vampir.gif'>
</td> </td>
<td><input type='checkbox' name='brat' class='input'><img src='../i/magic/brat.gif'></td> <td><input type='checkbox' name='brat' class='input'><img src='../i/magic/brat.gif'>
<td><input type='checkbox' name='dneit' class='input'><img src='../i/magic/dneit.gif'></td> </td>
<td><input type='checkbox' name='dneit' class='input'><img src='../i/magic/dneit.gif'>
</td>
</tr> </tr>
<tr> <tr>
<td><input type='checkbox' name='dpal' class='input'><img src='../i/magic/dpal.gif'></td> <td><input type='checkbox' name='dpal' class='input'><img src='../i/magic/dpal.gif'>
<td><input type='checkbox' name='ddark' class='input'><img src='../i/magic/ddark.gif'></td> </td>
<td><input type='checkbox' name='note' class='input'><img src='../i/magic/note.gif'></td> <td><input type='checkbox' name='ddark' class='input'><img src='../i/magic/ddark.gif'>
</td>
<td><input type='checkbox' name='note' class='input'><img src='../i/magic/note.gif'>
</td>
<td><input type='checkbox' name='sys' class='input'><img src='../i/magic/sys.gif'></td> <td><input type='checkbox' name='sys' class='input'><img src='../i/magic/sys.gif'></td>
<td><input type='checkbox' name='scanner' class='input'><img src='../i/magic/scanner.gif'> <td><input type='checkbox' name='scanner' class='input'><img
src='../i/magic/scanner.gif'>
</td> </td>
<td><input type='checkbox' name='rep' class='input'><img src='../i/magic/rep.gif'></td> <td><input type='checkbox' name='rep' class='input'><img src='../i/magic/rep.gif'></td>
<td><input type='checkbox' name='rost' class='input'><img src='../i/magic/rost.gif'></td> <td><input type='checkbox' name='rost' class='input'><img src='../i/magic/rost.gif'>
<td><input type='checkbox' name='bexit' class='input'><img src='../i/magic/bexit.gif'></td> </td>
<td><input type='checkbox' name='obezl' class='input'><img src='../i/magic/obezl.gif'></td> <td><input type='checkbox' name='bexit' class='input'><img src='../i/magic/bexit.gif'>
</td>
<td><input type='checkbox' name='obezl' class='input'><img src='../i/magic/obezl.gif'>
</td>
</tr> </tr>
<tr> <tr>
<td><input type='checkbox' name='obezl_off' class='input'><img <td><input type='checkbox' name='obezl_off' class='input'><img
src='../i/magic/obezl_off.gif'></td> src='../i/magic/obezl_off.gif'></td>
<td><input type='checkbox' name='marry' class='input'><img src='../i/magic/marry.gif'></td> <td><input type='checkbox' name='marry' class='input'><img src='../i/magic/marry.gif'>
<td><input type='checkbox' name='unmarry' class='input'><img src='../i/magic/unmarry.gif'> </td>
<td><input type='checkbox' name='unmarry' class='input'><img
src='../i/magic/unmarry.gif'>
</td> </td>
<td><input type='checkbox' name='un_align' class='input'><img <td><input type='checkbox' name='un_align' class='input'><img
src='../i/magic/un_align.gif'></td> src='../i/magic/un_align.gif'></td>
@ -238,7 +209,7 @@ if ($_POST['sbr_par']) {
$cl_reg_curr = db::c()->query('SELECT * FROM `reg_klan` LIMIT 1')->fetch_assoc(); $cl_reg_curr = db::c()->query('SELECT * FROM `reg_klan` LIMIT 1')->fetch_assoc();
// Clan adder : add clan // Clan adder : add clan
if ($_POST['clan_reg'] == 'add_clan') { if ($_POST['clan_reg'] == 'add_clan') {
$ser_cl_rights = array(); $ser_cl_rights = [];
$ser_cl_rights[$cl_reg_curr['owner']][0] = 1; $ser_cl_rights[$cl_reg_curr['owner']][0] = 1;
$ser_cl_rights[$cl_reg_curr['owner']][1] = 1; $ser_cl_rights[$cl_reg_curr['owner']][1] = 1;
$cl_rights = serialize($ser_cl_rights); $cl_rights = serialize($ser_cl_rights);
@ -885,7 +856,7 @@ foreach ($moj as $k => $v) {
break; break;
} }
# Эта строка генерирует свитки с навыком. Но нам нужен просто перечень всего… # Эта строка генерирует свитки с навыком. Но нам нужен просто перечень всего…
if ($script_name) print "<a onclick=\"$script_name('$magic_name','$k','target','target1') \" href='#'><img src='i/magic/".$k.".gif' title='".$magic_name."'></a>&nbsp;"; if ($script_name) print "<a onclick=\"$script_name('$magic_name','$k','target','target1') \" href='#'><img src='i/magic/" . $k . ".gif' title='" . $magic_name . "'></a>&nbsp;";
} }
echo "</div>"; echo "</div>";
?> ?>
@ -975,9 +946,9 @@ echo "</div>";
</select> <input type='submit' value='Применить'></form> </select> <input type='submit' value='Применить'></form>
<?php <?php
# Телеграф. # Телеграф.
if (!empty($_POST['receiver']) AND !empty($_POST['tgmsg'])) { if (!empty($_POST['receiver']) and !empty($_POST['tgmsg'])) {
$receiverId = db::c()->query('SELECT `id` FROM `users` WHERE `login`= "?s"',$_POST['receiver'])->fetch_row(); $receiverId = db::c()->query('SELECT `id` FROM `users` WHERE `login`= "?s"', $_POST['receiver'])->fetch_row();
telegraph($receiverId[0],$_POST['tgmsg']); telegraph($receiverId[0], $_POST['tgmsg']);
echo "Успешно."; echo "Успешно.";
} }
# Показывает невидимок. # Показывает невидимок.
@ -995,8 +966,8 @@ if (!empty($_POST['newsmsg'])) {
if ($_POST['login'] && $_POST['status']) { if ($_POST['login'] && $_POST['status']) {
$dd = db::c()->query('SELECT `ip`, `login` FROM `users` WHERE `login` = "?s"', $_POST['login'])->fetch_assoc(); $dd = db::c()->query('SELECT `ip`, `login` FROM `users` WHERE `login` = "?s"', $_POST['login'])->fetch_assoc();
if ($dd) { if ($dd) {
db::c()->query('UPDATE `users` SET `status` = "?s" WHERE `login` = "?s"', $_POST['status']. $_POST['login']); db::c()->query('UPDATE `users` SET `status` = "?s" WHERE `login` = "?s"', $_POST['status'] . $_POST['login']);
echo "<span class='success'>Статус ".$dd['login']." изменен на ". $_POST['status']. "</span><BR>"; echo "<span class='success'>Статус " . $dd['login'] . " изменен на " . $_POST['status'] . "</span><BR>";
} }
} }
# Меняем склонности # Меняем склонности
@ -1025,7 +996,7 @@ if ($_POST['login'] && $_POST['krest']) {
break; break;
} }
if ($_POST['krest'] == -1) db::c()->query('UPDATE `users` SET `align`="?s", `status`="?s" WHERE `login` = "?s" LIMIT 1;', '0', '', $_POST['login']); if ($_POST['krest'] == -1) db::c()->query('UPDATE `users` SET `align`="?s", `status`="?s" WHERE `login` = "?s" LIMIT 1;', '0', '', $_POST['login']);
else db::c()->query('UPDATE `users` SET `align` = "?s", `status` = "?s" WHERE `login` = "?s"',$_POST['krest'],$rang,$_POST['login']); else db::c()->query('UPDATE `users` SET `align` = "?s", `status` = "?s" WHERE `login` = "?s"', $_POST['krest'], $rang, $_POST['login']);
} }
@ -1064,12 +1035,10 @@ if ($_POST['login'] && $_POST['krest']) {
let xmlHttp1 = null; let xmlHttp1 = null;
try { try {
xmlHttp1 = new XMLHttpRequest(); xmlHttp1 = new XMLHttpRequest();
} } catch (e) {
catch (e) {
try { try {
xmlHttp1 = new ActiveXObject("Msxml2.XMLHTTP"); xmlHttp1 = new ActiveXObject("Msxml2.XMLHTTP");
} } catch (e) {
catch (e) {
xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP"); xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
} }
} }
@ -1270,13 +1239,11 @@ if ($_POST['login'] && $_POST['krest']) {
try { try {
// Firefox, Opera 8.0+, Safari // Firefox, Opera 8.0+, Safari
xmlHttp1 = new XMLHttpRequest(); xmlHttp1 = new XMLHttpRequest();
} } catch (e) {
catch (e) {
//Internet Explorer //Internet Explorer
try { try {
xmlHttp1 = new ActiveXObject("Msxml2.XMLHTTP"); xmlHttp1 = new ActiveXObject("Msxml2.XMLHTTP");
} } catch (e) {
catch (e) {
xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP"); xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
} }
} }

40
css/admin.css Normal file
View File

@ -0,0 +1,40 @@
body {
background: silver;
margin: 25px;
}
legend, legend a, .legend {
color: dimgray;
font-family: consolas, sans-serif;
font-size: 18px;
margin-top: 10px;
}
table.additem input {
width: 200px;
}
table.additem select {
width: 206px;
}
.abils {
background: #CFCFC4;
margin: 5px 0;
padding: 5px;
}
.appblock {
background: gold;
border-radius: 5px;
/* float: left;*/
margin: 10px;
max-width: 300px;
position: absolute;
top: 100px;
left: 100px;
}
div.appblock form, div.appblock legend {
margin: 5px;
}