Exemplo n.º 1
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/src/init.php";
$pageTitle = "Admin Control Panel";
$session->adminLock();
$sections = QNA::get_sections();
$sec = "staff";
$i = 0;
if (isset($_POST['submit'])) {
    $name = $_POST['name'];
    $acrnm = $_POST['acrnm'];
    Admin::addSection($name, $acrnm);
}
if (isset($_POST['sec_rem']) && $_POST['sec_rem'] == 'true') {
    $id = $_POST['id'];
    if (Admin::removeSection($id)) {
        die(json_encode('1'));
    } else {
        die('0');
    }
}
include ROOT_PATH . 'inc/head.php';
?>

<body>
	<div class="main" id="admincp">
		<div class="ui container section sec_mng">
			<h2>Sections</h2>
			<button class="ui green button" id="new_sec">Add new section</button><br><br>
			<table class="ui definition selectable single line table">
				<thead>
Exemplo n.º 2
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/src/init.php";
$sec = "questions";
$pageTitle = "Ask a new question";
include ROOT_PATH . 'inc/head.php';
if (!$session->is_logged_in()) {
    $session->message("You must log in to submit a new question.", "", "danger");
}
$QNA = new QNA();
$sections = $QNA->get_sections();
?>
<body>
	<div class="ui container section">

		<div class="ui raised very padded segment">
			<h3>Write a new story</h3>
				<form class="ui form create_q" action="" method="POST">
					<div class="field">
						<label>Title</label>
						<input type="text" name="title" placeholder="Title">

					</div>
					<div class="field">
						<label for="content">Content</label>
						<textarea name="content" rows="7"></textarea>
					</div>
					<div class="field">
						<label>Select section</label>
						<div class="ui selection dropdown" id="q_c_dropdown">
							<input type="hidden" name="section">