From 944f301e4bf8ef72c3a9a4a6a4e3fefef008d00d Mon Sep 17 00:00:00 2001 From: "Ap.Muthu" Date: Sun, 14 Apr 2013 15:53:04 +0530 Subject: [PATCH] Unquoted Constant, Undefined Variables, Index, Initialization - PHP Notices fixed All from: referer: http://openemr.example.com/interface/main/left_nav.php Undefined index: mode in /var/www/openemr/interface/billing/billing_report.php on line 28 Undefined index: mode in /var/www/openemr/interface/billing/billing_report.php on line 54 Undefined index: authorized in /var/www/openemr/interface/billing/billing_report.php on line 71 Use of undefined constant html_header_show - assumed 'html_header_show' in /var/www/openemr/interface/billing/billing_report.php on line 104 Undefined variable: all in /var/www/openemr/library/billrep.inc on line 116 Undefined variable: divnos in /var/www/openemr/interface/billing/billing_report.php on line 1110 --- interface/billing/billing_report.php | 94 +++++++++++++++--------------------- library/billrep.inc | 4 +- 2 files changed, 41 insertions(+), 57 deletions(-) diff --git a/interface/billing/billing_report.php b/interface/billing/billing_report.php index 53240ef69..839ce12e9 100644 --- a/interface/billing/billing_report.php +++ b/interface/billing/billing_report.php @@ -25,69 +25,53 @@ $EXPORT_INC = "$webserver_root/custom/BillingExport.php"; $alertmsg = ''; -if ($_POST['mode'] == 'export') { - $sql = ReturnOFXSql(); - $db = get_db(); - $results = $db->Execute($sql); - $billings = array(); - if ($results->RecordCount() == 0) { - echo xlt("No Bills Found to Include in OFX Export")."
"; - } - else { - while(!$results->EOF) { - $billings[] = $results->fields; - $results->MoveNext(); +if (isset($_POST['mode']) { + if ($_POST['mode'] == 'export') { + $sql = ReturnOFXSql(); + $db = get_db(); + $results = $db->Execute($sql); + $billings = array(); + if ($results->RecordCount() == 0) { + echo xlt("No Bills Found to Include in OFX Export")."
"; + } else { + while(!$results->EOF) { + $billings[] = $results->fields; + $results->MoveNext(); + } + $ofx = new OFX($billings); + header("Pragma: public"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); + header("Content-Disposition: attachment; filename=openemr_ofx.ofx"); + header("Content-Type: text/xml"); + echo $ofx->get_OFX(); + exit; } - $ofx = new OFX($billings); - header("Pragma: public"); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); - header("Content-Disposition: attachment; filename=openemr_ofx.ofx"); - header("Content-Type: text/xml"); - echo $ofx->get_OFX(); - exit; } -} - -// This is obsolete. -if ($_POST['mode'] == 'process') { - if (exec("ps x | grep 'process_bills[.]php'")) { - $alertmsg = xl('Request ignored - claims processing is already running!'); - } - else { - exec("cd $webserver_root/library/freeb;" . - "php -q process_bills.php bill > process_bills.log 2>&1 &"); - $alertmsg = xl('Batch processing initiated; this may take a while.'); + // This is obsolete. + if ($_POST['mode'] == 'process') { + if (exec("ps x | grep 'process_bills[.]php'")) { + $alertmsg = xl('Request ignored - claims processing is already running!'); + } else { + exec("cd $webserver_root/library/freeb;" . + "php -q process_bills.php bill > process_bills.log 2>&1 &"); + $alertmsg = xl('Batch processing initiated; this may take a while.'); + } } } //global variables: -if (!isset($_POST["mode"])) { - $from_date = isset($_POST['from_date']) ? $_POST['from_date'] : date('Y-m-d'); - $to_date = isset($_POST['to_date' ]) ? $_POST['to_date' ] : ''; - $code_type = isset($_POST['code_type']) ? $_POST['code_type'] : 'all'; - $unbilled = isset($_POST['unbilled' ]) ? $_POST['unbilled' ] : 'on'; - $my_authorized = $_POST["authorized"]; -} else { - $from_date = $_POST["from_date"]; - $to_date = $_POST["to_date"]; - $code_type = $_POST["code_type"]; - $unbilled = $_POST["unbilled"]; - $my_authorized = $_POST["authorized"]; -} +$from_date = isset($_POST['from_date']) ? $_POST['from_date'] : date('Y-m-d'); +$to_date = isset($_POST['to_date' ]) ? $_POST['to_date' ] : ''; +$code_type = isset($_POST['code_type']) ? $_POST['code_type'] : 'all'; +$unbilled = isset($_POST['unbilled' ]) ? $_POST['unbilled' ] : 'on'; +$my_authorized = isset($_POST["authorized"]) ? $_POST["authorized"] : ''); + // This tells us if only encounters that appear to be missing a "25" modifier // are to be reported. -$missing_mods_only = !empty($_POST['missing_mods_only']); - -/* -$from_date = isset($_POST['from_date']) ? $_POST['from_date'] : date('Y-m-d'); -$to_date = empty($_POST['to_date' ]) ? $from_date : $_POST['to_date']; -$code_type = isset($_POST['code_type']) ? $_POST['code_type'] : 'all'; -$unbilled = isset($_POST['unbilled' ]) ? $_POST['unbilled' ] : 'on'; -$my_authorized = $_POST["authorized"]; -*/ +$missing_mods_only = (isset($_POST['missing_mods_only']) && !empty($_POST['missing_mods_only'])); $left_margin = isset($_POST["left_margin"]) ? $_POST["left_margin"] : 24; $top_margin = isset($_POST["top_margin"] ) ? $_POST["top_margin" ] : 20; @@ -101,7 +85,7 @@ $oauthorized = $my_authorized; - +