diff --git a/application/controllers/Confg.php b/application/controllers/Confg.php index 3818d3c..9b2faa5 100644 --- a/application/controllers/Confg.php +++ b/application/controllers/Confg.php @@ -135,7 +135,7 @@ class Confg extends Bko_Controller { $this->load->library('table'); $this->table->set_template($this->template); - $mysql = "SELECT id,title,dir,msg,flags,added,status FROM faq"; // WHERE agent_id = " . $data['agent_id']; + $mysql = "SELECT id,title,dir,msg,flags,added,status,code FROM faq ORDER BY id desc"; // WHERE agent_id = " . $data['agent_id']; $query = $this->db->query($mysql); $data['faq_result'] = $query->result(); $data['faq_table'] = $this->table->generate($query); @@ -147,7 +147,22 @@ class Confg extends Bko_Controller { } } public function updatefaq(){ - echo 'got here'; + +// url: "/confg/updatefaq?faq_id=" + page_id + "&title=" + title + "&code=" + code + "&msg=" + msg + if ($_GET) { + $faq_id = $this->input->get('faq_id'); + $title = trim($this->input->get('title')); + $code = trim($this->input->get('code')); + $msg = trim($this->input->get('msg')); + if($title !='' & $msg !='' & $faq_id > 0 ){ + $sql1 = "UPDATE faq SET title='$title',msg='$msg', code='$code' WHERE id = $faq_id"; + $this->db->query($sql1); + echo 'Updated'; + } + else{ + echo 'Not Updated'; + } + } } public function addSkill() { $data = array(); diff --git a/application/views/bko/configure/extra/faq_form.php b/application/views/bko/configure/extra/faq_form.php index de3a105..80d1814 100644 --- a/application/views/bko/configure/extra/faq_form.php +++ b/application/views/bko/configure/extra/faq_form.php @@ -35,8 +35,9 @@ code==$row->code)?' selected ':''; ?> - +