Faq save
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -35,8 +35,9 @@
|
||||
<option value="">Select Category</option>
|
||||
<?php
|
||||
foreach($faq_category as $r1){
|
||||
$sel= ($r1->code==$row->code)?' selected ':'';
|
||||
?>
|
||||
<option value="<?= $r1->code?>"><?= $r1->description?></option>
|
||||
<option value="<?= $r1->code?>" <?=$sel?> ><?= $r1->description?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user