691 lines
34 KiB
PHP
691 lines
34 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>TMC 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" />
|
|
|
|
<!-- Vendor js -->
|
|
<script src="<?php echo base_url(); ?>assets/js/vendor.min.js"></script>
|
|
|
|
<style>
|
|
.mb25 {
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.required {
|
|
color: red;
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body class="loading" data-layout-mode="horizontal" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": false}'>
|
|
|
|
<!-- 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">TMC File Listing</h4>
|
|
<div class="page-title-right">
|
|
<ol class="breadcrumb m-0">
|
|
<li class="breadcrumb-item"><a href="javascript: void(0);">Files</a></li>
|
|
<li class="breadcrumb-item active">TMC File Listing</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-8"></div>
|
|
<div class="col-md-2">
|
|
<a class="btn btn-primary waves-effect waves-light" style="float:right" href="<?php echo base_url('corporate/tmc_sample_download') ?>" target="_blank"><i class="fa fa-download"></i> Sample</a>
|
|
</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"><i class="fa fa-upload"></i> Upload TMC Data</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>Agent</th>
|
|
<th>For Month</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>
|
|
<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">Upload TMC File</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>Agent<span class="required">*</span></label>
|
|
<input value="testagent" onkeyup="this.value = this.value.toUpperCase();" required type="text" name="usr[f_agent]" id="" class="form-control" />
|
|
</div>
|
|
<div class="col-md-6 mb25">
|
|
<label>Year<span class="required">*</span></label>
|
|
<select required id="yearselect" class="form-control" name="usr[f_year]" onchange="showmonths(this.value)">
|
|
<option value="">Select Year</option>
|
|
<?php
|
|
foreach($years as $yr){
|
|
echo '<option value="'.$yr.'">'.$yr.'</option>';
|
|
// echo '<option '.(($curYear==$yr?"selected='selected'":"")).' value="'.$yr.'">'.$yr.'</option>';
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
<div id="curyear" class="col-md-6 mb25">
|
|
<label>Month<span class="required">*</span></label>
|
|
<select id="scuryear" name="usr[f_month]" class="form-control">
|
|
<option value="">Select</option>
|
|
<?php
|
|
$c=0;
|
|
foreach($month as $am){
|
|
echo '<option value="'.++$c.'">'.$am.'</option>';
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
<script>
|
|
$('#scuryear').val(5);
|
|
$('#yearselect').val(2020);
|
|
|
|
</script>
|
|
<div id="otheryear" class="col-md-6 mb25" style="display:none">
|
|
<label>Month<span class="required">*</span></label>
|
|
<select disabled id="sotheryear" name="usr[f_month]" class="form-control">
|
|
<option value="">Select</option>
|
|
<?php
|
|
$c=0;
|
|
foreach($allmonth as $am){
|
|
echo '<option value="'.++$c.'">'.$am.'</option>';
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-6 mb25">
|
|
<label>File<span class="required">*</span></label>
|
|
<input required type="file" name="tmc_file" />
|
|
</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>
|
|
|
|
<button id="responsemref" style="display:none" type="button" data-toggle='modal' data-target="#response_modal"><i class="fa fa-upload"></i> Upload TMC Data</button>
|
|
|
|
<div id="response_modal" class="modal fade" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Upload Process</h4>
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
</div>
|
|
<form id="usrforme" class="form-horizontal editform" style="padding:10px;">
|
|
<input type="hidden" name="fileref" id="fileref" />
|
|
<div class="modal-body">
|
|
<div id="responsecontent"></div>
|
|
<!-- </div> -->
|
|
</div>
|
|
<div class="modal-footer">
|
|
<!--<button type="submit" class="btn btn-primary">Submit</button>-->
|
|
|
|
|
|
<button disabled class="btn btn-primary" type="button" id="loading2" style="display:none">
|
|
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
Loading...
|
|
</button>
|
|
|
|
<button type="button" id="proceedbtn" class="btn btn-default btn-secondary" data-dismiss="modal">Proceed</button>
|
|
<button type="button" id="reupload" class="btn btn-default btn-primary" data-dismiss="modal">Upload again</button>
|
|
</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 Corporate Details</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>Company Name<span class="required">*</span></label>
|
|
<input type="hidden" name="c_id" id="e_c_id" class="form-control" />
|
|
<input onkeyup="this.value = this.value.toUpperCase();" required type="text" name="usr[c_name]" id="e_c_name" class="form-control" />
|
|
</div>
|
|
<div class="col-md-6 mb25">
|
|
<label>Short Name<span class="required">*</span></label>
|
|
<input onkeyup="this.value = this.value.toUpperCase();" required type="text" name="usr[c_code]" id="e_c_code" class="form-control" />
|
|
</div>
|
|
<div class="col-md-6 mb25">
|
|
<label>Contact Person<span class="required">*</span></label>
|
|
<input onkeyup="this.value = this.value.toUpperCase();" required type="text" name="usr[c_person]" id="e_c_person" class="form-control" />
|
|
</div>
|
|
<div class="col-md-6 mb25">
|
|
<label>Email<span class="required">*</span></label>
|
|
<input type="text" name="usr[c_email]" id="e_c_email" class="form-control" required />
|
|
</div>
|
|
|
|
<div class="col-md-6 mb25">
|
|
<label>Mobile</label>
|
|
<input type="text" oninput="this.setCustomValidity('')" oninvalid="this.setCustomValidity('Valid format : 10 digit number')" pattern="[0-9]{10}" name="usr[c_number]" id="e_c_number" class="form-control" />
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<label>Status<span class="required">*</span></label> <br />
|
|
<label class="radio-inline">
|
|
<input type="radio" name="usr[c_isactive]" id="e_c_isactive_1" value="1" required> Active
|
|
</label>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="usr[c_isactive]" id="e_c_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 -->
|
|
|
|
<div class="modal" id="download_modal">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
|
|
<!-- Modal Header -->
|
|
<div class="modal-header">
|
|
<!-- <h4 class="modal-title">Forgot Password</h4> -->
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
</div>
|
|
|
|
<!-- Modal body -->
|
|
<div class="modal-body">
|
|
<form method="post" action="<?php echo base_url('Corporate/d_record_tmc'); ?>" target="_blank" id="dform1" class="form-horizontal" style="padding:10px;">
|
|
<input type="hidden" id="id" name="id" value=""/>
|
|
<div class="form-group">
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<label>Select Record Type</label>
|
|
</div>
|
|
<div class="col-md-8">
|
|
<select class="form-control" id="type" name="type" required>
|
|
<option>--select--</option>
|
|
<option value="Raw">Raw</option>
|
|
<option value="Validated">Validated</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer" style="margin-top:20px;">
|
|
<button type="submit" id="download" class="btn btn-primary">Download</button>
|
|
<button type="button" class="btn btn-danger" id="btn_close" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Modal footer -->
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 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 -->
|
|
|
|
<!-- Datatables init -->
|
|
<!-- <script src="<?php echo base_url(); ?>assets/js/pages/datatables.init.js"></script>-->
|
|
|
|
<script>
|
|
$('#reupload').on('click',function(){
|
|
$.ajax({
|
|
url:'<?php echo base_url('corporate/deltmc_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_tmc'); ?>',
|
|
data:{fileref:$('#fileref').val()},
|
|
type:'POST',
|
|
success:function(data){
|
|
|
|
$('#loading2').show();
|
|
$('#proceedbtn').hide();
|
|
|
|
var pdata = JSON.parse(data);
|
|
if (pdata.status == 1) {
|
|
$('#addclose').trigger('click');
|
|
usrforma.reset();
|
|
alert('File uploaded successfully.');
|
|
// getcorplisting();
|
|
location.reload();
|
|
} else {
|
|
alert('Request failed. Kindly try after sometime');
|
|
}
|
|
},
|
|
error:function(){
|
|
alert('Kindly try after sometime.');
|
|
}
|
|
})
|
|
})
|
|
|
|
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('admin/upd_corpdetail'); ?>',
|
|
data: form.serialize(), // serializes the form's elements.
|
|
success: function(data) {
|
|
if (data == 1) {
|
|
$('#editclose').trigger('click');
|
|
usrforme.reset();
|
|
alert('Corporate details updated successfully.');
|
|
getcorplisting();
|
|
} else if (data == 2) {
|
|
alert('Error. Corporate code already exists.');
|
|
} else if (data == 3) {
|
|
alert('Error. Email ID 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('tmc/upload_tmc'); ?>',
|
|
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('File uploaded successfully.');
|
|
// alert('File uploaded successfully. Records insertred - ' + pdata.added_records);
|
|
// getcorplisting();
|
|
location.reload();
|
|
} else if (pdata.status == 31) {
|
|
alert('File already uploaded for this criteria.');
|
|
} else if (pdata.status == 13) {
|
|
alert('Error. Column mismatch.');
|
|
} else if (pdata.status == 0) {
|
|
$('#fileref').val(pdata.insref);
|
|
var content = 'Total Records - '+pdata.ttlrows+'<br/>Invalid Records - '+pdata.invalidrows;
|
|
if(pdata.duprecords != 0)
|
|
content += '<br/>Duplicate Records - '+pdata.duprecords;
|
|
// var content = 'Error in <br/>';
|
|
// var row = 1;
|
|
// $.each(pdata.error, function(k, v){
|
|
// $.each(v, function(kk, vv) {
|
|
// var l = 0;
|
|
// if (kk == 'column') {
|
|
// if (l == 0) {
|
|
// content += 'Row ' + row + ' - ';
|
|
// l = l + 1;
|
|
// }
|
|
// for (var i = 0; i < vv.length; i++) {
|
|
// content += vv[i] + ',';
|
|
// }
|
|
// content += '<br/>';
|
|
// row = row + 1;
|
|
// }
|
|
// })
|
|
// })
|
|
$('#addclose').trigger('click');
|
|
$('#responsecontent').html(content+'<br/><span style="color:red">*</span>Note : If you proceed only valid records will be uploaded.');
|
|
$('#responsemref').trigger('click');
|
|
|
|
// console.log(content);
|
|
// var content='Error in \n';
|
|
// $.each(pdata.error,function(k,v){
|
|
// var sary = v.split('-');
|
|
// content += 'Row '+sary[0]+' - Column - '+sary[1]+'\n';
|
|
// })
|
|
// content += 'Kindly correct the data and upload';
|
|
// alert(content);
|
|
} else {
|
|
alert('Request failed. Kindly try after sometime');
|
|
}
|
|
},
|
|
error: function() {
|
|
alert('Request failed. Kindly try after sometime');
|
|
}
|
|
});
|
|
});
|
|
|
|
function editfn(c_id) {
|
|
$('#e_c_id').val(c_id);
|
|
var htmlData = '';
|
|
$.ajax({
|
|
url: '<?php echo base_url('admin/get_corpdetail') ?>',
|
|
data: {
|
|
c_id: c_id
|
|
},
|
|
type: 'POST',
|
|
success: function(data) {
|
|
var pdata = JSON.parse(data);
|
|
var pd = pdata.data;
|
|
$('#e_c_name').val(pd[0].c_name);
|
|
$('#e_c_email').val(pd[0].c_email);
|
|
$('#e_c_number').val(pd[0].c_number);
|
|
$('#e_c_person').val(pd[0].c_person);
|
|
$('#e_c_code').val(pd[0].c_code);
|
|
|
|
$.each(pd[0], function(k, v) {
|
|
if (k == 'c_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');
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
oTable = $('#datatable').DataTable({
|
|
dom: '<"top"Bf>rt<"bottom"ip><"clear">',
|
|
// dom:'B',
|
|
'lengthChange': false,
|
|
"columnDefs": [{
|
|
"targets": 7,
|
|
"width": "12%",
|
|
"render": function(data, type, full, meta) {
|
|
// return '<a target="_blank" href="<?php echo base_url('corporate/tmc_file_download/'); ?>' + data + '" style="font-size:16px;"><i class="fa fa-download" title="Download file"></i></a> <a target="_blank" href="<?php echo base_url('corporate/tmc_valid_download/'); ?>'+data+'" style="font-size:16px;color:green"><i class="fa fa-download" title="Download Valid Records"></i></a>';
|
|
|
|
return '<a href="javascript:void(0)" onclick="downloadfn('+data+')" style="font-size:16px;"><i class="fa fa-download" title="Download file"></i></a>';
|
|
}
|
|
}
|
|
|
|
|
|
//
|
|
// <a href='' style="font-size:16px;"><i class="fa fa-trash"></i> </a>
|
|
],
|
|
// order : [[ 4, "asc" ]],
|
|
columns: [
|
|
// { data : "c_name"},
|
|
{
|
|
data: "f_agent"
|
|
},
|
|
{
|
|
data: "inv_ref"
|
|
},
|
|
{
|
|
data: "f_min_date_ref"
|
|
},
|
|
{
|
|
data: "f_max_date_ref"
|
|
},
|
|
{
|
|
data: "u_name"
|
|
},
|
|
{
|
|
data: "u_email"
|
|
},
|
|
{
|
|
data: "f_uploadedat_ref"
|
|
},
|
|
{
|
|
data: "f_id"
|
|
}
|
|
],
|
|
buttons: ['excel']
|
|
// buttons: ['copy', 'excel', 'pdf']
|
|
});
|
|
getcorplisting();
|
|
});
|
|
|
|
function getcorplisting() {
|
|
var url = "<?php echo site_url('corporate/get_tmc'); ?>"; // the script where you handle the form input.
|
|
$.ajax({
|
|
type: "POST",
|
|
url: url,
|
|
success: function(data) {
|
|
if(data.length > 2){
|
|
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();
|
|
}
|
|
});
|
|
}
|
|
|
|
function downloadfn(val)
|
|
{
|
|
var id = val;
|
|
$('#id').val(id);
|
|
$('#download_modal').modal('show');
|
|
}
|
|
|
|
</script>
|
|
|
|
<!-- App js -->
|
|
<script src="<?php echo base_url(); ?>assets/js/app.min.js"></script>
|
|
|
|
</body>
|
|
|
|
</html>
|