2005-09-10 19:25:43 +02:00
|
|
|
|
<?php
|
|
|
|
|
$title = "Himmel";
|
|
|
|
|
$header = "FAQ / Fragen an die Erzengel";
|
2005-11-06 18:07:07 +01:00
|
|
|
|
$submenus = 1;
|
2006-12-01 22:49:52 +01:00
|
|
|
|
include ("./inc/funktion_faq.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
include ("./inc/header.php");
|
|
|
|
|
include ("./inc/funktion_user.php");
|
2006-11-20 22:05:56 +01:00
|
|
|
|
include ("./inc/funktion_db.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2005-11-06 18:07:07 +01:00
|
|
|
|
//var init
|
|
|
|
|
$quest_bearb=0;
|
|
|
|
|
|
2006-04-19 23:01:04 +02:00
|
|
|
|
if (IsSet($_GET["quest"]))
|
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2005-11-06 18:07:07 +01:00
|
|
|
|
switch ($_GET["quest"])
|
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
// *---------------------------------------------------------------------------
|
|
|
|
|
// * Anfragen - Bearbeitung
|
|
|
|
|
// *---------------------------------------------------------------------------
|
|
|
|
|
// * je nach <20>bergabeoption ($quest) koennen Anfragen beantwortet werden oder
|
|
|
|
|
// * als FAQ uebergeben werden
|
|
|
|
|
// *---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
case "all":
|
2006-04-19 23:01:04 +02:00
|
|
|
|
$SQL="SELECT * FROM `Questions` ORDER BY QID DESC";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
?>
|
|
|
|
|
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>
|
|
|
|
|
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<?PHP
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
$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>";
|
2006-04-19 23:01:04 +02:00
|
|
|
|
if (mysql_result($Erg, $n, "AID")>0)
|
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "Ja</td>\n";
|
|
|
|
|
echo "<td>".mysql_result($Erg, $n, "Answer")."</td>\n";
|
|
|
|
|
echo "<td>".UID2Nick(mysql_result($Erg, $n, "AID"))."</td>\n";
|
2006-04-19 23:01:04 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "Nein</td>\n";
|
|
|
|
|
echo "<td> </td>\n";
|
|
|
|
|
echo "<td> </td>\n";
|
|
|
|
|
}
|
2006-04-19 23:01:04 +02:00
|
|
|
|
echo "<td><a href=\"faq.php?quest=edit&QID=".mysql_result($Erg, $n, "QID")."\">xxx</a></td>";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
break;
|
2006-04-19 23:01:04 +02:00
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
case "open":
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL="SELECT * FROM `Questions` WHERE `AID`='0' ORDER BY `QID` DESC";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$quest_bearb=1; // Fragenliste anzeigen
|
2006-04-19 23:01:04 +02:00
|
|
|
|
echo "\t\tOffene Anfragen:<br>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
break;
|
2006-04-19 23:01:04 +02:00
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
case "edit":
|
2006-04-19 23:01:04 +02:00
|
|
|
|
if (!IsSet($_GET["QID"]))
|
|
|
|
|
echo "\t\tFehlerhafter Aufruf...<br>Bitte die Bearbeitung nochmals beginnen :)\n";
|
|
|
|
|
else
|
|
|
|
|
{
|
2006-12-04 22:41:40 +01:00
|
|
|
|
$SQL = "SELECT * FROM `Questions` WHERE `QID`='". $_GET["QID"]. "'";
|
2006-04-19 23:01:04 +02:00
|
|
|
|
$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";
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
} // Abfrage der QID
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "save":
|
2006-04-19 23:01:04 +02:00
|
|
|
|
if (!IsSet($_GET["QID"]))
|
|
|
|
|
echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...";
|
|
|
|
|
else
|
|
|
|
|
{
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL = "UPDATE `Questions` SET `Question`='". $_GET["Question"].
|
|
|
|
|
"', `AID`='". $_SESSION['UID']. "' , `Answer`='". $_GET["Answer"]. "' ".
|
|
|
|
|
"WHERE `QID`='". $_GET["QID"]. "' LIMIT 1";
|
2006-04-19 23:08:37 +02:00
|
|
|
|
$Erg = db_query($SQL, "save Question");
|
2006-04-19 23:01:04 +02:00
|
|
|
|
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";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "transfer":
|
2006-04-19 23:01:04 +02:00
|
|
|
|
if (!IsSet($_GET["QID"]))
|
|
|
|
|
echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n";
|
|
|
|
|
else
|
|
|
|
|
{
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL1="SELECT * FROM `Questions` WHERE `QID`='". $_GET["QID"]. "'";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg = mysql_query($SQL1, $con);
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL2="INSERT INTO `FAQ` Values ('', '".
|
|
|
|
|
mysql_result($Erg, 0, "Question")."', '".mysql_result($Erg, 0, "Answer")."')";
|
2006-04-19 23:08:37 +02:00
|
|
|
|
$Erg = db_query($SQL2, "trasfert to request to the FAQ");
|
2006-04-19 23:01:04 +02:00
|
|
|
|
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";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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...
|
2006-04-19 23:01:04 +02:00
|
|
|
|
echo "\tFAQ-Liste:<br>";
|
|
|
|
|
echo "<a href=\"./faq.php?quest=faqnew\">Neuen Eintrag</a>";
|
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$SQL = "SELECT * FROM `FAQ`";
|
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
|
|
|
|
|
// anzahl zeilen
|
|
|
|
|
$Zeilen = mysql_num_rows($Erg);
|
|
|
|
|
|
2006-04-19 23:01:04 +02:00
|
|
|
|
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";
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "faqedit":
|
2005-11-06 18:07:07 +01:00
|
|
|
|
if (!IsSet($_GET["FAQID"]))
|
2006-04-19 23:01:04 +02:00
|
|
|
|
echo "\tFehlerhafter Aufruf...<br>Bitte die Bearbeitung nochmals beginnen :)\n";
|
|
|
|
|
else
|
|
|
|
|
{
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL = "SELECT * FROM `FAQ` WHERE `FID`='". $_GET["FAQID"]. "'";
|
2006-04-19 23:01:04 +02:00
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2006-04-19 23:01:04 +02:00
|
|
|
|
// anzahl zeilen
|
|
|
|
|
$Zeilen = mysql_num_rows($Erg);
|
2005-09-10 19:25:43 +02:00
|
|
|
|
?>
|
2005-11-06 18:07:07 +01:00
|
|
|
|
<form action="./faq.php" method="GET">
|
2005-09-10 19:25:43 +02:00
|
|
|
|
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>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<input type="hidden" name="FAQID" value="<?PHP echo $_GET["FAQID"]; ?>">
|
2005-09-10 19:25:43 +02:00
|
|
|
|
<input type="hidden" name="quest" value="faqsave">
|
|
|
|
|
<input type="submit" value="Sichern...">
|
|
|
|
|
</form>
|
|
|
|
|
<form action="./faq.php">
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<input type="hidden" name="FAQID" value="<?PHP echo $_GET["FAQID"]; ?>">
|
2005-09-10 19:25:43 +02:00
|
|
|
|
<input type="hidden" name="quest" value="faqdelete">
|
|
|
|
|
<input type="submit" value="Löschen...">
|
|
|
|
|
</form>
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "faqdelete";
|
2005-11-06 18:07:07 +01:00
|
|
|
|
if (!IsSet($_GET["FAQID"]))
|
2006-04-19 23:01:04 +02:00
|
|
|
|
echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n";
|
|
|
|
|
else
|
2005-11-06 18:07:07 +01:00
|
|
|
|
{
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL = "DELETE FROM `FAQ` WHERE `FID`='". $_GET["FAQID"]. "' LIMIT 1";
|
2006-04-19 23:08:37 +02:00
|
|
|
|
$Erg = db_query($SQL, "delate faq item");
|
2006-04-19 23:01:04 +02:00
|
|
|
|
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";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "faqsave";
|
2005-11-06 18:07:07 +01:00
|
|
|
|
if (!IsSet($_GET["FAQID"]))
|
2006-04-19 23:01:04 +02:00
|
|
|
|
echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n";
|
|
|
|
|
else
|
2005-11-06 18:07:07 +01:00
|
|
|
|
{
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL = "UPDATE `FAQ` SET `Frage`='". $_GET["Frage"]. "', `Antwort`='". $_GET["Antwort"].
|
|
|
|
|
"' WHERE `FID`='". $_GET["FAQID"]. "' LIMIT 1";
|
2006-04-19 23:08:37 +02:00
|
|
|
|
$Erg = db_query($SQL, $con);
|
2006-04-19 23:01:04 +02:00
|
|
|
|
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";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "faqnew":
|
|
|
|
|
?>
|
2005-11-06 18:07:07 +01:00
|
|
|
|
<form action="./faq.php" method="GET">
|
2005-09-10 19:25:43 +02:00
|
|
|
|
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;
|
2006-04-19 23:01:04 +02:00
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
case "faqnewsave";
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL = "INSERT INTO `FAQ` VALUES ('', '". $_GET["Frage"]. "', '". $_GET["Antwort"]. "')";
|
2006-04-19 23:08:37 +02:00
|
|
|
|
$Erg = db_query($SQL, "Save new FAQ entry");
|
2006-04-19 23:01:04 +02:00
|
|
|
|
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";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2006-04-19 23:01:04 +02:00
|
|
|
|
} //switch ($_GET["quest"])
|
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
// Hilfsroutine f<>r die Anfragen:
|
|
|
|
|
// Fragenliste anzeigen???
|
2006-04-19 23:01:04 +02:00
|
|
|
|
if ($quest_bearb==1)
|
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
// anzahl zeilen
|
|
|
|
|
$Zeilen = mysql_num_rows($Erg);
|
|
|
|
|
|
2006-04-19 23:01:04 +02:00
|
|
|
|
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";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2006-04-19 23:01:04 +02:00
|
|
|
|
} //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";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
include ("./inc/footer.php");
|
|
|
|
|
?>
|