/[hr-web]/inc/global.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/global.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Fri Apr 20 08:25:32 2001 UTC (23 years ago) by dpavlin
Branch: pliva
CVS Tags: r0
Changes since 1.1: +0 -0 lines
initial import

1 <?php
2 include("inc/stuff.php");
3 $pages = array(
4 0 => "main.php",
5 1 => "OpciPodaci.php",
6 2 => "UPlivi.php",
7 3 => "IzvanPlive.php",
8 4 => "Dodiplomski.php",
9 5 => "Poslijediplomski.php",
10 6 => "Obrazovanje.php",
11 7 => "TecajeviManagementa.php",
12 8 => "OstaliTecajevi.php",
13 9 => "StraniJezici.php",
14 10 => "RadSRacunalom.php",
15 11 => "Nagrade.php",
16 12 => "Radovi.php",
17 13 => "StrucniSkupovi.php",
18 14 => "OMeni.php",
19 15 => "Overview.php",
20 100 => "NovaAplikacija.php",
21 200 => "NovaUstanova.php",
22 300 => "NoviTecaj.php"
23 );
24 function isparam($param) {
25 eval('global $'.$param.', $'.$param.'_x, $'.$param.'_y;');
26 if (eval('return isset($'.$param.') || isset($'.$param.'_x) || isset($'.$param.'_y);')) {
27 #eval('unset($'.$param.'); unset($'.$param.'_x); unset($'.$param.'_y);');
28 return true;
29 }
30 return false;
31 }
32 function CalcPage($script) {
33 global $pages;
34 $script = basename($script);
35 $pg = 0;
36 reset($pages);
37 while (list($var, $val) = each($pages))
38 if ($val == $script) $pg = $var;
39 return $pg;
40 }
41 function HTML_escape($str) {
42 $oldstr = $str; # KLUDGY!!!
43 $str = eregi_replace("\<BR\>", "\n", $str); # KLUDGY!!!
44 $foo = ($str != $oldstr); # KLUDGY!!!
45 $str = str_replace("&", "&amp;", $str);
46 $str = str_replace("<", "&lt;", $str);
47 $str = str_replace(">", "&gt;", $str);
48 $str = str_replace("\"", "&quot;", $str);
49 if ($foo) $str = ereg_replace("\n", "<BR>", $str); # KLUDGY!!!
50 return $str;
51 }
52 $CRO_Win = "ÈƊЎèæšðž";
53 $CRO_ISO = "ÈƩЮèæ¹ð¾";
54 function ISO_Win($str) {
55 global $CRO_ISO, $CRO_Win;
56 return strtr($str, $CRO_ISO, $CRO_Win);
57 }
58 function Win_ISO($str) {
59 global $CRO_ISO, $CRO_Win;
60 return strtr($str, $CRO_Win, $CRO_ISO);
61 }
62 function ParseDate($str) {
63 if (!$str) return $str;
64 $tmp = split("[\.\-]", $str);
65 $fnd = false;
66 for ($i = 0; $i < count($tmp); $i++)
67 if ($tmp[$i] + 0) $fnd = true;
68 if (!$fnd) return $str;
69 return getdate(strtotime($str));
70 }
71 function ComposeDate($d, $m, $y) {
72 return sprintf("%04d-%02d-%02d", $y, $m, $d);
73 }
74 function Compose() {
75 global $sifra, $language;
76 return implode("|", array($sifra, $language));
77 }
78 function Decompose($str) {
79 global $sifra, $language;
80 list($sifra, $language) = explode("|", $str);
81 }
82 function Params($pg = -1, $more = array()) {
83 global $page;
84 if ($pg >= 0) $page = $pg;
85 $tmp = Compose();
86 if (is_array($more)) {
87 while (list($key, $val) = each($more)) {
88 if ($tmp) $tmp = $tmp."&";
89 $tmp = $tmp."$key=$val";
90 }
91 }
92 if (isset($tmp) && $tmp) $tmp = "?ID=".$tmp;
93 return $tmp;
94 }
95 function nepoznato(&$sto) {
96 global $language;
97 if (isset($sto) && $sto == "") {
98 if ($language == "HR") $sto = "[nepoznato]";
99 if ($language == "EN") $sto = "[unknown]";
100 $sto = "<I>$sto</I>";
101 }
102 }
103 function Auth() {
104 global $sifra;
105 if (!$sifra) {
106 Header("Location: index.php");
107 return false;
108 }
109 return true;
110 }
111 Header("Pragma: no-cache");
112 if (!isset($language) || !$language) $language = "HR";
113 if (!isset($page) || !$page) $page = 0;
114 if (!isset($sifra) || !$sifra) $sifra = "";
115 if (isset($ID)) Decompose($ID);
116 ?>

  ViewVC Help
Powered by ViewVC 1.1.26