X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=php%2Fpcal.php;fp=php%2Fpcal.php;h=73aed379206de392ab26c41a330245f2ef1bbe33;hb=38a87dc6ae7e58d30d3325e244f6eaffb40e35bc;hp=0000000000000000000000000000000000000000;hpb=eda4b1909b4c4dcf5ccbe236a2213a8bab29bb40;p=mirrors%2FPrograms.git
diff --git a/php/pcal.php b/php/pcal.php
new file mode 100755
index 0000000..73aed37
--- /dev/null
+++ b/php/pcal.php
@@ -0,0 +1,46 @@
+
PeriodiCalendar
+PeriodiCal
+Calendar with period highlighting ability
+
+
+
+');
+} else {
+//init
+error_reporting(0);
+$day = 60*60*24;
+//get numbers
+$now = time(); $now = mktime(12, 0, 0, date('n',$now), 1, date('Y',$now));
+$last = date_parse_from_format('Y-m-d', $_GET['last']);
+$last = mktime(12, 0, 0, $last['month'], $last['day'], $last['year']);
+$period=28; if(isset($_GET['period'])) $period = $_GET['period'];
+$length=7; if(isset($_GET['len'])) $length = $_GET['len'];
+$months=12; if(isset($_GET['months'])) $months = $_GET['months'];
+
+echo('');
+$r = 0;
+for($i=0;$i<$months;$i++) {
+ $lm = $m = date('m',$now);
+ $mo = date('M',$now);
+ echo("$m ($mo) | ");
+ while($m == $lm) {
+ if(round(($now-$last)/$day)%($period) == 0) $r = $length;
+ $c = '';
+ if($r>0) $c = '#FF0000';
+ if($r==1 || $r==$length) $c = '#FF7777';
+ $r--;
+ echo("".date('d', $now).' | ');
+ $now += $day;
+ $m = date('m',$now);
+ }
+ echo('
');
+}
+echo('
You can bookmark this page it will get updated automatically each month.');
+}