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 - Úkony</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="uk.datum"; |
24 | | | if(!@$udalost) $udalost="vsechno"; |
25 | | | if(!@$rok) $rok="vsechno"; |
26 | | | |
27 | | | #vybrani default trideni |
28 | | | if($udalost=="vsechno") { |
29 | | | $condition = ""; |
30 | | | } else { |
31 | | | $condition = "AND uk.udalost=$udalost"; |
32 | | | } |
33 | | | |
34 | | | if($rok=="vsechno") { |
35 | | | $condition .= ""; |
36 | | | } else { |
37 | | | $condition .= " AND YEAR(uk.datum)=$rok"; |
38 | | | } |
39 | | | |
40 | | | |
41 | | | if($show!="all") |
42 | | | { |
43 | | | echo '<b>Seznam úkonů aktivních uživatelů:</b> <a href="ukony.php?show=all&udalost='.$udalost.'&rok='.$rok.'&order='.$order.'" class=odkaz>zobrazit vše</a>'; |
44 | | | $where="WHERE active IN (1) $condition "; |
45 | | | } |
46 | | | else |
47 | | | { |
48 | | | echo '<b>Seznam úkonů všech uživatelů:</b> <a href="ukony.php?show=active&udalost='.$udalost.'&rok='.$rok.'&order='.$order.'" class=odkaz>zobrazit pouze aktivní</a>'; |
49 | | | $where="WHERE active IN (0,1) $condition "; |
50 | | | } |
51 | | | |
52 | | | echo "<br>"; |
53 | | | #tisk datumu plateb |
54 | | | echo "Rok : "; |
55 | | | $dotaz=MySQL_Query("SELECT DISTINCT YEAR(datum) from finance ORDER BY datum"); |
56 | | | $count=MySQL_Num_Rows($dotaz); |
57 | | | $count++; |
58 | | | for ($i=1;$i<$count;$i++) |
59 | | | { |
60 | | | $radek=MySQL_Fetch_Array($dotaz); |
61 | | | echo "<a href=\"ukony.php?show=$show&udalost=$udalost&rok=".$radek["YEAR(datum)"]."&order=$order\">".$radek["YEAR(datum)"].'</a> * '; |
62 | | | echo ' |
63 | | | '; |
64 | | | } |
65 | | | #dotisk posledni volby pro vsechny roky |
66 | | | echo "<a href=\"ukony.php?show=$show&udalost=$udalost&rok=vsechno&order=$order\">všechno</a>"; |
67 | | | echo ' |
68 | | | '; |
69 | | | |
70 | | | echo "<br>"; |
71 | | | #tisk vsech moznosti udalosti |
72 | | | echo "Události : "; |
73 | | | $dotaz=MySQL_Query("SELECT * from udalosti ORDER BY id"); |
74 | | | $count=MySQL_Num_Rows($dotaz); |
75 | | | $count++; |
76 | | | for ($i=1;$i<$count;$i++) |
77 | | | { |
78 | | | $radek=MySQL_Fetch_Array($dotaz); |
79 | | | echo "<a href=\"ukony.php?show=$show&rok=$rok&udalost=".$radek["id"]."&order=$order\">".$radek["nazev"].'</a> * '; |
80 | | | echo ' |
81 | | | '; |
82 | | | } |
83 | | | #dotisk posledni volby pro vsechny udalosti |
84 | | | echo "<a href=\"ukony.php?show=$show&rok=$rok&udalost=vsechno&order=$order\">všechno</a><br><br>"; |
85 | | | echo ' |
86 | | | '; |
87 | | | |
88 | | | |
89 | | | #finalni dotaz |
90 | | | $string=MySQL_Query("SELECT c.id as cid, c.*, uk.id as ukid, uk.adresa as ukadresa, uk.finance as ukfinance, uk.*, u.id as uid, u.*, i.id as iid, i.* |
91 | | | FROM ((cleni c LEFT JOIN ukony uk ON c.id = uk.clen) |
92 | | | LEFT JOIN udalosti u ON uk.udalost = u.id) |
93 | | | LEFT JOIN ipecka i ON uk.predmet = i.id AND uk.udalost IN (7,8) $where ORDER BY $order"); |
94 | | | |
95 | | | echo ' |
96 | | | <form name="emaily" action="mail_multi.php" method="POST"> |
97 | | | <input class=field type="submit" name="OK" value=" pošli mail "> |
98 | | | <a href="#" onclick="i=0;while ((document.forms[0][i] != null )) {document.forms[0][i].checked = true;i+=1;};">Vybrat vše</a> |
99 | | | <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> |
100 | | | |
101 | | | |
102 | | | <table width=100% cellspacing=1> |
103 | | | <tr> |
104 | | | <td bgcolor=#73BE1E> |
105 | | | <table cellspacing=0 cellpadding=0 width=100%> |
106 | | | <tr> |
107 | | | <td bgcolor=#FFFFFF> </td> |
108 | | | <td bgcolor=#FFFFFF class=text> |
109 | | | <a title="seřadit podle ID" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=cid">ID</a> |
110 | | | </td> |
111 | | | <td bgcolor=#FFFFFF class=text> |
112 | | | <a title="seřadit podle jména" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=jmeno">Jméno</a> |
113 | | | </td> |
114 | | | <td bgcolor=#FFFFFF class=text> |
115 | | | <a title="seřadit podle příjmení" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=prijmeni">Příjmení:</a> |
116 | | | </td> |
117 | | | <td bgcolor=#FFFFFF class=text width=80> |
118 | | | <a title="seřadit podle přezdívky" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=prezdivka,prijmeni">Přezdívka:</a> |
119 | | | </td> |
120 | | | <td bgcolor=#FFFFFF class=text width=80> |
121 | | | <a title="seřadit podle Emailu" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=email">Email:</a> |
122 | | | </td> |
123 | | | <td bgcolor=#FFFFFF class=text width=80> |
124 | | | <a title="seřadit podle aktivity" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=active">A</a> |
125 | | | <a title="seřadit podle financí" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=finance">F</a> |
126 | | | <a title="seřadit podle internetu" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=internet">I</a> |
127 | | | <a title="seřadit podle elektřiny" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=energy">E</a> |
128 | | | </td> |
129 | | | <td bgcolor=#FFFFFF class=text> |
130 | | | <a title="seřadit podle typu připojení" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=domu">Domů</a> |
131 | | | </td> |
132 | | | <td bgcolor=#FFFFFF class=text> |
133 | | | <a title="seřadit podle přezdívky" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=mobil">Mobil</a> |
134 | | | </td> |
135 | | | <td bgcolor=#FFFFFF class=text> |
136 | | | <a title="seřadit podle data" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=datum">Datum</a> |
137 | | | </td> |
138 | | | <td bgcolor=#FFFFFF class=text> |
139 | | | <a title="seřadit podle událostí" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=udalost">Událost</a> |
140 | | | </td> |
141 | | | <td bgcolor=#FFFFFF class=text> |
142 | | | <a title="seřadit podle předmětů" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=uk.predmet">Předmět</a> |
143 | | | </td> |
144 | | | <td bgcolor=#FFFFFF class=text> |
145 | | | <a title="seřadit podle adres" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=uk.adresa">Adresa</a> |
146 | | | </td> |
147 | | | <td bgcolor=#FFFFFF class=text> |
148 | | | <a title="seřadit podle financí" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=uk.finance">Finance</a> |
149 | | | </td> |
150 | | | <td bgcolor=#FFFFFF class=text> |
151 | | | <a title="seřadit podle majetku" class=odkaz href="ukony.php?show='.$show.'&udalost='.$udalost.'&rok='.$rok.'&order=uk.majetek">Majetek</a> |
152 | | | </td> |
153 | | | </tr> |
154 | | | '; |
155 | | | |
156 | | | $color=1; |
157 | | | $celkem=0; |
158 | | | while($vysledek=MySQL_Fetch_Array($string)) |
159 | | | { |
160 | | | $celkem++; |
161 | | | if($color==0) |
162 | | | { |
163 | | | $color=1; |
164 | | | $barva="#E6E4E4"; |
165 | | | } |
166 | | | else |
167 | | | { |
168 | | | $color=0; |
169 | | | $barva="#FFFFFF"; |
170 | | | } |
171 | | | if($vysledek["id"]<1000) |
172 | | | { |
173 | | | $dot="lan.bmp"; |
174 | | | $alt="LAN Jablonka"; |
175 | | | } |
176 | | | else |
177 | | | { |
178 | | | if($vysledek["id"]==1000) |
179 | | | { |
180 | | | $dot="apy.bmp"; |
181 | | | $alt="AP Yenik"; |
182 | | | } |
183 | | | if($vysledek["id"]==1001) |
184 | | | { |
185 | | | $dot="apj.bmp"; |
186 | | | $alt="AP Jablonecká"; |
187 | | | } |
188 | | | } |
189 | | | |
190 | | | $icons=""; |
191 | | | if($show=="all" && $vysledek["active"]==2) $icons=$icons.'<img title="Čekatel" src="images/actv.gif"> '; |
192 | | | if($show=="all" && $vysledek["active"]==1) $icons=$icons.'<img title="Člen" src="images/actv.gif"> '; |
193 | | | if($show=="all" && $vysledek["active"]==0) $icons=$icons.'<img title="Pasivní" src="images/passv.gif"> '; |
194 | | | if($vysledek["finance"]==1) $icons=$icons.'<img title="Finance" src="images/dolar.gif"> '; |
195 | | | if($vysledek["internet"]==1) $icons=$icons.'<img title="Internet" src="images/net.gif"> '; |
196 | | | if($vysledek["energy"]==1) $icons=$icons.'<img title="Elektřina sleva" src="images/energysleva.gif"> '; |
197 | | | if($vysledek["energy"]==2) $icons=$icons.'<img title="Elektřina" src="images/energy.gif"> '; |
198 | | | echo ' |
199 | | | <tr> |
200 | | | <td bgcolor='.$barva.' class=text> <a class="odkaz" |
201 | | | target="_self" href="clen.php?clen='.$vysledek["cid"].'"><img src="images/'.$dot.'" title="'.$alt.'" border=0></a> |
202 | | | </td> |
203 | | | <td bgcolor='.$barva.' class="text"><a class="odkaz" target="_self" href="edit_user.php?id='.$vysledek["cid"].'">'.$vysledek["cid"].'</a></td> |
204 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["jmeno"].'</td> |
205 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["prijmeni"].'</td> |
206 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["prezdivka"].'</td> |
207 | | | <td bgcolor='.$barva.' class="text"> |
208 | | | '; |
209 | | | $from="info@jablonka.cz"; |
210 | | | $subject = "jablonka.cz"; |
211 | | | $text = "Zdravím, |
212 | | | dík |
213 | | | Síma |
214 | | | \n"; |
215 | | | |
216 | | | $text = str_replace(" ","%20",$text); |
217 | | | $text = str_replace("\n","%0d",$text); |
218 | | | if ( $vysledek["email"] ) { |
219 | | | echo ' |
220 | | | <INPUT type="checkbox" name="to'.$vysledek["cid"].'" value="'.$vysledek["email"].'"> |
221 | | | <a href="mail.php?to='.$vysledek["email"].'&subj='.$subject.'&from='.$from.'&text='.$text.'">int</a> |
222 | | | <a href="mailto:'.$vysledek["email"].'?subject='.$subject.'&body='.$text.'">ext</a> '.$vysledek["email"].' |
223 | | | '; |
224 | | | } |
225 | | | $clen=$vysledek["cid"]; |
226 | | | $adresa=clen_to_adresa($clen); |
227 | | | $ipecko=clen_to_ipecko($clen); |
228 | | | $icq=$vysledek["icq"]; |
229 | | | echo ' |
230 | | | </td> |
231 | | | |
232 | | | <td bgcolor='.$barva.' class="text">'.$icons.'</td> |
233 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["domu"].'</td> |
234 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["mobil"].'</td> |
235 | | | <td bgcolor='.$barva.' class="text"> |
236 | | | <a class="odkaz" target="_self" href="add_ukon.php?clen='.$vysledek["cid"].'">+</a> |
237 | | | '; |
238 | | | if(!@$vysledek["datum"]) |
239 | | | { |
240 | | | $datum=""; |
241 | | | } else |
242 | | | { |
243 | | | $datum=sql2datum($vysledek["datum"]); |
244 | | | } |
245 | | | echo ' |
246 | | | <a class="odkaz" target="_self" href="edit_ukon.php?id='.$vysledek["ukid"].'">'.$datum.'</a> |
247 | | | </td> |
248 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["nazev"].'</td> |
249 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["ip"].'</td> |
250 | | | <td bgcolor='.$barva.' class="text">'.id_to_adresa($vysledek["ukadresa"]).'</td> |
251 | | | <td bgcolor='.$barva.' class="text">'.id_to_finance($vysledek["ukfinance"]).'</td> |
252 | | | <td bgcolor='.$barva.' class="text">'.id_to_majetek($vysledek["majetek"]).'</td> |
253 | | | </tr> |
254 | | | '; |
255 | | | Next($vysledek); |
256 | | | } |
257 | | | |
258 | | | echo ' |
259 | | | |
260 | | | </table></tr></td></table></center> |
261 | | | <br> |
262 | | | Celkem zobrazeno '.$celkem.' záznamů. |
263 | | | '; |
264 | | | ?> |
265 | | | </body> |
266 | | | </html> |