Вынос стилей в отдельный файл

This commit is contained in:
Igor Barkov [iwork] 2018-12-12 13:59:29 +02:00
parent d5bc6c59fc
commit f5f7beaf5d
4 changed files with 360 additions and 365 deletions

View File

@ -2,8 +2,7 @@
ob_start("ob_gzhandler"); ob_start("ob_gzhandler");
session_start(); session_start();
if ($_SESSION['uid'] == null) header("Location: index.php"); if ($_SESSION['uid'] == null) header("Location: index.php");
include "config.php"; require_once "functions.php";
include "functions.php";
if ($user['room'] != 29) header("Location: main.php"); if ($user['room'] != 29) header("Location: main.php");
if ($user['battle'] != 0) { if ($user['battle'] != 0) {
header('location: fbattle.php'); header('location: fbattle.php');
@ -22,45 +21,13 @@ if (!$bank['id']) db::c()->query('INSERT INTO `bank` (`id`) VALUES (?i)', $_SESS
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/> <link href="css/main.css" rel="stylesheet"/>
<link href="css/secondary.css" rel="stylesheet"/>
<title>Банк</title> <title>Банк</title>
<script> <script>
function leave() { function leave() {
top.frames['main'].location = 'city.php?strah' top.frames['main'].location = 'city.php?strah'
} }
</script> </script>
<style>
.appblock {
background: silver;
border-radius: 2px;
float: left;
height: 200px;
margin: 10px;
width: 250px;
opacity: 0.75;
padding: 5px;
}
div.appblock form {
margin: 5px;
}
div.appblock span.legend {
padding: 0.2em 0.5em;
color: #666;
font-weight: bold;
display: block;
}
div.appblock br {
margin: 5px;
}
div.appblock span.wrap {
padding: 5px;
display: block;
font-family: Consolas, monospace;
}
div.appblock span.wrap span.num {
float:right;
display:block;
}
</style>
</head> </head>
<body> <body>
<h1>Банк</h1> <h1>Банк</h1>
@ -172,7 +139,7 @@ if (!$_SESSION['bankid']) {
err($mywarn); err($mywarn);
?> ?>
<p><a href="?exit"> выйти из счёта</a></p> <p><a href="?exit"> выйти из счёта</a></p>
<div class="appblock" style="background: whitesmoke;"> <div class="appblock appblock-main">
<span class="legend">ет <?=$bank['id']?></span> <span class="legend">ет <?=$bank['id']?></span>
<span class="wrap">Кредитов<span class="num"><?=$bank['cr']?></span></span> <span class="wrap">Кредитов<span class="num"><?=$bank['cr']?></span></span>
<span class="wrap">ЕвроКредитов<span class="num"><?=$bank['ekr']?></span></span><hr> <span class="wrap">ЕвроКредитов<span class="num"><?=$bank['ekr']?></span></span><hr>

View File

@ -543,7 +543,7 @@ div.effectList > div > [action] {
font-weight: bold; font-weight: bold;
font-size: 12pt; font-size: 12pt;
color: #8F0000; color: #8F0000;
font-family: Arial; font-family: Arial, serif;
text-align: center; text-align: center;
} }
@ -1027,7 +1027,7 @@ table.zebra tr:nth-child(even) {
background-color: #D5D5D5; background-color: #D5D5D5;
} }
legend { legend, .legend {
color: dimgray; color: dimgray;
font-family: consolas, sans-serif; font-family: consolas, sans-serif;
font-size: 18px; font-size: 18px;

35
css/secondary.css Normal file
View File

@ -0,0 +1,35 @@
/* Стили, созданные для этого проекта, которые должны стать основными. */
div.appblock {
background: silver;
border-radius: 2px;
float: left;
height: 200px;
margin: 10px;
width: 250px;
opacity: 0.75;
padding: 5px;
}
div.appblock-main {
background: whitesmoke;
}
div.appblock form {
margin: 5px;
}
div.appblock span.legend {
padding: 0.2em 0.5em;
color: #666;
font-weight: bold;
display: block;
}
div.appblock br {
margin: 5px;
}
div.appblock span.wrap {
padding: 5px;
display: block;
font-family: Consolas, monospace;
}
div.appblock span.wrap span.num {
float:right;
display:block;
}

View File

@ -1,8 +1,6 @@
<?php <?php
session_start(); session_start();
if (!isset($_SESSION['uid'])) { if ($_SESSION['uid'] == null) header("Location: index.php");
header("Location: index.php");
}
require_once("functions.php"); require_once("functions.php");
$d = db::c()->query('SELECT SUM(`massa`) FROM `inventory` WHERE `dressed` = 0 AND `owner` = ?i', $_SESSION['uid'])->fetch_assoc(); $d = db::c()->query('SELECT SUM(`massa`) FROM `inventory` WHERE `dressed` = 0 AND `owner` = ?i', $_SESSION['uid'])->fetch_assoc();
if ($user['room'] != 23) { if ($user['room'] != 23) {
@ -99,8 +97,9 @@ if ($_GET['sid'] && $_GET['rep']) {
?> ?>
<HTML> <HTML>
<HEAD> <HEAD>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8"> <meta charset="utf-8">
<link rel=stylesheet href="css/main.css">
<link href="css/secondary.css" rel="stylesheet"/>
</HEAD> </HEAD>
<body> <body>
<h1>Ремонтная мастерская</h1> <h1>Ремонтная мастерская</h1>
@ -152,19 +151,12 @@ if ($_GET['sid'] && $_GET['rep']) {
<TABLE WIDTH=100% BGCOLOR="#A5A5A5"> <TABLE WIDTH=100% BGCOLOR="#A5A5A5">
<?php <?php
if ($_GET['razdel'] == 0) { if ($_GET['razdel'] == 0) {
$data = db::c()->query('SELECT * FROM `inventory` WHERE `type` < 12 AND `dressed` = 0 AND `isrep` = 1 AND `setsale` = 0 AND `owner` = ?i ORDER BY `update` DESC',$_SESSION['uid']); $data = db::c()->query('SELECT * FROM `inventory` WHERE `type` < 12 AND `dressed` = 0 AND `isrep` = 1 AND `setsale` = 0 AND `owner` = ?i ORDER BY `update` DESC', $_SESSION['uid']);
while ($row = $data->fetch_assoc()) { while ($row = $data->fetch_assoc()) {
$row['count'] = 1;
if ($i == 0) {
$i = 1;
$color = '#C7C7C7';
} else {
$i = 0;
$color = '#D5D5D5';
}
echo "<TR bgcolor={$color}><TD align=center ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
$onecost = 0.1; $onecost = 0.1;
?> ?>
<TR>
<TD align=center><IMG SRC="i/sh/<?= $row['img'] ?>">
<BR> <BR>
<small> <small>
<? if ($row['duration'] > 0) { ?><A HREF="?rep=<?= $row['id'] ?>&sid=1">Ремонт 1 ед. <? if ($row['duration'] > 0) { ?><A HREF="?rep=<?= $row['id'] ?>&sid=1">Ремонт 1 ед.
@ -187,7 +179,7 @@ if ($_GET['sid'] && $_GET['rep']) {
} }
if ($_GET['razdel'] == 1) { if ($_GET['razdel'] == 1) {
$data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 3 AND `name` NOT LIKE "?S" AND `setsale`=0 ORDER by `update` DESC',$_SESSION['uid'],'%Букет%'); $data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 3 AND `name` NOT LIKE "?S" AND `setsale`=0 ORDER by `update` DESC', $_SESSION['uid'], '%Букет%');
while ($row = $data->fetch_assoc()) { while ($row = $data->fetch_assoc()) {
$row['count'] = 1; $row['count'] = 1;
if ($i == 0) { if ($i == 0) {
@ -201,7 +193,8 @@ if ($_GET['sid'] && $_GET['rep']) {
?> ?>
<BR> <BR>
<small> <small>
<? if (empty($row['text'])) { ?><A HREF="#" onclick="AddCount(<?= $row['id'] ?>)"> <? if (empty($row['text'])) { ?><A HREF="#"
onclick="AddCount(<?= $row['id'] ?>)">
Нанести надпись за 30 кр.</A><BR><? } else { Нанести надпись за 30 кр.</A><BR><? } else {
?><A HREF="?razdel=1&rep=<?= $row['id'] ?>&sid=2">Стереть надпись</A><BR><? ?><A HREF="?razdel=1&rep=<?= $row['id'] ?>&sid=2">Стереть надпись</A><BR><?
} ?> } ?>