11 * format = [empty=xls] , 'gnumeric' (download format)
12 * debug = true => download xml.
18 require_once 'Pman.php';
19 class Pman_Core_JsonToExcel extends Pman
23 $au = $this->getAuthUser();
25 die("NOT authenticated");
27 $this->authUser = $au;
33 $this->jerr("invalid get");
35 function post($fname) {
37 $ml = (int) ini_get('suhosin.post.max_value_length');
38 if (empty($_POST['_json'])) {
39 header("HTTP/1.0 400 Internal Server Error");
40 die( $ml ? "Suhosin Patch enabled - try and disable it!!!" : 'no JSON sent');
43 if (empty($_POST['_json'])) {
44 header("HTTP/1.0 400 Internal Server Error");
45 die("Missing json attribute");
47 $_json = $_POST['_json'];
49 $worksheet = $workbook->addWorksheet($cfg['workbook']);
50 if (is_a($worksheet, 'PEAR_Error')) {
51 die($worksheet->toString());
53 //print_R($worksheet);
54 $worksheet->setInputEncoding('UTF-8');