Ejemplo n.º 1
0
}
if (isset($_POST["catall"])) {
    $reply = true;
    //= $formu->getAllCategory();
    if ($reply == true) {
        echo 'Category added succesfully';
    } else {
        print '<option>Nothing Selected</option>';
    }
}
if (isset($_POST["newcategory"])) {
    echo '<div id="newcategorydiv"><form class="signupform" id="signupform" method="post" action="" enctype="multipart/form-data">' . '<p class="forumfeed"></p>' . '<fieldset><legend><span class="title">category Details</span></legend><p><label>Name:</label>' . '<input id="cat" class="smallinputs" name="firstname" type="text" required /></p><p><label>Category Name:</label>' . '<input id="cat_name" class="smallinputs" name="middlename" type="text" required /></p><p><label>Category Description:</label>' . '<textarea id="cat_desc" class="smalltextarea" cols="50" rows="4" required></textarea></p>' . '</fieldset></form><p style="text-align:center"><button class="submit" id="newcategorybt" name="cratnewtopic">Create Category:</button ></p></div>';
}
if (isset($_POST["newtopic"])) {
    global $forum;
    echo ' <div id="newtopicdiv"><form class="signupform" id="newtopicform" method="post" action="" enctype="multipart/form-data">' . '<p class="forumfeed"></p><fieldset><legend><span class="title">Topic deatils</span></legend>' . '<p><label>Topic Subject</label><input id="topic_subject" class="smallinputs" name="firstname" type="text" required /></p>' . '<p><label>Topic Category</label><select id="topic_cat_select" class="smallinput" name="firstname" value="' . $_SESSION["username"] . '" required>' . $forum->getAllCategory() . '</select></p>' . '<p><label> Topic By</label><input id="topic_by" class="smallinputs" name="middlename" userid="' . $_SESSION["user_id"] . '" type="text" value="' . $_SESSION["username"] . '" required /></p>' . '</fieldset></form><p style="text-align:center"><button  class="submit" id="newtopicbt" name="cratnewtopic">Create Topic</button ></p></div>';
}
if (isset($_POST["getallforum"])) {
    //$reply = $formu->addCategory();
    echo 'Forum for will display most recent forms';
}
if (isset($_POST["c_view"])) {
    echo $forum->getAllCategoryView();
}
if (isset($_POST["topicspecview"])) {
    $topic = htmlentities(htmlspecialchars($_POST["topic"]));
    echo $forum->getTopicSpecView($topic);
}
if (isset($_POST["t_view"])) {
    echo $forum->getAllTopicView();
}
}
if (isset($_POST["catall"])) {
    $reply = true;
    //= $formu->getAllCategory();
    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);
}