Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Implements callback for user report batch process.
- */
- function ls_draw_batch_process_user_report() {
- // Code for CSV file download ends.
- $destination = url('admin/reports/draws');
- $id = @$_GET['from_session'];
- $num_operations = 1000;
- $row_numbers = count($_SESSION['users_segment'][$id]);
- $operations = $row_numbers / $num_operations;
- $operations = floor($operations);
- $batch_operations = [];
- $filename = "summary_report_data_" . $id . "_" . time() . ".csv";
- for ($i = 0; $i <= $operations; $i++) {
- $min = 1 + $num_operations * $i;
- $batch_operations[] = [
- 'ls_draw_write_data_on_csv_and_download_user_report',
- [
- 'operation_type' => $id,
- 'min' => $min,
- 'filename' => $filename,
- ],
- [
- t('(Operation @operation)', ['@operation' => $i + 1]),
- ],
- ];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement