Example #1
0
         }
     }
     $smarty->assign('errorfeed', '');
     $smarty->assign('title', '..::ECE_E-Learning:homeViewLogin');
 } else {
     if ($view == "newResource") {
         $smarty->assign('mainContent', $smarty->fetch("newResources.tpl"));
         $smarty->assign('errorfeed', '');
         $smarty->assign('title', '..::ECE_E-Learning:homeViewLogin');
     } else {
         if ($view == "archiveView") {
             $smarty->assign('mainContent', "Archive View");
             $smarty->assign('title', '..::ECE_E-Learning:archive');
         } else {
             if ($view == "forumView") {
                 $smarty->assign('forumhome', $forum->goHome());
                 $smarty->assign('mainContent', $smarty->fetch("forum.tpl"));
                 $smarty->assign('title', '..::ECE_E-Learning:forum');
             } else {
                 if ($view == "contactView") {
                     $smarty->assign('mainContent', $smarty->fetch("contact.tpl"));
                     $smarty->assign('title', '..::ECE_E-Learning:contact');
                 } else {
                     if ($view == "registerView") {
                         go_homeforlogedin();
                     } else {
                         if ($view == "userCourses") {
                             $course = new Course();
                             $smarty->assign('courses', $course->displayAllCourse());
                             $smarty->assign('title', '..::ECE_E-Learning:userCouses');
                             $smarty->assign('mainContent', $smarty->fetch("userCourses.tpl"));
    if ($reply == true) {
        echo 'Category added succesfully';
    } else {
        print '<option>Nothing Selected</option>';
    }
}
if (isset($_POST["newcategory"])) {
    echo '<div id="newcategorydiv"><form>' . '<p class="forumfeed"></p>' . '<fieldset><legend><span class="boldertext">Category Details</span></legend>' . '<input id="cat" data-clear-btn="true" data-mini="true" class="" value="' . isset($_SESSION["user_id"]) ? $_SESSION["user_id"] : "" . '" type="hidden" required /></p>' . '<p><label>Category Name:</label>' . '<input id="cat_name" data-clear-btn="true" data-mini="true" class="" name="middlename" type="text" required /></p>' . '<p><label>Category Description:</label>' . '<textarea id="cat_desc" class="smalltextarea" cols="30" rows="4" required></textarea></p>' . '</fieldset></form></div></p>';
}
if (isset($_POST["newtopic"])) {
    global $forum;
    echo ' <div id="newtopicdiv"><form>' . '<p class="forumfeed"></p>' . '<fieldset><legend><span class="boldertext">Topic deatils</span></legend>' . '<p><label>Topic Subject</label>' . '<input id="topic_subject" class="" type="text" required /></p>' . '<p><label>Topic Category</label>' . '<select id="topic_cat_select" class="" required>' . $forum->getAllCategory() . '</select></p>' . '<p><label> Topic By</label>' . '<input id="topic_by" class=""  userid="' . $_SESSION["user_id"] . '" type="text" value="' . $_SESSION["username"] . '" required /></p>' . '</fieldset></form></div>';
}
if (isset($_POST["getallforum"])) {
    //$reply = $formu->addCategory();
    echo $forum->goHome();
}
////category view codes
if (isset($_POST["c_view"])) {
    echo $forum->getAllCategoryView();
}
//topic spec view codes
if (isset($_POST["topicspecview"])) {
    $topic = htmlentities(htmlspecialchars($_POST["topic_subject"]));
    $id = htmlentities(htmlspecialchars($_POST["topic_id"]));
    echo $forum->getTopicSpecView($topic, $id);
}
//topic in category
if (isset($_POST["topicincat"])) {
    $cat = htmlentities(htmlspecialchars($_POST["category"]));
    $id = htmlentities(htmlspecialchars($_POST["catid"]));