108 lines
3.1 KiB
PHP
108 lines
3.1 KiB
PHP
<div class="panel-heading">
|
|
<b>FAQ</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;
|
|
?>
|
|
<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->msg?></textarea>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<select class="form-control" id="code<?=$row->id?>" name="code<?=$row->id?>">
|
|
<option value="">Select Category</option>
|
|
<?php
|
|
foreach($faq_category as $r1){
|
|
$sel= ($r1->code==$row->code)?' selected ':'';
|
|
?>
|
|
<option value="<?= $r1->code?>" <?=$sel?> ><?= $r1->description?></option>
|
|
<?php
|
|
}
|
|
?>
|
|
</select>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:right;">
|
|
<div id='updt<?=$row->id?>'></div> <button type="button" class="btn btn-info" onclick="updaFAQ('<?=$row->id?>');">Update</button>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<?php
|
|
|
|
}
|
|
?>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
<table class="table">
|
|
<tbody>
|
|
<tr>
|
|
<td >
|
|
<div id="reason_msg"></div>
|
|
<?= $faq_table ?>
|
|
</td>
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<script type="text/javascript">
|
|
<!--
|
|
|
|
function updaFAQ(page_id) {
|
|
|
|
let title= $('#title'+page_id).val();
|
|
let msg= $('#msg'+page_id).val();
|
|
let code= $('#code'+page_id).val();
|
|
|
|
//alert(code);
|
|
/*
|
|
$('#configure_detail').html('Processing...');
|
|
$('#acc' + page_id).prop('disabled', true); */
|
|
$.ajax({
|
|
url: "/confg/updatefaq?faq_id=" + page_id + "&title=" + title + "&code=" + code + "&msg=" + msg
|
|
}).done(function (data) {
|
|
$('#updt'+page_id).html(data);
|
|
// $('#acc' + page_id).prop('disabled', false);
|
|
});
|
|
|
|
return false;
|
|
}
|
|
|
|
// -->
|
|
</script>
|
|
|