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 - Ulice </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 | | | echo ' |
20 | | | <center>'; |
21 | | | |
22 | | | if(!@$show) $show="all"; |
23 | | | if(!@$order) $order="ulice,cp,byt"; |
24 | | | if(!@$ulice) $ulice="vsechno"; |
25 | | | |
26 | | | #vybrani default trideni |
27 | | | if($ulice=="vsechno") { |
28 | | | $condition = ""; |
29 | | | } else { |
30 | | | $condition = "AND ulice IN (\"$ulice\")"; |
31 | | | } |
32 | | | |
33 | | | |
34 | | | if(!@$show) $show="all"; |
35 | | | if(!@$order) $order="prijmeni"; |
36 | | | if($show!="all") { |
37 | | | # $where="WHERE active BETWEEN 0 AND 1"; |
38 | | | $where="WHERE active IN (1) $condition"; |
39 | | | echo '<b>Seznam příspěvků aktivních uživatelů:</b> <a href="ulice.php?show=all&order='.$order.'&ulice='.$ulice.'" class=odkaz>zobrazit vše</a>'; |
40 | | | } else { |
41 | | | $where="WHERE active IN (0,1) $condition"; |
42 | | | echo '<b>Seznam příspěvků všech uživatelů:</b> <a href="ulice.php?show=active&order='.$order.'&ulice='.$ulice.'" class=odkaz>zobrazit pouze aktivní</a>'; |
43 | | | } |
44 | | | |
45 | | | echo "<br>"; |
46 | | | #tisk datumu plateb |
47 | | | echo "Ulice : "; |
48 | | | $dotaz=MySQL_Query("SELECT DISTINCT ulice from adresy ORDER BY ulice,cp,byt"); |
49 | | | $count=MySQL_Num_Rows($dotaz); |
50 | | | $count++; |
51 | | | for ($i=1;$i<$count;$i++) |
52 | | | { |
53 | | | $radek=MySQL_Fetch_Array($dotaz); |
54 | | | echo "<a href=\"ulice.php?show=$show&ulice=".$radek["ulice"]."&order=$order\">".$radek["ulice"].'</a> * '; |
55 | | | echo ' |
56 | | | '; |
57 | | | } |
58 | | | #dotisk posledni volby pro vsechny roky |
59 | | | echo "<a href=\"ulice.php?show=$show&ulice=vsechno&order=$order\">všechno</a>"; |
60 | | | echo ' |
61 | | | '; |
62 | | | |
63 | | | #finalni dotaz do databaze pred vypisem zvolene sestavy |
64 | | | $string=MySQL_Query("SELECT c.id as cid, c.*, a.id as aid, a.*, i.id as iid, i.* |
65 | | | FROM (adresy a LEFT JOIN cleni c ON a.clen = c.id) |
66 | | | LEFT JOIN ipecka i ON a.id = i.adresa AND c.id = a.clen |
67 | | | $where AND a.clen > 0 GROUP BY a.id |
68 | | | ORDER BY $order"); |
69 | | | |
70 | | | #$string=MySQL_Query("SELECT c.id as cid, c.*, a.id as aid, a.*, i.id as iid, i.* |
71 | | | # FROM (cleni c LEFT JOIN adresy a ON c.id = a.clen ) |
72 | | | # LEFT JOIN ipecka i ON c.id = i.clen AND a.id = i.adresa $where GROUP BY c.id ORDER BY $order" ); |
73 | | | |
74 | | | |
75 | | | |
76 | | | echo ' |
77 | | | |
78 | | | <table width=100% cellspacing=1> |
79 | | | <tr> |
80 | | | <td bgcolor=#73BE1E> |
81 | | | <table cellspacing=0 cellpadding=0 width=100%> |
82 | | | <tr> |
83 | | | <td bgcolor=#FFFFFF class=text width=80> |
84 | | | <a title="seřadit podle ulice" class=odkaz href="ulice.php?show='.$show.'&ulice='.$ulice.'&order=ulice,cp,byt">Ulice</a> |
85 | | | </td> |
86 | | | <td bgcolor=#FFFFFF class=text width=80> |
87 | | | <a title="seřadit podle č.p." class=odkaz href="ulice.php?show='.$show.'&ulice='.$ulice.'&order=cp">č.p.</a> |
88 | | | </td> |
89 | | | <td bgcolor=#FFFFFF class=text width=80> |
90 | | | <a title="seřadit podle bytů" class=odkaz href="ulice.php?show='.$show.'&ulice='.$ulice.'&order=byt">Byt</a> |
91 | | | </td> |
92 | | | <td bgcolor=#FFFFFF> </td> |
93 | | | <td bgcolor=#FFFFFF class=text> |
94 | | | <a title="seřadit podle ID" class=odkaz href="ulice.php?show='.$show.'&ulice='.$ulice.'&order=cid">ID</a> |
95 | | | </td> |
96 | | | <td bgcolor=#FFFFFF class=text> |
97 | | | <a title="seřadit podle jména" class=odkaz href="ulice.php?show='.$show.'&ulice='.$ulice.'&order=jmeno">Jméno</a> |
98 | | | </td> |
99 | | | <td bgcolor=#FFFFFF class=text> |
100 | | | <a title="seřadit podle příjmení" class=odkaz href="ulice.php?show='.$show.'&ulice='.$ulice.'&order=prijmeni">Příjmení:</a> |
101 | | | </td> |
102 | | | <td bgcolor=#FFFFFF class=text> |
103 | | | <a title="seřadit podle pokladny" class=odkaz href="ulice.php?show='.$show.'&ulice='.$ulice.'&order=ip">IP</a> |
104 | | | </td> |
105 | | | </tr> |
106 | | | '; |
107 | | | |
108 | | | ####################################################################################### |
109 | | | ####################################################################################### |
110 | | | |
111 | | | $color=1; |
112 | | | $celkem=0; |
113 | | | $castkacelkem=0; |
114 | | | $prijmy=0; |
115 | | | $vydaje=0; |
116 | | | |
117 | | | while($vysledek=MySQL_Fetch_Array($string)) |
118 | | | { |
119 | | | $celkem++; |
120 | | | if($color==0) |
121 | | | { |
122 | | | $color=1; |
123 | | | $barva="#E6E4E4"; |
124 | | | } |
125 | | | else |
126 | | | { |
127 | | | $color=0; |
128 | | | $barva="#FFFFFF"; |
129 | | | } |
130 | | | |
131 | | | if($vysledek["id"]<1000) |
132 | | | { |
133 | | | $dot="lan.bmp"; |
134 | | | $alt="LAN Jablonka"; |
135 | | | } |
136 | | | else |
137 | | | { |
138 | | | if($vysledek["id"]==1000) |
139 | | | { |
140 | | | $dot="apy.bmp"; |
141 | | | $alt="AP Yenik"; |
142 | | | } |
143 | | | if($vysledek["id"]==1001) |
144 | | | { |
145 | | | $dot="apj.bmp"; |
146 | | | $alt="AP Jablonecká"; |
147 | | | } |
148 | | | } |
149 | | | |
150 | | | $icons=""; |
151 | | | if($show=="all" && $vysledek["active"]==2) $icons=$icons.'<img title="Čekatel" src="images/actv.gif"> '; |
152 | | | if($show=="all" && $vysledek["active"]==1) $icons=$icons.'<img title="Člen" src="images/actv.gif"> '; |
153 | | | if($show=="all" && $vysledek["active"]==0) $icons=$icons.'<img title="Pasivní" src="images/passv.gif"> '; |
154 | | | if($vysledek["finance"]==1) $icons=$icons.'<img title="Finance" src="images/dolar.gif"> '; |
155 | | | if($vysledek["internet"]==1) $icons=$icons.'<img title="Internet" src="images/net.gif"> '; |
156 | | | if($vysledek["energy"]==1) $icons=$icons.'<img title="Elektřina sleva" src="images/energysleva.gif"> '; |
157 | | | if($vysledek["energy"]==2) $icons=$icons.'<img title="Elektřina" src="images/energy.gif"> '; |
158 | | | echo ' |
159 | | | <tr> |
160 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["ulice"].'</td> |
161 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["cp"].'</td> |
162 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["byt"].'</td> |
163 | | | <td bgcolor='.$barva.' class=text> <a class="odkaz" |
164 | | | target="_self" href="clen.php?clen='.$vysledek["cid"].'"><img src="images/'.$dot.'" title="'.$alt.'" border=0></a> |
165 | | | </td> |
166 | | | <td bgcolor='.$barva.' class="text"><a class="odkaz" target="_self" href="edit_user.php?id='.$vysledek["cid"].'">'.$vysledek["cid"].'</a></td> |
167 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["jmeno"].'</td> |
168 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["prijmeni"].'</td> |
169 | | | |
170 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["ip"].'</td> |
171 | | | </tr> |
172 | | | '; |
173 | | | |
174 | | | Next($vysledek); |
175 | | | } |
176 | | | |
177 | | | echo ' |
178 | | | </table></tr></td></table></center> |
179 | | | <br> |
180 | | | Celkem zobrazeno '.$celkem.' záznamů.<br> |
181 | | | '; |
182 | | | ?> |
183 | | | </body> |
184 | | | </html> |