/[hr-web]/RadSRacunalom.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 /RadSRacunalom.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 (22 years, 11 months ago) by dpavlin
Branch: pliva
CVS Tags: r0
Changes since 1.1: +0 -0 lines
initial import

1 <?php
2 include("inc/global.php");
3 if (!Auth()) exit;
4 $page = CalcPage($PHP_SELF);
5 $p = $page;
6 if (isparam("wb_p")) $p--;
7 if (isparam("wb_OK")) $p++;
8 if (isparam("wb_h")) $p = 0;
9 if (isparam("wb_o")) $p = 15;
10 if (isparam("wb_A")) $p = 100;
11 include("inc/conn.php");
12 DBOpen();
13 $del = 0;
14 reset($HTTP_GET_VARS);
15 while ($var = key($HTTP_GET_VARS)) {
16 next($HTTP_GET_VARS);
17 if (!eregi('^del_([0-9]+)$', $var, $match)) continue;
18 $del = $match[1];
19 }
20 reset($HTTP_POST_VARS);
21 while ($var = key($HTTP_POST_VARS)) {
22 next($HTTP_POST_VARS);
23 if (!eregi('^del_([0-9]+)$', $var, $match)) continue;
24 $del = $match[1];
25 }
26 if ($del) {
27 unset($edit);
28 DBQuery("DELETE FROM edukacije WHERE (sifra=$del) AND (sif_radnika='$sifra') AND (sif_qualification=4)");
29 }
30 $warning = 0;
31 if ($update || $p != $page) {
32 if ($tecaj) {
33 if (!$warning) {
34 if ($edit)
35 DBQuery("UPDATE edukacije SET sif_tecaja=$tecaj (sifra=$edit) AND (sif_radnika='$sifra') AND (sif_qualification=4)");
36 else {
37 $id = DBQuery("SELECT MAX(sifra) FROM edukacije WHERE (sif_qualification=4)");
38 $id = $id[0][0] + 1;
39 DBQuery("INSERT INTO edukacije (sifra,sif_radnika,sif_tecaja,sif_qualification) VALUES ($id,'$sifra',$tecaj,4)");
40 }
41 }
42 } else if ($edit)
43 DBQuery("DELETE FROM edukacije WHERE (sifra=$edit) AND (sif_radnika='$sifra') AND (sif_qualification=4)");
44 if ($p != $page && !$warning) {
45 DBClose();
46 Header("Location: $pages[$p]".Params($p));
47 exit;
48 }
49 }
50 if (($new || $update) && !$warning)
51 unset($edit, $tecaj);
52 include("inc/util.php");
53 $rows = DBQuery("SELECT sifra,naziv FROM tecajevi WHERE (language='$language') AND (sif_qualification=4) AND (naziv<>'')");
54 $tecajevi = array();
55 for ($i = 0; $i < count($rows); $i++) {
56 list($sif, $naz) = $rows[$i];
57 array_push($tecajevi, array("id" => $sif,
58 "name" => HTML_Escape(Win_ISO($naz))));
59 }
60 usort($tecajevi, "sort_name");
61 $rows = DBQuery("SELECT sifra,sif_tecaja FROM edukacije WHERE (sif_radnika='$sifra') AND (sif_qualification=4)");
62 $vars = array();
63 $fnd = false;
64 for ($i = 0; $i < count($rows); $i++) {
65 list($id, $ap) = $rows[$i];
66 $ap2 = "";
67 for ($j = 0; $j < count($tecajevi); $j++) {
68 if ($tecajevi[$j]["id"] == $ap) {
69 $ap2 = $tecajevi[$j]["name"];
70 break;
71 }
72 }
73 $ap2 = ereg_replace("\r?\n", "<BR>", $ap2);
74 nepoznato($ap2);
75 array_push($vars, array(
76 "id" => $id,
77 "link" => $PHP_SELF.Params($page, array("edit" => $id)),
78 "naziv" => $ap2,
79 ));
80 if ($edit && $edit == $id) {
81 $tecaj = $ap;
82 $fnd = true;
83 }
84 }
85 if (!$fnd) unset($edit);
86 DBClose();
87 include("inc/Smarty.class.php");
88 $tpl = new Smarty;
89 $tpl->template_dir = "./tpl";
90 $tpl->compile_dir = "./tpc";
91 $tpl->assign("action", $PHP_SELF.Params($page,
92 $edit ? array("edit" => $edit) : array()));
93 $tpl->assign("language", $language);
94 $tpl->assign("sifra", $sifra);
95 $tpl->assign("vars", $vars);
96 $tpl->assign("edit", $edit);
97 $tpl->assign("tecajevi", $tecajevi);
98 $tpl->assign("tecaj", $tecaj);
99 $tpl->assign("warning", $warning);
100 $pg = basename($PHP_SELF);
101 $pg = eregi_replace("\.php$", "", $pg);
102 $tpl->display("$pg-$language.tpl");
103 ?>

  ViewVC Help
Powered by ViewVC 1.1.26