0

I am uploading a excel file and based on excel file i am inserting and updating multiple table in database and doing calculation also based on excel data.

In codeigniter form action i am passing a controller Dataprocessing and doing all the process but i want to show a progress bar in the UI with percentage how much data uploaded for only uploading i can do that thing but here i need to perform calculation and insert and get data from and then update another table and then get data from another table and update another table so on and for this i am created 4 function and calling each function in the end of each function and in the last function i am redirecting to upload page.

So how can i able to get the progress of my functions, how can i track the execution of function and send to UI for displaying progress bar in realtime.

Or there is another way to do it and please tell me...

1. View Page Where i have form
echo form_open('DataProcessing/upload_kpi_data', $attributes);

2. in DataProcessing.php

upload_kpi_data(){
//upload in temp table
....
function2() //calling another function for calculation
}

function2(){
//performing calculation
....
//updating main table and insert new value
function3() //calling another function for calculation
}
and so on...

so how can i able to get realtime progress bar for this?

progress bar

  • PHP is a server side language and it give you response based on request, you can not manipulate (like you want) on DOM. for this you should use javascript and AJAX to change DOM elements based on PHP result. following answer may help you in achieving what you want: https://stackoverflow.com/questions/7049303/show-progress-for-long-running-php-script – prashant Dec 09 '19 at 06:58
  • I tried this already but what i want this is not there. I am getting response at the end of execution not synchronously when i am redirecting to my upload page that time only i got the response but whole time when process is running i didn't get any response from jQuery and AJAX. I also tired setinterval function, and creating a session variable in php and give it a value and then in setinterval function i am checking that session variable has any value or not but this is also not working for me this is also sending the response at the end of the execution method. – Mohammed Maviya Ansari Dec 09 '19 at 08:55

0 Answers0