YaWK  24.1
Yet another WebKit
faq-frontend.php
Go to the documentation of this file.
1 <?php
2 namespace YAWK\PLUGINS\FAQ {
3  /**
4  * @details <b>Frontend FAQ Class</b>
5  * <p>This class extends \YAWK\PLUGINS\FAQ\faq.</p>
6  * <p><i>This class covers frontend functionality. See Methods Summary for Details!</i></p>
7  * @author Daniel Retzl <[email protected]>
8  * @version 1.0.0
9  * @brief Handles the FAQ Frontend methods.
10  */
12  /** * @param int faq ID */
13  public $id;
14  /** * @param int category ID */
15  public $cat;
16  /** * @param string question */
17  public $question;
18  /** * @param string answer */
19  public $answer;
20 
21  /**
22  * @brief get all data from faq database and draw (output) a html list with all FAQ's
23  * @param object $db database
24  */
25  function draw_faq($db) {
26  /** @var $db \YAWK\db */
27  echo "<h1><i class=\"fa fa-question-circle\"></i> &nbsp;F.A.Q. <small>H&auml;ufig gestellte Fragen &amp; Antworten...</small></h1><br>";
28  if ($res = $db->query("SELECT * FROM {plugin_faq} ORDER by sort,id"))
29  { // get faq as html list item in loop
30  while($row = mysqli_fetch_assoc($res))
31  { // 1 list item per FAQ entry
32  print "<ul class=\"list-group\">
33  <li class=\"list-group-item\"><h4>".$row['question']."</h4>".$row['answer']."<br><br></li>
34  </ul>";
35  }
36  }
37  else
38  { // q failed
39  \YAWK\alert::draw("danger", "Error!", "Could not get FAQ Entries. This could be a database error.","","2400");
40  }
41  } // end function
42 
43  } // end class
44 } // end namespace
Handles the FAQ backend methods.
Definition: faq-backend.php:15
Handles the FAQ Frontend methods.
static draw($type, $title, $text, $redirect, $delay)
Definition: alert.php:30