Advertisement
i-Hmx

Untitled

Apr 30th, 2013
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?
  2.  
  3. require_once('xivo.php');
  4.  
  5. $bloc = isset($_QR['bloc']) === false ? '' : $_QR['bloc'];
  6. $type = isset($_QR['type']) === false ? '' : $_QR['type'];
  7.  
  8. if(($result = dwho_report::get_bloc($type,$bloc)) === false)
  9.     die;
  10.  
  11. $title = str_replace(' ','_',html_entity_decode(base64_decode($bloc)));
  12.  
  13. header('Pragma: no-cache');
  14. header('Cache-Control: private, must-revalidate');
  15. header('Last-Modified: '.date('D, d M Y H:i:s',mktime()).' '.dwho_i18n::strftime_l('%Z',null));
  16. header('Content-Disposition: attachment; filename=xivo_report_'.$type.'-'.$title.'.txt');
  17. header('Content-Type: text/plain; charset=UTF-8');
  18.  
  19. ob_start();
  20.  
  21. while($result)
  22.     echo html_entity_decode(array_shift($result),ENT_QUOTES,'UTF-8'),"\n";
  23.  
  24. header('Content-Length: '.ob_get_length());
  25. ob_end_flush();
  26. die();
  27.  
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement