admin faq
This commit is contained in:
parent
32b3ce5f90
commit
626b9a81f3
|
@ -3,7 +3,7 @@
|
|||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Erstellungszeit: 02. Juni 2011 um 22:21
|
||||
-- Erstellungszeit: 02. Juni 2011 um 23:02
|
||||
-- Server Version: 5.1.44
|
||||
-- PHP-Version: 5.3.1
|
||||
|
||||
|
@ -75,16 +75,17 @@ INSERT INTO `Counter` (`URL`, `Anz`) VALUES
|
|||
('login', 24),
|
||||
('logout', 13),
|
||||
('start', 25),
|
||||
('faq', 6),
|
||||
('faq', 16),
|
||||
('credits', 3),
|
||||
('register', 3),
|
||||
('admin_rooms', 70),
|
||||
('admin_angel_types', 69),
|
||||
('user_settings', 116),
|
||||
('user_messages', 108),
|
||||
('admin_groups', 99),
|
||||
('user_questions', 53),
|
||||
('admin_questions', 41);
|
||||
('user_messages', 111),
|
||||
('admin_groups', 104),
|
||||
('user_questions', 54),
|
||||
('admin_questions', 41),
|
||||
('admin_faq', 53);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
@ -94,27 +95,29 @@ INSERT INTO `Counter` (`URL`, `Anz`) VALUES
|
|||
|
||||
CREATE TABLE IF NOT EXISTS `FAQ` (
|
||||
`FID` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`Frage` text NOT NULL,
|
||||
`Antwort` text NOT NULL,
|
||||
`Frage_de` text NOT NULL,
|
||||
`Antwort_de` text NOT NULL,
|
||||
`Frage_en` text NOT NULL,
|
||||
`Antwort_en` text NOT NULL,
|
||||
PRIMARY KEY (`FID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=24 ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=26 ;
|
||||
|
||||
--
|
||||
-- Daten für Tabelle `FAQ`
|
||||
--
|
||||
|
||||
INSERT INTO `FAQ` (`FID`, `Frage`, `Antwort`) VALUES
|
||||
(1, 'Komme ich als Engel billiger/kostenlos auf den Congress?<br />\r\nDo I get in cheaper / for free to the congress as an angel ?', 'Nein, jeder Engel muss normal Eintritt bezahlen.<br />\r\nNo, every angel has to pay full price.'),
|
||||
(2, 'Was bekomme ich für meine Mitarbeit?<br />\r\nWhat can i expect in return for my help? \r\n', 'Jeder Engel der arbeitet bekommt ein kostenloses T-Shirt nach der Veranstalltung <br />\r\nEvery working angel gets a free shirt after the event. '),
|
||||
(3, 'Wie lange muss ich als Engel arbeiten?<br />\r\nHow long do I have to work as an angel ?', 'Diese Frage ist schwer zu beantworten. Es hängt z.B. davon ab, was man macht (z.B. Workshop-Engel) und wieviele Engel wir zusammen bekommen. <br />\r\nThis is difficult to answer. It depends on what you decide to do (e.g. workshop angel) and how many people will attend. '),
|
||||
(6, 'Ich bin erst XX Jahre alt. Kann ich überhaupt helfen?<br />\r\nI''m only XX years old. Can I help anyway?', 'Wir können jede helfende Hand gebrauchen. Wenn du alt genug bist, um zum Congress zu kommen, bist du auch alt genug zu helfen. <br />\r\nWe need every help we can get. If your old enough to come to the congress, your old enough to help.'),
|
||||
(8, 'Wer sind eigentlich die Erzengel?<br />\r\nWho <b>are</b> the Arch-Angels?\r\n', 'Erzengel sind dieses Jahr: BugBlue, TabascoEye, Jeedi, Daizy, volty<br /> \r\nThe ArchAngels for this year are: BugBlue, TabascoEye, Jeedi, Daizy, volty\r\n'),
|
||||
(9, 'Gibt es dieses Jahr wieder einen IRC-Channel für Engel?<br />\r\nWill there be an IRC-channel for angels again?', 'Ja, im IRC-Net existiert #chaos-angel. Einfach mal reinschaun!<br />\r\nYes, in the IRC-net there''s #chaos-angel. Just have a look!'),
|
||||
(10, 'Wie gehe ich mit den Besuchern um? <br />\r\nHow do I treat visitors?', 'Man soll gegenüber den Besuchern immer höflich und freundlich sein, auch wenn diese gestresst sind. Wenn man das Gefühl hat, dass man mit der Situation nicht mehr klarkommt, sollte man sich jemanden zur Unterstützung holen, bevor man selbst auch gestresst wird :-) <br />\r\nYou should always be polite and friendly, especially if they are stressed. When you feel you can''t handle it on your own, get someone to help you out before you get so stressed yourself that you get impolite.'),
|
||||
(11, 'Wann sind die Engelbesprechungen? <br />\r\nWhen are the angels briefings?', 'Das wird vor Ort noch festgelegt und steht im Himmelnewssystem.<br />\r\nThe information on the Angel Briefings will be in the news section of this system.'),
|
||||
(12, 'Was muss ich noch bedenken?<br />\r\nAnything else I should know?', 'Man sollte nicht total übermüdet oder ausgehungert, wenn n man einen Einsatz hat. Eine gewisse Fitness ist hilfreich.<br />\r\nYou should not be exhausted or starving when you arrive for a shift. A reasonable amount of fitness for work would be very helpful.'),
|
||||
(13, 'Ich habe eine Frage, auf die ich in der FAQ keine Antwort gefunden habe. Wohin soll ich mich wenden? <br />\r\nI have a guestion not answered here. Who can I ask?', 'Bei weitere Fragen kannst du die Anfragen an die Erzengel Formular benutzen.<br />\r\nIf you have further questions, you can use the Questions for the ArchAngels form.'),
|
||||
(20, 'Wer muss alles Eintritt zahlen?<br />\r\nWho has to pay the full entrance price?', 'Jeder. Zumindest, solange er/sie älter als 12 Jahre ist...<br />\r\nEveryone who is at older than 12 years old.');
|
||||
INSERT INTO `FAQ` (`FID`, `Frage_de`, `Antwort_de`, `Frage_en`, `Antwort_en`) VALUES
|
||||
(1, 'Komme ich als Engel billiger/kostenlos auf den Congress?', 'Nein, jeder Engel muss normal Eintritt bezahlen.', 'Do I get in cheaper / for free to the congress as an angel ?', 'No, every angel has to pay full price.'),
|
||||
(2, 'Was bekomme ich für meine Mitarbeit?', 'Jeder Engel der arbeitet bekommt ein kostenloses T-Shirt nach der Veranstalltung', 'What can i expect in return for my help?', 'Every working angel gets a free shirt after the event.'),
|
||||
(3, 'Wie lange muss ich als Engel arbeiten?', 'Diese Frage ist schwer zu beantworten. Es hängt z.B. davon ab, was man macht (z.B. Workshop-Engel) und wieviele Engel wir zusammen bekommen.', 'How long do I have to work as an angel ?', 'This is difficult to answer. It depends on what you decide to do (e.g. workshop angel) and how many people will attend.'),
|
||||
(6, 'Ich bin erst XX Jahre alt. Kann ich überhaupt helfen?', 'Wir können jede helfende Hand gebrauchen. Wenn du alt genug bist, um zum Congress zu kommen, bist du auch alt genug zu helfen.', 'I''m only XX years old. Can I help anyway?', 'We need every help we can get. If your old enough to come to the congress, your old enough to help.'),
|
||||
(8, 'Wer sind eigentlich die Erzengel?', 'Erzengel sind dieses Jahr: BugBlue, TabascoEye, Jeedi, Daizy, volty', 'Who <b>are</b> the Arch-Angels?', 'The ArchAngels for this year are: BugBlue, TabascoEye, Jeedi, Daizy, volty'),
|
||||
(9, 'Gibt es dieses Jahr wieder einen IRC-Channel für Engel?', 'Ja, im IRC-Net existiert #chaos-angel. Einfach mal reinschaun!', 'Will there be an IRC-channel for angels again?', 'Yes, in the IRC-net there''s #chaos-angel. Just have a look!'),
|
||||
(10, 'Wie gehe ich mit den Besuchern um?', 'Man soll gegenüber den Besuchern immer höflich und freundlich sein, auch wenn diese gestresst sind. Wenn man das Gefühl hat, dass man mit der Situation nicht mehr klarkommt, sollte man sich jemanden zur Unterstützung holen, bevor man selbst auch gestresst wird :-)', 'How do I treat visitors?', 'You should always be polite and friendly, especially if they are stressed. When you feel you can''t handle it on your own, get someone to help you out before you get so stressed yourself that you get impolite.'),
|
||||
(11, 'Wann sind die Engelbesprechungen?', 'Das wird vor Ort noch festgelegt und steht im Himmelnewssystem.', 'When are the angels briefings?', 'The information on the Angel Briefings will be in the news section of this system.'),
|
||||
(12, 'Was muss ich noch bedenken?', 'Man sollte nicht total übermüdet oder ausgehungert, wenn n man einen Einsatz hat. Eine gewisse Fitness ist hilfreich.', 'Anything else I should know?', 'You should not be exhausted or starving when you arrive for a shift. A reasonable amount of fitness for work would be very helpful.'),
|
||||
(13, 'Ich habe eine Frage, auf die ich in der FAQ keine Antwort gefunden habe. Wohin soll ich mich wenden?', 'Bei weitere Fragen kannst du die Anfragen an die Erzengel Formular benutzen.', 'I have a guestion not answered here. Who can I ask?', 'If you have further questions, you can use the Questions for the ArchAngels form.'),
|
||||
(20, 'Wer muss alles Eintritt zahlen?', 'Jeder. Zumindest, solange er/sie älter als 12 Jahre ist...', 'Who has to pay the full entrance price?', 'Everyone who is at older than 12 years old.');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
@ -128,7 +131,7 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` (
|
|||
`privilege_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `group_id` (`group_id`,`privilege_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=36 ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=40 ;
|
||||
|
||||
--
|
||||
-- Daten für Tabelle `GroupPrivileges`
|
||||
|
@ -140,12 +143,13 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES
|
|||
(31, -2, 11),
|
||||
(30, -2, 9),
|
||||
(23, -1, 2),
|
||||
(34, -4, 12),
|
||||
(33, -4, 7),
|
||||
(36, -4, 7),
|
||||
(37, -4, 13),
|
||||
(29, -2, 3),
|
||||
(28, -2, 4),
|
||||
(12, -5, 10),
|
||||
(35, -4, 6);
|
||||
(38, -4, 12),
|
||||
(39, -4, 6);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
@ -256,7 +260,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` (
|
|||
`desc` varchar(1024) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ;
|
||||
|
||||
--
|
||||
-- Daten für Tabelle `Privileges`
|
||||
|
@ -274,7 +278,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES
|
|||
(9, 'user_messages', 'Writing and reading messages from user to user'),
|
||||
(10, 'admin_groups', 'Manage usergroups and their rights'),
|
||||
(11, 'user_questions', 'Let users ask questions'),
|
||||
(12, 'admin_questions', 'Answer user''s questions');
|
||||
(12, 'admin_questions', 'Answer user''s questions'),
|
||||
(13, 'admin_faq', 'Edit FAQs');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
@ -1009,7 +1014,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES
|
|||
('user_questions', 'DE', 'Erzengel fragen'),
|
||||
('user_questions', 'EN', 'Ask arch angel'),
|
||||
('admin_questions', 'DE', 'Fragen beantworten'),
|
||||
('admin_questions', 'EN', 'Answer questions');
|
||||
('admin_questions', 'EN', 'Answer questions'),
|
||||
('admin_faq', 'DE', 'FAQs bearbeiten'),
|
||||
('admin_faq', 'EN', 'Edit FAQs');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
@ -1052,7 +1059,7 @@ CREATE TABLE IF NOT EXISTS `User` (
|
|||
--
|
||||
|
||||
INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES
|
||||
(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307053257, '0000-00-00 00:00:00', '', '', ''),
|
||||
(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307055685, '0000-00-00 00:00:00', '', '', ''),
|
||||
(147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1307042703, '2011-06-02 00:55:09', '', '', '');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
function admin_faq() {
|
||||
if (!isset ($_REQUEST['action'])) {
|
||||
$faqs_html = "";
|
||||
$faqs = sql_select("SELECT * FROM `FAQ`");
|
||||
foreach ($faqs as $faq) {
|
||||
$faqs_html .= '<tr><td><dl><dt>' . $faq['Frage_de'] . '</dt><dd>' . $faq['Antwort_de'] . '</dd></dl></td><td><dl><dt>' . $faq['Frage_en'] . '</dt><dd>' . $faq['Antwort_en'] . '</dd></dl></td>';
|
||||
$faqs_html .= '<td><a href="' . page_link_to("admin_faq") . '&action=edit&id=' . $faq['FID'] . '">Edit</a></td></tr>';
|
||||
}
|
||||
return template_render('../templates/admin_faq.html', array (
|
||||
'link' => page_link_to("admin_faq"),
|
||||
'faqs' => $faqs_html
|
||||
));
|
||||
} else {
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'create' :
|
||||
$frage = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['frage']));
|
||||
$antwort = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['antwort']));
|
||||
$question = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['question']));
|
||||
$answer = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['answer']));
|
||||
sql_query("INSERT INTO `FAQ` SET `Frage_de`='" . sql_escape($frage) . "', `Frage_en`='" . sql_escape($question) . "', `Antwort_de`='" . sql_escape($antwort) . "', `Antwort_en`='" . sql_escape($answer) . "'");
|
||||
header("Location: " . page_link_to("admin_faq"));
|
||||
break;
|
||||
|
||||
case 'save' :
|
||||
if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
||||
$id = $_REQUEST['id'];
|
||||
else
|
||||
return error("Incomplete call, missing FAQ ID.");
|
||||
|
||||
$faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
||||
if (count($faq) > 0) {
|
||||
list ($faq) = $faq;
|
||||
|
||||
$frage = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['frage']));
|
||||
$antwort = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['antwort']));
|
||||
$question = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['question']));
|
||||
$answer = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['answer']));
|
||||
sql_query("UPDATE `FAQ` SET `Frage_de`='" . sql_escape($frage) . "', `Frage_en`='" . sql_escape($question) . "', `Antwort_de`='" . sql_escape($antwort) . "', `Antwort_en`='" . sql_escape($answer) . "' WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
||||
header("Location: " . page_link_to("admin_faq"));
|
||||
} else
|
||||
return error("No FAQ found.");
|
||||
break;
|
||||
|
||||
case 'edit' :
|
||||
if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
||||
$id = $_REQUEST['id'];
|
||||
else
|
||||
return error("Incomplete call, missing FAQ ID.");
|
||||
|
||||
$faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
||||
if (count($faq) > 0) {
|
||||
list ($faq) = $faq;
|
||||
|
||||
return template_render('../templates/admin_faq_edit_form.html', array (
|
||||
'link' => page_link_to("admin_faq"),
|
||||
'id' => $id,
|
||||
'frage' => $faq['Frage_de'],
|
||||
'antwort' => $faq['Antwort_de'],
|
||||
'question' => $faq['Frage_en'],
|
||||
'answer' => $faq['Antwort_en']
|
||||
));
|
||||
} else
|
||||
return error("No FAQ found.");
|
||||
break;
|
||||
|
||||
case 'delete' :
|
||||
if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
||||
$id = $_REQUEST['id'];
|
||||
else
|
||||
return error("Incomplete call, missing FAQ ID.");
|
||||
|
||||
$faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
||||
if (count($faq) > 0) {
|
||||
list ($faq) = $faq;
|
||||
|
||||
sql_query("DELETE FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
||||
header("Location: " . page_link_to("admin_faq"));
|
||||
} else
|
||||
return error("No FAQ found.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -2,29 +2,17 @@
|
|||
function guest_faq() {
|
||||
$html = "";
|
||||
$faqs = sql_select("SELECT * FROM `FAQ`");
|
||||
foreach ($faqs as $faq)
|
||||
if ($faq['Antwort'] != "") {
|
||||
list ($frage_de, $frage_en) = explode('<br />', $faq['Frage']);
|
||||
list ($antwort_de, $antwort_en) = explode('<br />', $faq['Antwort']);
|
||||
foreach ($faqs as $faq) {
|
||||
$html .= "<dl>";
|
||||
if ($_SESSION['Sprache'] == "DE") {
|
||||
$html .= "<dt>" . $frage_de . "</dt>";
|
||||
$html .= "<dd>" . $antwort_de . "</dd>";
|
||||
$html .= "<dt>" . $faq['Frage_de'] . "</dt>";
|
||||
$html .= "<dd>" . $faq['Antwort_de'] . "</dd>";
|
||||
} else {
|
||||
$html .= "<dt>" . $frage_en . "</dt>";
|
||||
$html .= "<dd>" . $antwort_en . "</dd>";
|
||||
$html .= "<dt>" . $faq['Frage_en'] . "</dt>";
|
||||
$html .= "<dd>" . $faq['Antwort_en'] . "</dd>";
|
||||
}
|
||||
$html .= "</dl>";
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
function noAnswer() {
|
||||
global $con;
|
||||
|
||||
$SQL = "SELECT UID FROM Questions WHERE `AID`='0'";
|
||||
$Res = mysql_query($SQL, $con);
|
||||
|
||||
return mysql_num_rows($Res);
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -32,7 +32,8 @@ function make_navigation() {
|
|||
"admin_questions",
|
||||
"admin_angel_types",
|
||||
"admin_rooms",
|
||||
"admin_groups"
|
||||
"admin_groups",
|
||||
"admin_faq"
|
||||
));
|
||||
return $menu;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Deutsch
|
||||
</th>
|
||||
<th>
|
||||
English
|
||||
</th>
|
||||
<th>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
%faqs%
|
||||
</tbody>
|
||||
</table>
|
||||
<hr/>Create new FAQ:
|
||||
<form action="%link%&action=create" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Frage
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="frage"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Antwort
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="antwort"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Question
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="question"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Answer
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="answer"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="submit" name="submit" value="Create" />
|
||||
</form>
|
|
@ -0,0 +1,41 @@
|
|||
Edit FAQ:
|
||||
<form action="%link%&action=save" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Frage
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="frage">%frage%</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Antwort
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="antwort">%antwort%</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Question
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="question">%question%</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Answer
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="answer">%answer%</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="id" value="%id%" /><input type="submit" name="submit" value="Save" />
|
||||
</form><hr/>
|
||||
<form action="%link%&action=delete" method="post">
|
||||
Delete FAQ: <input type="hidden" name="id" value="%id%" /><input type="submit" name="submit" value="Delete" />
|
||||
</form>
|
1
txt/TODO
1
txt/TODO
|
@ -7,6 +7,7 @@
|
|||
* Privilegien korrigieren (an die vom CVS anpassen)
|
||||
* Beim Raum-Management die benötigten Engel anzeigen
|
||||
* Löschen nur mit Rückfrage
|
||||
* FAQ ordentlich mehrsprachig machen
|
||||
|
||||
* schichten ueber monatsgrenzen einbaue im moment werden die tage nur
|
||||
hochgezaehlt und die monatzgrenzen werden ignoriert
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
<h4 class="menu"> Anfragen und FAQ </h4>
|
||||
|
||||
<li><a href="faq.php?quest=all">Alle Anfragen</a></li>
|
||||
<li><a href="faq.php?quest=open">Offene Anfragen (<?php echo noAnswer(); ?>)</a></li>
|
||||
<li><a href="faq.php?quest=faq">FAQ-Liste editiern</a></li>
|
||||
|
|
@ -1,271 +0,0 @@
|
|||
<?php
|
||||
require_once ('../bootstrap.php');
|
||||
|
||||
$title = "Himmel";
|
||||
$header = "FAQ / Fragen an die Erzengel";
|
||||
$submenus = 1;
|
||||
include ("includes/header.php");
|
||||
include ("includes/funktion_db.php");
|
||||
|
||||
//var init
|
||||
$quest_bearb = 0;
|
||||
|
||||
if (IsSet ($_GET["quest"])) {
|
||||
|
||||
switch ($_GET["quest"]) {
|
||||
|
||||
// *---------------------------------------------------------------------------
|
||||
// * Anfragen - Bearbeitung
|
||||
// *---------------------------------------------------------------------------
|
||||
// * je nach <20>bergabeoption ($quest) koennen Anfragen beantwortet werden oder
|
||||
// * als FAQ uebergeben werden
|
||||
// *---------------------------------------------------------------------------
|
||||
|
||||
case "all" :
|
||||
$SQL = "SELECT * FROM `Questions` ORDER BY QID DESC";
|
||||
?>
|
||||
Alle Anfragen:<br />
|
||||
<table width="100%" class="border" cellpadding="2" cellspacing="1">
|
||||
<tr class="contenttopic">
|
||||
<th>Frage</th>
|
||||
<th>Anfragender</th>
|
||||
<th>Beantwortet?</th>
|
||||
<th>Antwort</th>
|
||||
<th>Antwort von</th>
|
||||
<th>change</th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
// anzahl zeilen
|
||||
$Zeilen = mysql_num_rows($Erg);
|
||||
for ($n = 0; $n < $Zeilen; $n++) {
|
||||
echo "<tr class=\"content\">\n";
|
||||
echo "<td>" . mysql_result($Erg, $n, "Question") . "</td>\n";
|
||||
echo "<td>" . UID2Nick(mysql_result($Erg, $n, "UID")) . "</td>\n";
|
||||
echo "<td>";
|
||||
if (mysql_result($Erg, $n, "AID") > 0) {
|
||||
echo "Ja</td>\n";
|
||||
echo "<td>" . mysql_result($Erg, $n, "Answer") . "</td>\n";
|
||||
echo "<td>" . UID2Nick(mysql_result($Erg, $n, "AID")) . "</td>\n";
|
||||
} else {
|
||||
echo "Nein</td>\n";
|
||||
echo "<td> </td>\n";
|
||||
echo "<td> </td>\n";
|
||||
}
|
||||
echo "<td><a href=\"faq.php?quest=edit&QID=" . mysql_result($Erg, $n, "QID") . "\">xxx</a></td>";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
break;
|
||||
|
||||
case "open" :
|
||||
$SQL = "SELECT * FROM `Questions` WHERE `AID`='0' ORDER BY `QID` DESC";
|
||||
$quest_bearb = 1; // Fragenliste anzeigen
|
||||
echo "\t\tOffene Anfragen:<br />\n";
|
||||
break;
|
||||
|
||||
case "edit" :
|
||||
if (!IsSet ($_GET["QID"]))
|
||||
echo "\t\tFehlerhafter Aufruf...<br />Bitte die Bearbeitung nochmals beginnen :)\n";
|
||||
else {
|
||||
$SQL = "SELECT * FROM `Questions` WHERE `QID`='" . $_GET["QID"] . "'";
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
echo "\t\t<form action=\"./faq.php\" method=\"GET\">\n";
|
||||
echo "\t\tAnfrage von <b>" . UID2NICK(mysql_result($Erg, 0, "UID")) . "</b>:<br />\n";
|
||||
echo "\t\t<textarea name=\"Question\" rows=\"3\" cols=\"80\">" .
|
||||
mysql_result($Erg, 0, "Question") . "</textarea>\n";
|
||||
echo "<br /><br />Antwort der Erzengel:<br />\n";
|
||||
if (mysql_result($Erg, 0, "Answer") == "")
|
||||
echo "\t\t<textarea name=\"Answer\" rows=\"5\" cols=\"80\">" .
|
||||
"Bitte hier die Antwort eintragen...</textarea><br />\n";
|
||||
else
|
||||
echo "\t\t<textarea name=\"Answer\" rows=\"5\" cols=\"80\">" .
|
||||
mysql_result($Erg, 0, "Answer") . "</textarea>\n<br />\n";
|
||||
echo "\t\t<input type=\"hidden\" name=\"QID\" value=\"" . $_GET["QID"] . "\">\n";
|
||||
echo "\t\t<input type=\"hidden\" name=\"quest\" value=\"save\">\n";
|
||||
echo "\t\t<input type=\"submit\" value=\"Sichern...\">\n";
|
||||
echo "\t</form>\n";
|
||||
if (mysql_result($Erg, 0, "AID") <> "0") {
|
||||
echo "\tDu kannst diese Anfrage so wie sie ist, als Engel-FAQ eintrag übernehmen.<br />\n";
|
||||
echo "<a href=\"./faq.php?quest=transfer&QID=" . $_GET["QID"] . "\">Als FAQ-Eintrag sichern...</a>\n";
|
||||
}
|
||||
} // Abfrage der QID
|
||||
break;
|
||||
|
||||
case "save" :
|
||||
if (!IsSet ($_GET["QID"]))
|
||||
echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...";
|
||||
else {
|
||||
$SQL = "UPDATE `Questions` SET `Question`='" . $_GET["Question"] .
|
||||
"', `AID`='" . $_SESSION['UID'] . "' , `Answer`='" . $_GET["Answer"] . "' " .
|
||||
"WHERE `QID`='" . $_GET["QID"] . "' LIMIT 1";
|
||||
$Erg = db_query($SQL, "save Question");
|
||||
if ($Erg == 1) {
|
||||
echo "\tDer Eintrag wurde geändert<br />\n";
|
||||
SetHeaderGo2Back();
|
||||
} else
|
||||
echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n";
|
||||
}
|
||||
break;
|
||||
|
||||
case "transfer" :
|
||||
if (!IsSet ($_GET["QID"]))
|
||||
echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n";
|
||||
else {
|
||||
$SQL1 = "SELECT * FROM `Questions` WHERE `QID`='" . $_GET["QID"] . "'";
|
||||
$Erg = mysql_query($SQL1, $con);
|
||||
$SQL2 = "INSERT INTO `FAQ` Values ('', '" .
|
||||
mysql_result($Erg, 0, "Question") . "', '" . mysql_result($Erg, 0, "Answer") . "')";
|
||||
$Erg = db_query($SQL2, "trasfert to request to the FAQ");
|
||||
if ($Erg == 1)
|
||||
echo "\tDer Eintrag wurde übertragen.<br />\n";
|
||||
else
|
||||
echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n";
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// *---------------------------------------------------------------------------
|
||||
// * FAQ - Bearbeitung
|
||||
// *---------------------------------------------------------------------------
|
||||
// * je nach <20>bergabeoption ($quest) koennen FAQ's erfasst werden,
|
||||
// * geaendert oder geloscht werden...
|
||||
// *---------------------------------------------------------------------------
|
||||
case "faq" :
|
||||
$quest_bearb = 0; // keine Fragenliste anzeigen, FAQ editieren...
|
||||
echo "\tFAQ-Liste:<br />";
|
||||
echo "<a href=\"./faq.php?quest=faqnew\">Neuen Eintrag</a>";
|
||||
|
||||
$SQL = "SELECT * FROM `FAQ`";
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
|
||||
// anzahl zeilen
|
||||
$Zeilen = mysql_num_rows($Erg);
|
||||
|
||||
for ($n = 0; $n < $Zeilen; $n++)
|
||||
if (mysql_result($Erg, $n, "Antwort") != "") {
|
||||
echo "\t<p class=\"question\">" . mysql_result($Erg, $n, "Frage") . "</p>\n";
|
||||
echo "\t<p class=\"answetion\">" . mysql_result($Erg, $n, "Antwort") . "</p>\n";
|
||||
echo "\t<a href=\"./faq.php?quest=faqedit&FAQID=" . mysql_result($Erg, $n, "FID") .
|
||||
"\">Bearbeiten</a>\n<br />---<br />\n";
|
||||
}
|
||||
break;
|
||||
|
||||
case "faqedit" :
|
||||
if (!IsSet ($_GET["FAQID"]))
|
||||
echo "\tFehlerhafter Aufruf...<br />Bitte die Bearbeitung nochmals beginnen :)\n";
|
||||
else {
|
||||
$SQL = "SELECT * FROM `FAQ` WHERE `FID`='" . $_GET["FAQID"] . "'";
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
|
||||
// anzahl zeilen
|
||||
$Zeilen = mysql_num_rows($Erg);
|
||||
?>
|
||||
<form action="./faq.php" method="GET">
|
||||
Frage:<br />
|
||||
<textarea name="Frage" rows="3" cols="80"><?php echo mysql_result($Erg, 0, "Frage"); ?></textarea>
|
||||
<br /><br />
|
||||
Antwort:<br />
|
||||
<textarea name="Antwort" rows="5" cols="80"><?php echo mysql_result($Erg, 0, "Antwort"); ?></textarea><br />
|
||||
<input type="hidden" name="FAQID" value="<?php echo $_GET["FAQID"]; ?>">
|
||||
<input type="hidden" name="quest" value="faqsave">
|
||||
<input type="submit" value="Sichern...">
|
||||
</form>
|
||||
<form action="./faq.php">
|
||||
<input type="hidden" name="FAQID" value="<?php echo $_GET["FAQID"]; ?>">
|
||||
<input type="hidden" name="quest" value="faqdelete">
|
||||
<input type="submit" value="Löschen...">
|
||||
</form>
|
||||
<?php
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case "faqdelete";
|
||||
if (!IsSet ($_GET["FAQID"]))
|
||||
echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n";
|
||||
else {
|
||||
$SQL = "DELETE FROM `FAQ` WHERE `FID`='" . $_GET["FAQID"] . "' LIMIT 1";
|
||||
$Erg = db_query($SQL, "delate faq item");
|
||||
if ($Erg == 1)
|
||||
echo "\tDer Eintrag wurde gelöscht<br />\n";
|
||||
else
|
||||
echo "\tEin Fehler ist aufgetreten. Ist der Eintag bereits gelöscht gewesen?\n";
|
||||
}
|
||||
break;
|
||||
|
||||
case "faqsave";
|
||||
if (!IsSet ($_GET["FAQID"]))
|
||||
echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n";
|
||||
else {
|
||||
$SQL = "UPDATE `FAQ` SET `Frage`='" . $_GET["Frage"] . "', `Antwort`='" . $_GET["Antwort"] .
|
||||
"' WHERE `FID`='" . $_GET["FAQID"] . "' LIMIT 1";
|
||||
$Erg = db_query($SQL, $con);
|
||||
if ($Erg == 1)
|
||||
echo "\tDer Eintrag wurde geändert<br />\n";
|
||||
else
|
||||
echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n";
|
||||
}
|
||||
break;
|
||||
|
||||
case "faqnew" :
|
||||
?>
|
||||
<form action="./faq.php" method="GET">
|
||||
Frage:<br />
|
||||
<textarea name="Frage" rows="3" cols="80">Frage...</textarea><br /><br />
|
||||
Antwort:<br />
|
||||
<textarea name="Antwort" rows="5" cols="80">Antwort</textarea><br />
|
||||
<input type="hidden" name="quest" value="faqnewsave">
|
||||
<input type="submit" value="Sichern...">
|
||||
</form>
|
||||
<?php
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case "faqnewsave";
|
||||
$SQL = "INSERT INTO `FAQ` VALUES ('', '" . $_GET["Frage"] . "', '" . $_GET["Antwort"] . "')";
|
||||
$Erg = db_query($SQL, "Save new FAQ entry");
|
||||
if ($Erg == 1)
|
||||
echo "\tDer Eintrag wurde erfasst.<br />\n";
|
||||
else
|
||||
echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n";
|
||||
break;
|
||||
|
||||
} //switch ($_GET["quest"])
|
||||
|
||||
// Hilfsroutine f<>r die Anfragen:
|
||||
// Fragenliste anzeigen???
|
||||
if ($quest_bearb == 1) {
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
// anzahl zeilen
|
||||
$Zeilen = mysql_num_rows($Erg);
|
||||
|
||||
if ($Zeilen == 0)
|
||||
echo "\tkeine vorhanden...\n";
|
||||
else
|
||||
for ($n = 0; $n < $Zeilen; $n++) {
|
||||
echo "\t<p>" . nl2br(mysql_result($Erg, $n, "Question")) . "\n</p><br />\n";
|
||||
echo "\t<a href=\"./faq.php?quest=edit&QID=" . mysql_result($Erg, $n, "QID") . "\">Bearbeiten</a>\n";
|
||||
echo "<br />---<br />\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} //if (IsSet($_GET["quest"]))
|
||||
else {
|
||||
echo "Bitte wähle aus, ob du:\n";
|
||||
echo "<ul>\n";
|
||||
echo "\t<li><a href=\"./faq.php?quest=all\">Alle Anfragen anzeigen/bearbeiten möchtest</a></li>\n";
|
||||
echo "\t<li><a href=\"./faq.php?quest=open\">Alle offenen Anfragen anzeigen/bearbeiten möchtest (" .
|
||||
noAnswer() . ")</a></li>\n";
|
||||
echo "\t<li><a href=\"./faq.php?quest=faq\">Die FAQ's anzeigen/bearbeiten</a></li>\n";
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
include ("includes/footer.php");
|
||||
?>
|
|
@ -109,6 +109,11 @@ td, th {
|
|||
border: 1px solid #888;
|
||||
}
|
||||
|
||||
textarea {
|
||||
height: 200px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.background {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
|
|
@ -73,6 +73,10 @@ if (in_array($p, $privileges)) {
|
|||
elseif ($p == "admin_groups") {
|
||||
require_once ('includes/pages/admin_groups.php');
|
||||
$content = admin_groups();
|
||||
}
|
||||
elseif ($p == "admin_faq") {
|
||||
require_once ('includes/pages/admin_faq.php');
|
||||
$content = admin_faq();
|
||||
} else {
|
||||
require_once ('includes/pages/guest_start.php');
|
||||
$content = guest_start();
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
<?php
|
||||
require_once ('../bootstrap.php');
|
||||
|
||||
$title = "Himmel";
|
||||
$header = "FAQ / Fragen an die Erzengel";
|
||||
include "includes/header.php";
|
||||
|
||||
// Erstaufruf, oder Frage bereits abgeschickt?
|
||||
if (!isset ($_POST["eUID"])) {
|
||||
Print_Text(35);
|
||||
?>
|
||||
<br /><br />
|
||||
<form action="./faq.php" method="POST">
|
||||
<input type="hidden" name="eUID" value="<?php echo $_SESSION['UID']; ?>">
|
||||
<textarea name="frage" cols="40" rows="10"><?php Print_Text(36); ?></textarea><br /><br />
|
||||
<input type="submit" value="<?php Print_Text("save"); ?>">
|
||||
</form>
|
||||
<?php
|
||||
|
||||
|
||||
} else {
|
||||
// Auswertung d. Formular-Daten:
|
||||
|
||||
echo "<b>" . Get_Text(37) . "</b><br /><br />\n" . nl2br($_POST["frage"]) . "<br /><br />\n" . Get_Text(38) . "<br />\n";
|
||||
|
||||
$SQL = "INSERT INTO `Questions` VALUES ('', '" . $_SESSION['UID'] . "', '" . $_POST["frage"] . "', '', '')";
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
|
||||
}
|
||||
// Bisherige Anfragen:
|
||||
echo "<br />\n<b>" . Get_Text(39) . "</b><br />\n";
|
||||
echo "<hr width=\"99%\">\n";
|
||||
echo "<br /><b>" . Get_Text(40) . "</b><br />\n";
|
||||
|
||||
$SQL = "SELECT * FROM `Questions` WHERE `UID` = " . $_SESSION['UID'] . " AND `AID`='0' ORDER BY 'QID' DESC";
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
|
||||
// anzahl zeilen
|
||||
$Zeilen = mysql_num_rows($Erg);
|
||||
|
||||
if ($Zeilen == 0) {
|
||||
Print_Text(41);
|
||||
|
||||
} else {
|
||||
for ($n = 0; $n < $Zeilen; $n++) {
|
||||
echo "<p class='question'>" . nl2br(mysql_result($Erg, $n, "Question")) . "<br />\n";
|
||||
// Es gibt ja noch keine Antwort:
|
||||
// echo "<p class='answer'>".nl2br(mysql_result($Erg, $n, "Answer"))."</p>\n";
|
||||
echo "\n<br />---<br />";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<hr width=\"99%\">\n";
|
||||
echo "<br /><b>" . Get_Text(42) . "</b><br />\n";
|
||||
$SQL = "SELECT * FROM `Questions` WHERE `UID`='" . $_SESSION['UID'] . "' and `AID`<>'0' ORDER BY 'QID' DESC";
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
|
||||
// anzahl zeilen
|
||||
$Zeilen = mysql_num_rows($Erg);
|
||||
|
||||
if ($Zeilen == 0) {
|
||||
Print_Text(41);
|
||||
} else {
|
||||
for ($n = 0; $n < $Zeilen; $n++) {
|
||||
echo "<p class='question'>" . nl2br(mysql_result($Erg, $n, "Question")) . "<br />\n";
|
||||
echo "<p class='answer'>" . nl2br(mysql_result($Erg, $n, "Answer")) .
|
||||
"@" . UID2Nick(mysql_result($Erg, $n, "AID")) . "\n";
|
||||
echo "\n<br />---<br />";
|
||||
}
|
||||
}
|
||||
|
||||
include ("includes/footer.php");
|
||||
?>
|
Loading…
Reference in New Issue