491 lines
24 KiB
PHP
491 lines
24 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>GSTR2A File Listing</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" />
|
|
<meta content="Coderthemes" name="author" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<!-- App favicon -->
|
|
<!-- <link rel="shortcut icon" href="<?php echo base_url(); ?>assets/images/favicon.ico">-->
|
|
<link rel='shortcut icon' href=assets/images/tsplogo2.png>
|
|
|
|
<!-- third party css -->
|
|
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
|
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
|
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
|
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-select-bs4/css//select.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
|
<!-- third party css end -->
|
|
|
|
<!-- App css -->
|
|
<link href="<?php echo base_url(); ?>assets/css/bootstrap-creative.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
|
|
<link href="<?php echo base_url(); ?>assets/css/app-creative.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
|
|
|
|
<link href="<?php echo base_url(); ?>assets/css/bootstrap-creative-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
|
|
<link href="<?php echo base_url(); ?>assets/css/app-creative-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
|
|
|
|
<!-- icons -->
|
|
<link href="<?php echo base_url(); ?>assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
|
|
|
<style>
|
|
.mb25{
|
|
margin-bottom: 25px;
|
|
}
|
|
.required{
|
|
color: red;
|
|
}
|
|
.footer
|
|
{
|
|
padding-top: 19px;
|
|
padding-right: 17px;
|
|
padding-bottom: 2px;
|
|
padding-left: 17px;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body class="loading" data-layout-mode="horizontal" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": true}'>
|
|
|
|
<!-- Begin page -->
|
|
<div id="wrapper">
|
|
|
|
<?php include('includes/top_nav.php'); ?>
|
|
|
|
<!-- ============================================================== -->
|
|
<!-- Start Page Content here -->
|
|
<!-- ============================================================== -->
|
|
|
|
<!-- <div class="content-page">
|
|
<div class="content"> -->
|
|
|
|
<!-- Start Content-->
|
|
<!-- <div class="container-fluid"> -->
|
|
|
|
<!-- start page title -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="page-title-box page-title-box-alt">
|
|
<h4 class="page-title">GST Nos</h4>
|
|
<div class="page-title-right">
|
|
<ol class="breadcrumb m-0">
|
|
<li class="breadcrumb-item"><a href="javascript: void(0);">Masters</a></li>
|
|
<li class="breadcrumb-item active">GST</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-10"><h5>GST Nos</h5></div>
|
|
<div class="col-md-2">
|
|
<button style="float:right" type="button" class="btn btn-primary waves-effect waves-light" data-toggle='modal' data-target="#add_modal">Add GST No</button>
|
|
</div>
|
|
</div>
|
|
<!--
|
|
<h4 class="header-title">Scroll - Horizontal</h4>
|
|
<p class="text-muted font-13 mb-4">
|
|
DataTables has the ability to show tables with horizontal scrolling, which is very useful for when you have a wide
|
|
table, but want to constrain it to a limited horizontal display area.
|
|
</p>
|
|
-->
|
|
|
|
<table id="datatable" class="table w-100 nowrap">
|
|
<thead>
|
|
<tr>
|
|
<th>GST No</th>
|
|
<th>Created on</th>
|
|
<th>Status</th>
|
|
<!--
|
|
<th>From</th>
|
|
<th>To</th>
|
|
<th>Uploaded By</th>
|
|
<th>Email</th>
|
|
<th>Uploaded On</th>
|
|
-->
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
</div> <!-- end card body-->
|
|
</div> <!-- end card -->
|
|
</div><!-- end col-->
|
|
</div>
|
|
<!-- end row-->
|
|
|
|
</div> <!-- container -->
|
|
|
|
</div> <!-- content -->
|
|
|
|
<?php include('includes/footer.php'); ?>
|
|
|
|
</div>
|
|
|
|
<!-- ============================================================== -->
|
|
<!-- End Page content -->
|
|
<!-- ============================================================== -->
|
|
|
|
<div id="add_modal" class="modal fade" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Add GST No</h4>
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
</div>
|
|
<form id="usrforma" enctype="multipart/form-data" class="form-horizontal editform" style="padding:10px;">
|
|
<div class="modal-body">
|
|
|
|
<div class="form-body">
|
|
<div class="form-group">
|
|
<!-- <div class="row"> -->
|
|
|
|
|
|
<div class="form-group">
|
|
<div class="row">
|
|
<div class="col-md-6 mb25">
|
|
<label>GST Number<span class="required">*</span></label>
|
|
<input onkeyup="this.value = this.value.toUpperCase();" required type="text" pattern="^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$" title="Please enter a valid GST number." name="gn_gstno" id="" class="form-control"/>
|
|
</div>
|
|
<div class="col-md-6 mb25">
|
|
<label>Status<span class="required">*</span></label> <br/>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="gn_isactive" id="add_gn_isactive_1" value="1" required> Active
|
|
</label>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="gn_isactive" id="add_gn_isactive_0" value="0"> Deactive
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- </div> -->
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-primary" type="button" id="loading1" style="display:none">
|
|
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
Loading...
|
|
</button>
|
|
<button type="submit" id="submit1" class="btn btn-primary">Submit</button>
|
|
<button type="button" id="addclose" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="edit_modal" class="modal fade" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Edit GST No</h4>
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
</div>
|
|
<form id="usrforme" class="form-horizontal editform" style="padding:10px;">
|
|
<div class="modal-body">
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="row">
|
|
<div class="col-md-6 mb25">
|
|
<label>GST Number<span class="required">*</span></label>
|
|
<input type="hidden" name="gn_id" id="e_gn_id" class="form-control"/>
|
|
<input onkeyup="this.value = this.value.toUpperCase();" required type="text" name="gn_gstno" id="e_gn_gstno" class="form-control"/>
|
|
</div>
|
|
|
|
<div class="col-md-6 mb25">
|
|
<label>Status<span class="required">*</span></label> <br/>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="gn_isactive" id="e_gn_isactive_1" value="1" required> Active
|
|
</label>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="gn_isactive" id="e_gn_isactive_0" value="0"> Deactive
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- </div> -->
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="submit" class="btn btn-primary">Submit</button>
|
|
<button type="button" id="editclose" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<button style="display:none" id="editref" type="button" class="btn btn-primary" data-toggle='modal' data-target="#edit_modal">edit ref</button>
|
|
<!-- END wrapper -->
|
|
|
|
<button style="display:none" id="editref" type="button" class="btn btn-primary" data-toggle='modal' data-target="#edit_modal">edit ref</button>
|
|
|
|
<!-- Vendor js -->
|
|
<script src="<?php echo base_url(); ?>assets/js/vendor.min.js"></script>
|
|
|
|
<!-- third party js -->
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net/js/jquery.dataTables.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/buttons.html5.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/buttons.flash.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/buttons.print.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-select/js/dataTables.select.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/pdfmake/build/pdfmake.min.js"></script>
|
|
<script src="<?php echo base_url(); ?>assets/libs/pdfmake/build/vfs_fonts.js"></script>
|
|
<!-- third party js ends -->
|
|
|
|
<script>
|
|
$('#reupload').on('click',function(){
|
|
$.ajax({
|
|
url:'<?php echo base_url('corporate/delgstr2a_data'); ?>',
|
|
data:{fileref:$('#fileref').val()},
|
|
type:'POST',
|
|
success:function(data){
|
|
location.reload();
|
|
},
|
|
error:function(){
|
|
alert('Kindy try after sometime.');
|
|
}
|
|
})
|
|
})
|
|
$('#proceedbtn').on('click',function(){
|
|
|
|
$('#loading2').show();
|
|
$('#proceedbtn').hide();
|
|
|
|
$.ajax({
|
|
url:'<?php echo base_url('corporate/proceedinsert_gstr2a'); ?>',
|
|
data:{fileref:$('#fileref').val()},
|
|
type:'POST',
|
|
success:function(data){
|
|
|
|
$('#loading2').hide();
|
|
$('#proceedbtn').show();
|
|
|
|
var pdata = JSON.parse(data);
|
|
if (pdata.status == 1) {
|
|
$('#addclose').trigger('click');
|
|
usrforma.reset();
|
|
alert('File uploaded successfully.');
|
|
// getgstlisting();
|
|
location.reload();
|
|
} else {
|
|
alert('Request failed. Kindly try after sometime');
|
|
}
|
|
},
|
|
error:function(){
|
|
alert('Kindly try after sometime.');
|
|
}
|
|
})
|
|
})
|
|
</script>
|
|
|
|
<!-- Datatables init -->
|
|
<!-- <script src="<?php echo base_url(); ?>assets/js/pages/datatables.init.js"></script>-->
|
|
|
|
<script>
|
|
|
|
function showmonths(year){
|
|
var d = new Date();
|
|
var n = d.getFullYear();
|
|
if(year == n){
|
|
$('#curyear').show();
|
|
$('#scuryear').prop('required',true);
|
|
$('#scuryear').prop('disabled',false);
|
|
$('#sotheryear').prop('disabled',true);
|
|
$('#otheryear').hide();
|
|
}
|
|
else{
|
|
$('#curyear').hide();
|
|
$('#sotheryear').prop('required',true);
|
|
$('#sotheryear').prop('disabled',false);
|
|
$('#scuryear').prop('disabled',true);
|
|
$('#otheryear').show();
|
|
}
|
|
}
|
|
|
|
$("#usrforme").submit(function(e) {
|
|
e.preventDefault(); // avoid to execute the actual submit of the form.
|
|
var form = $(this);
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '<?php echo base_url('corporate/upd_gstno'); ?>',
|
|
data: form.serialize(), // serializes the form's elements.
|
|
success: function(data)
|
|
{
|
|
if(data == 1){
|
|
$('#editclose').trigger('click');
|
|
usrforme.reset();
|
|
alert('Record updated successfully.');
|
|
getgstlisting();
|
|
}
|
|
else if(data == 2){
|
|
alert('Error. GST No already exists.');
|
|
}
|
|
else{
|
|
alert('Request failed. Kindly try after sometime');
|
|
}
|
|
},
|
|
error:function(){
|
|
alert('Request failed. Kindly try after sometime');
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#usrforma").submit(function(e) {
|
|
|
|
$('#loading1').show();
|
|
$('#submit1').hide();
|
|
|
|
e.preventDefault(); // avoid to execute the actual submit of the form.
|
|
// var form = $(this);
|
|
var formData = new FormData( $("#usrforma")[0] );
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '<?php echo base_url('corporate/add_gstno'); ?>',
|
|
data: formData,
|
|
processData:false,
|
|
contentType:false,
|
|
cache:false,
|
|
async:false,
|
|
success: function(data)
|
|
{
|
|
|
|
$('#loading1').hide();
|
|
$('#submit1').show();
|
|
|
|
var pdata = JSON.parse(data);
|
|
if(pdata.status == 1){
|
|
$('#addclose').trigger('click');
|
|
usrforma.reset();
|
|
alert('Record added successfully.');
|
|
getgstlisting();
|
|
// location.reload();
|
|
}
|
|
else if(pdata.status == 2){
|
|
alert('Request failed. GST No already exists');
|
|
}
|
|
else{
|
|
alert('Request failed. Kindly try after sometime');
|
|
}
|
|
},
|
|
error:function(){
|
|
alert('Request failed. Kindly try after sometime');
|
|
}
|
|
});
|
|
});
|
|
|
|
$(document).ready(function() {
|
|
oTable = $('#datatable').DataTable({
|
|
|
|
dom: '<"top"Bf>rt<"bottom"ip><"clear">',
|
|
// dom:'B',
|
|
'lengthChange' : false,
|
|
"columnDefs": [
|
|
{
|
|
"targets": 3,
|
|
"width": "12%",
|
|
"render": function ( data, type, full, meta ) {
|
|
return '<a onclick="editfn('+data+')" href="javascript:void(0)" style="font-size:16px;"><i class="fa fa-edit" title="Edit"></i></a>';
|
|
}
|
|
}
|
|
],
|
|
// order : [[ 4, "asc" ]],
|
|
columns : [
|
|
// { data : "c_name"},
|
|
{ data : "gn_gstno"},
|
|
{ data : "gn_createdon_ref"},
|
|
{ data : "gn_isactive_ref"},
|
|
{ data : "gn_id"}
|
|
],
|
|
buttons: ['excel']
|
|
// buttons: ['copy', 'excel', 'pdf']
|
|
});
|
|
getgstlisting();
|
|
} );
|
|
|
|
function editfn(gn_id){
|
|
$('#e_gn_id').val(gn_id);
|
|
var htmlData = '';
|
|
$.ajax({
|
|
url : '<?php echo base_url('corporate/get_gstno') ?>/'+gn_id,
|
|
type:'POST',
|
|
success:function(data){
|
|
var pdata = JSON.parse(data);
|
|
var pd = pdata.data;
|
|
$('#e_gn_gstno').val(pd[0].gn_gstno);
|
|
|
|
$.each(pd[0],function(k,v){
|
|
if(k == 'gn_isactive')
|
|
{
|
|
console.log(v);
|
|
if((v == '0') || (v == '1')){
|
|
$('#e_'+k+'_'+v).prop('checked', true);
|
|
}
|
|
}
|
|
});
|
|
},
|
|
error:function(){
|
|
alert('Request failed. Kindly try after sometime.');
|
|
}
|
|
});
|
|
$('#editref').trigger('click');
|
|
}
|
|
|
|
function getgstlisting(){
|
|
var url = "<?php echo site_url('corporate/get_gstno'); ?>"; // the script where you handle the form input.
|
|
$.ajax({
|
|
type: "POST",
|
|
url: url,
|
|
success: function(data)
|
|
{
|
|
oTable.clear();
|
|
var jsonData = JSON.parse(data);
|
|
var jd = jsonData.data;
|
|
var htmlData = '';
|
|
var i=0;
|
|
var rowNode = oTable
|
|
.rows.add( jsonData.data )
|
|
.draw();
|
|
$('#wait').hide();
|
|
// $('#example1_filter').hide();
|
|
// $('#dtableid').show();
|
|
// get_all_pnr_counts();
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<!-- App js -->
|
|
<script src="<?php echo base_url(); ?>assets/js/app.min.js"></script>
|
|
|
|
</body>
|
|
</html>
|