1 | <?php
|
---|
2 | include('includes/global.php');
|
---|
3 |
|
---|
4 | //Počet client_textů na stránce
|
---|
5 | $Number_client_text = 200;
|
---|
6 |
|
---|
7 | if(array_key_exists('order', $_GET)) {
|
---|
8 | $order = $_GET['order'];
|
---|
9 | $desc = $_GET['desc'];
|
---|
10 | $_SESSION['order'] = $_GET['order'];
|
---|
11 | $_SESSION['desc'] = $_GET['desc'];
|
---|
12 | } else {
|
---|
13 | if (isset($_SESSION['order'])) {
|
---|
14 | $order = $_SESSION['order'];
|
---|
15 | $desc = $_SESSION['desc'];
|
---|
16 | } else {
|
---|
17 | $order = '';
|
---|
18 | $desc = 'desc';
|
---|
19 | }
|
---|
20 | }
|
---|
21 |
|
---|
22 | if(array_key_exists('limitx', $_GET)) {
|
---|
23 | $_SESSION['limitx'] = mysql_escape_string($_GET['limitx']);
|
---|
24 | $_SESSION['limity'] = mysql_escape_string($_GET['limity']);
|
---|
25 | } else {
|
---|
26 | if (isset($_SESSION['limitx']) == false) {
|
---|
27 | $_SESSION['limitx'] = '0';
|
---|
28 | $_SESSION['limity'] = $Number_client_text;
|
---|
29 | }
|
---|
30 | }
|
---|
31 |
|
---|
32 | function WritePages($Addres, $Where)
|
---|
33 | { // BEGIN function WritePages
|
---|
34 | global $Database, $Number_client_text;
|
---|
35 |
|
---|
36 | $Line = mysql_fetch_row($Database->SQLCommand("SELECT count(*) FROM client_text $Where"));
|
---|
37 | $CountLists = $Line[0]/$Number_client_text;
|
---|
38 |
|
---|
39 | echo 'Počet client_textů: <b>'.$Line[0].'</b><br />
|
---|
40 | Zobrazit stránku: ';
|
---|
41 |
|
---|
42 | for ($i=0; $i< $CountLists; ++$i) {
|
---|
43 | $limity = $Number_client_text;
|
---|
44 | $limitx = $i*$limity;
|
---|
45 | $Page = $i+1;
|
---|
46 | if ($_SESSION['limitx'] == $limitx)
|
---|
47 | echo '<b>'.$Page.'</b> ';
|
---|
48 | else
|
---|
49 | echo '<a href="'.$Addres.'&limitx='.$limitx.'&limity='.$limity.'">'.$Page.'</a> ';
|
---|
50 | }
|
---|
51 |
|
---|
52 | if (@$_SESSION['limitx'] > @$limitx) $_SESSION['limitx'] = 0;
|
---|
53 |
|
---|
54 | } // END function WritePages
|
---|
55 |
|
---|
56 | function Write_client_text($sql, $limit, $address)
|
---|
57 | { // BEGIN function Writeclient_text
|
---|
58 | global $Database, $order, $desc;
|
---|
59 |
|
---|
60 | if ($limit <> '') $limit = 'LIMIT '.$limit;
|
---|
61 |
|
---|
62 | if ($address <> 'selection') {
|
---|
63 | if ($order <> '') $order = 'ORDER BY '.$order;
|
---|
64 | if ($desc <> 'desc') $desc = 'desc'; else $desc = '';
|
---|
65 | } else {
|
---|
66 | $order = '';
|
---|
67 | $desc = '';
|
---|
68 | }
|
---|
69 |
|
---|
70 | echo '<table border="1" cellpadding="2" cellspacing="0">
|
---|
71 | <tr>
|
---|
72 | <th><a href="client_list.php?'.$address.'&order=ID&desc='.$desc.'">Pořadové číslo</a></th>
|
---|
73 | <th><a href="client_list.php?'.$address.'&order=entry&desc='.$desc.'">ID client_textu</a></th>';
|
---|
74 | if ($address <> 'notran') echo '<th><a href="client_list.php?'.$address.'&order=user&desc='.$desc.'">User</a></th>
|
---|
75 | <th><a href="client_list.php?'.$address.'&order=vote&desc='.$desc.'">Známka</a></th>
|
---|
76 | <th><a href="client_list.php?'.$address.'&order=CountVote&desc='.$desc.'">Počet hlasování</a></th>';
|
---|
77 | echo '</tr>';
|
---|
78 |
|
---|
79 | // echo "$sql $order $desc $limit";
|
---|
80 | $ID = $Database->SQLCommand("$sql $order $desc $limit");
|
---|
81 | while ($Line = mysql_fetch_array($ID)) {
|
---|
82 | echo '<tr>
|
---|
83 | <td><a href="client_form.php?ID='.$Line['ID'].'">'.$Line['ID'].'</a></td>
|
---|
84 | <td>'.$Line['entry'].'</td>';
|
---|
85 | if ($address <> 'notran') echo '<td>'.@$Line['User'].'</td>
|
---|
86 | <td>'.substr($Line['Vote'], 0, 4).'</td>
|
---|
87 | <td>'.$Line['CountVote'].'</td>';
|
---|
88 | echo '</tr>';
|
---|
89 | }
|
---|
90 | echo '</table>';
|
---|
91 | } // END function Writeclient_text
|
---|
92 |
|
---|
93 |
|
---|
94 | if(array_key_exists('notran', $_GET)) {
|
---|
95 | echo '<a Title="Zobrazit client_texty podle vlastního filtru" href="client_list.php?filter">Filtr client_textů</a> ->
|
---|
96 | <a Title="Zde můžete začít překládat" href="client_list.php?selection">Nepřeložené client_texty</a> - >
|
---|
97 | <b>Vypsání nepřeložených client_textů s limitem na stránku</b><br><br>';
|
---|
98 |
|
---|
99 | WritePages('client_list.php?notran',"items WHERE items.Language = '0' AND
|
---|
100 | NOT EXISTS(SELECT 1 FROM client_text sub WHERE sub.Language <> 0 AND sub.entry = items.entry)");
|
---|
101 |
|
---|
102 | Write_client_text("SELECT * FROM client_text items WHERE items.Language = '0' AND
|
---|
103 | NOT EXISTS(SELECT 1 FROM client_text sub WHERE sub.Language <> 0 AND sub.entry = items.entry) ", $_SESSION['limitx'].','.$_SESSION['limity'],'notran');
|
---|
104 | }
|
---|
105 |
|
---|
106 | if(array_key_exists('notvote', $_GET)) {
|
---|
107 | echo '<a Title="Zobrazit client_texty podle vlasního filtru" href="client_list.php?filter">Filtr client_textů</a> ->
|
---|
108 | <a Title="Zatím neznámkované client_texty" href="client_list.php?notvote">Neznámkované client_texty</a><br><br>';
|
---|
109 |
|
---|
110 | WritePages('client_list.php?notvote'," WHERE Language <> 0 AND client_text.Complete = '1' AND User <> ".$_SESSION['UserID']." AND
|
---|
111 | NOT EXISTS(SELECT 1 FROM client_vote WHERE IDuser = ".$_SESSION['UserID']." AND IDclient = client_text.ID)");
|
---|
112 |
|
---|
113 | Write_client_text("SELECT *, (SELECT user.user FROM user WHERE user.id = client_text.user) as User
|
---|
114 | FROM client_text WHERE Language <> 0 AND client_text.Complete = '1' AND User <> ".$_SESSION['UserID']." AND
|
---|
115 | NOT EXISTS(SELECT 1 FROM client_vote WHERE IDuser = ".$_SESSION['UserID']." AND IDclient = client_text.ID)", $_SESSION['limitx'].','.$_SESSION['limity'],'notvote');
|
---|
116 | }
|
---|
117 |
|
---|
118 | if(array_key_exists('Translate', $_GET)) {
|
---|
119 | echo '<a Title="Zobrazit client_texty podle vlasního filtru" href="client_list.php?filter">Filtr client_textů</a> ->
|
---|
120 | <a Title="Přeložené client_texty, můžete zde hlasovat, nebo opravovat client_texty" href="client_list.php?Translate">Přeložené client_texty</a><br><br>';
|
---|
121 |
|
---|
122 | WritePages('client_list.php?Translate', "WHERE client_text.Language <> 0 AND client_text.Complete = '1'");
|
---|
123 |
|
---|
124 | Write_client_text("SELECT *, (SELECT user.user FROM user WHERE user.id = client_text.user) as User FROM
|
---|
125 | client_text WHERE client_text.Language <> 0 AND client_text.Complete = '1'", $_SESSION['limitx'].','.$_SESSION['limity'], 'Translate');
|
---|
126 | }
|
---|
127 |
|
---|
128 | if(array_key_exists('my', $_GET) and Licence(0)) {
|
---|
129 | echo '<a Title="Zobrazit client_texty podle vlasního filtru" href="client_list.php?filter">Filtr client_textů</a> ->
|
---|
130 | <a Title="Přeložené client_texty přilášeného uživatele" href="client_list.php?my">Moje client_texty</a><br><br>';
|
---|
131 | Write_client_text("SELECT * FROM client_text Where user = ".$_SESSION['UserID'], '', 'my');
|
---|
132 | }
|
---|
133 |
|
---|
134 | if(array_key_exists('mydevelop', $_GET) and Licence(0)) {
|
---|
135 | echo '<a Title="Zobrazit client_texty podle vlasního filtru" href="client_list.php?filter">Filtr client_textů</a> ->
|
---|
136 | <a Title="Nedokončené client_texty" href="client_list.php?mydevelop">Rozepsané client_texty</a><br><br>';
|
---|
137 | Write_client_text("SELECT * FROM client_text Where user = ".$_SESSION['UserID']." AND complete = '0'", '', 'mydevelop');
|
---|
138 | }
|
---|
139 |
|
---|
140 |
|
---|
141 | if(array_key_exists('users', $_GET)) {
|
---|
142 | echo '<a Title="Zobrazit client_texty podle vlasního filtru" href="client_list.php?filter">Filtr client_textů</a> ->
|
---|
143 | <b>Vypsání client_textů od určitých uživatelů</b><br><br>';
|
---|
144 | $users = @$_POST['users'];
|
---|
145 |
|
---|
146 | $WhereUsers = '';
|
---|
147 |
|
---|
148 | for ($i=0; $i<Count($users); $i++):
|
---|
149 | if ($WhereUsers <> '')
|
---|
150 | $WhereUsers .= " OR User = ".$users[$i];
|
---|
151 | else
|
---|
152 | $WhereUsers .= " User = ".$users[$i];
|
---|
153 | endfor;
|
---|
154 | Write_client_text("SELECT *, (SELECT user.user FROM user WHERE user.id = client_text.user) as User FROM client_text Where $WhereUsers", '', 'users');
|
---|
155 |
|
---|
156 | }
|
---|
157 |
|
---|
158 | if(array_key_exists('byvote', $_GET)) {
|
---|
159 | echo '<a Title="Zobrazit client_texty podle vlastního filtru" href="client_list.php?filter">Filtr client_textů</a> ->
|
---|
160 | <b>Vypsání podle známky</b><br><br>';
|
---|
161 |
|
---|
162 | $SingVote = $_POST['SingVote'];
|
---|
163 | $SingNumberVote = $_POST['SingNumberVote'];
|
---|
164 | $Vote = $_POST['Vote'];
|
---|
165 | $NumberVote = $_POST['NumberVote'];
|
---|
166 |
|
---|
167 | Write_client_text("SELECT *, (SELECT user.user FROM user WHERE user.id = client_text.user) as User
|
---|
168 | FROM client_text WHERE Vote $SingVote $Vote AND CountVote $SingNumberVote $NumberVote", '', 'users');
|
---|
169 |
|
---|
170 | }
|
---|
171 |
|
---|
172 | if (array_key_exists('search', $_GET)) {
|
---|
173 | $Search = $_GET['search'];
|
---|
174 |
|
---|
175 | $sql = "SELECT * FROM `client_text`
|
---|
176 | WHERE `ID` LIKE '%$Search%'
|
---|
177 | OR `text` LIKE '%$Search%'
|
---|
178 | OR `id_text` LIKE '%$Search%'
|
---|
179 | OR `Language` LIKE '%$Search%'
|
---|
180 | OR `Vote` LIKE '%$Search%'
|
---|
181 | OR `CountVote` LIKE '%$Search%'
|
---|
182 | OR `User` LIKE '%$Search%'
|
---|
183 | OR `Complete` LIKE '%$Search%'
|
---|
184 | OR `Take` LIKE '%$Search%'";
|
---|
185 | Write_client_text($sql, '', 'search='.$Search);
|
---|
186 | }
|
---|
187 |
|
---|
188 | if (array_key_exists('searchentry', $_GET)) {
|
---|
189 | $Search = $_GET['searchentry'];
|
---|
190 |
|
---|
191 | $sql = "SELECT * FROM `client_text` WHERE `entry` LIKE '$Search'";
|
---|
192 |
|
---|
193 | Write_client_text($sql, '', 'searchentry='.$Search);
|
---|
194 | }
|
---|
195 |
|
---|
196 | if(array_key_exists('filter', $_GET)) {
|
---|
197 | echo '<a Title="Zobrazit client_texty podle vlastního filtru" href="client_list.php?filter">Filtr client_textů</a><br><br><br>';
|
---|
198 | echo '
|
---|
199 |
|
---|
200 | <script type="text/javascript" language="JavaScript">
|
---|
201 | <!--
|
---|
202 |
|
---|
203 | function showhidemain(){
|
---|
204 | show(Button2);
|
---|
205 | if (Main1.style.display==\'none\') {
|
---|
206 | show(Button2);
|
---|
207 | hide(Button1);
|
---|
208 | show(Main1);
|
---|
209 | show(Main2);
|
---|
210 | show(Main3);
|
---|
211 | show(Main4);
|
---|
212 | show(Main5);
|
---|
213 | } else {
|
---|
214 | hide(Button2);
|
---|
215 | show(Button1);
|
---|
216 | hide(Main1);
|
---|
217 | hide(Main2);
|
---|
218 | hide(Main3);
|
---|
219 | hide(Main4);
|
---|
220 | hide(Main5);
|
---|
221 | }
|
---|
222 |
|
---|
223 | }
|
---|
224 | -->
|
---|
225 |
|
---|
226 | </script>
|
---|
227 |
|
---|
228 | <span ID="Button1" onClick="showhidemain()">[Zobrazit hlavní fitry]</span>
|
---|
229 | <span ID="Button2" onClick="showhidemain()" style="display:none">[Skrýt hlavní fitry]</span>
|
---|
230 |
|
---|
231 | <table border="1" cellpadding="3" cellspacing="0">
|
---|
232 | <tr><th>Odkaz</th><th>Popis</th></tr>';
|
---|
233 |
|
---|
234 | echo '<tr ID="Main1" style="display:none"><td><a Title="Zde můžete začít překládat" href="client_list.php?notran">Nepřeložené client_texty</a></td>
|
---|
235 | <td>Nikým nepřeložené client_texty, zde můžete začít překládat</td></tr>
|
---|
236 | <tr ID="Main2" style="display:none"><td><a Title="Přeložené client_texty, můžete zde hlasovat, nebo opravovat client_text" href="client_list.php?Translate">Přeložené client_texty</a></td>
|
---|
237 | <td>Přeložené client_texty, můžete zde hlasovat, nebo opravovat client_texty</td></tr>
|
---|
238 | ';
|
---|
239 |
|
---|
240 | if (Licence(0)) {
|
---|
241 | echo '<tr ID="Main3" style="display:none"><td><a Title="Nedokončené client_texty" href="client_list.php?mydevelop">Rozepsané client_texty</a></td>
|
---|
242 | <td>Nedokončené client_texty přilášeného uživatele</td></tr>
|
---|
243 | <tr ID="Main4" style="display:none"><td><a Title="Přeložené client_texty přilášeného uživatele" href="client_list.php?my">Moje client_texty</a></td>
|
---|
244 | <td>Přeložené client_texty přilášeného uživatele</td></tr>
|
---|
245 | <tr ID="Main5" style="display:none"><td><a Title="Zatím neznámkované client_texty" href="client_list.php?notvote">Neznámkované client_texty</a></td>
|
---|
246 | <td>Zatím neznámkované client_texty</td></tr>';
|
---|
247 | }
|
---|
248 |
|
---|
249 | echo '<tr><td><form action="client_list.php?users" method="post">
|
---|
250 | <select name="users[]" size="10" multiple>';
|
---|
251 |
|
---|
252 | $ID = $Database->SQLCommand("SELECT user,ID FROM `user` WHERE
|
---|
253 | EXISTS(SELECT 1 FROM client_text WHERE user = user.ID) ORDER BY user");
|
---|
254 | while ($Line = mysql_fetch_array($ID))
|
---|
255 | echo '<option value="'.$Line['ID'].'">'.$Line['user'].'</option>';
|
---|
256 |
|
---|
257 | echo '</select><br>
|
---|
258 | <input type="submit" value="Vypsat"></form></td>
|
---|
259 | <td>Vypsat pouze od těchto uživatalů<br>
|
---|
260 | Vybrat více uživatelů můžete pomocí CTRL+click</td></tr>';
|
---|
261 |
|
---|
262 | echo '<tr><td>
|
---|
263 | <form action="client_list.php?byvote" method="post">
|
---|
264 | Počet hlasů: <br />
|
---|
265 | <input type="radio" name="SingNumberVote" value="=" checked="true" title="Rovná se "="">
|
---|
266 | <input type="radio" name="SingNumberVote" value=">" checked="true" title="Je větší než ">"">
|
---|
267 | <input type="radio" name="SingNumberVote" value="<" checked="true" title="Je menší než "<"">
|
---|
268 | <input type="text" name="NumberVote" value="3" size="1"><br>
|
---|
269 | Známka: <br />
|
---|
270 | <input type="radio" name="SingVote" value="=" checked="true" title="Rovná se "="">
|
---|
271 | <input type="radio" name="SingVote" value=">" checked="true" title="Je větší než ">"">
|
---|
272 | <input type="radio" name="SingVote" value="<" checked="true" title="Je menší než "<"">
|
---|
273 | <input type="text" name="Vote" value="3" size="1"><br>
|
---|
274 | <input type="submit" value="Vypsat"></form>
|
---|
275 | </td><td>Zobrazit podle známky</td></tr>';
|
---|
276 |
|
---|
277 | echo '<tr><td><form action="client_list.php" method="get">
|
---|
278 | <input type="text" name="search" size="8">
|
---|
279 | <input type="submit" value="Hledat">
|
---|
280 | </form>
|
---|
281 | </td><td>Vyhledat pomocí textu</td></tr>
|
---|
282 | ';
|
---|
283 |
|
---|
284 | echo '<tr><td><form action="client_list.php" method="get">
|
---|
285 | <input type="text" name="searchentry" size="8">
|
---|
286 | <input type="submit" value="Hledat">
|
---|
287 | </form>
|
---|
288 | </td><td>Zobrazit podle ID client_textu v mangosu</td></tr>
|
---|
289 | ';
|
---|
290 |
|
---|
291 |
|
---|
292 |
|
---|
293 | echo '</table>';
|
---|
294 | // Writeclient_text("SELECT * FROM client_text Where user = ".$_SESSION['UserID']." AND complete = '0'", '', 'mydevelop');
|
---|
295 | }
|
---|
296 |
|
---|
297 |
|
---|
298 | ShowFooter();
|
---|
299 | ?>
|
---|
300 |
|
---|