23.10
This commit is contained in:
63
Zadania/Z60 - Dzień tygodnia/index.php
Normal file
63
Zadania/Z60 - Dzień tygodnia/index.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
$text = '';
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$dzien = $_POST['dzien'];
|
||||
switch ($dzien) {
|
||||
case 1:
|
||||
$text = 'Poniedziałek';
|
||||
break;
|
||||
case 2:
|
||||
$text = 'Wtorek';
|
||||
break;
|
||||
case 3:
|
||||
$text = 'Środa';
|
||||
break;
|
||||
case 4:
|
||||
$text = 'Czwartek';
|
||||
break;
|
||||
case 5:
|
||||
$text = 'Piątek';
|
||||
break;
|
||||
case 6:
|
||||
$text = 'Sobota';
|
||||
break;
|
||||
case 7:
|
||||
$text = 'Niedziela';
|
||||
break;
|
||||
default:
|
||||
$text = 'Podana liczba jest spoza zakresu!';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Z60 - Dzień tygodnia</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Zadanie Z60</h1>
|
||||
<h2>Autor: Jakub Grzegorczyk</h2>
|
||||
</header>
|
||||
<div class="box">
|
||||
<p>Napisz program, który dla podanej liczby całkowitej z przedziału od 1 do 7 wypisuje jaki to dzień tygodnia. Zakładamy, że 1 to poniedziałek. W przypadku liczby z poza zakresu należy wyświetlić informację o błędzie.</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<form action="index.php" method="post">
|
||||
<label for="dzien">Wprowadź liczbę od 1 do 7: </label><br>
|
||||
<input type="number" name="dzien" id="dzien"><br>
|
||||
<button type="submit">Wyślij</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
echo '<div class="box">' . $text . '</div>';
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
68
Zadania/Z60 - Dzień tygodnia/style.css
Normal file
68
Zadania/Z60 - Dzień tygodnia/style.css
Normal file
@@ -0,0 +1,68 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
font-family: Verdana, serif;
|
||||
background: #ffffff;
|
||||
margin: 15px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
header {
|
||||
border: 2px solid black;
|
||||
border-radius: 1em;
|
||||
padding: 10px 20px;
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
input {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
width: 30%;
|
||||
border: black 2px solid;
|
||||
border-radius: 0.5em;
|
||||
height: 2em;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 5px;
|
||||
width: 30%;
|
||||
border: black 2px solid;
|
||||
border-radius: 0.5em;
|
||||
font-weight: bold;
|
||||
margin-top: 10px;
|
||||
}
|
||||
pre {
|
||||
font-family: Verdana, serif;
|
||||
}
|
||||
|
||||
.box {
|
||||
border: 2px solid black;
|
||||
padding: 15px 20px;
|
||||
border-radius: 1em;
|
||||
margin: 15px 0 10px 0;
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
|
||||
}
|
||||
|
||||
.box h3 {
|
||||
cursor: pointer;
|
||||
}
|
||||
td {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
tr {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.y {
|
||||
background: yellow;
|
||||
}
|
||||
|
||||
.b {
|
||||
background:blue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user