Location: PHPKode > projects > FAQMasterFlex > FAQMasterFlex/FAQMasterFlex/faq_admin.php
<?php include "admin_authorize.php" ?>
<?php include "header.php" ?>


		<!-- MAIN TEXT -->


		<h1>FAQ Administration</h1>
		
		
		
		<?php
		
                include "faq_config.php";
                
                
                if ($category) {
                
                   print "<h3>$cat_name</h3>\n";
                   print "<p style=\"margin-top: -1em\"><a href=\"$_SERVER[PHP_SELF]\">FAQ Admin</a> | <a href=\"faq_admin_faq_add.php?category=$category&cat_name=$cat_name\" onclick=\"NewWindow(this.href,'FAQ_Add','430','400','no');return false\">Add New FAQ to $cat_name</a></p>\n";
                   $result = mysql_query("SELECT * FROM faqs WHERE category_id = '$category'") or die(mysql_error());
                   
                   
                   print "<table width=\"100%\" border=\"0\" cellpadding=\"4\" cellspacing=\"0\">\n";


                     while ($row = mysql_fetch_array($result)) {

                       print "<tr>
		                  <td class=\"QA\" valign=\"top\">Q</td>
		                  <td valign=\"top\"><pre class=\"question\">$row[question]</pre></td>
                              </tr>\n";

                       print "<tr>
		                  <td class=\"QA\" valign=\"top\">A</td>
		                  <td valign=\"top\"><pre class=\"answer\">$row[answer]</pre></td>
                              </tr>\n";

                       print "<tr>
		                  <td>&nbsp;</td>
		                  <td class=\"options\" valign=\"top\"><a href=\"faq_admin_faq_edit.php?edit=$row[id]&category=$category&cat_name=$cat_name\" onclick=\"NewWindow(this.href,'FAQ_Edit','430','380','no');return false\">Edit</a> | <a href=\"faq_admin_faq_delete.php?delete=$row[id]&category=$category&cat_name=$cat_name\" onclick=\"NewWindow(this.href,'FAQ_Delete','350','250','no');return false\">Delete</a></td>
                              </tr>\n";

                       print "<tr>
		                  <td colspan=\"2\">&nbsp;</td>
                              </tr>\n";
                     }
                   
                   print "</table>\n";
                
                }
                
                
                
                else {
                
                     print "<h3>FAQ Categories</h3>\n";
                     print "<p style=\"margin-top: -1em\">Action: <a href=\"faq_admin_cat_add.php\" onclick=\"NewWindow(this.href,'cat_add','320','270','no');return false\">Add Category</a> | <a href=\"faq_admin_cat_edit.php\" onclick=\"NewWindow(this.href,'cat_edit','520','280','no');return false\">Edit Category</a> |  <a href=\"faq_admin_cat_delete.php\" onclick=\"NewWindow(this.href,'cat_del','520','400','yes');return false\">Delete Category</a></p>";

                     $result = mysql_query("SELECT * FROM faqcategories ORDER BY category") or die(mysql_error());

                     print "<ul>\n";

                     while ($row = mysql_fetch_array($result)) {
                        print "<li class=\"category\"><strong><a href=\"$_SERVER[PHP_SELF]?category=$row[id]&cat_name=$row[category]\">$row[category]</a></strong></li>\n";
                     }

                     print "</ul>\n";
                }


		mysql_close($link);
		
		?>


		<!-- END MAIN TEXT -->

		

<?php include "footer.php" ?>
Return current item: FAQMasterFlex