".$locale['404']."
\n".$locale['405']; } elseif ($status == "delcy") { $title = $locale['400']; $message = "".$locale['401'].""; } opentable($title); echo "
".$message."
\n"; closetable(); tablebreak(); } if ($action == "delete" && $t == "cat") { $result = dbquery("SELECT * FROM ".$db_prefix."faqs WHERE faq_cat_id='$faq_cat_id'"); if (dbrows($result) != 0) { redirect(FUSION_SELF.$aidlink."&status=delcn"); } else { $result = dbquery("DELETE FROM ".$db_prefix."faq_cats WHERE faq_cat_id='$faq_cat_id'"); redirect(FUSION_SELF.$aidlink."&status=delcy"); } closetable(); } else { if ($action == "delete" && $t == "faq") { $faq_count = dbcount("(faq_id)", "faqs", "faq_id='$faq_id'"); $result = dbquery("DELETE FROM ".$db_prefix."faqs WHERE faq_id='$faq_id'"); if ($faq_count != 0) { redirect(FUSION_SELF.$aidlink."&faq_cat_id=$faq_cat_id"); } else { redirect(FUSION_SELF.$aidlink); } } if (isset($_POST['save_cat'])) { $faq_cat_name = stripinput($_POST['faq_cat_name']); $faq_cat_description = stripinput($_POST['faq_cat_description']); if ($action == "edit" && $t == "cat") { $result = dbquery("UPDATE ".$db_prefix."faq_cats SET faq_cat_name='$faq_cat_name', faq_cat_description='$faq_cat_description' WHERE faq_cat_id='$faq_cat_id'"); } else { if ($faq_cat_name != "") { $result = dbquery("INSERT INTO ".$db_prefix."faq_cats (faq_cat_name, faq_cat_description) VALUES('$faq_cat_name', '$faq_cat_description')"); } } redirect(FUSION_SELF.$aidlink); } if (isset($_POST['save_faq'])) { $faq_question = stripinput($_POST['faq_question']); $faq_answer = addslash($_POST['faq_answer']); if ($action == "edit" && $t == "faq") { $result = dbquery("UPDATE ".$db_prefix."faqs SET faq_cat_id='$faq_cat', faq_question='$faq_question', faq_answer='$faq_answer' WHERE faq_id='$faq_id'"); } else { if ($faq_question != "" && $faq_answer != "") { $result = dbquery("INSERT INTO ".$db_prefix."faqs (faq_cat_id, faq_question, faq_answer) VALUES ('$faq_cat', '$faq_question', '$faq_answer')"); } } redirect(FUSION_SELF.$aidlink."&faq_cat_id=$faq_cat"); } if ($action == "edit") { if ($t == "cat") { $data = dbarray(dbquery("SELECT * FROM ".$db_prefix."faq_cats WHERE faq_cat_id='$faq_cat_id'")); $faq_cat_id = $data['faq_cat_id']; $faq_cat_name = $data['faq_cat_name']; $faq_cat_description = $data['faq_cat_description']; $faq_cat_title = $locale['421']; $faq_cat_action = FUSION_SELF.$aidlink."&action=edit&faq_cat_id=$faq_cat_id&t=cat"; // --------------------- // $faq_question = ""; $faq_answer = ""; $faq_title = $locale['422']; $faq_action = FUSION_SELF.$aidlink; } else if ($t == "faq") { $data = dbarray(dbquery("SELECT * FROM ".$db_prefix."faqs WHERE faq_id='$faq_id'")); $faq_cat_name = ""; $faq_cat_description = ""; $faq_cat_title = $locale['420']; $faq_cat_action = FUSION_SELF.$aidlink; // --------------------- // $faq_id = $data['faq_id']; $faq_question = $data['faq_question']; $faq_answer = stripslashes($data['faq_answer']); $faq_title = $locale['423']; $faq_action = FUSION_SELF.$aidlink."&action=edit&faq_id=$faq_id&t=faq"; } } else { $faq_cat_name = ""; $faq_cat_description = ""; $faq_cat_title = $locale['420']; $faq_cat_action = FUSION_SELF.$aidlink; $faq_question = ""; $faq_answer = ""; $faq_title = $locale['422']; $faq_action = FUSION_SELF.$aidlink; } if (!isset($t) || $t != "faq") { opentable($faq_cat_title); echo "
".$locale['440'].":
".$locale['442'].":
\n"; closetable(); } if (!isset($t) || $t != "cat") { $cat_opts = ""; $sel = ""; $result2 = dbquery("SELECT * FROM ".$db_prefix."faq_cats ORDER BY faq_cat_name"); if (dbrows($result2) != 0) { if (!$t) tablebreak(); while ($data2 = dbarray($result2)) { if ($action == "edit" && $t == "faq") $sel = ($data2['faq_cat_id'] == $faq_cat_id ? " selected" : ""); $cat_opts .= "\n"; } opentable($faq_title); echo "
".$locale['460'].": 
".$locale['461'].": 
".$locale['462'].": 
', '');\"> ', '');\"> ', '');\"> Link');\"> ');\"> ', '');\"> ', '');\"> ', '');\"> ', '');\">

\n"; closetable(); } } } tablebreak(); opentable($locale['480']); $result = dbquery("SELECT * FROM ".$db_prefix."faq_cats ORDER BY faq_cat_name"); if (dbrows($result) != 0) { echo "\n"; while ($data = dbarray($result)) { if (!isset($faq_cat_id)) $faq_cat_id = ""; if ($data['faq_cat_id'] == $faq_cat_id) { $p_img = "off"; $div = ""; } else { $p_img = "on"; $div = "style='display:none'"; } echo "\n"; $result2 = dbquery("SELECT * FROM ".$db_prefix."faqs WHERE faq_cat_id='".$data['faq_cat_id']."' ORDER BY faq_id"); if (dbrows($result2) != 0) { echo "\n"; } else { echo "\n"; } } echo "
".$locale['481']." ".$locale['482']."
".$data['faq_cat_name']." ".$locale['483']." - ".$locale['484']."
\n"; while ($data2 = dbarray($result2)) { echo "\n"; } echo "
".$data2['faq_question']." ".$locale['483']." - ".$locale['484']."
".trimlink(stripinput($data2['faq_answer']), 60)."
\n"; echo "\n"; } else { echo "
".$locale['486']."
\n
\n"; } closetable(); echo "\n"; require_once BASEDIR."footer.php"; ?>