source: quests/form.php@ 263

Last change on this file since 263 was 263, checked in by maron, 17 years ago

Páru oprav

File size: 5.0 KB
Line 
1<?php
2include('includes/global.php');
3
4 if (array_key_exists('ID', $_GET)) {
5 $QuestID = mysql_escape_string($_GET['ID']);
6
7 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests Where ID = $QuestID"));
8
9 $LineAJ = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests Where Language = '0'
10 AND entry = '".$Line['entry']."'"));
11
12 $User = @$_SESSION['User'];
13 $IDUser = $Database->SQLCommand("SELECT * FROM user Where id = '".$Line['User']."'");
14 $LineUser = mysql_fetch_array($IDUser);
15
16
17 if ($Line['Language'] <> '0' and $LineUser['user'] <> '') echo 'Pøelo¾il: <b>'.$LineUser['user'].'</b> <br />';
18 if ($Line['Take'] <> '0' and $Line['Take'] <> $Line['ID']) {
19 $Language = mysql_fetch_array($Database->SQLCommand("SELECT Language FROM quests Where ID = '".$Line['Take']."'"));
20 // echo $Language['Language'].' '.$Line['Take'];
21 if ($Language['Language'] <> 0)
22 echo 'Pøevzato z: <a href="form.php?ID='.$Line['Take'].'">'.$Line['Take'].'</a> <br />';
23 }
24 echo 'Quest: ';
25 if ($Line['Language'] <> '0') {
26 if ($Line['complete'] == 1) echo ' <b>Hotov</b><br />';
27 else echo ' <b> Ulo¾en v rozepsaných</b><br />';
28 } else {
29 echo ' <b>Anglická, pùvodní verze</b>';
30 }
31
32 if ($Line['Language'] <> '0') {
33 echo 'Známka Questu: <b>'.$Line['Vote'].'</b><br />';
34 }
35
36
37 if (Licence(0) and ($LineUser['ID'] <> $_SESSION['UserID']) and ($Line['Language'] <> 0)) {
38 $LineVote = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests_vote WHERE
39 IDuser = ".$_SESSION['UserID']." AND IDquest = $QuestID"));
40 if (!$LineVote) {
41 echo ' Hodnotit Quest: ';
42 for ($i=1; $i<6; ++$i)
43 echo '<a href="action.php?vote='.$i.'&amp;ID='.$QuestID.'">'.$i.'</a> ';
44 echo ' bodù (5 nejlep¹í)';
45 } else { echo ' Ji¾ jsi hlasoval: '.$LineVote['vote']; }
46 }
47 echo '<br><a href="ListQuests.php?searchentry='.$Line['entry'].'">Zobrazit v¹echny verze tohoto questu</a>';
48
49// Speciální znaky: $B - Odøádkování, $N - Jméno, $C - povolání
50?>
51 <form action="save.php" method="post">
52<?php
53 if (Licence(0)) {
54 echo '<input type="submit" value="Ulo¾it do rozepsaných" name="save" Title="Kliknìte na ulo¾it pro pozdìj¹í dokonèení Q">
55 <input type="submit" value="Dokonèeno" name="End" Title="Kliknìte na Dokonèeno jesli jsou v¹echny texty hotové a chcete ji¾ publikovat">';
56
57 }
58
59
60 if (Licence(1) and $Line['Language'] <> 0) {
61 echo '<input type="submit" value="Opravit" name="Repair" Title="Opravit po u¾ivateli chyby (Moderator only)">';
62 }
63 if (Licence(1) and ($Line['Language'] <> 0)) {
64 // echo '<input type="submit" value="Opravit Q" name="Repair"> Kliknìte Jestli si pøejete opravit chyby v Questu<br>';
65
66 echo ' <input type="hidden" name="UserRepair" value="'.$Line['User'].'">';
67 echo ' <a style="color: Red" title="smazat (Moderator only)" href="action.php?delete=1&amp;ID='.$QuestID.'">x</a>
68 <a style="color: Red" title="Není hotovo (Moderator only)" href="action.php?NotComplete=1&amp;ID='.$QuestID.'"><-</a>
69
70 ';
71 }
72?>
73 <input type="hidden" name="entry" value="<?php echo $LineAJ['entry']?>">
74 <input type="hidden" name="user" value="<?php echo $User ?>">
75 <input type="hidden" name="ID" value="<?php echo $QuestID ?>">
76 <table border="1" cellpadding="1" cellspacing="0">
77 <tr>
78 <th>Èíslo Q.: <?php echo $LineAJ['entry'];?></th>
79 <th>Nepøelo¾ené</th>
80 <th>Pøelo¾ené</th>
81 </tr>
82 <tr>
83 <th>Jazyk</th>
84 <td width="300">Anglický</td>
85 <td>
86 Pøelo¾eno do: <?php
87 if ($Line['Language'] <> 0)
88 $Language = $Line['Language'];
89 else {
90 $IDUser = $Database->SQLCommand("SELECT * FROM user Where id = '".@$_SESSION['UserID']."'");
91 $LineUser = mysql_fetch_array($IDUser);
92 $Language = $LineUser['Language']; //jiný user vyèítám
93 }
94 WriteLanguages($Language);
95 ?>
96 </td>
97 </tr>
98 <tr>
99 <th>Title</th>
100 <td width="300"><?php echo htmlspecialchars($LineAJ['Title'])?></td>
101 <td><input type="text" size="45" name="Title" value="<?php echo htmlspecialchars($Line['Title']) ?>"></td>
102 </tr>
103
104<?php foreach($Texts as $Index => $TextItem)
105 {
106 if (($LineAJ[$TextItem[0]] <> '') or ($Line[$TextItem[0]] <> ''))
107 echo '
108 <tr>
109 <th>'.$TextItem[0].'</th>
110 <td width="300">'.htmlspecialchars($LineAJ[$TextItem[0]]).'</td>
111 <td><textarea style="width: 300px; height: 100%;" name="'.$TextItem[0].'">'.htmlspecialchars($Line[$TextItem[0]]).'</textarea></td>
112 </tr>';
113 }
114?>
115 </table>
116 </form>
117<?php
118
119 } else {
120 // include 'ListQuests.php';
121
122 echo 'Nebylo zadáno ID <a href="index.php">zpìt</a>';
123
124 }
125
126
127
128 ShowFooter();
129?>
130
Note: See TracBrowser for help on using the repository browser.