From 515a92dda7d53f295eac01454c84cc02709db94e Mon Sep 17 00:00:00 2001 From: james Date: Thu, 20 Dec 2007 18:13:06 +0000 Subject: [PATCH] Dont use JSON anymore, we really dont need the entire report object, we just need the 3 fields type, stock and desc, so return them on their own line, so we can just split on \n --- admin/report.ajax.php | 10 ++++++++-- admin/reports.php | 27 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/admin/report.ajax.php b/admin/report.ajax.php index 19fcc7d5..e1437dc5 100644 --- a/admin/report.ajax.php +++ b/admin/report.ajax.php @@ -32,8 +32,14 @@ if($reports_id > 0) { $report = report_load($reports_id); - echo json_encode($report); + echo $report['type']."\n"; + echo $report['stock']."\n"; + echo $report['desc']."\n"; +// echo json_encode($report); } else - echo json_encode(array()); + { + echo "\n\n\n"; +// echo json_encode(array()); + } ?> diff --git a/admin/reports.php b/admin/reports.php index 9f937ff2..31b51b27 100644 --- a/admin/reports.php +++ b/admin/reports.php @@ -239,6 +239,7 @@ document.getElementById('reporttypecustom').style.display='none'; document.getElementById('reportstockcustom').style.display='none'; +/* dont use JSON anymore since it adds an extra PHP-side requirement, we'll just get a 3 line response with one thing per line that we need var obj=eval('('+http.responseText+')'); if(obj['option']['type']) { for(i=0;i