| Current Path : /home/users/unlimited/www/talentorbit.codeskitter.site/resources/views/admin/faq/ |
| Current File : /home/users/unlimited/www/talentorbit.codeskitter.site/resources/views/admin/faq/index.blade.php |
@extends('admin.layouts.admin_layout')
@section('content')
<style type="text/css">
.table td, .table th {
font-size: 12px;
line-height: 2.42857 !important;
}
</style>
<div class="page-content-wrapper">
<!-- BEGIN CONTENT BODY -->
<div class="page-content">
<!-- BEGIN PAGE HEADER-->
<!-- BEGIN PAGE BAR -->
<div class="page-bar">
<ul class="page-breadcrumb">
<li> <a href="{{ route('admin.home') }}">Home</a> <i class="fa fa-circle"></i> </li>
<li> <span>FAQs</span> </li>
</ul>
</div>
<!-- END PAGE BAR -->
<!-- BEGIN PAGE TITLE-->
<h3 class="page-title">Manage FAQs <small>FAQs</small> </h3>
<!-- END PAGE TITLE-->
<!-- END PAGE HEADER-->
<div class="row">
<div class="col-md-12">
<!-- Begin: life time stats -->
<div class="portlet light portlet-fit portlet-datatable bordered">
<div class="portlet-title">
<div class="caption"> <i class="icon-settings font-dark"></i> <span class="caption-subject font-dark sbold uppercase">FAQs</span> </div>
<div class="actions">
<a href="{{ route('create.faq') }}" class="btn btn-xs btn-success"><i class="glyphicon glyphicon-plus"></i> Add New FAQ</a>
</div>
</div>
<div class="portlet-body">
<div class="table-container">
<form method="post" role="form" id="faq-search-form">
<table class="table table-striped table-bordered table-hover" id="faq_datatable_ajax">
<thead>
<tr role="row" class="filter">
<td>{!! Form::select('lang', ['' => 'Select Language']+$languages, config('default_lang'), array('id'=>'lang', 'class'=>'form-control')) !!}</td>
<td><input type="text" class="form-control" name="faq_question" id="faq_question" autocomplete="off"></td>
<td><input type="text" class="form-control" name="faq_answer" id="faq_answer" autocomplete="off"></td>
<td></td>
</tr>
<tr role="row" class="heading">
<th>Language</th>
<th>Question</th>
<th>Answer</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table></form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END CONTENT BODY -->
</div>
@endsection
@push('scripts')
<script>
$(function () {
var oTable = $('#faq_datatable_ajax').DataTable({
processing: true,
serverSide: true,
stateSave: true,
searching: false,
/* "order": [[0, "desc"]],
paging: true,
info: true,
*/
ajax: {
url: '{!! route('fetch.data.faqs') !!}',
data: function (d) {
d.lang = $('#lang').val();
d.faq_question = $('input[name=faq_question]').val();
d.faq_answer = $('input[name=faq_answer]').val();
}
}, columns: [
/*{data: 'id_checkbox', name: 'id_checkbox', orderable: false, searchable: false},*/
{data: 'lang', name: 'lang'},
{data: 'faq_question', name: 'faq_question'},
{data: 'faq_answer', name: 'faq_answer'},
{data: 'action', name: 'action', orderable: false, searchable: false}
]
});
$('#faq-search-form').on('submit', function (e) {
oTable.draw();
e.preventDefault();
});
$('#lang').on('change', function (e) {
oTable.draw();
e.preventDefault();
});
$('#faq_question').on('keyup', function (e) {
oTable.draw();
e.preventDefault();
});
$('#faq_answer').on('keyup', function (e) {
oTable.draw();
e.preventDefault();
});
});
function delete_faq(id) {
if (confirm('Are you sure! you want to delete?')) {
$.post("{{ route('delete.faq') }}", {id: id, _method: 'DELETE', _token: '{{ csrf_token() }}'})
.done(function (response) {
if (response == 'ok')
{
var table = $('#faq_datatable_ajax').DataTable();
table.row('faq_dt_row_' + id).remove().draw(false);
} else
{
alert('Request Failed!');
}
});
}
}
</script>
@endpush