Skip to content

Commit

Permalink
Merge pull request #14 from digitalutsc/bug
Browse files Browse the repository at this point in the history
fixed bug missing last few records when bulk binding
  • Loading branch information
kylehuynh205 authored Mar 12, 2021
2 parents 362ce86 + 0a7f672 commit be8c5b1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1177,9 +1177,15 @@ function doPost(index, total_data, csvResult) {
// pulll preserve read data from CSV from local storage
var csvResult = JSON.parse(localStorage.getItem("importCSV"));
var password = JSON.parse(localStorage.getItem("syspasswd"));
var keys = csvResult[0].split(',').map(function (x) {
if (Array.isArray(csvResult)) {
var keys = csvResult[0].split(',').map(function (x) {
return x.toUpperCase();
});
});
}
else {
return;
}


// start binding each line of CSV file
var item = csvResult[index];
Expand Down Expand Up @@ -1242,14 +1248,14 @@ function processPostSuccess(index, csvResult, data) {
$('#total_data').text(total_data);

// calculate percentage of ongoing process.
var width = Math.round(((index + 1) / total_data) * 100);
var width = ((index + 1) / total_data) * 100;

// update the progress bar.
$('#process_data').text(index);
$('.progress-bar').css('width', width + '%');

// if the process reaches 100%
if (width >= 99) {
if (width >= 100) {

// dismiss the progress bar
$('#process').css('display', 'none');
Expand Down

0 comments on commit be8c5b1

Please sign in to comment.