<?php require_once "../includes/sessions.php"; require_once "../includes/db-connection.php"; require_once "../includes/functions.php"; $page = "manage-questions.php"; ?> <!-- Query database for all users --> <?php $questions_list = get_all_questions(); ?> <?php include '../includes/layouts/header.php'; ?> <body> <div id="wrapper"> <!-- Sidebar --> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
} else { $where .= " category = {$cat_id}"; } } $ans = isset($_GET['ans']) ? intval($_GET['ans']) : 0; if ($ans > 0) { $ans = $ans == 2 ? 0 : $ans; if ($where != "") { $where .= " AND is_answered = {$ans}"; } else { $where .= " is_answered = {$ans}"; } $ans = $ans === 0 ? 2 : $ans; } //where script ends $questions_list = get_all_questions($where); $total = $questions_list->num_rows; parse_str($_SERVER["QUERY_STRING"], $output); unset($output['page']); $get_query = http_build_query($output, '', '&'); $targetpage = "wl_manage-questions.php?{$get_query}"; //your file name $limit = 10; //how many items to show per page $p = isset($_GET['page']) ? $_GET['page'] : ""; if ($p) { $start = ($p - 1) * $limit; } else { $start = 0; } $questions_list = get_all_questions_limit($start, $limit, $where);