1 | 2 | simandl | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | | | <html> |
3 | | | <head> |
4 | | | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> |
5 | | | <style type="text/css" media="screen"> @import "style.css"; </style> |
6 | | | <title>db.jablonka.cz - Člen </title> |
7 | | | </head> |
8 | | | <link rel="stylesheet" type="text/css" href="style.css"> |
9 | | | </head> |
10 | | | <body topmargin=0 leftmargin=10> |
11 | | | <? |
12 | | | include ("header.htm"); |
13 | | | require('grab_globals.lib.php'); |
14 | | | include ("fce.php"); |
15 | | | $spojeni = MySQL_Connect($db_host, $db_user, $db_pass); |
16 | | | MySQL_Select_DB($db_name); |
17 | | | |
18 | | | |
19 | | | ################################################################################################################ |
20 | | | ### Finance |
21 | | | ################################################################################################################ |
22 | | | |
23 | | | $celkem=0; |
24 | | | $castkacelkem=0; |
25 | | | |
26 | | | echo ' |
27 | | | <center>'; |
28 | | | |
29 | | | if(!@$show) $show="all"; |
30 | | | if(!@$order) $order="prijmeni"; |
31 | | | if(!@$platba) $platba="vsechno"; |
32 | | | if(!@$pokladna) $pokladna="vsechno"; |
33 | | | if(!@$rok) $rok="vsechno"; |
34 | | | |
35 | | | # default trideni |
36 | | | if($platba=="vsechno") { |
37 | | | $condition = ""; |
38 | | | } else { |
39 | | | $condition = "AND f.platba=$platba"; |
40 | | | } |
41 | | | |
42 | | | if($pokladna=="vsechno") { |
43 | | | $condition .= ""; |
44 | | | } else { |
45 | | | $condition .= " AND f.pokladna=$pokladna"; |
46 | | | } |
47 | | | |
48 | | | if($rok=="vsechno") { |
49 | | | $condition .= ""; |
50 | | | } else { |
51 | | | $condition .= " AND YEAR(f.datum)=$rok"; |
52 | | | } |
53 | | | |
54 | | | if(@$clen==0 || @$clen) { |
55 | | | $condition .= " AND c.id=$clen"; |
56 | | | } else { |
57 | | | $condition .= ""; |
58 | | | } |
59 | | | |
60 | | | echo "<br>"; |
61 | | | #tisk datumu plateb |
62 | | | echo "Rok : "; |
63 | | | $dotaz=MySQL_Query("SELECT DISTINCT YEAR(datum) from finance ORDER BY datum"); |
64 | | | $count=MySQL_Num_Rows($dotaz); |
65 | | | $count++; |
66 | | | for ($i=1;$i<$count;$i++) |
67 | | | { |
68 | | | $radek=MySQL_Fetch_Array($dotaz); |
69 | | | echo "<a href=\"clen.php?clen=$clen&show=$show&pokladna=$pokladna&platba=$platba&rok=".$radek["YEAR(datum)"]."&order=$order\">".$radek["YEAR(datum)"].'</a> * '; |
70 | | | echo ' |
71 | | | '; |
72 | | | } |
73 | | | #dotisk posledni volby pro vsechny platby |
74 | | | echo "<a href=\"clen.php?clen=$clen&show=$show&pokladna=$pokladna&platba=$platba&rok=&order=$order\">všechno</a>"; |
75 | | | echo '<br><br> |
76 | | | '; |
77 | | | |
78 | | | if(!$order) $order="prijmeni"; |
79 | | | $where="WHERE active IN (0,1) $condition "; |
80 | | | echo '<b>Seznam příspěvků uživatele: '.id_to_name($clen).'</b> '; |
81 | | | |
82 | | | |
83 | | | echo "<br>"; |
84 | | | #tisk vsech moznosti plateb |
85 | | | echo "Platby : "; |
86 | | | $dotaz=MySQL_Query("SELECT * from platby ORDER BY id"); |
87 | | | $count=MySQL_Num_Rows($dotaz); |
88 | | | $count++; |
89 | | | for ($i=1;$i<$count;$i++) |
90 | | | { |
91 | | | $radek=MySQL_Fetch_Array($dotaz); |
92 | | | echo "<a href=\"clen.php?clen=$clen&show=$show&pokladna=$pokladna&rok=$rok&platba=".$radek["id"]."&order=$order\">".$radek["nazev"].'</a> * '; |
93 | | | echo ' |
94 | | | '; |
95 | | | } |
96 | | | #dotisk posledni volby pro vsechny platby |
97 | | | echo "<a href=\"clen.php?clen=$clen&show=$show&pokladna=$pokladna&rok=$rok&platba=&order=$order\">všechno</a>"; |
98 | | | echo ' |
99 | | | '; |
100 | | | |
101 | | | echo "<br>"; |
102 | | | #tisk vsech moznosti pokladen |
103 | | | echo "Pokladny : "; |
104 | | | $dotaz=MySQL_Query("SELECT * from pokladny ORDER BY id"); |
105 | | | $count=MySQL_Num_Rows($dotaz); |
106 | | | $count++; |
107 | | | for ($i=1;$i<$count;$i++) |
108 | | | { |
109 | | | $radek=MySQL_Fetch_Array($dotaz); |
110 | | | echo "<a href=\"clen.php?clen=$clen&show=$show&platba=$platba&rok=$rok&pokladna=".$radek["id"]."&order=$order\">".$radek["nazev"].'</a> * '; |
111 | | | echo ' |
112 | | | '; |
113 | | | } |
114 | | | #dotisk posledni volby pro vsechny platby |
115 | | | echo "<a href=\"clen.php?clen=$clen&show=$show&pokladna=&rok=$rok&platba=$platba&order=$order\">všechno</a>"; |
116 | | | echo ' |
117 | | | '; |
118 | | | |
119 | | | #finalni dotaz do databaze pred vypisem zvolene sestavy |
120 | | | $string=MySQL_Query("SELECT c.id as cid, c.*, f.id as fid, f.*, p.id as pid, p.* |
121 | | | FROM (cleni c LEFT JOIN finance f ON c.id = f.clen) |
122 | | | LEFT JOIN platby p ON f.platba = p.id $where ORDER BY $order"); |
123 | | | |
124 | | | echo ' |
125 | | | |
126 | | | <table width=100% cellspacing=1> |
127 | | | <tr> |
128 | | | <td bgcolor=#C00000> |
129 | | | <table cellspacing=0 cellpadding=0 width=100%> |
130 | | | <tr> |
131 | | | <td bgcolor=#FFFFFF> </td> |
132 | | | <td bgcolor=#FFFFFF class=text> |
133 | | | <a title="seřadit podle ID" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=cid">ID</a> |
134 | | | </td> |
135 | | | <td bgcolor=#FFFFFF class=text> |
136 | | | <a title="seřadit podle jména" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=jmeno">Jméno</a> |
137 | | | </td> |
138 | | | <td bgcolor=#FFFFFF class=text> |
139 | | | <a title="seřadit podle příjmení" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=prijmeni">Příjmení:</a> |
140 | | | </td> |
141 | | | <td bgcolor=#FFFFFF class=text width=80> |
142 | | | <a title="seřadit podle přezdívky" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=prezdivka">Přezdívka:</a> |
143 | | | </td> |
144 | | | <td bgcolor=#FFFFFF class=text width=80> |
145 | | | <a title="seřadit podle var.symb." class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=vs">v.s.:</a> |
146 | | | </td> |
147 | | | <td bgcolor=#FFFFFF class=text> |
148 | | | <a title="seřadit podle pokladny" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=pokladna">Pokladna</a> |
149 | | | </td> |
150 | | | <td bgcolor=#FFFFFF class=text> |
151 | | | <a title="seřadit podle čísla účtenky" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=uctenka">Účtenka</a> |
152 | | | </td> |
153 | | | <td bgcolor=#FFFFFF class=text> |
154 | | | <a title="seřadit podle komentáře" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=komentar">Komentář</a> |
155 | | | </td> |
156 | | | <td bgcolor=#FFFFFF class=text> |
157 | | | <a title="seřadit podle dodavatele" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=dodavatel">Dodavatel</a> |
158 | | | </td> |
159 | | | <td bgcolor=#FFFFFF class=text> |
160 | | | <a title="seřadit podle data" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=datum">Datum</a> |
161 | | | </td> |
162 | | | <td bgcolor=#FFFFFF class=text> |
163 | | | <a title="seřadit podle hodnoty" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=hodnota">Hodnota</a> |
164 | | | </td> |
165 | | | <td bgcolor=#FFFFFF class=text> |
166 | | | <a title="seřadit podle typu plateb" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&pokladna='.$pokladna.'&rok='.$rok.'&platba='.$platba.'&order=platba">Platba</a> |
167 | | | </td> |
168 | | | </tr> |
169 | | | '; |
170 | | | |
171 | | | $color=1; |
172 | | | |
173 | | | while($vysledek=MySQL_Fetch_Array($string)) |
174 | | | { |
175 | | | $celkem++; |
176 | | | if($color==0) |
177 | | | { |
178 | | | $color=1; |
179 | | | $barva="#E6E4E4"; |
180 | | | } |
181 | | | else |
182 | | | { |
183 | | | $color=0; |
184 | | | $barva="#FFFFFF"; |
185 | | | } |
186 | | | if($vysledek["id"]<1000) |
187 | | | { |
188 | | | $dot="lan.bmp"; |
189 | | | $alt="LAN Jablonka"; |
190 | | | } |
191 | | | else |
192 | | | { |
193 | | | if($vysledek["id"]==1000) |
194 | | | { |
195 | | | $dot="apy.bmp"; |
196 | | | $alt="AP Yenik"; |
197 | | | } |
198 | | | if($vysledek["id"]==1001) |
199 | | | { |
200 | | | $dot="apj.bmp"; |
201 | | | $alt="AP Jablonecká"; |
202 | | | } |
203 | | | } |
204 | | | |
205 | | | $icons=""; |
206 | | | if($show=="all" && $vysledek["active"]==2) $icons=$icons.'<img title="Čekatel" src="images/actv.gif"> '; |
207 | | | if($show=="all" && $vysledek["active"]==1) $icons=$icons.'<img title="Člen" src="images/actv.gif"> '; |
208 | | | if($show=="all" && $vysledek["active"]==0) $icons=$icons.'<img title="Pasivní" src="images/passv.gif"> '; |
209 | | | if($vysledek["finance"]==1) $icons=$icons.'<img title="Finance" src="images/dolar.gif"> '; |
210 | | | if($vysledek["internet"]==1) $icons=$icons.'<img title="Internet" src="images/net.gif"> '; |
211 | | | if($vysledek["energy"]==1) $icons=$icons.'<img title="Elektřina sleva" src="images/energysleva.gif"> '; |
212 | | | if($vysledek["energy"]==2) $icons=$icons.'<img title="Elektřina" src="images/energy.gif"> '; |
213 | | | echo ' |
214 | | | <tr> |
215 | | | <td bgcolor='.$barva.' class=text> <img src="images/'.$dot.'" title="'.$alt.'"></td> |
216 | | | <td bgcolor='.$barva.' class="text"><a class="odkaz" target="_self" href="edit_user.php?id='.$vysledek["cid"].'">'.$vysledek["cid"].'</a></td> |
217 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["jmeno"].'</td> |
218 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["prijmeni"].'</td> |
219 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["prezdivka"].'</td> |
220 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["vs"].'</td> |
221 | | | <td bgcolor='.$barva.' class="text">';echo id_to_pokladna($vysledek["pokladna"]);echo '</td> |
222 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["uctenka"].'</td> |
223 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["komentar"].'</td> |
224 | | | <td bgcolor='.$barva.' class="text">';echo id_to_dodavatel($vysledek["dodavatel"]);echo '</td> |
225 | | | |
226 | | | <td bgcolor='.$barva.' class="text"> |
227 | | | <a class="odkaz" target="_self" href="add_platba.php?clen='.$vysledek["cid"].'">+</a> |
228 | | | '; |
229 | | | if(!@$vysledek["datum"]) |
230 | | | { |
231 | | | $datum=""; |
232 | | | } else |
233 | | | { |
234 | | | $datum=sql2datum($vysledek["datum"]); |
235 | | | } |
236 | | | echo ' |
237 | | | <a class="odkaz" target="_self" href="edit_platba.php?id='.$vysledek["fid"].'">'.$datum.'</a> |
238 | | | </td> |
239 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["hodnota"].'</td> |
240 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["nazev"].'</td> |
241 | | | <td bgcolor='.$barva.'></td> |
242 | | | </tr> |
243 | | | '; |
244 | | | $castkacelkem=$castkacelkem+str_replace(",",".",$vysledek["hodnota"]); |
245 | | | Next($vysledek); |
246 | | | } |
247 | | | |
248 | | | echo ' |
249 | | | </table></tr></td></table></center> |
250 | | | Celkem zobrazeno '.$celkem.' záznamů. Celková částka zobrazených záznamů je '.$castkacelkem.'Kč |
251 | | | '; |
252 | | | |
253 | | | ################################################################################################################ |
254 | | | ### Ukony |
255 | | | ################################################################################################################ |
256 | | | |
257 | | | echo ' |
258 | | | <br> |
259 | | | <br> |
260 | | | |
261 | | | <center>'; |
262 | | | |
263 | | | if($rok=="vsechno") { |
264 | | | $condition = ""; |
265 | | | } else { |
266 | | | $condition = " AND YEAR(uk.datum)=$rok"; |
267 | | | } |
268 | | | |
269 | | | if(@$clen==0 || @$clen) { |
270 | | | $condition .= " AND c.id=$clen"; |
271 | | | } else { |
272 | | | $condition .= ""; |
273 | | | } |
274 | | | |
275 | | | $celkem=0; |
276 | | | |
277 | | | if(!$order) $order="prijmeni"; |
278 | | | $where="WHERE active IN (0,1) $condition"; |
279 | | | echo '<b>Seznam úkonů uživatele: '.id_to_name($clen).'</b> '; |
280 | | | |
281 | | | #finalni dotaz |
282 | | | $string=MySQL_Query("SELECT c.id as cid, c.*, uk.id as ukid, uk.*, u.id as uid, u.*, i.id as iid, i.* |
283 | | | FROM ((cleni c LEFT JOIN ukony uk ON c.id = uk.clen) |
284 | | | LEFT JOIN udalosti u ON uk.udalost = u.id) |
285 | | | LEFT JOIN ipecka i ON uk.predmet = i.id AND uk.udalost IN (7,8) $where ORDER BY $order"); |
286 | | | |
287 | | | echo ' |
288 | | | |
289 | | | <table width=100% cellspacing=1> |
290 | | | <tr> |
291 | | | <td bgcolor=#C00000> |
292 | | | <table cellspacing=0 cellpadding=0 width=100%> |
293 | | | <tr> |
294 | | | <td bgcolor=#FFFFFF> </td> |
295 | | | <td bgcolor=#FFFFFF class=text> |
296 | | | <a title="seřadit podle ID" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=cid">ID</a> |
297 | | | </td> |
298 | | | <td bgcolor=#FFFFFF class=text> |
299 | | | <a title="seřadit podle jména" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=jmeno">Jméno</a> |
300 | | | </td> |
301 | | | <td bgcolor=#FFFFFF class=text> |
302 | | | <a title="seřadit podle příjmení" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=prijmeni">Příjmení:</a> |
303 | | | </td> |
304 | | | <td bgcolor=#FFFFFF class=text width=80> |
305 | | | <a title="seřadit podle přezdívky" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=prezdivka,prijmeni">Přezdívka:</a> |
306 | | | </td> |
307 | | | <td bgcolor=#FFFFFF class=text width=80> |
308 | | | <a title="seřadit podle Emailu" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=email">Email:</a> |
309 | | | </td> |
310 | | | <td bgcolor=#FFFFFF class=text width=80> |
311 | | | <a title="seřadit podle aktivity" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=active">A</a> |
312 | | | <a title="seřadit podle financí" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=finance">F</a> |
313 | | | <a title="seřadit podle internetu" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=internet">I</a> |
314 | | | <a title="seřadit podle elektřiny" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=energy">E</a> |
315 | | | </td> |
316 | | | <td bgcolor=#FFFFFF class=text> |
317 | | | <a title="seřadit podle typu připojení" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=domu">Domů</a> |
318 | | | </td> |
319 | | | <td bgcolor=#FFFFFF class=text> |
320 | | | <a title="seřadit podle přezdívky" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=mobil">Mobil</a> |
321 | | | </td> |
322 | | | <td bgcolor=#FFFFFF class=text> |
323 | | | <a title="seřadit podle data" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=datum">Datum</a> |
324 | | | </td> |
325 | | | <td bgcolor=#FFFFFF class=text> |
326 | | | <a title="seřadit podle událostí" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=udalost">Událost</a> |
327 | | | </td> |
328 | | | <td bgcolor=#FFFFFF class=text> |
329 | | | <a title="seřadit podle předmětů" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=predmet">Předmět</a> |
330 | | | </td> |
331 | | | </tr> |
332 | | | '; |
333 | | | |
334 | | | $color=1; |
335 | | | |
336 | | | while($vysledek=MySQL_Fetch_Array($string)) |
337 | | | { |
338 | | | $celkem++; |
339 | | | if($color==0) |
340 | | | { |
341 | | | $color=1; |
342 | | | $barva="#E6E4E4"; |
343 | | | } |
344 | | | else |
345 | | | { |
346 | | | $color=0; |
347 | | | $barva="#FFFFFF"; |
348 | | | } |
349 | | | if($vysledek["id"]<1000) |
350 | | | { |
351 | | | $dot="lan.bmp"; |
352 | | | $alt="LAN Jablonka"; |
353 | | | } |
354 | | | else |
355 | | | { |
356 | | | if($vysledek["id"]==1000) |
357 | | | { |
358 | | | $dot="apy.bmp"; |
359 | | | $alt="AP Yenik"; |
360 | | | } |
361 | | | if($vysledek["id"]==1001) |
362 | | | { |
363 | | | $dot="apj.bmp"; |
364 | | | $alt="AP Jablonecká"; |
365 | | | } |
366 | | | } |
367 | | | |
368 | | | $icons=""; |
369 | | | if($show=="all" && $vysledek["active"]==2) $icons=$icons.'<img title="Čekatel" src="images/actv.gif"> '; |
370 | | | if($show=="all" && $vysledek["active"]==1) $icons=$icons.'<img title="Člen" src="images/actv.gif"> '; |
371 | | | if($show=="all" && $vysledek["active"]==0) $icons=$icons.'<img title="Pasivní" src="images/passv.gif"> '; |
372 | | | if($vysledek["finance"]==1) $icons=$icons.'<img title="Finance" src="images/dolar.gif"> '; |
373 | | | if($vysledek["internet"]==1) $icons=$icons.'<img title="Internet" src="images/net.gif"> '; |
374 | | | if($vysledek["energy"]==1) $icons=$icons.'<img title="Elektřina sleva" src="images/energysleva.gif"> '; |
375 | | | if($vysledek["energy"]==2) $icons=$icons.'<img title="Elektřina" src="images/energy.gif"> '; |
376 | | | echo ' |
377 | | | <tr> |
378 | | | <td bgcolor='.$barva.' class=text> <img src="images/'.$dot.'" title="'.$alt.'"></td> |
379 | | | <td bgcolor='.$barva.' class="text"><a class="odkaz" target="_self" href="edit_user.php?id='.$vysledek["cid"].'">'.$vysledek["cid"].'</a></td> |
380 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["jmeno"].'</td> |
381 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["prijmeni"].'</td> |
382 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["prezdivka"].'</td> |
383 | | | <td bgcolor='.$barva.' class="text"> |
384 | | | '; |
385 | | | $from="info@jablonka.cz"; |
386 | | | $subject = ""; |
387 | | | $text = "Zdravím, |
388 | | | hezký den |
389 | | | \n"; |
390 | | | $text = str_replace(" ","%20",$text); |
391 | | | $text = str_replace("\n","%0d",$text); |
392 | | | if ( $vysledek["email"] ) { |
393 | | | echo ' |
394 | | | <a href="mail.php?to='.$vysledek["email"].'&subj='.$subject.'&from='.$from.'&text='.$text.'">int</a> |
395 | | | <a href="mailto:'.$vysledek["email"].'?subject='.$subject.'&body='.$text.'">ext</a> '.$vysledek["email"].'</td> |
396 | | | '; |
397 | | | } |
398 | | | echo ' |
399 | | | <td bgcolor='.$barva.' class="text">'.$icons.'</td> |
400 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["domu"].'</td> |
401 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["mobil"].'</td> |
402 | | | <td bgcolor='.$barva.' class="text"> |
403 | | | <a class="odkaz" target="_self" href="add_ukon.php?clen='.$vysledek["cid"].'">+</a> |
404 | | | '; |
405 | | | if(!@$vysledek["datum"]) |
406 | | | { |
407 | | | $datum=""; |
408 | | | } else |
409 | | | { |
410 | | | $datum=sql2datum($vysledek["datum"]); |
411 | | | } |
412 | | | echo ' |
413 | | | <a class="odkaz" target="_self" href="edit_ukon.php?id='.$vysledek["ukid"].'">'.$datum.'</a> |
414 | | | </td> |
415 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["nazev"].'</td> |
416 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["ip"].'</td> |
417 | | | </tr> |
418 | | | '; |
419 | | | Next($vysledek); |
420 | | | } |
421 | | | |
422 | | | echo ' |
423 | | | </table></tr></td></table></center> |
424 | | | Celkem zobrazeno '.$celkem.' záznamů. |
425 | | | '; |
426 | | | |
427 | | | ################################################################################################################ |
428 | | | ### Prispevky |
429 | | | ################################################################################################################ |
430 | | | |
431 | | | if(!@$show) $show="all"; |
432 | | | if(!@$order) $order="prijmeni"; |
433 | | | |
434 | | | if($rok=="vsechno") { |
435 | | | # $rok = "now()"; |
436 | | | $rok = date("Y"); |
437 | | | } |
438 | | | |
439 | | | $where="WHERE c.id=".$clen; |
440 | | | |
441 | | | |
442 | | | #finalni dotaz |
443 | | | $string=MySQL_Query("SELECT c.id as cid, c.*, f.id as fid, f.*, p.id as pid, p.*, u.id as uid, u.datum as udatum, u.*, i.id as iid, i.* |
444 | | | FROM (((cleni c LEFT JOIN finance f ON c.id = f.clen AND f.platba = 2 AND YEAR(f.datum) = $rok ) |
445 | | | LEFT JOIN platby p ON f.platba = p.id) LEFT JOIN ukony u ON c.id = u.clen AND u.udalost = 7) |
446 | | | LEFT JOIN ipecka i ON c.id = i.clen AND i.id = u.predmet $where ORDER BY $order"); |
447 | | | |
448 | | | echo ' |
449 | | | <center> |
450 | | | <br>Prispevky za rok <b>'.$rok.'</b><br> |
451 | | | |
452 | | | <form name="emaily" action="mail_multi.php" method="POST"> |
453 | | | <input class=field type="submit" name="OK" value=" pošli mail "> |
454 | | | <a href="#" onclick="i=0;while ((document.forms[0][i] != null )) {document.forms[0][i].checked = true;i+=1;};">Vybrat vše</a> |
455 | | | <a href="#" onclick="i=0;while ((document.forms[0][i] != null )) {document.forms[0][i].checked = !document.forms[0][i].checked;i+=1;};">Invertovat</a> |
456 | | | |
457 | | | <table width=100% cellspacing=1 border=1> |
458 | | | <tr> |
459 | | | <td bgcolor=#73BE1E> |
460 | | | <table cellspacing=1 cellpadding=1 width=100%> |
461 | | | <tr> |
462 | | | <td bgcolor=#FFFFFF class=text> |
463 | | | <a title="seřadit podle ID" class=odkaz href="prispevky_2008.php?show='.$show.'&order=cid">ID</a> |
464 | | | </td> |
465 | | | <td bgcolor=#FFFFFF class=text> |
466 | | | <a title="seřadit podle jména" class=odkaz href="prispevky_2008.php?show='.$show.'&order=jmeno,cid">Jméno</a> |
467 | | | </td> |
468 | | | <td bgcolor=#FFFFFF class=text> |
469 | | | <a title="seřadit podle příjmení" class=odkaz href="prispevky_2008.php?show='.$show.'&order=prijmeni,cid">Příjmení</a> |
470 | | | </td> |
471 | | | <td bgcolor=#FFFFFF class=text width=80> |
472 | | | <a title="seřadit podle aktivity" class=odkaz href="prispevky_2008.php?show='.$show.'&order=active,cid">A</a> |
473 | | | <a title="seřadit podle financí" class=odkaz href="prispevky_2008.php?show='.$show.'&order=finance,cid">F</a> |
474 | | | <a title="seřadit podle internetu" class=odkaz href="prispevky_2008.php?show='.$show.'&order=internet,cid">I</a> |
475 | | | <a title="seřadit podle elektřiny" class=odkaz href="prispevky_2008.php?show='.$show.'&order=energy,cid">E</a> |
476 | | | </td> |
477 | | | <td bgcolor=#FFFFFF class=text width=80>email</td> |
478 | | | <td bgcolor=#FFFFFF class=text width=80>Připojen od</td> |
479 | | | <td bgcolor=#FFFFFF class=text width=80>Přip. měsíců (50)</td> |
480 | | | <td bgcolor=#FFFFFF class=text width=80>Inet měsíců (50)</td> |
481 | | | <td bgcolor=#FFFFFF class=text width=80>Sleva switch (-25)</td> |
482 | | | <td bgcolor=#FFFFFF class=text width=80>Sleva router (-50)</td> |
483 | | | <td bgcolor=#FFFFFF class=text width=80>Částka</td> |
484 | | | <td bgcolor=#FFFFFF class=text width=80>var.symb.</td> |
485 | | | <td bgcolor=#FFFFFF class=text>Přehled plateb</td> |
486 | | | <td bgcolor=#FFFFFF class=text>Součet plateb</td> |
487 | | | <td bgcolor=#FFFFFF class=text>Přenos z předchozího roku</td> |
488 | | | <td bgcolor=#FFFFFF class=text>Celkem</td> |
489 | | | </tr> |
490 | | | '; |
491 | | | |
492 | | | # nastaveni pocatecnich hodnot pro tisk tabulky |
493 | | | # pokud ma clen vice radku tak se tiskne jen jeden souhrnny |
494 | | | $color=1; |
495 | | | $lastcid=-1; |
496 | | | $celkem=0; |
497 | | | $castkacelkem=0; |
498 | | | $mindatum="2008-12-31"; |
499 | | | $ipecka=""; |
500 | | | $platby=""; |
501 | | | $soucetplateb=0; |
502 | | | |
503 | | | while($vysledek=MySQL_Fetch_Array($string)) { |
504 | | | #pro prvni je treba rovnou priradit lastcid |
505 | | | if ($lastcid == -1 ) $lastcid = $vysledek["cid"]; |
506 | | | #pokud je uz jiny clen tak se jde na tisk predchoziho |
507 | | | if ( $lastcid != $vysledek["cid"] ) { |
508 | | | $celkem++; |
509 | | | if($color==0) { $color=1; $barva="#E6E4E4"; } else { $color=0; $barva="#FFFFFF"; } |
510 | | | $delkaletos = round((strtotime("2008-12-31")-strtotime($mindatum))/(60*60*24*30.42)); |
511 | | | if($delkaletos>12) $delkaletos=12; |
512 | | | $prenos=id_to_prenos($cid,$rok); |
513 | | | |
514 | | | $delkapripojeniletos=round(id_to_delkazarok($cid,$rok,22,23)/(60*60*24*30.42)); |
515 | | | $delkanapajeniletos=round(id_to_delkazarok($cid,$rok,5,6)/(60*60*24*30.42)); |
516 | | | $delkanapajenirouteruletos=round(id_to_delkazarok($cid,$rok,24,25)/(60*60*24*30.42)); |
517 | | | $delkakonektivityletos=round(id_to_delkazarok($cid,$rok,7,8)/(60*60*24*30.42)); |
518 | | | |
519 | | | $castka = ( 50 * $delkapripojeniletos - 25 * $delkanapajeniletos - 50 * $delkanapajenirouteruletos + 50 * $delkakonektivityletos); |
520 | | | $castkacelkem=$castkacelkem+$castka; |
521 | | | |
522 | | | |
523 | | | tisk_radku($barva,$cid,$lastcid,$jmeno,$prijmeni,$icons,$mindatum,$delkapripojeniletos,$delkanapajeniletos,$delkanapajenirouteruletos,$delkakonektivityletos,$castka,$varsymb,$platby,$prenos,$mail); |
524 | | | |
525 | | | $mindatum="2008-12-31"; |
526 | | | $ipecka=""; |
527 | | | $platby=""; |
528 | | | $soucetplateb=0; |
529 | | | $lastcid = $vysledek["cid"]; |
530 | | | } |
531 | | | #vytvari se a ukladaji promenne pro clena - muze byt i z vice radku |
532 | | | $icons=""; |
533 | | | if($show=="all" && $vysledek["active"]==2) $icons=$icons.'<img title="Čekatel" src="images/actv.gif"> '; |
534 | | | if($show=="all" && $vysledek["active"]==1) $icons=$icons.'<img title="Člen" src="images/actv.gif"> '; |
535 | | | if($show=="all" && $vysledek["active"]==0) $icons=$icons.'<img title="Pasivní" src="images/passv.gif"> '; |
536 | | | if($vysledek["finance"]==1) $icons=$icons.'<img title="Finance" src="images/dolar.gif"> '; |
537 | | | if($vysledek["internet"]==1) $icons=$icons.'<img title="Internet" src="images/net.gif"> '; |
538 | | | if($vysledek["energy"]==1) $icons=$icons.'<img title="Elektřina sleva" src="images/energysleva.gif"> '; |
539 | | | if($vysledek["energy"]==2) $icons=$icons.'<img title="Elektřina" src="images/energy.gif"> '; |
540 | | | |
541 | | | $cid = $vysledek["cid"]; |
542 | | | $jmeno = $vysledek["jmeno"]; |
543 | | | $prijmeni = $vysledek["prijmeni"]; |
544 | | | #pokud je nove datum pripojeni nejakeho IP starsi tak ho vezmem jako nove minimum |
545 | | | |
546 | | | if ($vysledek["datum"]) if ( strtotime($mindatum) > strtotime($vysledek["datum"])) $mindatum = $vysledek["datum"]; |
547 | | | $energy = $vysledek["energy"]; |
548 | | | $internet = $vysledek["internet"]; |
549 | | | $ipecka = $ipecka." ".$vysledek["ip"]; |
550 | | | $varsymb = $vysledek["vs"]; |
551 | | | # $platby = $vysledek["hodnota"]; |
552 | | | if ( $vysledek["fid"] ) { |
553 | | | $platby = $platby.":".$vysledek["fid"]." ".$vysledek["hodnota"]; |
554 | | | $soucetplateb = 1; |
555 | | | } |
556 | | | $mail=$vysledek["email"]; |
557 | | | } # while |
558 | | | |
559 | | | |
560 | | | ############################################################ |
561 | | | #rozdeli hodnoty pole podle mezery na klic a hodnotu |
562 | | | #v hodnote jsou dve cisla a prvni je brano jako klic a druhe jako hodnota pod timto klicem |
563 | | | #zaroven to odstrani i duplikatni hodnoty |
564 | | | function unikatni_dvojice($array) { |
565 | | | $result = array(); |
566 | | | foreach ($array as $tvalue) { |
567 | | | $polozky = explode(" ", $tvalue); |
568 | | | $result[$polozky[0]] = $polozky[1]; |
569 | | | } |
570 | | | return $result; |
571 | | | } |
572 | | | |
573 | | | ############################################################ |
574 | | | function tiskni_platby($platby) { |
575 | | | #rozdeleni jednotlivych plateb do pole |
576 | | | $jednotlive = explode (":",$platby); |
577 | | | #odstraneni prvniho pole ktere obsahuje nesmysly |
578 | | | $prvni=array_shift($jednotlive); |
579 | | | #setrideni a vyhazeni unikatnich |
580 | | | $jednotlive=unikatni_dvojice($jednotlive); |
581 | | | $pocetplateb = count($jednotlive); |
582 | | | $soucet=0; |
583 | | | $platby_tisk=""; |
584 | | | foreach (array_keys($jednotlive) as $key) |
585 | | | { |
586 | | | $platba="<a class=\"odkaz\" target=\"_self\" href=\"edit_platba.php?id=$key\">$jednotlive[$key]</a> "; |
587 | | | $platby_tisk=$platby_tisk."".$platba; |
588 | | | #desetinne carky se prevedou na tecky |
589 | | | $soucet=$soucet+str_replace(",",".",$jednotlive[$key]); |
590 | | | } |
591 | | | global $vybranocelkem; |
592 | | | $vybranocelkem=$vybranocelkem+$soucet; |
593 | | | unset($vybranocelkem); |
594 | | | global $vybrano; |
595 | | | $vybrano=$soucet; |
596 | | | unset($vybrano); |
597 | | | if ($pocetplateb) { |
598 | | | return str_replace(" konec","",$platby_tisk."konec") ; |
599 | | | } else { |
600 | | | return "" ; |
601 | | | } |
602 | | | } |
603 | | | |
604 | | | ############################################################ |
605 | | | function tisk_radku($barva,$cid,$lastcid,$jmeno,$prijmeni,$icons,$mindatum,$delkaletos,$delkanapajeniletos,$delkanapajenirouteruletos,$delkakonektivityletos,$castka,$varsymb,$platby,$prenos,$mail) { |
606 | | | global $vybranocelkem; |
607 | | | global $vybrano; |
608 | | | $dot="lan.bmp"; |
609 | | | $alt="Přehled"; |
610 | | | echo ' |
611 | | | <tr> |
612 | | | <td bgcolor='.$barva.' class=text> |
613 | | | <a class="odkaz" target="_self" href="clen.php?clen='.$lastcid.'"> |
614 | | | <img src="images/'.$dot.'" title="'.$alt.'" border=0></a> |
615 | | | <a class="odkaz" target="_self" href="edit_user.php?id='.$cid.'">'.$lastcid.'</a></td> |
616 | | | <td bgcolor='.$barva.' class="text">'.$jmeno.'</td> |
617 | | | <td bgcolor='.$barva.' class="text">'.$prijmeni.'</td> |
618 | | | <td bgcolor='.$barva.' class="text">'.$icons.'</td> |
619 | | | |
620 | | | <td bgcolor='.$barva.' class="text"> |
621 | | | '; |
622 | | | $from="info@jablonka.cz"; |
623 | | | $subject = "Členství v o.s. jablonka.cz"; |
624 | | | $text = "Zdravím, |
625 | | | dík |
626 | | | Síma |
627 | | | \n"; |
628 | | | |
629 | | | $text = str_replace(" ","%20",$text); |
630 | | | $text = str_replace("\n","%0d",$text); |
631 | | | if ( @$mail ) { |
632 | | | echo ' |
633 | | | <INPUT type="checkbox" name="to'.$cid.'" value="'.$mail.'"> |
634 | | | <a href="mail.php?to='.$mail.'&subj='.$subject.'&from='.$from.'&text='.$text.'">int</a> |
635 | | | <a href="mailto:'.$mail.'?subject='.$subject.'&body='.$text.'">ext</a> '.$mail.' |
636 | | | '; |
637 | | | } |
638 | | | echo ' |
639 | | | </td> |
640 | | | |
641 | | | <td bgcolor='.$barva.' class="text">'.sql2datum($mindatum).'</td> |
642 | | | <td bgcolor='.$barva.' class="text">'.$delkaletos.'</td> |
643 | | | <td bgcolor='.$barva.' class="text">'.$delkakonektivityletos.'</td> |
644 | | | <td bgcolor='.$barva.' class="text">'.$delkanapajeniletos.'</td> |
645 | | | <td bgcolor='.$barva.' class="text">'.$delkanapajenirouteruletos.'</td> |
646 | | | <td bgcolor='.$barva.' class="text">'.$castka.'</td> |
647 | | | <td bgcolor='.$barva.' class="text">'.$varsymb.' |
648 | | | '; |
649 | | | echo ' |
650 | | | |
651 | | | </td> |
652 | | | <td bgcolor='.$barva.' class="text"> |
653 | | | <a class="odkaz" target="_self" href="add_platba.php?clen='.$cid.'&platba=2">+</a> '.tiskni_platby($platby).' |
654 | | | </td> |
655 | | | <td bgcolor='.$barva.' class="text">'.$vybrano.'</td> |
656 | | | <td bgcolor='.$barva.' class="text">'.$prenos.'</td> |
657 | | | <td bgcolor='.$barva.' class="text">'.($vybrano+str_replace(",",".",$prenos)-$castka).' |
658 | | | '; |
659 | | | |
660 | | | $from="info@jablonka.cz"; |
661 | | | $subject = "Výzva k zaplacení členských příspěvků jablonka.cz : $jmeno $prijmeni"; |
662 | | | $text = "Dobrý den, |
663 | | | v tomto mailu Vám posíláme informace o stavu Vašich členských příspěvků pro tento rok. |
664 | | | \n"; |
665 | | | $text .= "Jméno člena : $jmeno $prijmeni\n"; |
666 | | | $text .= "Číslo konta : 2118436001/5500\n"; |
667 | | | $text .= "Zbývá zaplatit : ".(-1*($vybrano+str_replace(",",".",$prenos)-$castka))."Kč\n"; |
668 | | | $text .= "Var.Symbol : ".$varsymb."\n\n"; |
669 | | | |
670 | | | $text .= "Pro minimalizaci bankovních poplatků plaťte větší částky najednou - tedy alespoň 300Kč čtvrtletně. |
671 | | | |
672 | | | Plaťte prosím na začátku daného období vždy do 15. dne v prvním měsíci každého čtvrtletí, |
673 | | | ale nejlépe bude pokud zaplatíte jednou jedinou platbou až do konce roku. |
674 | | | |
675 | | | Neplaťte prosím v tomto roce více než je třeba, protože přeplatek nám přidělává práci v účetnictví. |
676 | | | Nezapomínejte prosím vyplnit variabilní symbol. |
677 | | | Neposílejte peníze přes českou poštu, protože odstraňují variabilní symbol a přidělává nám to práci. |
678 | | | |
679 | | | hezký den |
680 | | | www.jablonka.cz |
681 | | | "; |
682 | | | |
683 | | | $text = str_replace(" ","%20",$text); |
684 | | | $text = str_replace("\n","%0d",$text); |
685 | | | $celkemjeden=(-1*($vybrano+str_replace(",",".",$prenos)-$castka)); |
686 | | | $aktualnidatum=date("Y-m-d"); |
687 | | | #tohle spocita pocet mesicu ktere v tomto roce nemusi byt jeste zaplaceny |
688 | | | #je to pouzito k rozliseni kdo tech kteri maji zaplaceno alespon tri mesice dopredu |
689 | | | $budoucimesice = round((strtotime("2008-12-31")-strtotime($aktualnidatum))/(60*60*24*30.42)); |
690 | | | #odpocet se stanovi tak aby lidi meli dopredu placeno aspon 300Kc |
691 | | | $odpocet=$budoucimesice*100-300; |
692 | | | echo ' |
693 | | | <a href="mail.php?to='.$mail.'&subj='.$subject.'&from='.$from.'&text='.$text.'">int</a> |
694 | | | <a href="mailto:'.$mail.'?subject='.$subject.'&body='.$text.'">ext </a> |
695 | | | </td> |
696 | | | </tr> |
697 | | | '; |
698 | | | unset($vybranocelkem); |
699 | | | unset($vybrano); |
700 | | | } |
701 | | | ############################################################ |
702 | | | |
703 | | | #dotisk posledniho radku |
704 | | | $celkem++; |
705 | | | if($color==0) { $color=1; $barva="#E6E4E4"; } else { $color=0; $barva="#FFFFFF"; } |
706 | | | |
707 | | | $delkaletos = round((strtotime("2008-12-31")-strtotime($mindatum))/(60*60*24*30.42)); |
708 | | | if($delkaletos>12) $delkaletos=12; |
709 | | | $prenos=id_to_prenos($cid,$rok); |
710 | | | $delkapripojeniletos=round(id_to_delkazarok($cid,$rok,22,23)/(60*60*24*30.42)); |
711 | | | $delkanapajeniletos=round(id_to_delkazarok($cid,$rok,5,6)/(60*60*24*30.42)); |
712 | | | $delkanapajenirouteruletos=round(id_to_delkazarok($cid,$rok,24,25)/(60*60*24*30.42)); |
713 | | | $delkakonektivityletos=round(id_to_delkazarok($cid,$rok,7,8)/(60*60*24*30.42)); |
714 | | | |
715 | | | $castka = ( 50 * $delkapripojeniletos - 25 * $delkanapajeniletos - 50 * $delkanapajenirouteruletos + 50 * $delkakonektivityletos); |
716 | | | $castkacelkem=$castkacelkem+$castka; |
717 | | | |
718 | | | tisk_radku($barva,$cid,$lastcid,$jmeno,$prijmeni,$icons,$mindatum,$delkapripojeniletos,$delkanapajeniletos,$delkanapajenirouteruletos,$delkakonektivityletos,$castka,$varsymb,$platby,$prenos,$mail); |
719 | | | |
720 | | | #konec dotisku posledniho radku |
721 | | | |
722 | | | echo ' |
723 | | | </table></tr></td></table></center> |
724 | | | </form> |
725 | | | <br> |
726 | | | Celkem zobrazeno '.$celkem.' záznamů. Celková částka je '.$castkacelkem.'Kč a zatím se vybralo '.$vybranocelkem.'Kč |
727 | | | '; |
728 | | | |
729 | | | ################################################################################################################ |
730 | | | ### Adresy |
731 | | | ################################################################################################################ |
732 | | | |
733 | | | echo ' |
734 | | | <br> |
735 | | | <br> |
736 | | | <center>'; |
737 | | | $celkem=0; |
738 | | | |
739 | | | if(@$clen==0 || @$clen) { |
740 | | | $condition = " AND c.id=$clen"; |
741 | | | } else { |
742 | | | $condition = ""; |
743 | | | } |
744 | | | |
745 | | | if(!$order) $order="prijmeni"; |
746 | | | $where="WHERE active IN (0,1) $condition"; |
747 | | | echo '<b>Seznam Adres a IP adres uživatele: '.id_to_name($clen).'</b> '; |
748 | | | |
749 | | | $string=MySQL_Query("SELECT c.id as cid, c.*, a.id as aid, a.*, i.id as iid, i.* |
750 | | | FROM (cleni c LEFT JOIN adresy a ON c.id = a.clen) |
751 | | | LEFT JOIN ipecka i ON c.id = i.clen AND a.id = i.adresa $where ORDER BY $order"); |
752 | | | |
753 | | | |
754 | | | echo ' |
755 | | | |
756 | | | <table width=100% cellspacing=1> |
757 | | | <tr> |
758 | | | <td bgcolor=#73BE1E> |
759 | | | <table cellspacing=0 cellpadding=0 width=100%> |
760 | | | <tr> |
761 | | | <td bgcolor=#FFFFFF> </td> |
762 | | | <td bgcolor=#FFFFFF class=text> |
763 | | | <a title="seřadit podle ID" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=cid">ID</a> |
764 | | | </td> |
765 | | | <td bgcolor=#FFFFFF class=text> |
766 | | | <a title="seřadit podle jména" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=jmeno">Jméno</a> |
767 | | | </td> |
768 | | | <td bgcolor=#FFFFFF class=text> |
769 | | | <a title="seřadit podle příjmení" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=prijmeni">Příjmení:</a> |
770 | | | </td> |
771 | | | <td bgcolor=#FFFFFF class=text width=80> |
772 | | | <a title="seřadit podle přezdívky" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=prezdivka,prijmeni">Přezdívka:</a> |
773 | | | </td> |
774 | | | <td bgcolor=#FFFFFF class=text width=80> |
775 | | | <a title="seřadit podle Emailu" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=email">Email:</a> |
776 | | | </td> |
777 | | | <td bgcolor=#FFFFFF class=text width=80> |
778 | | | <a title="seřadit podle aktivity" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=active">A</a> |
779 | | | <a title="seřadit podle financí" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=finance">F</a> |
780 | | | <a title="seřadit podle internetu" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=internet">I</a> |
781 | | | <a title="seřadit podle elektřiny" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=energy">E</a> |
782 | | | </td> |
783 | | | <td bgcolor=#FFFFFF class=text> |
784 | | | <a title="seřadit podle typu připojení" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=domu">Domů</a> |
785 | | | </td> |
786 | | | <td bgcolor=#FFFFFF class=text> |
787 | | | <a title="seřadit podle přezdívky" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=mobil">Mobil</a> |
788 | | | </td> |
789 | | | <td bgcolor=#FFFFFF class=text> |
790 | | | <a title="seřadit podle IP" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=ip">IP</a> |
791 | | | </td> |
792 | | | <td bgcolor=#FFFFFF class=text> |
793 | | | <a title="seřadit podle ICQ" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=ulice,cp,byt">Ulice</a> |
794 | | | </td> |
795 | | | <td bgcolor=#FFFFFF class=text> |
796 | | | <a title="seřadit podle ICQ" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=cp,ulice,byt">č.p.</a> |
797 | | | </td> |
798 | | | <td bgcolor=#FFFFFF class=text> |
799 | | | <a title="seřadit podle ICQ" class=odkaz href="clen.php?clen='.$clen.'&show='.$show.'&order=byt,cp,ulice">Byt</a> |
800 | | | </td> |
801 | | | </tr> |
802 | | | '; |
803 | | | |
804 | | | $color=1; |
805 | | | |
806 | | | while($vysledek=MySQL_Fetch_Array($string)) |
807 | | | { |
808 | | | $celkem++; |
809 | | | if($color==0) |
810 | | | { |
811 | | | $color=1; |
812 | | | $barva="#E6E4E4"; |
813 | | | } |
814 | | | else |
815 | | | { |
816 | | | $color=0; |
817 | | | $barva="#FFFFFF"; |
818 | | | } |
819 | | | if($vysledek["id"]<1000) |
820 | | | { |
821 | | | $dot="lan.bmp"; |
822 | | | $alt="LAN Jablonka"; |
823 | | | } |
824 | | | else |
825 | | | { |
826 | | | if($vysledek["id"]==1000) |
827 | | | { |
828 | | | $dot="apy.bmp"; |
829 | | | $alt="AP Yenik"; |
830 | | | } |
831 | | | if($vysledek["id"]==1001) |
832 | | | { |
833 | | | $dot="apj.bmp"; |
834 | | | $alt="AP Jablonecká"; |
835 | | | } |
836 | | | } |
837 | | | |
838 | | | $icons=""; |
839 | | | if($show=="all" && $vysledek["active"]==2) $icons=$icons.'<img title="Čekatel" src="images/actv.gif"> '; |
840 | | | if($show=="all" && $vysledek["active"]==1) $icons=$icons.'<img title="Člen" src="images/actv.gif"> '; |
841 | | | if($show=="all" && $vysledek["active"]==0) $icons=$icons.'<img title="Pasivní" src="images/passv.gif"> '; |
842 | | | if($vysledek["finance"]==1) $icons=$icons.'<img title="Finance" src="images/dolar.gif"> '; |
843 | | | if($vysledek["internet"]==1) $icons=$icons.'<img title="Internet" src="images/net.gif"> '; |
844 | | | if($vysledek["energy"]==1) $icons=$icons.'<img title="Elektřina sleva" src="images/energysleva.gif"> '; |
845 | | | if($vysledek["energy"]==2) $icons=$icons.'<img title="Elektřina" src="images/energy.gif"> '; |
846 | | | $gwcimg='http://81.0.245.33/hotsanic/networks/int'.$vysledek["ip"].'-week.png'; |
847 | | | $gwcurl='http://81.0.245.33/hotsanic/networks/int'.$vysledek["ip"].'.html'; |
848 | | | $gwuimg='http://62.24.71.157/hotsanic/networks/int'.$vysledek["ip"].'-week.png'; |
849 | | | $gwuurl='http://62.24.71.157/hotsanic/networks/int'.$vysledek["ip"].'.html'; |
850 | | | |
851 | | | list($ipa,$ipb,$ipc,$ipd)=explode('.',$vysledek["ip"]); |
852 | | | $gwrrd=$ipa.'.'.$ipb.'.0.'.$ipc; |
853 | | | $gwrimg='http://'.$ipa.'.'.$ipb.'.0.'.$ipc.'/hotsanic/networks/int'.$vysledek["ip"].'-week.png'; |
854 | | | $gwrurl='http://'.$ipa.'.'.$ipb.'.0.'.$ipc.'/hotsanic/networks/int'.$vysledek["ip"].'.html'; |
855 | | | |
856 | | | $adresa_pro_mapu=iconv("ISO-8859-2", "UTF-8", $vysledek["ulice"]); |
857 | | | $adresa_pro_mapu=urlencode( $adresa_pro_mapu); |
858 | | | |
859 | | | echo ' |
860 | | | <tr> |
861 | | | <td bgcolor='.$barva.' class=text> <img src="images/'.$dot.'" title="'.$alt.'"></td> |
862 | | | <td bgcolor='.$barva.' class="text"><a class="odkaz" target="_self" href="edit_user.php?id='.$vysledek["cid"].'">'.$vysledek["cid"].'</a></td> |
863 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["jmeno"].'</td> |
864 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["prijmeni"].'</td> |
865 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["prezdivka"].'</td> |
866 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["email"].'</td> |
867 | | | <td bgcolor='.$barva.' class="text">'.$icons.'</td> |
868 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["domu"].'</td> |
869 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["mobil"].'</td> |
870 | | | <td bgcolor='.$barva.' class="text"> |
871 | | | <a class="odkaz" target="_self" href="add_ip.php?clen='.$vysledek["cid"].'&adresa='.$vysledek["aid"].'">+</a> |
872 | | | <a class="odkaz" target="_self" href="edit_ip.php?id='.$vysledek["iid"].'">'.$vysledek["ip"].'</a> |
873 | | | </td> |
874 | | | <td bgcolor='.$barva.' class="text"> |
875 | | | <a class="odkaz" target="_self" href="add_adres.php?clen='.$vysledek["cid"].'">+</a> |
876 | | | <a class="odkaz" target="_top" href="http://www.mapy.cz/?query='.$adresa_pro_mapu.'%20'.$vysledek["cp"].',%20Praha">M</a> |
877 | | | <a class="odkaz" target="_self" href="edit_adres.php?id='.$vysledek["aid"].'">'.$vysledek["ulice"].'</a></td> |
878 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["cp"].'</td> |
879 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["byt"].'</td> |
880 | | | </tr> |
881 | | | <tr> |
882 | | | <td bgcolor='.$barva.' colspan=5 align=center class=text> |
883 | | | <a href="'.$gwcurl.'"><img src="'.$gwcimg.'" width=250 height=60></a> |
884 | | | <br> |
885 | | | '; |
886 | | | $gwctrn=getweb('http://10.33.0.25/cgi-bin/rrdfetch.pl?'.$vysledek["ip"].'&week&0'); |
887 | | | $gwctrn=preg_replace('/\s+/', ' ', $gwctrn); |
888 | | | $gwctrn=preg_replace('/^\s+/', '', $gwctrn); |
889 | | | list($gwcin,$gwcout)=explode(' ',$gwctrn); |
890 | | | $gwcin = round($gwcin / 104857.6)/10 ; |
891 | | | $gwcout = round($gwcout / 104857.6)/10 ; |
892 | | | echo "Casa ".$gwcin."MiB ".$gwcout."MiB"; |
893 | | | echo ' |
894 | | | </td> |
895 | | | <td bgcolor='.$barva.' colspan=4 align=center class=text> |
896 | | | <a href="'.$gwuurl.'"><img src="'.$gwuimg.'" width=250 height=60></a> |
897 | | | <br> |
898 | | | '; |
899 | | | $gwutrn=getweb('http://10.33.0.30/cgi-bin/rrdfetch.pl?'.$vysledek["ip"].'&week&0'); |
900 | | | $gwutrn=preg_replace('/\s+/', ' ', $gwutrn); |
901 | | | $gwutrn=preg_replace('/^\s+/', '', $gwutrn); |
902 | | | list($gwuin,$gwuout)=explode(' ',$gwutrn); |
903 | | | $gwuin = round($gwuin / 104857.6)/10 ; |
904 | | | $gwuout = round($gwuout / 104857.6)/10 ; |
905 | | | echo "UPC ".$gwuin."MiB ".$gwuout."MiB"; |
906 | | | echo ' |
907 | | | </td> |
908 | | | |
909 | | | <td bgcolor='.$barva.' colspan=4 align=center class=text> |
910 | | | <a href="'.$gwrurl.'"><img src="'.$gwrimg.'" width=250 height=60></a> |
911 | | | <br> |
912 | | | '; |
913 | | | $gwrtrn=getweb('http://'.$gwrrd.'/cgi-bin/rrdfetch.pl?'.$vysledek["ip"].'&week&0'); |
914 | | | $gwrtrn=preg_replace('/\s+/', ' ', $gwrtrn); |
915 | | | $gwrtrn=preg_replace('/^\s+/', '', $gwrtrn); |
916 | | | list($gwrin,$gwrout)=explode(' ',$gwrtrn); |
917 | | | $gwrin = round($gwrin / 104857.6)/10 ; |
918 | | | $gwrout = round($gwrout / 104857.6)/10 ; |
919 | | | echo "Router ".$gwrin."MiB ".$gwrout."MiB"; |
920 | | | echo ' |
921 | | | </td> |
922 | | | </tr> |
923 | | | '; |
924 | | | Next($vysledek); |
925 | | | } |
926 | | | |
927 | | | echo ' |
928 | | | </table></tr></td></table></center> |
929 | | | <br> |
930 | | | Celkem zobrazeno '.$celkem.' záznamů. |
931 | | | '; |
932 | | | |
933 | | | |
934 | | | |
935 | | | ?> |
936 | | | </body> |
937 | | | </html> |