summaryrefslogtreecommitdiff
path: root/www-ssl/nonpublic/faq.php
blob: 41e967a93a8187530baf77352349612fcadfacc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
$title = "Himmel";
$header = "FAQ / Fragen an die Erzengel";
include ("./inc/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"))."\n";
	  echo "\n<br>---<br>";
	}
}

include ("./inc/footer.php");
?>