File: //home/cafsindia/.trash/application.1/views/monthly_input_mapping/form.php
<?php
echo form_open('monthly_input_mapping/save/'.$primeId,array('id'=>'monthly_input_mapping_form','class'=>'form-inline'));
?>
<fieldset>
<div class="form-group">
<?php
echo form_label("Timeoffice Component", 'time_office_component', array('class' => 'required'));
echo form_dropdown(array(
'name' => 'time_office_component',
'id' => 'time_office_component',
'class' => 'form-control input-sm select2'), $time_office_component_list, $mapping_result[0]->time_office_component);
?>
</div>
<div class="form-group">
<?php
echo form_label("Monthly Input Column", 'mi_component', array('class' => 'required'));
echo form_dropdown(array(
'name' => 'mi_component',
'id' => 'mi_component',
'class' => 'form-control input-sm select2'), $match_columns, $mapping_result[0]->mi_component);
?>
</div>
</fieldset>
<?php echo form_close(); ?>
<script type="text/javascript">
$(document).ready(function(){
var prime_id = "#<?php echo $prime_id;?>";
var form_id = "#<?php echo $form_id;?>";
var date_exist = "<?php echo $date_exist;?>";
if(date_exist === "1"){
$(function () {
$(".datepicker").datetimepicker({
format: 'MM-YYYY',
//debug: true
});
});
}
var drop_exist = "<?php echo $drop_exist;?>";
$(function(){
$('.select2').select2({
placeholder: '---- Select ----',
dropdownParent: $('.modal-dialog')
});
$('.select2-tags').select2({
tags: true,
tokenSeparators: [',']
});
});
$('#monthly_input_mapping_form').validate($.extend({
submitHandler: function (form){
//Encrypted
let formData = new FormData(form);
// Convert FormData to JSON object
let jsonData = Object.fromEntries(formData.entries());
var key = '<?php echo $encKey; ?>';
<?php echo $json_multi; ?>;
var encData = encrypt(key,jsonData);
$("#submit").html("<i class='fa fa-spinner fa-spin'></i> Processing...");
$('#submit').attr('disabled','disabled');
$.ajax({
url : $(form).attr('action'),
type : 'POST',
contentType : 'text/plain',
data : encData,
success: function (response){
$('#submit').attr('disabled',false);
$("#submit").html("Submit");
if(response.success){
toastr.success(response.message);
$('.row_btn').show();
$('.modal').modal('hide');
$('#table').DataTable().ajax.reload();
}else{
toastr.error(response.message);
}
},
dataType: 'json'
});
},
rules:{
<?php echo $validation_rule; ?>
}
}));
/* LOAD SCRIPT AND CONDITION LOAD */
<?php
echo "$document_load_script";
foreach($condition_list as $list){
echo $list;
}
?>
/* LOAD SCRIPT AND CONDITION LOAD */
});
</script>
<style>
.textcolor{
color: blue;
}
</style>