Exemplo n.º 1
0
     } else {
         echo '<p class="notification red">Something went wrong while updating the frequently asked questions.</p>';
     }
 }
 if ($hideForm !== true) {
     ?>
     <form action="" method="post" class="styled">
     <table width="100%">
     	<tr>
         	<th width="20px">#</th>
             <th width="160px">Question</th>
             <th>Answer</th>
             <th width="150px">Time added</th>
        	</tr>
     <?php 
     $dataArr = $faq->getFAQ(true);
     if ($dataArr == false) {
         echo '<tr><td colspan="4"><p class="notification red minimal">There are no existing frequently asked questions that can be edited.</p>';
     } else {
         $i = 0;
         foreach ($dataArr as $data) {
             echo '<tr>';
             echo '<td>' . ++$i . '<input type="hidden" name="faq_id[]" value="' . $data['id'] . '" /></td>';
             echo '<td><input style="width: 150px;" type="text" name="faq_question[]" value="' . $data['question'] . '" /></td>';
             echo '<td><input style="width: 320px;" type="text" name="faq_answer[]" value="' . $data['answer'] . '" /></td>';
             echo '<td>' . $data['date_added'] . '</td>';
             echo '</tr>';
         }
     }
     if ($dataArr !== false) {
         ?>
<?php

/******************************************************************
 * Project: The Three Little Pigs - Siri Proxy | Web Interface
 * Project start date: 21-01-2012
 * Author: Wouter De Schuyter
 * Website: www.wouterds.be
 * E: info[@]wouterds[.]be
 * T: www.twitter.com/wouterds
 *
 * File: frequently-asked-questions.php
 * Last update: 22-02-2012
 ******************************************************************/
echo '<h1>FAQ (Frequently Asked Questions)</h1>';
$faq = new Faq();
$dataArr = $faq->getFAQ();
if ($dataArr == false) {
    echo '<p class="notification red">There are no existing frequently asked questions.</p>';
} else {
    $i = 0;
    foreach ($dataArr as $data) {
        echo '<p id="FAQ-' . $data['id'] . '"><b>Q:</b> ' . $data['question'] . '<br /><b>A:</b> ' . $data['answer'] . '</p>';
    }
}