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 - Majetek </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 | | | $celkem=0; |
20 | | | $spotrebacelkem=0; |
21 | | | |
22 | | | echo ' |
23 | | | <center> |
24 | | | <a href="add_majetek.php?clen=0" target="_self" class=odkaz>Přidat majetek</a> |
25 | | | <br> |
26 | | | '; |
27 | | | |
28 | | | $condition=""; |
29 | | | |
30 | | | if(!@$show) $show="all"; |
31 | | | if(!@$zarizeni) $zarizeni="vsechno"; |
32 | | | if(!@$order) $order="prijmeni"; |
33 | | | |
34 | | | #vybrani default trideni |
35 | | | if($zarizeni=="vsechno") { |
36 | | | $condition = ""; |
37 | | | } else { |
38 | | | $condition = "AND zarizeni IN (\"$zarizeni\")"; |
39 | | | } |
40 | | | |
41 | | | |
42 | | | if($show!="all") { |
43 | | | # $where="WHERE active BETWEEN 0 AND 1"; |
44 | | | $where="WHERE active IN (1) $condition"; |
45 | | | echo '<b>Seznam majetku aktivních uživatelů:</b> <a href="majetek.php?show=all&order='.$order.'" class=odkaz>zobrazit vše</a>'; |
46 | | | } else { |
47 | | | $where="WHERE active IN (0,1) $condition"; |
48 | | | echo '<b>Seznam majetku všech uživatelů:</b> <a href="majetek.php?show=active&order='.$order.'" class=odkaz>zobrazit pouze aktivní</a>'; |
49 | | | } |
50 | | | |
51 | | | echo "<br>"; |
52 | | | |
53 | | | #tisk zarizeni |
54 | | | echo "Zařízení : "; |
55 | | | $dotaz=MySQL_Query("SELECT DISTINCT zarizeni from majetek"); |
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="majetek.php?show='.$show.'&zarizeni='.$radek["zarizeni"].'&order='.$order.'">'.id_to_zarizeni($radek["zarizeni"]).'</a> * |
62 | | | '; |
63 | | | } |
64 | | | #dotisk posledni volby pro vsechny ulice |
65 | | | echo "<a href=\"majetek.php?show=$show&zarizeni=vsechno&order=$order\">všechno</a>"; |
66 | | | echo ' |
67 | | | '; |
68 | | | |
69 | | | echo "<br><br>"; |
70 | | | |
71 | | | |
72 | | | |
73 | | | |
74 | | | #finalni dotaz do databaze pred vypisem zvolene sestavy |
75 | | | $string=MySQL_Query("SELECT c.id as cid, c.*, m.id as mid,m.komentar as mkomentar, m.*, a.id as aid, a.* |
76 | | | FROM (majetek m LEFT JOIN cleni c ON c.id = m.clen) |
77 | | | LEFT JOIN adresy a ON a.id = m.adresa $where ORDER BY $order"); |
78 | | | |
79 | | | echo ' |
80 | | | |
81 | | | <table width=100% cellspacing=1> |
82 | | | <tr> |
83 | | | <td bgcolor=#C00000> |
84 | | | <table cellspacing=0 cellpadding=0 width=100%> |
85 | | | <tr> |
86 | | | <td bgcolor=#FFFFFF> </td> |
87 | | | <td bgcolor=#FFFFFF class=text> |
88 | | | <a title="seřadit podle ID" class=odkaz href="majetek.php?show='.$show.'&zarizeni='.$zarizeni.'&order=mid">ID</a> |
89 | | | </td> |
90 | | | <td bgcolor=#FFFFFF class=text> |
91 | | | <a title="seřadit podle člena" class=odkaz href="majetek.php?show='.$show.'&zarizeni='.$zarizeni.'&order=cid">Člen</a> |
92 | | | </td> |
93 | | | <td bgcolor=#FFFFFF class=text> |
94 | | | <a title="seřadit podle adresy" class=odkaz href="majetek.php?show='.$show.'&zarizeni='.$zarizeni.'&order=adresa">Umístění</a> |
95 | | | </td> |
96 | | | <td bgcolor=#FFFFFF class=text width=80> |
97 | | | <a title="seřadit podle zařízení" class=odkaz href="majetek.php?show='.$show.'&zarizeni='.$zarizeni.'&order=zarizeni">Zařízení</a> |
98 | | | </td> |
99 | | | <td bgcolor=#FFFFFF class=text> |
100 | | | <a title="seřadit podle financí účtenky" class=odkaz href="majetek.php?show='.$show.'&zarizeni='.$zarizeni.'&order=m.finance">Finance/Účtenka</a> |
101 | | | </td> |
102 | | | <td bgcolor=#FFFFFF class=text> |
103 | | | <a title="seřadit podle spotřeby" class=odkaz href="majetek.php?show='.$show.'&zarizeni='.$zarizeni.'&order=spotreba">Spotřeba [W]</a> |
104 | | | </td> |
105 | | | <td bgcolor=#FFFFFF class=text> |
106 | | | <a title="seřadit podle součásti" class=odkaz href="majetek.php?show='.$show.'&zarizeni='.$zarizeni.'&order=soucast">Součást</a> |
107 | | | </td> |
108 | | | <td bgcolor=#FFFFFF class=text width=80> |
109 | | | <a title="seřadit podle sériového čísla" class=odkaz href="majetek.php?show='.$show.'&zarizeni='.$zarizeni.'&order=scislo">Identifikace/číslo</a> |
110 | | | </td> |
111 | | | <td bgcolor=#FFFFFF class=text width=80> |
112 | | | <a title="seřadit podle MAC" class=odkaz href="majetek.php?show='.$show.'&zarizeni='.$zarizeni.'&order=mac">MAC</a> |
113 | | | </td> |
114 | | | <td bgcolor=#FFFFFF class=text> |
115 | | | <a title="seřadit podle komentáře" class=odkaz href="majetek.php?show='.$show.'&zarizeni='.$zarizeni.'&order=m.komentar">Komentář</a> |
116 | | | </td> |
117 | | | </tr> |
118 | | | '; |
119 | | | |
120 | | | $color=1; |
121 | | | |
122 | | | while($vysledek=MySQL_Fetch_Array($string)) |
123 | | | { |
124 | | | $celkem++; |
125 | | | if($color==0) |
126 | | | { |
127 | | | $color=1; |
128 | | | $barva="#E6E4E4"; |
129 | | | } |
130 | | | else |
131 | | | { |
132 | | | $color=0; |
133 | | | $barva="#FFFFFF"; |
134 | | | } |
135 | | | |
136 | | | $dot="lan.bmp"; |
137 | | | $alt="LAN Jablonka"; |
138 | | | |
139 | | | echo ' |
140 | | | <tr> |
141 | | | <td bgcolor='.$barva.' class=text> <a class="odkaz" |
142 | | | target="_self" href="clen.php?clen='.$vysledek["cid"].'"><img src="images/'.$dot.'" title="'.$alt.'" border=0></a> |
143 | | | </td> |
144 | | | <td bgcolor='.$barva.' class="text"><a class="odkaz" target="_self" href="edit_majetek.php?id='.$vysledek["mid"].'">'.$vysledek["mid"].'</a></td> |
145 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["jmeno"]." ".$vysledek["prijmeni"].'</td> |
146 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["ulice"]." ".$vysledek["cp"]." ".$vysledek["byt"].'</td> |
147 | | | <td bgcolor='.$barva.' class="text">'.id_to_zarizeni($vysledek["zarizeni"]).'</td> |
148 | | | <td bgcolor='.$barva.' class="text"><a href="edit_platba.php?id='.$vysledek["finance"].'">'.id_to_ucet($vysledek["finance"]).'</a></td> |
149 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["spotreba"].'</td> |
150 | | | <td bgcolor='.$barva.' class="text">'.id_to_majetek($vysledek["soucast"]).'</td> |
151 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["scislo"].'</td> |
152 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["mac"].'</td> |
153 | | | <td bgcolor='.$barva.' class="text">'.$vysledek["mkomentar"].'</td> |
154 | | | |
155 | | | </tr> |
156 | | | '; |
157 | | | $spotrebacelkem=$spotrebacelkem+str_replace(",",".",$vysledek["spotreba"]); |
158 | | | Next($vysledek); |
159 | | | } |
160 | | | |
161 | | | $spotrebamesicne=($spotrebacelkem*30*24/1000)*3.6; |
162 | | | $spotrebarocne=($spotrebacelkem*365*24/1000)*3.6; |
163 | | | echo ' |
164 | | | </table></tr></td></table></center> |
165 | | | <br> |
166 | | | Celkem zobrazeno '.$celkem.' záznamů. Celková okamžitá spotřeba zobrazených záznamů je '.$spotrebacelkem.'W což je '.$spotrebamesicne.'Kč měsíčně a '.$spotrebarocne.'Kč za rok. |
167 | | | '; |
168 | | | ?> |
169 | | | </body> |
170 | | | </html> |