/[health_html]/inc/pgOvulacija.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /inc/pgOvulacija.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Wed Sep 26 13:04:28 2001 UTC (17 years, 9 months ago) by ravilov
Branch: MAIN
Changes since 1.1: +1 -1 lines
Added some missing files, and some missing features...

1 <?php
2 $foo = getdate();
3 $tpl->assign("year", $foo["year"]);
4 $tpl->assign("ME", HTMLSpecialChars("?section=$section&section_menu=$section_menu"));
5 $godine = array();
6 for ($i = $foo["year"] - 1; $i <= $foo["year"] + 1; $i++) array_push($godine, $i);
7 $tpl->assign("godine", $godine);
8 $mjeseci = array();
9 for ($i = 1; $i <= 12; $i++) array_push($mjeseci, $i);
10 $tpl->assign("mjeseci", $mjeseci);
11 $days = array(31, -1, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
12 $y = $godina ? $godina : $foo["year"];
13 $dani = array();
14 for ($i = 1; $i <= 31; $i++) array_push($dani, $i);
15 $tpl->assign("dani", $dani);
16 $trajanja = array();
17 for ($i = 24; $i <= 35; $i++) array_push($trajanja, $i);
18 $tpl->assign("trajanja", $trajanja);
19 $tpl->assign("dan", $dan ? $dan : $foo["mday"]);
20 $tpl->assign("mjesec", $mjesec ? $mjesec : $foo["mon"]);
21 $tpl->assign("godina", $godina ? $godina : $foo["year"]);
22 $tpl->assign("trajanje", $trajanje ? $trajanje : 28);
23 $tpl->assign("ime", $ime);
24 if ($kalendar || $print) {
25 $tpl->assign("old_dan", $dan);
26 $tpl->assign("old_mjesec", $mjesec);
27 $tpl->assign("old_godina", $godina);
28 $tpl->assign("old_trajanje", $trajanje);
29 $tpl->assign("old_kalendar", true);
30 $kal = array();
31 $tim = mktime(0, 0, 0, $mjesec, $dan, $godina);
32 $dat = getdate($tim);
33 $dat = getdate(mktime(0, 0, 0, $mjesec, $dan - (($dat["wday"] - 1) % 7), $godina));
34 $ovul = mktime(0, 0, 0, $mjesec, $dan + $trajanje - 14, $godina);
35 $cd = 0;
36 define("DAY", 24 * 60 * 60);
37 for ($i = 0; $i < 7; $i++) {
38 $tmp = array();
39 for ($j = 0; $j < 7; $j++) {
40 if ($dat["mon"] > $mjesec) $cd++;
41 if ($dat["mon"] == $mjesec && $dat["mday"] >= $dan) $cd++;
42 $tim2 = mktime(0, 0, 0, $dat["mon"], $dat["mday"], $godina);
43 $msg = 0;
44 if ($tim2 == $tim) $msg = -1;
45 if ($tim2 == mktime(0, 0, 0, $mjesec, $dan + $trajanje, $godina)) $msg = 1;
46 if ($tim2 == mktime(0, 0, 0, $mjesec, $dan + $trajanje + 2, $godina)) $msg = -2;
47 if ($ovul - $tim2 == DAY || $ovul - $tim2 == (DAY * 2)) $msg = 9;
48 if ($tim2 == $ovul) $msg = 10;
49 if ($tim2 - $ovul == (DAY * 10)) $msg = 3;
50 if ($tim2 - $ovul == (DAY * 12)) $msg = 2;
51 if ($tim2 - $ovul == DAY || $tim2 - $ovul == DAY * 2) $msg = 4;
52 if ($ovul - $tim2 == DAY * 3 || $ovul - $tim2 == DAY * 4 || $ovul - $tim2 == DAY * 5) $msg = 5;
53 array_push($tmp, array(
54 "cd" => $cd,
55 "dat_dan" => $dat["mday"],
56 "dat_mjesec" => $dat["mon"],
57 "msg" => $msg
58 ));
59 $dat = getdate(mktime(0, 0, 0, $dat["mon"], $dat["mday"] + 1, $godina));
60 }
61 array_push($kal, $tmp);
62 }
63 $tp = new Smarty();
64 $tp->assign("ime", $ime);
65 $tp->assign("kal", $kal);
66 $table = $tp->fetch("kalendar".($print?"-print":"").".tpl");
67 $tpl->assign("CONTENT", $table);
68 if (!$print) {
69 include_once("print.php");
70 $tpl->assign("PRINT", GetPrint(array("dan", "mjesec", "godina", "trajanje")));
71 } else $main_template = "wrapper.tpl";
72 }
73 if (!$ns4) {
74 $date = ($dan && $mjesec && $godina) ? "new Date($godina, $mjesec, $dan)" : "null";
75 if (!$godina) $godina = $foo["year"];
76 $before = $godina - $foo["year"] + 1;
77 $after = $foo["year"] - $godina + 1;
78 $onload .= "DS = new DateSelector(document.forms[1], $date, $before, $after);";
79 }
80 ?>

  ViewVC Help
Powered by ViewVC 1.1.26