-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
128 lines (127 loc) · 3.81 KB
/
Copy pathindex.php
File metadata and controls
128 lines (127 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<?
include 'data.inc.php';
include 'lib.inc.php';
include 'cookie.inc.php';
$title = "Наш сайт";
$header = "$welcome, Гость!";
$id = isset($_GET['id']) ? strtolower(strip_tags(trim($_GET['id']))) : '';
switch ($id) {
case 'about':
$title = 'О сайте';
$header = 'О нашем сайте';
break;
case 'for':
$title = 'Цикл for';
$header = 'Цикл for';
break;
case 'while':
$title = 'Цикл while';
$header = 'Цикл while';
break;
case 'table':
$title = 'Таблица умножения';
$header = 'Таблица умножения';
break;
case 'contact':
$title = 'Контакты';
$header = 'Обратная связь';
break;
case 'lesson1':
$title = 'Задание №1';
$header = 'Перевод величин';
break;
case 'lesson2':
$title = 'Задание №2';
$header = 'Простое вычисление';
break;
case 'lesson3':
$title = 'Задание №3';
$header = 'Сложное вычисление';
break;
case 'lesson4':
$title = 'Задание №4';
$header = 'Простое условие';
break;
case 'lesson5':
$title = 'Задание №5';
$header = 'Сложное условие';
break;
case 'lesson6':
$title = 'Задание №6';
$header = 'Простой цикл For';
break;
case 'lesson7':
$title = 'Задание №7';
$header = 'Простой цикл While';
break;
case 'lesson8':
$title = 'Задание №8';
$header = 'Обработка одномерного массива';
break;
case 'lesson9':
$title = 'Задание №9';
$header = 'Обработка двухмерного массива';
break;
case 'lesson10':
$title = 'Задание №10';
$header = 'Строки';
break;
default:
break;
}
?>
<html>
<head>
<title><?= $title?></title>
<meta charset="utf-8" >
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body>
<div id="header">
<!-- Верхняя часть страницы -->
<? include 'top.inc.php'?>
<? echo "Вы зашли к нам $visit_counter раз <br>";
echo "Последнее посещение: $last_visit";?>
<!-- Верхняя часть страницы -->
</div>
<div id="content">
<!-- Заголовок -->
<h1><?= $header?></h1>
<!-- Заголовок -->
<!-- Область основного контента -->
<? switch($id){
case 'about': include 'about.php'; break;
case 'for': include 'for.php'; break;
case 'while': include 'while.php'; break;
case 'table': include 'tablemult.php'; break;
case 'contact': include 'contact.php'; break;
case 'lesson1': include 'lesson1.php'; break;
case 'lesson2': include 'lesson2.php'; break;
case 'lesson3': include 'lesson3.php'; break;
case 'lesson4': include 'lesson4.php'; break;
case 'lesson5': include 'lesson5.php'; break;
case 'lesson6': include 'lesson6.php'; break;
case 'lesson7': include 'lesson7.php'; break;
case 'lesson8': include 'lesson8.php'; break;
case 'lesson9': include 'lesson9.php'; break;
case 'lesson10': include 'lesson10.php'; break;
default: include 'index.inc.php';
}
?>
<!-- Область основного контента -->
</div>
<div id="nav">
<!-- Навигация -->
<? include 'menu.inc.php'?>
<!-- Навигация -->
</div>
<div id="footer">
<!-- Нижняя часть страницы -->
<? include 'bottom.inc.php'?>
<!-- Нижняя часть страницы -->
</div>
</body>
</html>