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 - Přenosy 2007 2008</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 | | | #pomocne funkce |
20 | | | |
21 | | | echo ' |
22 | | | <center>'; |
23 | | | if(!@$show) $show="all"; |
24 | | | if(!@$order) $order="prijmeni"; |
25 | | | |
26 | | | $where="WHERE c.id>0"; |
27 | | | if($show!="all") |
28 | | | { |
29 | | | echo '<b>Seznam příspěvků aktivních uživatelů za rok 2007:</b> <a href="?show=all&order='.$order.'" class=odkaz>zobrazit vše</a>'; |
30 | | | if(!$order) { |
31 | | | $order="cid"; |
32 | | | } |
33 | | | $where="WHERE active=1 AND c.id>0"; |
34 | | | } |
35 | | | else |
36 | | | { |
37 | | | echo '<b>Seznam příspěvků všech uživatelů za rok 2007:</b> <a href="?show=active&order='.$order.'" class=odkaz>zobrazit pouze aktivní</a>'; |
38 | | | if(!$order) { |
39 | | | $order="cid"; |
40 | | | } |
41 | | | } |
42 | | | |
43 | | | #finalni dotaz |
44 | | | #$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.* |
45 | | | # FROM (((cleni c LEFT JOIN finance f ON c.id = f.clen AND f.platba = 2 AND YEAR(f.datum) = 2007 ) |
46 | | | # LEFT JOIN platby p ON f.platba = p.id) LEFT JOIN ukony u ON c.id = u.clen AND u.udalost = 7) |
47 | | | # LEFT JOIN ipecka i ON c.id = i.clen AND i.id = u.predmet $where ORDER BY $order"); |
48 | | | |
49 | | | $string=MySQL_Query("SELECT c.id as cid, c.*, f.id as fid, f.* |
50 | | | FROM (cleni c LEFT JOIN finance f ON c.id = f.clen AND (f.platba = 2 or f.platba=18) AND YEAR(f.datum) = 2007 ) |
51 | | | $where ORDER BY $order"); |
52 | | | |
53 | | | echo ' |
54 | | | |
55 | | | <form name="emaily" action="mail_multi.php" method="POST"> |
56 | | | <input class=field type="submit" name="OK" value=" pošli mail "> |
57 | | | <a href="#" onclick="i=0;while ((document.forms[0][i] != null )) {document.forms[0][i].checked = true;i+=1;};">Vybrat vše</a> |
58 | | | <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> |
59 | | | |
60 | | | <table width=100% cellspacing=1 border=1> |
61 | | | <tr> |
62 | | | <td bgcolor=#73BE1E> |
63 | | | <table cellspacing=1 cellpadding=1 width=100%> |
64 | | | <tr> |
65 | | | <td bgcolor=#FFFFFF class=text> |
66 | | | <a title="seřadit podle ID" class=odkaz href="?show='.$show.'&order=cid">ID</a> |
67 | | | </td> |
68 | | | <td bgcolor=#FFFFFF class=text> |
69 | | | <a title="seřadit podle jména" class=odkaz href="?show='.$show.'&order=jmeno,cid">Jméno</a> |
70 | | | </td> |
71 | | | <td bgcolor=#FFFFFF class=text> |
72 | | | <a title="seřadit podle příjmení" class=odkaz href="?show='.$show.'&order=prijmeni,cid">Příjmení</a> |
73 | | | </td> |
74 | | | <td bgcolor=#FFFFFF class=text width=80> |
75 | | | <a title="seřadit podle aktivity" class=odkaz href="?show='.$show.'&order=active,cid">A</a> |
76 | | | <a title="seřadit podle financí" class=odkaz href="?show='.$show.'&order=finance,cid">F</a> |
77 | | | <a title="seřadit podle internetu" class=odkaz href="?show='.$show.'&order=internet,cid">I</a> |
78 | | | <a title="seřadit podle elektřiny" class=odkaz href="?show='.$show.'&order=energy,cid">E</a> |
79 | | | </td> |
80 | | | <td bgcolor=#FFFFFF class=text width=80>email</td> |
81 | | | <td bgcolor=#FFFFFF class=text width=80>Připojen od</td> |
82 | | | <td bgcolor=#FFFFFF class=text width=80>Přip. (50)</td> |
83 | | | <td bgcolor=#FFFFFF class=text width=80>Inet (50)</td> |
84 | | | <td bgcolor=#FFFFFF class=text width=80>switch (-25)</td> |
85 | | | <td bgcolor=#FFFFFF class=text width=80>router (-50)</td> |
86 | | | <td bgcolor=#FFFFFF class=text width=80>Částka</td> |
87 | | | <td bgcolor=#FFFFFF class=text width=80>var.symb.</td> |
88 | | | <td bgcolor=#FFFFFF class=text width=80>IP</td> |
89 | | | <td bgcolor=#FFFFFF class=text>Přehled plateb</td> |
90 | | | <td bgcolor=#FFFFFF class=text>Součet plateb</td> |
91 | | | <td bgcolor=#FFFFFF class=text>Přenos z roku 2006</td> |
92 | | | <td bgcolor=#FFFFFF class=text>Celkem</td> |
93 | | | </tr> |
94 | | | '; |
95 | | | |
96 | | | # nastaveni pocatecnich hodnot pro tisk tabulky |
97 | | | # pokud ma clen vice radku tak se tiskne jen jeden souhrnny |
98 | | | $color=1; |
99 | | | $lastcid=-1; |
100 | | | $celkem=0; |
101 | | | $castkacelkem=0; |
102 | | | $mindatum="2007-12-31"; |
103 | | | $ipecka=""; |
104 | | | $platby=""; |
105 | | | $soucetplateb=0; |
106 | | | |
107 | | | while($vysledek=MySQL_Fetch_Array($string)) { |
108 | | | #pro prvni je treba rovnou priradit lastcid |
109 | | | if ($lastcid == -1 ) $lastcid = $vysledek["cid"]; |
110 | | | #pokud je uz jiny clen tak se jde na tisk predchoziho |
111 | | | if ( $lastcid != $vysledek["cid"] ) { |
112 | | | $celkem++; |
113 | | | $delkaletos = round((strtotime("2007-12-31")-strtotime($mindatum))/(60*60*24*30)); |
114 | | | if($delkaletos>12) $delkaletos=12; |
115 | | | $prenos=id_to_prenos06($cid); |
116 | | | |
117 | | | $delkapripojeniletos=round(id_to_delkazarok($cid,2007,22,23)/(60*60*24*30)); |
118 | | | $delkanapajeniletos=round(id_to_delkazarok($cid,2007,5,6)/(60*60*24*30)); |
119 | | | $delkanapajenirouteruletos=round(id_to_delkazarok($cid,2007,24,25)/(60*60*24*30)); |
120 | | | $delkakonektivityletos=round(id_to_delkazarok($cid,2007,7,8)/(60*60*24*30)); |
121 | | | # $delkakonektivityletos=id_to_delkakonektivity($cid,2007)/(60*60*24); |
122 | | | |
123 | | | $castka = ( 50 * $delkapripojeniletos - 25 * $delkanapajeniletos - 50 * $delkanapajenirouteruletos + 50 * $delkakonektivityletos); |
124 | | | $castkacelkem=$castkacelkem+$castka; |
125 | | | |
126 | | | $stavkdnesku= -$castka+$prenos+$soucetplateb; |
127 | | | if (($stavkdnesku < 0 ) || ($stavkdnesku > 0 )) { |
128 | | | #echo "<tr><td colspan=16> stav $stavkdnesku castka $castka prenos $prenos soucetplateb $soucetplateb platby $platby</td></tr>"; |
129 | | | if($color==0) { $color=1; $barva="#E6E4E4"; } else { $color=0; $barva="#FFFFFF"; } |
130 | | | # tisk_radku($barva,$cid,$lastcid,$jmeno,$prijmeni,$icons,$mindatum,$delkapripojeniletos,$delkanapajeniletos,$delkanapajenirouteruletos,$delkakonektivityletos,$castka,$varsymb,$platby,$prenos,$mail); |
131 | | | |
132 | | | |
133 | | | |
134 | | | $dot="lan.bmp"; |
135 | | | $alt="Přehled"; |
136 | | | $from="info@jablonka.cz"; |
137 | | | $subject = "Členství v o.s. jablonka.cz"; |
138 | | | $text = "Zdravím, |
139 | | | dík |
140 | | | Síma |
141 | | | \n"; |
142 | | | $text = str_replace(" ","%20",$text); |
143 | | | $text = str_replace("\n","%0d",$text); |
144 | | | |
145 | | | echo ' |
146 | | | <tr> |
147 | | | <td bgcolor='.$barva.' class=text> |
148 | | | <a class="odkaz" target="_self" href="clen.php?clen='.$lastcid.'"> |
149 | | | <img src="images/'.$dot.'" title="'.$alt.'" border=0></a> |
150 | | | <a class="odkaz" target="_self" href="edit_user.php?id='.$cid.'">'.$lastcid.'</a></td> |
151 | | | <td bgcolor='.$barva.' class="text">'.$jmeno.'</td> |
152 | | | <td bgcolor='.$barva.' class="text">'.$prijmeni.'</td> |
153 | | | <td bgcolor='.$barva.' class="text">'.$icons.'</td> |
154 | | | <td bgcolor='.$barva.' class="text"> |
155 | | | '; |
156 | | | |
157 | | | if ( @$mail ) { |
158 | | | echo ' |
159 | | | <INPUT type="checkbox" name="to'.$cid.'" value="'.$mail.'"> |
160 | | | <a href="mail.php?to='.$mail.'&subj='.$subject.'&from='.$from.'&text='.$text.'">int</a> |
161 | | | <a href="mailto:'.$mail.'?subject='.$subject.'&body='.$text.'">ext</a> '.$mail.' |
162 | | | '; |
163 | | | } |
164 | | | echo ' |
165 | | | </td> |
166 | | | |
167 | | | <td bgcolor='.$barva.' class="text">'.sql2datum($mindatum).'</td> |
168 | | | <td bgcolor='.$barva.' class="text">'.$delkaletos.'</td> |
169 | | | <td bgcolor='.$barva.' class="text">'.$delkakonektivityletos.'</td> |
170 | | | <td bgcolor='.$barva.' class="text">'.$delkanapajeniletos.'</td> |
171 | | | <td bgcolor='.$barva.' class="text">'.$delkanapajenirouteruletos.'</td> |
172 | | | <td bgcolor='.$barva.' class="text">'.$castka.'</td> |
173 | | | <td bgcolor='.$barva.' class="text">'.$varsymb.'</td> |
174 | | | <td bgcolor='.$barva.' class="text">'; |
175 | | | |
176 | | | $ipecka=clen_to_ipecka($lastcid); |
177 | | | foreach ($ipecka as $key => $value) { |
178 | | | if (last_ip_action($key) == 8) { |
179 | | | echo "<strike><a href=edit_ip.php?id=$key>$value</a></strike><br>\n"; |
180 | | | } else |
181 | | | { |
182 | | | #echo last_ip_action($user["iid"]); |
183 | | | echo "<a href=edit_ip.php?id=$key>$value</a><br>\n"; |
184 | | | } |
185 | | | } |
186 | | | |
187 | | | echo ' |
188 | | | </td> |
189 | | | <td bgcolor='.$barva.' class="text"> |
190 | | | <a class="odkaz" target="_self" href="add_platba.php?clen='.$cid.'&platba=2">+</a> '.tiskni_platby($platby).'</td> |
191 | | | <td bgcolor='.$barva.' class="text">'.$vybrano.'</td> |
192 | | | <td bgcolor='.$barva.' class="text">'.$prenos.'</td> |
193 | | | <td bgcolor='.$barva.' class="text">'.($vybrano+str_replace(",",".",$prenos)-$castka).' |
194 | | | <a class="odkaz" target="_self" href="add_platba.php?clen='.$cid.'&hodnota='.-($vybrano+str_replace(",",".",$prenos)-$castka).'&platba=18&datum=31.12.2007">z</a> |
195 | | | <a class="odkaz" target="_self" href="add_platba.php?clen='.$cid.'&hodnota='.($vybrano+str_replace(",",".",$prenos)-$castka).'&platba=7&datum=1.1.2008">do</a> |
196 | | | '; |
197 | | | echo ' |
198 | | | |
199 | | | </td> |
200 | | | </tr> |
201 | | | '; |
202 | | | |
203 | | | |
204 | | | |
205 | | | |
206 | | | |
207 | | | |
208 | | | |
209 | | | |
210 | | | |
211 | | | |
212 | | | |
213 | | | |
214 | | | |
215 | | | |
216 | | | |
217 | | | |
218 | | | |
219 | | | |
220 | | | |
221 | | | |
222 | | | |
223 | | | } |
224 | | | |
225 | | | $mindatum="2007-12-31"; |
226 | | | $ipecka=""; |
227 | | | $platby=""; |
228 | | | $soucetplateb=0; |
229 | | | $lastcid = $vysledek["cid"]; |
230 | | | } |
231 | | | #vytvari se a ukladaji promenne pro clena - muze byt i z vice radku |
232 | | | $icons=""; |
233 | | | if($show=="all" && $vysledek["active"]==2) $icons=$icons.'<img title="Čekatel" src="images/actv.gif"> '; |
234 | | | if($show=="all" && $vysledek["active"]==1) $icons=$icons.'<img title="Člen" src="images/actv.gif"> '; |
235 | | | if($show=="all" && $vysledek["active"]==0) $icons=$icons.'<img title="Pasivní" src="images/passv.gif"> '; |
236 | | | if($vysledek["finance"]==1) $icons=$icons.'<img title="Finance" src="images/dolar.gif"> '; |
237 | | | if($vysledek["internet"]==1) $icons=$icons.'<img title="Internet" src="images/net.gif"> '; |
238 | | | if($vysledek["energy"]==1) $icons=$icons.'<img title="Elektřina sleva" src="images/energysleva.gif"> '; |
239 | | | if($vysledek["energy"]==2) $icons=$icons.'<img title="Elektřina" src="images/energy.gif"> '; |
240 | | | |
241 | | | $cid = $vysledek["cid"]; |
242 | | | $jmeno = $vysledek["jmeno"]; |
243 | | | $prijmeni = $vysledek["prijmeni"]; |
244 | | | #pokud je nove datum pripojeni nejakeho IP starsi tak ho vezmem jako nove minimum |
245 | | | |
246 | | | if ($vysledek["datum"]) if ( strtotime($mindatum) > strtotime($vysledek["datum"])) $mindatum = $vysledek["datum"]; |
247 | | | $energy = $vysledek["energy"]; |
248 | | | $internet = $vysledek["internet"]; |
249 | | | $ipecka = $ipecka." ".$vysledek["ip"]; |
250 | | | $varsymb = $vysledek["vs"]; |
251 | | | # $platby = $vysledek["hodnota"]; |
252 | | | if ( $vysledek["fid"] ) { |
253 | | | $platby = $platby.":".$vysledek["fid"]." ".$vysledek["hodnota"]; |
254 | | | $soucetplateb = $soucetplateb + $vysledek["hodnota"]; |
255 | | | } |
256 | | | $mail=$vysledek["email"]; |
257 | | | } # while |
258 | | | |
259 | | | |
260 | | | ############################################################ |
261 | | | #rozdeli hodnoty pole podle mezery na klic a hodnotu |
262 | | | #v hodnote jsou dve cisla a prvni je brano jako klic a druhe jako hodnota pod timto klicem |
263 | | | #zaroven to odstrani i duplikatni hodnoty |
264 | | | function unikatni_dvojice($array) { |
265 | | | $result = array(); |
266 | | | foreach ($array as $tvalue) { |
267 | | | $polozky = explode(" ", $tvalue); |
268 | | | $result[$polozky[0]] = $polozky[1]; |
269 | | | } |
270 | | | return $result; |
271 | | | } |
272 | | | |
273 | | | ############################################################ |
274 | | | function tiskni_platby($platby) { |
275 | | | #rozdeleni jednotlivych plateb do pole |
276 | | | $jednotlive = explode (":",$platby); |
277 | | | #odstraneni prvniho pole ktere obsahuje nesmysly |
278 | | | $prvni=array_shift($jednotlive); |
279 | | | #setrideni a vyhazeni unikatnich |
280 | | | $jednotlive=unikatni_dvojice($jednotlive); |
281 | | | $pocetplateb = count($jednotlive); |
282 | | | $soucet=0; |
283 | | | $platby_tisk=""; |
284 | | | foreach (array_keys($jednotlive) as $key) |
285 | | | { |
286 | | | $platba="<a class=\"odkaz\" target=\"_self\" href=\"edit_platba.php?id=$key\">$jednotlive[$key]</a> "; |
287 | | | $platby_tisk=$platby_tisk."".$platba; |
288 | | | #desetinne carky se prevedou na tecky |
289 | | | $soucet=$soucet+str_replace(",",".",$jednotlive[$key]); |
290 | | | } |
291 | | | global $vybranocelkem; |
292 | | | $vybranocelkem=$vybranocelkem+$soucet; |
293 | | | unset($vybranocelkem); |
294 | | | global $vybrano; |
295 | | | $vybrano=$soucet; |
296 | | | unset($vybrano); |
297 | | | if ($pocetplateb) { |
298 | | | return str_replace(" konec","",$platby_tisk."konec") ; |
299 | | | } else { |
300 | | | return "" ; |
301 | | | } |
302 | | | } |
303 | | | |
304 | | | ############################################################ |
305 | | | function tisk_radku($barva,$cid,$lastcid,$jmeno,$prijmeni,$icons,$mindatum,$delkaletos,$delkanapajeniletos,$delkanapajenirouteruletos,$delkakonektivityletos,$castka,$varsymb,$platby,$prenos,$mail) { |
306 | | | global $vybranocelkem; |
307 | | | global $vybrano; |
308 | | | $dot="lan.bmp"; |
309 | | | $alt="Přehled"; |
310 | | | echo ' |
311 | | | <tr> |
312 | | | <td bgcolor='.$barva.' class=text> |
313 | | | <a class="odkaz" target="_self" href="clen.php?clen='.$lastcid.'"> |
314 | | | <img src="images/'.$dot.'" title="'.$alt.'" border=0></a> |
315 | | | <a class="odkaz" target="_self" href="edit_user.php?id='.$cid.'">'.$lastcid.'</a></td> |
316 | | | <td bgcolor='.$barva.' class="text">'.$jmeno.'</td> |
317 | | | <td bgcolor='.$barva.' class="text">'.$prijmeni.'</td> |
318 | | | <td bgcolor='.$barva.' class="text">'.$icons.'</td> |
319 | | | |
320 | | | <td bgcolor='.$barva.' class="text"> |
321 | | | '; |
322 | | | $from="info@jablonka.cz"; |
323 | | | $subject = "Členství v o.s. jablonka.cz"; |
324 | | | $text = "Zdravím, |
325 | | | dík |
326 | | | Síma |
327 | | | \n"; |
328 | | | |
329 | | | $text = str_replace(" ","%20",$text); |
330 | | | $text = str_replace("\n","%0d",$text); |
331 | | | if ( @$mail ) { |
332 | | | echo ' |
333 | | | <INPUT type="checkbox" name="to'.$cid.'" value="'.$mail.'"> |
334 | | | <a href="mail.php?to='.$mail.'&subj='.$subject.'&from='.$from.'&text='.$text.'">int</a> |
335 | | | <a href="mailto:'.$mail.'?subject='.$subject.'&body='.$text.'">ext</a> '.$mail.' |
336 | | | '; |
337 | | | } |
338 | | | echo ' |
339 | | | </td> |
340 | | | |
341 | | | <td bgcolor='.$barva.' class="text">'.sql2datum($mindatum).'</td> |
342 | | | <td bgcolor='.$barva.' class="text">'.$delkaletos.'</td> |
343 | | | <td bgcolor='.$barva.' class="text">'.$delkakonektivityletos.'</td> |
344 | | | <td bgcolor='.$barva.' class="text">'.$delkanapajeniletos.'</td> |
345 | | | <td bgcolor='.$barva.' class="text">'.$delkanapajenirouteruletos.'</td> |
346 | | | <td bgcolor='.$barva.' class="text">'.$castka.'</td> |
347 | | | <td bgcolor='.$barva.' class="text">'.$varsymb.' |
348 | | | '; |
349 | | | echo ' |
350 | | | |
351 | | | </td> |
352 | | | <td bgcolor='.$barva.' class="text"> |
353 | | | <a class="odkaz" target="_self" href="add_platba.php?clen='.$cid.'&platba=2">+</a> '.tiskni_platby($platby).' |
354 | | | </td> |
355 | | | <td bgcolor='.$barva.' class="text">'.$vybrano.'</td> |
356 | | | <td bgcolor='.$barva.' class="text">'.$prenos.'</td> |
357 | | | <td bgcolor='.$barva.' class="text">'.($vybrano+str_replace(",",".",$prenos)-$castka).' |
358 | | | '; |
359 | | | |
360 | | | $from="info@jablonka.cz"; |
361 | | | $subject = "Výzva k zaplacení členských příspěvků jablonka.cz : $jmeno $prijmeni"; |
362 | | | $text = "Dobrý den, |
363 | | | v tomto mailu Vám posíláme informace o stavu Vašich členských příspěvků pro tento rok. |
364 | | | \n"; |
365 | | | $text .= "Jméno člena : $jmeno $prijmeni\n"; |
366 | | | $text .= "Číslo konta : 2118436001/2400\n"; |
367 | | | $text .= "Zbývá zaplatit : ".(-1*($vybrano+str_replace(",",".",$prenos)-$castka))."Kč\n"; |
368 | | | $text .= "Var.Symbol : ".$varsymb."\n\n"; |
369 | | | |
370 | | | $text .= "Pro minimalizaci bankovních poplatků plaťte větší částky najednou - tedy alespoň 300Kč čtvrtletně. |
371 | | | |
372 | | | 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í, |
373 | | | ale nejlépe bude pokud zaplatíte jednou jedinou platbou až do konce roku. |
374 | | | |
375 | | | 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í. |
376 | | | Nezapomínejte prosím vyplnit variabilní symbol. |
377 | | | 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. |
378 | | | |
379 | | | hezký den |
380 | | | www.jablonka.cz |
381 | | | "; |
382 | | | |
383 | | | $text = str_replace(" ","%20",$text); |
384 | | | $text = str_replace("\n","%0d",$text); |
385 | | | $celkemjeden=(-1*($vybrano+str_replace(",",".",$prenos)-$castka)); |
386 | | | $aktualnidatum=date("Y-m-d"); |
387 | | | #tohle spocita pocet mesicu ktere v tomto roce nemusi byt jeste zaplaceny |
388 | | | #je to pouzito k rozliseni kdo tech kteri maji zaplaceno alespon tri mesice dopredu |
389 | | | $budoucimesice = round((strtotime("2007-12-31")-strtotime($aktualnidatum))/(60*60*24*30)); |
390 | | | #odpocet se stanovi tak aby lidi meli dopredu placeno aspon 300Kc |
391 | | | $odpocet=$budoucimesice*100-300; |
392 | | | if ( ($celkemjeden-$odpocet) > 0 ) { |
393 | | | echo ' |
394 | | | <a href="mail.php?to='.$mail.'&subj='.$subject.'&from='.$from.'&text='.$text.'">int</a> |
395 | | | <a href="mailto:'.$mail.'?subject='.$subject.'&body='.$text.'">ext </a> |
396 | | | '; |
397 | | | } |
398 | | | echo ' |
399 | | | |
400 | | | </td> |
401 | | | </tr> |
402 | | | '; |
403 | | | unset($vybranocelkem); |
404 | | | unset($vybrano); |
405 | | | } |
406 | | | ############################################################ |
407 | | | |
408 | | | #dotisk posledniho radku |
409 | | | $celkem++; |
410 | | | if($color==0) { $color=1; $barva="#E6E4E4"; } else { $color=0; $barva="#FFFFFF"; } |
411 | | | |
412 | | | $delkaletos = round((strtotime("2007-12-31")-strtotime($mindatum))/(60*60*24*30)); |
413 | | | if($delkaletos>12) $delkaletos=12; |
414 | | | $prenos=id_to_prenos06($cid); |
415 | | | $delkapripojeniletos=round(id_to_delkazarok($cid,2007,22,23)/(60*60*24*30)); |
416 | | | $delkanapajeniletos=round(id_to_delkazarok($cid,2007,5,6)/(60*60*24*30)); |
417 | | | $delkanapajenirouteruletos=round(id_to_delkazarok($cid,2007,24,25)/(60*60*24*30)); |
418 | | | $delkakonektivityletos=round(id_to_delkazarok($cid,2007,7,8)/(60*60*24*30)); |
419 | | | # $delkakonektivityletos=id_to_delkakonektivity($cid,2007)/(60*60*24); |
420 | | | |
421 | | | $castka = ( 50 * $delkapripojeniletos - 25 * $delkanapajeniletos - 50 * $delkanapajenirouteruletos + 50 * $delkakonektivityletos); |
422 | | | $castkacelkem=$castkacelkem+$castka; |
423 | | | |
424 | | | $stavkdnesku= -$castka+$prenos+$soucetplateb; |
425 | | | if ($stavkdnesku < 0 ) { |
426 | | | #echo "<tr><td colspan=16> stav $stavkdnesku castka $castka prenos $prenos soucetplateb $soucetplateb platby $platby</td></tr>"; |
427 | | | if($color==0) { $color=1; $barva="#E6E4E4"; } else { $color=0; $barva="#FFFFFF"; } |
428 | | | tisk_radku($barva,$cid,$lastcid,$jmeno,$prijmeni,$icons,$mindatum,$delkapripojeniletos,$delkanapajeniletos,$delkanapajenirouteruletos,$delkakonektivityletos,$castka,$varsymb,$platby,$prenos,$mail); |
429 | | | } |
430 | | | |
431 | | | # if ($castka == $soucetplateb) { |
432 | | | # if($color==0) { $color=1; $barva="#E6E4E4"; } else { $color=0; $barva="#FFFFFF"; } |
433 | | | # tisk_radku($barva,$cid,$lastcid,$jmeno,$prijmeni,$icons,$mindatum,$delkapripojeniletos,$delkanapajeniletos,$delkanapajenirouteruletos,$delkakonektivityletos,$castka,$varsymb,$platby,$prenos,$mail); |
434 | | | # } |
435 | | | |
436 | | | #tisk_radku($barva,$cid,$lastcid,$jmeno,$prijmeni,$icons,$mindatum,$delkapripojeniletos,$delkanapajeniletos,$delkanapajenirouteruletos,$delkakonektivityletos,$castka,$varsymb,$platby,$prenos,$mail); |
437 | | | |
438 | | | #konec dotisku posledniho radku |
439 | | | |
440 | | | echo ' |
441 | | | </table></tr></td></table></center> |
442 | | | </form> |
443 | | | <br> |
444 | | | Celkem zobrazeno '.$celkem.' záznamů. Celková částka je '.$castkacelkem.'Kč a zatím se vybralo '.$vybranocelkem.'Kč |
445 | | | '; |
446 | | | ?> |
447 | | | </body> |
448 | | | </html> |