back office help

This commit is contained in:
CHIEFSOFT\ameye
2024-02-03 08:16:13 -05:00
parent 653f467dfa
commit cd6c6c4e2b
3 changed files with 111 additions and 1 deletions
+29
View File
@@ -36,6 +36,17 @@ class Confg extends Bko_Controller {
if ($data['page_id'] != '') {
switch ($data['page_id']) {
case 'APPHELP':
$this->load->library('table');
$this->table->set_template($this->template);
$mysql = "SELECT id ,uid ,icon ,title ,contents FROM help_items WHERE status = 1 ORDER BY id ASC"; // WHERE agent_id = " . $data['agent_id'];
$query = $this->db->query($mysql);
$data['faq_result'] = $query->result();
$data['faq_table'] = $this->table->generate($query);
$this->load->view('bko/configure/extra/appfaq_form', $data);
break;
case "JOBCATEG":
$this->load->library('table');
@@ -157,6 +168,24 @@ class Confg extends Bko_Controller {
}
}
}
public function updateHelpfaq(){
if ($_GET) {
$faq_id = $this->input->get('faq_id');
$title = trim($this->input->get('title'));
$faq_uid = trim($this->input->get('faq_uid'));
$msg = trim($this->input->get('msg'));
if($title !='' & $msg !='' & $faq_id > 0 ){
$sql1 = "UPDATE help_items SET title='$title',contents='$msg' WHERE id = $faq_id AND uid='$faq_uid' ";
$this->db->query($sql1);
echo 'Updated';
}
else{
echo 'Not Updated';
}
}
}
public function updatefaq(){
// url: "/confg/updatefaq?faq_id=" + page_id + "&title=" + title + "&code=" + code + "&msg=" + msg
@@ -0,0 +1,81 @@
<div class="panel-heading">
<b>App Help</b>
</div>
<form>
<div class="table-responsive">
<table class="table">
<tbody>
<?php
foreach ($faq_result as $row)
{
// echo $row->title;
// echo $row->name;
// echo $row->body;
// id | uid | icon | title | contents
?>
<tr>
<td style="width:50px;">
<?=$row->id?>
</td>
<td>
<table class="table table-striped">
<tbody>
<tr>
<td>
<input type="text" class="form-control" id="title<?=$row->id?>" name="title<?=$row->id?>" aria-describedby="titleHelp" placeholder="Enter Title" value="<?=$row->title?>">
</td>
</tr>
<tr>
<td>
<textarea class="form-control" id="msg<?=$row->id?>" name="msg<?=$row->id?>" rows="3"><?=$row->contents?></textarea>
</td>
</tr>
<tr>
<td>
<?=$row->uid?>
</td>
</tr>
<tr>
<td style="text-align:right;">
<div id='updt<?=$row->id?>'></div> <button type="button" class="btn btn-info" onclick="updaHelpFAQ('<?=$row->id?>','<?=$row->uid?>');">Update</button>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</form>
<script type="text/javascript">
<!--
function updaHelpFAQ(page_id, page_uid) {
let title= $('#title'+page_id).val();
let msg= $('#msg'+page_id).val();
// alert(title);
$.ajax({
url: "/confg/updateHelpfaq?faq_id=" + page_id + "&title=" + title + "&msg=" + msg +"&faq_uid="+page_uid
}).done(function (data) {
$('#updt'+page_id).html(data);
// $('#acc' + page_id).prop('disabled', false);
});
return false;
}
// -->
</script>
@@ -66,7 +66,7 @@
<!-- Current server load -->
<div class="panel">
<div class="panel-body">
<a href='#'><h5 class="no-margin">Item X</h5></a>
<a href='#' onclick="openConfig('APPHELP');"><h5 class="no-margin">App Help</h5></a>
</div>
</div>
<!-- /current server load -->