if ($user_origin == 'quotation') { header('Location: ../ambulatory/amb_clinic_discharge.php' . URL_REDIRECT_APPEND . '&user_origin=' . $user_origin . '&pn=' . $encounter . '&pyear=' . date("Y") . '&pmonth=' . date("n") . '&pday=' . date(j) . '&tb=' . str_replace("#", "", $cfg['top_bgcolor']) . '&tt=' . str_replace("#", "", $cfg['top_txtcolor']) . '&bb=' . str_replace("#", "", $cfg['body_bgcolor']) . '&d=' . $cfg['dhtml'] . '&station=' . $station . '&backpath=' . urlencode('../billing_tz/billing_tz_quotation.php') . '&dept_nr=' . $dept_nr); } else { header('Location: ../ambulatory/amb_clinic_discharge.php' . URL_REDIRECT_APPEND . '&user_origin=' . $user_origin . '&pn=' . $encounter . '&pyear=' . date("Y") . '&pmonth=' . date("n") . '&pday=' . date(j) . '&tb=' . str_replace("#", "", $cfg['top_bgcolor']) . '&tt=' . str_replace("#", "", $cfg['top_txtcolor']) . '&bb=' . str_replace("#", "", $cfg['body_bgcolor']) . '&d=' . $cfg['dhtml'] . '&station=' . $station . '&backpath=' . urlencode('../billing_tz/billing_tz_pending.php') . '&dept_nr=' . $dept_nr); } } } elseif (false) { echo 'TEST'; die; /* Get the pending test requests */ // If this is the first call, get the first pn number out of the database... if (empty($batch_nr)) { if ($debug) { echo "<h1>get first pid</h1>"; } $pid = $bill_obj->GetFirstPid(); $batch_nr = $pid; } else { if ($debug) { echo "<h1>{$batch_nr}</h1>"; } $pid = $batch_nr; } // Load all batch-numbers of this person into this array $array_encounters $array_encounters = $bill_obj->GetAllEncounters(); // Now we have all encounters, but we are not sure that this person ($pid) made // some tasks with interesting points for us as billing module. while (list($index, $encounter_nr) = each($array_encounters)) { if ($debug) { echo "---------------------------------------------------------------------------------<br>"; }