/[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

Annotation of /inc/pgOvulacija.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Tue Oct 16 13:07:03 2001 UTC (18 years, 1 month ago) by ravilov
Branch: MAIN
Changes since 1.3: +10 -2 lines
Added a favicon for IE. Added a new Smarty modifier (js_popup). Fixed the news editor. Other bugfixes.

1 ravilov 1.1 <?php
2     $foo = getdate();
3     $tpl->assign("year", $foo["year"]);
4 ravilov 1.2 $tpl->assign("ME", HTMLSpecialChars("?section=$section&section_menu=$section_menu"));
5 ravilov 1.1 $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 ravilov 1.4 $tp->assign("section", $section);
65     $tp->assign("section_menu", $section_menu);
66     $tp->assign("section_menu2", $section_menu2);
67     $tp->assign("dan", $dan);
68     $tp->assign("mjesec", $mjesec);
69     $tp->assign("godina", $godina);
70     $tp->assign("trajanje", $trajanje);
71 ravilov 1.1 $tp->assign("ime", $ime);
72 ravilov 1.4 $tp->assign("ime2", urlencode($ime));
73 ravilov 1.1 $tp->assign("kal", $kal);
74     $table = $tp->fetch("kalendar".($print?"-print":"").".tpl");
75     $tpl->assign("CONTENT", $table);
76     if (!$print) {
77     include_once("print.php");
78 ravilov 1.4 $tpl->assign("PRINT", GetPrint(array("dan", "mjesec", "godina", "trajanje", "ime"), false));
79 ravilov 1.1 } else $main_template = "wrapper.tpl";
80     }
81     if (!$ns4) {
82     $date = ($dan && $mjesec && $godina) ? "new Date($godina, $mjesec, $dan)" : "null";
83     if (!$godina) $godina = $foo["year"];
84     $before = $godina - $foo["year"] + 1;
85     $after = $foo["year"] - $godina + 1;
86 ravilov 1.4 $onload .= "DS = new DateSelector(document.forms[".($kalendar?2:1)."], $date, $before, $after);";
87 ravilov 1.1 }
88     ?>

  ViewVC Help
Powered by ViewVC 1.1.26