80 |
|
|
81 |
$instaliran=0; |
$instaliran=0; |
82 |
|
|
83 |
$result = pg_Exec ($conn, "select datum,opis,ime,prezime,status_tip_id as st |
$result = pg_Exec ($conn, "select status.id as status_id,datum,opis,ime,prezime,status_tip_id as st |
84 |
from status,kontakt_osobe,status_tip |
from status,kontakt_osobe,status_tip |
85 |
where kontakt_osoba_id=kontakt_osobe.id and status_tip_id=status_tip.id |
where kontakt_osoba_id=kontakt_osobe.id and status_tip_id=status_tip.id |
86 |
and osoba_id=$id order by datum"); |
and osoba_id=$id order by datum"); |
89 |
|
|
90 |
$nr = pg_numrows($result); |
$nr = pg_numrows($result); |
91 |
if ($nr > 0) { |
if ($nr > 0) { |
92 |
for ($i=0;$i<$nr; $i++) { |
for ($i=0; $i<$nr; $i++) { |
93 |
$row=pg_fetch_array($result,$i); |
$row=pg_fetch_array($result,$i); |
94 |
$statusi.="<tr ".bgcolor()."><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>"; |
if ($row[st] != 2) { |
95 |
|
$statusi.="<tr ".bgcolor()."><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>"; |
96 |
|
} else { |
97 |
|
$statusi.="<tr ".bgcolor()."><td><small>$row[datum]</small></td><td><a href=\"promjene.php?osoba_id=$id&status_id=$row[status_id]\">$row[opis]</a></td><td>$row[ime] $row[prezime]</td></tr>"; |
98 |
|
} |
99 |
if ($row[st] == 6) { $instaliran = 1; }; |
if ($row[st] == 6) { $instaliran = 1; }; |
100 |
} |
} |
101 |
} else { |
} else { |
140 |
|
|
141 |
<table border=0> |
<table border=0> |
142 |
<tr><th>datum</th><th>status</th><th>status postavio/la</th></tr> |
<tr><th>datum</th><th>status</th><th>status postavio/la</th></tr> |
143 |
$statusi |
$statusi"; |
|
<tr><td align=right><b>Dodati status:</b></td> |
|
144 |
|
|
145 |
<td><select name=status_tip_id>"; |
$statusi="<tr>"; |
146 |
|
|
147 |
|
if ($prava == $pr_admin) { |
148 |
|
$statusi.="<td><select name=date_offset> |
149 |
|
<option value=>danas</option> |
150 |
|
<option value=1>sutra</option>"; |
151 |
|
$dani=array("nedjelju","ponedjeljak","utorak","srijedu", |
152 |
|
"četvrtak","petak","subotu"); |
153 |
|
for ($d=2; $d<10; $d++) { |
154 |
|
$statusi.="<option value=$d>u ".$dani[(date("w")+$d) % 7].", ". date("d.m.Y",time()+$d*24*60*60)."</option>"; |
155 |
|
} |
156 |
|
$statusi.="</select></td>"; |
157 |
|
} else { |
158 |
|
$statusi.="<td align=right><b>Dodati status:</b></td>"; |
159 |
|
} |
160 |
|
|
161 |
|
$statusi.="<td><select name=status_tip_id>"; |
162 |
|
|
163 |
$result = pg_Exec ($conn, "select id,opis |
$result = pg_Exec ($conn, "select id,opis |
164 |
from status_tip |
from status_tip |
165 |
where id >= 5 |
where id >= 5 |
166 |
"); |
"); |
167 |
|
|
168 |
|
$num_prava=0; |
169 |
|
|
170 |
for ($i=0; $i<pg_numrows($result); $i++) { |
for ($i=0; $i<pg_numrows($result); $i++) { |
171 |
$row=pg_fetch_array($result,$i); |
$row=pg_fetch_array($result,$i); |
172 |
print "<option value=$row[id]>$row[opis]</option>\n"; |
if ($prava & pow(2,$row[id])) { |
173 |
|
$statusi.="<option value=$row[id]>$row[opis]</option>\n"; |
174 |
|
$num_prava++; |
175 |
|
} |
176 |
} |
} |
177 |
|
|
178 |
print "</select></td> |
$statusi.="</select></td> |
|
|
|
179 |
<td>$korow[ime] $korow[prezime]</td> |
<td>$korow[ime] $korow[prezime]</td> |
180 |
<td><input type=submit value=\"Dodaj\"></td></tr> |
<td><input type=submit value=\"Dodaj\"></td></tr>"; |
181 |
|
|
182 |
|
if ($num_prava>0) { |
183 |
|
print "$statusi"; |
184 |
|
} |
185 |
|
|
186 |
|
print " |
187 |
</table> |
</table> |
188 |
</form> |
</form> |
189 |
|
|
199 |
|
|
200 |
} // isset($id) |
} // isset($id) |
201 |
|
|
202 |
print '<p>Povratak na <a href="lista.php">listu zahtjeva</a> ili |
print "<p>Povratak na "; |
203 |
<a href="/">početnu stranicu</a>.'; |
if (isset($HTTP_REFERER)) { |
204 |
|
print "<a href=\"$HTTP_REFERER\">stranicu sa koje ste došli</a> ili "; |
205 |
|
} |
206 |
|
print "<a href=\"/\">početnu stranicu</a>."; |
207 |
|
|
208 |
|
|
209 |
include("inc/footer.inc"); |
include("inc/footer.inc"); |
210 |
|
|