/** * This function is used to show the faq page * * * @return string */ function showFaq() { $pagesize = 10; if (isset($_GET['page'])) { $start = trim($_GET['page'] - 1) * $pagesize; $end = $pagesize; } else { $start = 0; $end = $pagesize; } $total = 0; $sql = "select * from faq_table"; $query = new Bin_Query(); if ($query->executeQuery($sql)) { $total = ceil($query->totrows / $pagesize); include 'classes/Lib/Paging.php'; $tmp = new Lib_Paging('classic', array('totalpages' => $total, 'length' => 10), 'pagination'); $this->data['paging'] = $tmp->output; $this->data['prev'] = $tmp->prev; $this->data['next'] = $tmp->next; } $sql = "select * from faq_table"; $query = new Bin_Query(); $query->executeQuery($sql); return Display_DFaq::listFaq($query->records, $this->data['paging'], $this->data['prev'], $this->data['next'], $start); }
/** * Function get the details for the selected FAQ * @param array $result * * @return string */ function show($result = '') { $id = (int) $_GET['id']; if ($id != '') { $sql = "select * from faq_table where faq_id=" . $id; $query = new Bin_Query(); $query->executeQuery($sql); return Display_DFaq::show($result, $query->records[0]); } else { return Display_DFaq::show($result); } }