Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. /**
  2.  * Implements callback for user report batch process.
  3.  */
  4. function ls_draw_batch_process_user_report() {
  5.   // Code for CSV file download ends.
  6.   $destination = url('admin/reports/draws');
  7.   $id = @$_GET['from_session'];
  8.   $num_operations = 1000;
  9.   $row_numbers = count($_SESSION['users_segment'][$id]);
  10.   $operations = $row_numbers / $num_operations;
  11.   $operations = floor($operations);
  12.   $batch_operations = [];
  13.   $filename = "summary_report_data_" . $id . "_" . time() . ".csv";
  14.   for ($i = 0; $i <= $operations; $i++) {
  15.     $min = 1 + $num_operations * $i;
  16.     $batch_operations[] = [
  17.       'ls_draw_write_data_on_csv_and_download_user_report',
  18.       [
  19.         'operation_type' => $id,
  20.         'min' => $min,
  21.         'filename' => $filename,
  22.       ],
  23.       [
  24.         t('(Operation @operation)', ['@operation' => $i + 1]),
  25.       ],
  26.     ];
  27.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement