[go: up one dir, main page]

Menu

[r10]: / answeredQestionsTable.php  Maximize  Restore  History

Download this file

67 lines (57 with data), 2.2 kB

 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
<?php
include('includes/databaseLogin.php');
include('includes/installedLanguage.php');
echo "<!DOCTYPE html>";
?>
<html>
<head>
<link rel="stylesheet" href="css/style.css" />
</head>
<?php
function labelOption($node, $nodeIndex, $tab){
$index=0;
$radice = '';
while($index<$tab){
$index++;
$radice = $radice . "--";
}
echo"<option value=\"" . $nodeIndex . "\">" . $radice . "" . $node . "</option>";
}
function preOrderTreeVisit($node, $index, $tab){
//cast the function to execute on the label
if($node != 'root'){
labelOption($node, $index, $tab);
}
//serch for label's sons
$getLabels = mysql_query("SELECT * FROM labels WHERE labelParent='" . $index . "'");
if(!$getLabels){
}else{
while($row = mysql_fetch_array($getLabels)) {
preOrderTreeVisit($row[labelName], $row[labelID], $row[labelTab]);
}
}
}
?>
<body>
<?php
if(isset($_POST[sCode])){
echo "<span class=\"BlockHeader\"><span>" . _T("Answered questions") . "</span></span>";
$getQuestions = mysql_query("SELECT * FROM questions WHERE questStatus='1' ORDER BY questTime");
if(!$getQuestions){
}else{
while($row = mysql_fetch_array($getQuestions)) {
echo "<div style=\"margin: 0px 0px 10px 0px; float: right; border: solid 1px gray; background-color: #FFCCFF; width: 100%;\">";
echo "<table style=\"width: 100%;\">";
echo "<tr><td><b><i>" . nl2br($row[questBody]) . "</i></b></td><td style=\"width: 10%; vertical-align: top; text-align: right;\"><a class=\"aAnsweredModify\" name=\"" . $row[questID] . "\" href=\"#\"><img src=\"images/modifica.png\"></a><a class=\"aAnsweredDelete\" name=\"" . $row[questID] . "\" href=\"#\"><img src=\"images/cancella.png\"></a></td></tr>";
echo "<tr><td><i>" . nl2br($row[questAnswer]) . "</i></td><td></td></tr>";
echo "<tr><td colspan=\"2\" style=\"text-align: right;\" valign=\"top\">" . _T("Move question under the FAQ label") . " <select class=\"sAChapter\" name=\"" . $row[questID] . "\" id=\"quest" . $row[questID] . "\"><option value=\"0\"></option>";
preOrderTreeVisit('root', '1', '0');
echo "</select></td></tr>";
echo "</table>";
echo "</div>";
}
}
}
?>
</body>
</html>