-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_reports.php
34 lines (33 loc) · 1.01 KB
/
view_reports.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
<?php
$lib = @$_GET["lib"];
$year = @$_GET["year"];
$filename = "No logs";
if ($year == "") {
$year = date("Y");
}
echo "Broken Link Reports for <b>" . $year . "</b><br><br>";
if ($lib != "") {
$i = 0;
for ($m = 1; $m <= 12; $m++) {
if ($m < 10) {
$filename = "files/" . $lib . "_" . $year . "_0" . $m . ".csv";
} else $filename = "files/" . $lib . "_" . $year . "_" . $m . ".csv";
if (filesize($filename) != 0) {
$i = $i + 1;
$dateObj = DateTime::createFromFormat('!m', $m);
$monthName = $dateObj->format('F'); // March
echo "<a target=_blank href=$filename>" . "Reports for $year - $monthName</a><br>";
}
}
if ($i == 0) echo "There is no reports for " . $year . ".";
}
$y = date("Y");
if ($y > 2022) {
echo "<br><br><br>View reports for ";
for ($i = 0; $i <= 2; $i++) {
$vy = $y - $i;
echo "<a href=view_reports.php?lib=$lib&year=$vy>" . $vy . "</a> ";
}
}
echo "<br><br><center>PALS@" . $y . " - Broken Link Report Logging</center>";
?>