0 && $_GET["s"] < count(SORT_ARRAY_GROUPS)) ? $_GET["s"] : 0; $order = SORT_ARRAY_GROUPS[$sort]; $limit = $limit ?? 100; $current_page = (isset($_GET["p"]) && $_GET["p"] > 0) ? $_GET["p"] : 1; $groups = new Groups($search); $groups_obj = $groups->query_read($order, $limit, $current_page); $templateVars = [ 'groups' => $groups_obj, 'group_count' => $groups->num_rows, 'page' => $page, 'current_page' => $current_page, 'sort' => $sort, 'order' => $order, 'search' => $search, 'limit' => $limit, 'user' => $user, ]; $page_html = ''; if ($page == "groups") { $page_html .= parse_template('group/partials/group_navtabs'); } if ($groups->num_rows < 1) { $page_html .= parse_template('partials/alert', ['type' => 'info', 'strong' => 'Notice', 'text' => 'No groups found.']); } else { $page_html .= parse_template('group/group_list', $templateVars); }