207 lines
7.5 KiB
PHP
Executable File
207 lines
7.5 KiB
PHP
Executable File
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
|
?>
|
|
<!--sidebar end-->
|
|
<!--main content start-->
|
|
|
|
|
|
<!-- <div class="app-content content">
|
|
<section class="content-wrapper"> -->
|
|
<div class="app-content content">
|
|
<section class="content-wrapper">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
|
|
<div class="card-header">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h3 class="font-weight-bold">Form Templates</h3>
|
|
</div>
|
|
|
|
<div class="col-md-6 no-print pull-right">
|
|
<a href="<?php echo base_url(); ?>php-form-builder/drag-n-drop-form-builder/">
|
|
<div class="btn-group float-right">
|
|
<button id="" class="btn btn-info btn-min-width mr-1 mb-1">
|
|
<i class="fa fa-plus-circle"></i> <?php echo lang('add_new'); ?>
|
|
</button>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr class="mt-0 mb-0" />
|
|
|
|
<div class="card-content collapse show">
|
|
<div class="card-body card-dashboard">
|
|
<div class="panel-body">
|
|
<div class="adv-table editable-table ">
|
|
<div class="space15"></div>
|
|
<table class="table table-striped table-bordered dom-jQuery-events" id="editable-sample" cellspacing="0" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th>Sl.no</th>
|
|
<th>Name</th>
|
|
<!-- <th>Status</th> -->
|
|
<th class="no-print" style="width: 30%;">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="tableContaint">
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div style="display:none;">
|
|
<form method="post" id="formDataSend" action="<?php echo base_url(); ?>php-form-builder/drag-n-drop-form-builder/">
|
|
<textarea name="form_content" id="formDataTextarea"></textarea>
|
|
<input type="hidden" name="form_name" id="formDataName">
|
|
<input type="hidden" name="template_id" id="formDataTempId">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<!-- Large modal -->
|
|
|
|
|
|
<div class="modal fade bd-example-modal-lg" id="previewModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content modal-form-body" >
|
|
...
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
function editForm(Fobj){
|
|
//formJsonDatafromDB
|
|
var parent=$(Fobj).parent().closest('td');
|
|
var data=$(parent).find('textarea[use="formJsonDatafromDB"]').val();
|
|
var formName=$(parent).find('input[use="formJsonFormNamefromDB"]').val();
|
|
var TempId=$(parent).find('input[use="formJsonTempIdfromDB"]').val();
|
|
$("#formDataTextarea").val(data);
|
|
$("#formDataName").val(formName);
|
|
$("#formDataTempId").val(TempId);
|
|
$("#formDataSend").submit();
|
|
//console.log(data);
|
|
}
|
|
|
|
</script>
|
|
<script>
|
|
function previewModal(id){
|
|
var formid=id;
|
|
$.ajax({
|
|
url:"<?php echo base_url(); ?>formbuilder/getFromData",
|
|
type:"GET",
|
|
data:{formid:formid},
|
|
dataType: "text",
|
|
success:function(data){
|
|
//console.log(data);
|
|
$.ajax({
|
|
url: "<?php echo base_url(); ?>php-form-builder/drag-n-drop-form-builder/ajax/preview.php",
|
|
type: 'POST',
|
|
data: { 'data': data,'<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>' },
|
|
success:function(formoutput){
|
|
//console.log(formoutput);
|
|
$('.modal-form-body').html(formoutput);
|
|
$('#previewModal').modal();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
<!--main content end-->
|
|
<!--footer start-->
|
|
|
|
<script>
|
|
|
|
$(document).ready(function () {
|
|
// $('#editable-sample').DataTable();
|
|
var table = $('#editable-sample').DataTable({
|
|
"processing": true,
|
|
"serverSide": true,
|
|
"searchable": true,
|
|
"responsive": true,
|
|
"ajax": {
|
|
url: "<?php echo base_url(); ?>formbuilder/getList",
|
|
type: 'POST',
|
|
data: {
|
|
'<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>'
|
|
},
|
|
},
|
|
scroller: {
|
|
loadingIndicator: true
|
|
},
|
|
|
|
dom: "<'row'<'col-sm-5 data-table-pagelimit'l><'col-sm-6 data-table-search'f><'col-sm-1 text-center data-table-button-collection'B>>" +
|
|
"<'row'<'col-sm-12 data-table-body'tr>>" +
|
|
"<'row'<'col-sm-5 data-table-pagecountsummary'i><'col-sm-7 data-table-pagination'p>>",
|
|
buttons: [
|
|
{
|
|
extend: 'collection',
|
|
text: '...',
|
|
buttons: [
|
|
'copyHtml5',
|
|
'excelHtml5',
|
|
'csvHtml5',
|
|
'pdfHtml5',
|
|
{
|
|
extend: 'print',
|
|
exportOptions: {
|
|
columns: [0, 1, 2, 3, 4, 5, 6],
|
|
}
|
|
}
|
|
]
|
|
},
|
|
],
|
|
|
|
|
|
aLengthMenu: [
|
|
[10, 25, 50, 100, -1],
|
|
[10, 25, 50, 100, "All"]
|
|
],
|
|
iDisplayLength: 100,
|
|
"order": [[1, "asc"]],
|
|
|
|
"language": {
|
|
"lengthMenu": "_MENU_",
|
|
search: "_INPUT_",
|
|
"url": "common/assets/DataTables/languages/<?php echo $this->language; ?>.json"
|
|
},
|
|
"columnDefs": [
|
|
{ "orderable": false, "targets": [0] }
|
|
]
|
|
});
|
|
|
|
table.buttons().container().appendTo('.custom_buttons');
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
<?php
|
|
if(isset($_SESSION['deleted'])){
|
|
?>
|
|
<script>
|
|
$(function(){
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'success',
|
|
title: 'Successfully Deleted',
|
|
showConfirmButton: false,
|
|
timer: 2000
|
|
})
|
|
})
|
|
</script>
|
|
<?php
|
|
}
|
|
?>
|
|
|