БК

 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
global $m;
$kp=ceil($m/5); //11
$sch=0;
if(($p>$kp) or (0>$p)) {
echo "<font size=\"+4\">404 Not Found!</font><br>";
}
if ($kp>5 and $p>3) { //true //yes
echo "<a href=\"?p=1\" class=\"al\">&#9668;&#9668;</a>";
}
if ($p==FALSE){$p=1;} //false
if (($p!=1) or (1>$p)) { //true //yes
$page=$p-1;
echo "<a href=\"?p=$page\" class=\"all\">&#9668;</a>";
}
if(($kp<6) or (($p<4) and ($kp>5))) { //false
while (($sch<$kp) and ($sch<5)) {
$sch++;
if ($p==$sch) {
echo "<a href=\"?p=$p\" class=\"other\">$p</a>";
}
else
{
echo "<a href=\"?p=$sch\" class=\"all\">$sch</a>";
}
}
}
elseif ($p>=$kp-2) {
while ($kp-5+$sch<$kp) {
$sch++;
if ($kp-5+$sch==$p) {
echo "<a href=\"?p=$p\" class=\"other\">$p</a>";
}
else
{
$page=$kp-5+$sch;
echo "<a href=\"?p=$page\" class=\"all\">$page</a>";
}
}
}
else
{
while ($p-2+$sch<=$p+2) {
$sch++;
if ($sch==3) {
echo "<a href=\"?p=$p\" class=\"other\">$p</a>";
}
else
{
$page=$p-3+$sch;
echo "<a href=\"?p=$page\" class=\"all\">$page</a>";
}
} }
if (($p>$kp) or ($p!=$kp)) {
$page=$p+1;
echo "<a href=\"?p=$page\" class=\"all\">&#9658;</a>";
}
if(($kp>5) and ($p<$kp-2)) {
echo "<a href=\"?p=$kp\" class=\"al\">&#9658;&#9658;</a>";
}