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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations)
Thu Sep 5 09:09:03 2002 UTC (16 years, 9 months ago) by ravilov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +4 -4 lines
a

1 <?php
2 include("inc/global.php");
3 if (!Auth()) exit;
4 include("inc/conn.php");
5 function Prepare($str, $ne = true) {
6 $str = nl2br(HTML_Escape(Win_ISO($str)));
7 if ($ne) nepoznato($str);
8 return $str;
9 }
10 $tpl = new MySmarty;
11 for ($i = 0; $i < count($pages); $i++)
12 $tpl->assign("page_".$i, $pages[$i].Params($i));
13 $tpl->assign("page_logout", $dir);
14 DBOpen();
15 # -- 1. Opci podaci
16 $rows = DBQuery("SELECT sif_radnika,ime,prezime,naziv_struke,opis,radna_jedinica,radno_mjesto,spol,telefon,email,stupanj_str_spreme,smjer,titula,datum_rodjenja FROM osoba,org_jed WHERE (sif_radnika='$sifra') AND (sif_org_jed=sifra) AND (org_jed.language=osoba.language)");
17 list($sif, $ime, $prez, $struka, $org_jed, $rad_jed, $rm, $sp, $tel, $em, $sss, $smj, $zv, $dr) = $rows[0];
18 $tpl->assign("sifra", Prepare($sif));
19 $tpl->assign("ime", Prepare($ime));
20 $tpl->assign("prezime", Prepare($prez));
21 $tpl->assign("struka", Prepare($struka));
22 $tpl->assign("org_jed", Prepare($org_jed));
23 $tpl->assign("radna_jed", Prepare($rad_jed));
24 $tpl->assign("radno_mj", Prepare($rm));
25 $tpl->assign("smjer", Prepare($smj));
26 $tpl->assign("zvanje", Prepare($zv));
27 $tpl->assign("sss", Prepare($sss));
28 $tpl->assign("telefon", Prepare($tel));
29 $tpl->assign("email", Prepare($em));
30 $dr = ParseDate($dr);
31 $tpl->assign("dat_rod_d", $dr["mday"]);
32 $tpl->assign("dat_rod_m", $dr["mon"]);
33 $tpl->assign("dat_rod_g", $dr["year"]);
34 $sp = Prepare($sp, false);
35 $spol = $sp;
36 if (ereg("^[mM]$", $sp)) $spol = 'M';
37 if (ereg("^[zZ¾®žŽfF]$", $sp)) $spol = 'F';
38 if (!$spol) $spol = "?";
39 $tpl->assign("spol", $spol);
40 # -- 2. Radna mjesta u Plivi
41 $rows = DBQuery("SELECT radno_mjesto,zadaci,datum_od,datum_do FROM u_plivi WHERE (sif_radnika='$sifra') ORDER BY datum_od");
42 $tmp = array();
43 for ($i = 0; $i < count($rows); $i++) {
44 list($rm, $zad, $od, $do) = $rows[$i];
45 $od = ParseDate($od);
46 $do = ParseDate($do);
47 array_push($tmp, array(
48 "radno_mj" => Prepare($rm),
49 "zadaci" => Prepare($zad),
50 "od_d" => $od["mday"], "od_m" => $od["mon"], "od_g" => $od["year"],
51 "do_d" => $do["mday"], "do_m" => $do["mon"], "do_g" => $do["year"]
52 ));
53 }
54 $tpl->assign("uplivi", $tmp);
55 # -- 3. Radna mjesta izvan Plive
56 $rows = DBQuery("SELECT tvrtka,radno_mjesto,zadaci,datum_od,datum_do FROM izvan_plive WHERE (sif_radnika='$sifra') ORDER BY datum_od");
57 $tmp = array();
58 for ($i = 0; $i < count($rows); $i++) {
59 list($tv, $rm, $zad, $od, $do) = $rows[$i];
60 $od = ParseDate($od);
61 $do = ParseDate($do);
62 array_push($tmp, array(
63 "tvrtka" => Prepare($tv),
64 "radno_mj" => Prepare($rm),
65 "zadaci" => Prepare($zad),
66 "od_d" => $od["mday"], "od_m" => $od["mon"], "od_g" => $od["year"],
67 "do_d" => $do["mday"], "do_m" => $do["mon"], "do_g" => $do["year"]
68 ));
69 }
70 $tpl->assign("izvanplive", $tmp);
71 # -- 4. Dodiplomski studij
72 $rows = DBQuery("SELECT sifra, naziv, grad FROM ustanove WHERE language='$language' AND naziv||grad<>'' AND obrazovna");
73 $ou = array();
74 for ($i = 0; $i < count($rows); $i++) {
75 list($sif, $naz, $grad) = $rows[$i];
76 if ($grad) $naz = "$naz, $grad";
77 $ou[$sif] = $naz;
78 }
79 $rows = DBQuery("SELECT sifra,opis FROM vrsta_strucne_spreme WHERE (language='$language')");
80 $vss = array();
81 for ($i = 0; $i < count($rows); $i++) {
82 list($sif, $opis) = $rows[$i];
83 $vss[$sif] = $opis;
84 }
85 $rows = DBQuery("SELECT sif_ustanove, naziv, titula, stupanj, sif_vrsta_str_spreme, datum_upisa, datum_zavrsetka FROM edukacije, strucne_spreme WHERE sif_radnika='$sifra' AND sif_qualification=1 AND strucne_spreme.sif_str_spreme=edukacije.sif_strucna_sprema");
86 $tmp = array();
87 for ($i = 0; $i < count($rows); $i++) {
88 list($naz, $sm, $zv, $st, $vr, $od, $do) = $rows[$i];
89 $od = ParseDate($od);
90 $do = ParseDate($do);
91 array_push($tmp, array(
92 "naziv" => Prepare($ou[$naz]),
93 "smjer" => Prepare($sm),
94 "zvanje" => Prepare($zv),
95 "sss" => Prepare($st),
96 "vss" => Prepare($vss[$vr]),
97 "od_d" => $od["mday"], "od_m" => $od["mon"], "od_g" => $od["year"],
98 "do_d" => $do["mday"], "do_m" => $do["mon"], "do_g" => $do["year"]
99 ));
100 }
101 $tpl->assign("dodiplomski", $tmp);
102 # -- 5. Poslijediplomski studij
103 # $ou je vec popunjeno.
104 # $vss je vec popunjeno.
105 $rows = DBQuery("SELECT sif_ustanove,naziv,titula,stupanj,sif_vrsta_str_spreme,datum_upisa,datum_zavrsetka,ukupno_ispita,polozenih_ispita,ukupno_semestara,polozenih_semestara FROM edukacije,strucne_spreme WHERE (sif_radnika='$sifra') AND (sif_qualification=2) AND (strucne_spreme.sif_str_spreme=edukacije.sif_strucna_sprema) ORDER BY datum_upisa");
106 $tmp = array();
107 for ($i = 0; $i < count($rows); $i++) {
108 list($naz, $sm, $zv, $st, $vr, $od, $do, $ui, $pi, $us, $ps) = $rows[$i];
109 $od = ParseDate($od);
110 $do = ParseDate($do);
111 array_push($tmp, array(
112 "naziv" => Prepare($ou[$naz]),
113 "studij" => Prepare($sm),
114 "zvanje" => Prepare($zv),
115 "sss" => Prepare($st),
116 "vss" => Prepare($vss[$vr]),
117 "od_d" => $od["mday"], "od_m" => $od["mon"], "od_g" => $od["year"],
118 "do_d" => $do["mday"], "do_m" => $do["mon"], "do_g" => $do["year"],
119 "uispita" => $ui, "pispita" => $pi,
120 "usemestara" => $us, "psemestara" => $ps
121 ));
122 }
123 $tpl->assign("poslijediplomski", $tmp);
124 # -- 6. Obrazovanje po propisima
125 $rows = DBQuery("SELECT sifra,naziv FROM tecajevi WHERE (language='$language') AND (sif_qualification=5)");
126 $tec = array();
127 for ($i = 0; $i < count($rows); $i++) {
128 list($id, $naz) = $rows[$i];
129 $tec[$id] = $naz;
130 }
131 $rows = DBQuery("SELECT sifra, naziv, grad FROM ustanove WHERE language='$language' AND naziv||grad<>'' AND NOT obrazovna");
132 $ustanove = array();
133 for ($i = 0; $i < count($rows); $i++) {
134 list($sif, $naz, $gr) = $rows[$i];
135 if ($gr) $naz = "$naz, $gr";
136 $ustanove[$sif] = $naz;
137 }
138 $rows = DBQuery("SELECT sif_tecaja,certifikati.sif_ustanove,edukacije.sif_ustanove,datum_upisa,datum_zavrsetka,certifikati.naziv,certifikati.titula,dat_polaganja,dat_izdavanja,dat_vrijedi_do FROM certifikati,edukacije WHERE (certifikati.sif_radnika=edukacije.sif_radnika) AND (edukacije.sif_radnika='$sifra') AND (certifikati.sif_edukacije=edukacije.sifra) AND (sif_qualification=5) ORDER BY datum_upisa");
139 $tmp = array();
140 for ($i = 0; $i < count($rows); $i++) {
141 list($edu, $ust, $tec2, $od, $do, $naz, $tit, $pol, $izd, $ist) = $rows[$i];
142 $od = ParseDate($od);
143 $do = ParseDate($do);
144 $pol = ParseDate($pol);
145 $izd = ParseDate($izd);
146 $ist = ParseDate($ist);
147 array_push($tmp, array(
148 "edukacija" => Prepare($tec[$edu]),
149 "tecaj_naz" => Prepare($ustanove[$tec2]),
150 "ispit_naz" => Prepare($ustanove[$ust]),
151 "licenca" => Prepare($naz),
152 "zvanje" => Prepare($tit),
153 "od_d" => $od["mday"], "od_m" => $od["mon"], "od_g" => $od["year"],
154 "do_d" => $do["mday"], "do_m" => $do["mon"], "do_g" => $do["year"],
155 "pol_d" => $pol["mday"], "pol_m" => $pol["mon"], "pol_g" => $pol["year"],
156 "izd_d" => $izd["mday"], "izd_m" => $izd["mon"], "izd_g" => $izd["year"],
157 "ist_d" => $ist["mday"], "ist_m" => $ist["mon"], "ist_g" => $ist["year"]
158 ));
159 }
160 $tpl->assign("obrazovanje", $tmp);
161 # -- 7. Tecajevi managementa
162 $rows = DBQuery("SELECT sifra, naziv FROM tecajevi WHERE language='$language' AND sif_qualification=6");
163 $tec = array();
164 for ($i = 0; $i < count($rows); $i++) {
165 list($id, $naz) = $rows[$i];
166 $tec[$id] = $naz;
167 }
168 # $ustanove je vec popunjeno.
169 $rows = DBQuery("SELECT sif_tecaja,sif_ustanove,datum_upisa,datum_zavrsetka,grad_odrzavanja_tecaja FROM edukacije WHERE (sif_radnika='$sifra') AND (sif_qualification=6) ORDER BY datum_upisa");
170 $tmp = array();
171 for ($i = 0; $i < count($rows); $i++) {
172 list($edu, $ust, $od, $do, $mj) = $rows[$i];
173 $od = ParseDate($od);
174 $do = ParseDate($do);
175 array_push($tmp, array(
176 "tecaj" => Prepare($tec[$edu]),
177 "ust_naz" => Prepare($ustanove[$ust]),
178 "od_d" => $od["mday"], "od_m" => $od["mon"], "od_g" => $od["year"],
179 "do_d" => $do["mday"], "do_m" => $do["mon"], "do_g" => $do["year"],
180 "mjesto" => Prepare($mj)
181 ));
182 }
183 $tpl->assign("tecajevi", $tmp);
184 # -- 8. Strucne i ostale edukacije
185 $rows = DBQuery("SELECT sifra,naziv FROM tecajevi WHERE (language='$language') AND (sif_qualification=7)");
186 $tec = array();
187 for ($i = 0; $i < count($rows); $i++) {
188 list($id, $naz) = $rows[$i];
189 $tec[$id] = $naz;
190 }
191 # $ustanove je vec popunjeno.
192 $rows = DBQuery("SELECT sif_tecaja,sif_ustanove,datum_upisa,datum_zavrsetka,grad_odrzavanja_tecaja,titula,zavrsio_ispitom FROM edukacije WHERE (sif_radnika='$sifra') AND (sif_qualification=7) ORDER BY datum_upisa");
193 $tmp = array();
194 for ($i = 0; $i < count($rows); $i++) {
195 list($edu, $ust, $od, $do, $mj, $tit, $form) = $rows[$i];
196 $od = ParseDate($od);
197 $do = ParseDate($do);
198 array_push($tmp, array(
199 "tecaj" => Prepare($tec[$edu]),
200 "ust_naz" => Prepare($ustanove[$ust]),
201 "mjesto" => Prepare($mj),
202 "zvanje" => Prepare($tit),
203 "formalno" => (strcasecmp("true", $form) == 0 || strcasecmp("t", $form) == 0) ? true : false,
204 "od_d" => $od["mday"], "od_m" => $od["mon"], "od_g" => $od["year"],
205 "do_d" => $do["mday"], "do_m" => $do["mon"], "do_g" => $do["year"],
206 ));
207 }
208 $tpl->assign("ostalo", $tmp);
209 # -- 9. Strani jezici
210 $rows = DBQuery("SELECT sifra,opis FROM strani_jezik WHERE (language='$language') AND (opis<>'')");
211 $sj = array();
212 for ($i = 0; $i < count($rows); $i++) {
213 list($id, $naz) = $rows[$i];
214 $sj[$id] = $naz;
215 }
216 $rows = DBQuery("SELECT sifra,stupanj FROM stupanj_str_jezika WHERE (language='$language') AND (stupanj<>'')");
217 $st = array();
218 for ($i = 0; $i < count($rows); $i++) {
219 list($id, $naz) = $rows[$i];
220 $st[$id] = $naz;
221 }
222 $rows = DBQuery("SELECT sif_stranog_jezika,stupanj_str_jezika FROM edukacije WHERE (sif_radnika='$sifra') AND (sif_qualification=3)");
223 $tmp = array();
224 for ($i = 0; $i < count($rows); $i++) {
225 list($jez, $stup) = $rows[$i];
226 array_push($tmp, array(
227 "naziv" => Prepare($sj[$jez]),
228 "stupanj" => Prepare($st[$stup])
229 ));
230 }
231 $tpl->assign("jezici", $tmp);
232 # -- 10. Vjestina rada s racunalom
233 $rows = DBQuery("SELECT sifra,naziv FROM tecajevi WHERE (language='$language') AND (sif_qualification=4) AND (naziv<>'')");
234 $ap = array();
235 for ($i = 0; $i < count($rows); $i++) {
236 list($id, $naz) = $rows[$i];
237 $ap[$id] = $naz;
238 }
239 $rows = DBQuery("SELECT sif_tecaja FROM edukacije WHERE (sif_radnika='$sifra') AND (sif_qualification=4)");
240 $tmp = array();
241 for ($i = 0; $i < count($rows); $i++) {
242 list($a) = $rows[$i];
243 array_push($tmp, array(
244 "naziv" => Prepare($ap[$a]),
245 ));
246 }
247 $tpl->assign("racunalo", $tmp);
248 # -- 11. Nagrade i priznanja
249 # $ustanove je vec popunjeno.
250 $rows = DBQuery("SELECT naziv,sif_ustanove,urucitelj,godina FROM nagrade WHERE (sif_radnika='$sifra') ORDER BY godina");
251 $tmp = array();
252 for ($i = 0; $i < count($rows); $i++) {
253 list($naz, $ust, $ur, $god) = $rows[$i];
254 array_push($tmp, array(
255 "naziv" => Prepare($naz),
256 "ust_naz" => Prepare($ustanove[$ust]),
257 "urucitelj" => Prepare($ur),
258 "godina" => Prepare($god, false)
259 ));
260 }
261 $tpl->assign("nagrade", $tmp);
262 # -- 12. Izumi / Racionalizacije / Tehnièka unapreðenja
263 $rows = DBQuery("SELECT autori,naziv,godina,zastita,na_snazi,drzave,komentar FROM patenti WHERE (sif_radnika='$sifra') ORDER BY naziv");
264 $tmp = array();
265 for ($i = 0; $i < count($rows); $i++) {
266 list($aut, $naz, $god, $zast, $ns, $drz, $kom) = $rows[$i];
267 array_push($tmp, array(
268 "autori" => Prepare($aut, false),
269 "naziv" => Prepare($naz),
270 "godina" => Prepare($god, false),
271 "zastita" => Prepare($zast),
272 "na_snazi" => ($ns[0] != "f" && $ns[0] != "F"),
273 "drzave" => Prepare($drz, false),
274 "komentar" => Prepare($kom, false)
275 ));
276 }
277 $tpl->assign("patenti", $tmp);
278 # -- 13. Objavljeni radovi / clanci / knjige
279 $rows = DBQuery("SELECT naziv_rada_knjige,naziv_casopisa,godina FROM radovi WHERE (sif_str_skupa=0) AND (sif_radnika='$sifra') ORDER BY godina");
280 $tmp = array();
281 for ($i = 0; $i < count($rows); $i++) {
282 list($rad, $kom, $god) = $rows[$i];
283 array_push($tmp, array(
284 "naziv" => Prepare($rad),
285 "komentar" => Prepare($kom),
286 "godina" => Prepare($god, false)
287 ));
288 }
289 $tpl->assign("radovi", $tmp);
290 # -- 14. Sudjelovanje na strucnim skupovima
291 $rows = DBQuery("SELECT naziv,grad,datum_od,datum_do,naziv_rada_knjige FROM strucni_skupovi,radovi WHERE (radovi.sif_str_skupa=strucni_skupovi.rbr) AND (strucni_skupovi.sif_radnika=radovi.sif_radnika) AND (radovi.sif_radnika='$sifra') ORDER BY datum_od");
292 $tmp = array();
293 for ($i = 0; $i < count($rows); $i++) {
294 list($naz, $mj, $od, $do, $rd) = $rows[$i];
295 $od = ParseDate($od);
296 $do = ParseDate($do);
297 array_push($tmp, array(
298 "naziv" => Prepare($naz),
299 "mjesto" => Prepare($mj),
300 "rad" => Prepare($rd),
301 "od_d" => $od["mday"], "od_m" => $od["mon"], "od_g" => $od["year"],
302 "do_d" => $do["mday"], "do_m" => $do["mon"], "do_g" => $do["year"],
303 ));
304 }
305 $tpl->assign("skupovi", $tmp);
306 # -- 15. O meni
307 $rows = DBQuery("SELECT opis FROM o_meni WHERE (sif_radnika='$sifra')");
308 $tpl->assign("omeni", Prepare($rows[0][0], false));
309 # -- KRAJ
310 DBClose();
311 $tpl->show();
312 ?>

  ViewVC Help
Powered by ViewVC 1.1.26