-
Notifications
You must be signed in to change notification settings - Fork 0
/
calendar.php
120 lines (103 loc) · 2.67 KB
/
calendar.php
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
<html dir="rtl">
<head>
<title>جدول فعالیت صفحه ۱۵۷</title>
<style>
@font-face {
font-family: "Vazirmatn";
src: url("fonts/Vazirmatn-Regular.woff2") format("woff2");
font-weight: 400;
}
@font-face {
font-family: "Vazirmatn";
src: url("fonts/Vazirmatn-Bold.woff2") format("woff2");
font-weight: 700;
}
body {
font-family: "Vazirmatn";
display: flex;
flex-direction: column;
align-items: center;
user-select: none;
}
table {
font-size: 18px;
padding: 10px;
border: 2px dashed orangered;
}
thead {
font-weight: bold;
color: red;
}
td {
border: 1px solid darkred;
padding: 1em 2em;
text-align: center;
transition: color 0.2s, background-color 0.2s;
}
td:hover {
background-color: darkred;
color: white;
font-weight: bold;
}
.holiday {
background-color: lightcoral;
}
tbody {
color: darkred;
}
.next-month {
color: #999;
}
.next-month:hover {
background-color: white;
color: black;
font-weight: normal;
}
a:link,
a:visited {
color: black;
text-decoration: none;
border-bottom: 1px solid black;
font-weight: bold;
}
</style>
</head>
<body>
<h1>جدول فعالیت صفحه ۱۵۷</h1>
<?php
$days = array("شنبه", "یکشنبه", "دوشنبه", "شهشنبه", "چهارشنبه", "پنجشنبه", "جمعه");
$titles = array(
"اول", "دوم", "سوم", "چهارم", "پنجم", "ششم", "هفتم", "هشتم", "نهم", "دهم",
"یازدهم", "دوازدهم", "سیزدهم", "چهاردهم", "پانزدهم", "شانزدهم", "هفدهم", "هجدهم", "نوزدهم", "بیستم",
"بیستویکم", "بیستودوم", "بیستوسوم", "بیستوچهارم", "بیستوپنجم", "بیستوششم", "بیستوهفتم", "بیستوهشتم", "بیستونهم", "سیام"
);
$max_houses = 7 * 5;
echo "<table><thead><tr>";
foreach ($days as $day) {
echo "<td title='{$day}'>{$day}</td>";
}
echo "</tr></thead>";
echo "<tbody><tr>";
$h = 8;
for ($j = 1; $j <= 30; $j++) {
if ($j % $h == 0) {
echo "<td class='holiday' title='{$titles[$j - 1]} - تعطیل رسمی'>{$j}</td>";
$h += 5;
} else {
echo "<td title='{$titles[$j - 1]}'>{$j}</td>";
}
if ($j % 7 == 0) {
echo "</tr><tr>";
}
}
$n = 1;
for ($i = 0; $i < $max_houses - 30; $i++) {
echo "<td title='شما دنبال چی هستی آقای فردوسیپور؟' class='next-month'>$n</td>";
// این یک شوخی است
$n += 1;
}
echo "</tr></tbody></table>";
?>
<p><a href="./persian_date.php">مشاهده تاریخ امروز با PHP</a></p>
</body>
</html>