本文整理汇总了PHP中SLQueryValue函数的典型用法代码示例。如果您正苦于以下问题:PHP SLQueryValue函数的具体用法?PHP SLQueryValue怎么用?PHP SLQueryValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SLQueryValue函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: slInitialize
function slInitialize()
{
if ($GLOBALS['oer_config']['ws_accounting']['enabled'] === 2) {
return;
}
global $chart_id_cash, $chart_id_ar, $chart_id_income, $services_id;
global $sl_cash_acc, $sl_ar_acc, $sl_income_acc, $sl_services_id;
SLConnect();
$chart_id_cash = SLQueryValue("select id from chart where accno = '{$sl_cash_acc}'");
if ($sl_err) {
die($sl_err);
}
if (!$chart_id_cash) {
die(xl("There is no COA entry for cash account ") . "'{$sl_cash_acc}'");
}
$chart_id_ar = SLQueryValue("select id from chart where accno = '{$sl_ar_acc}'");
if ($sl_err) {
die($sl_err);
}
if (!$chart_id_ar) {
die(xl("There is no COA entry for AR account ") . "'{$sl_ar_acc}'");
}
$chart_id_income = SLQueryValue("select id from chart where accno = '{$sl_income_acc}'");
if ($sl_err) {
die($sl_err);
}
if (!$chart_id_income) {
die(xl("There is no COA entry for income account ") . "'{$sl_income_acc}'");
}
$services_id = SLQueryValue("select id from parts where partnumber = '{$sl_services_id}'");
if ($sl_err) {
die($sl_err);
}
if (!$services_id) {
die(xl("There is no parts entry for services ID ") . "'{$sl_services_id}'");
}
}
示例2: generate_receipt
//.........这里部分代码省略.........
?>
</td>
<td><b><?php
echo xlt('Total Charges');
?>
</b></td>
<td align='right'> </td>
<td align='right'> </td>
<td align='right'><?php
echo text(oeFormatMoney($charges, true));
?>
</td>
</tr>
<tr>
<td colspan='5'> </td>
</tr>
<?php
if ($INTEGRATED_AR) {
// Get co-pays.
$inres = sqlStatement("SELECT fee, code_text FROM billing WHERE " . "pid = ? AND encounter = ? AND " . "code_type = 'COPAY' AND activity = 1 AND fee != 0 " . "ORDER BY id", array($patient_id, $encounter));
while ($inrow = sqlFetchArray($inres)) {
$charges += sprintf('%01.2f', $inrow['fee']);
receiptPaymentLine($svcdate, 0 - $inrow['fee'], $inrow['code_text']);
}
// Get other payments.
$inres = sqlStatement("SELECT " . "a.code, a.modifier, a.memo, a.payer_type, a.adj_amount, a.pay_amount, " . "s.payer_id, s.reference, s.check_date, s.deposit_date " . "FROM ar_activity AS a " . "LEFT JOIN ar_session AS s ON s.session_id = a.session_id WHERE " . "a.pid = ? AND a.encounter = ? AND " . "a.pay_amount != 0 " . "ORDER BY s.check_date, a.sequence_no", array($patient_id, $encounter));
$payer = empty($inrow['payer_type']) ? 'Pt' : 'Ins' . $inrow['payer_type'];
while ($inrow = sqlFetchArray($inres)) {
$charges -= sprintf('%01.2f', $inrow['pay_amount']);
receiptPaymentLine($svcdate, $inrow['pay_amount'], $payer . ' ' . $inrow['reference']);
}
} else {
$chart_id_cash = SLQueryValue("select id from chart where accno = '{$sl_cash_acc}'");
if ($sl_err) {
die($sl_err);
}
if (!$chart_id_cash) {
die("There is no COA entry for cash account '{$sl_cash_acc}'");
}
//
// Request all cash entries belonging to the invoice.
$atres = SLQuery("SELECT * FROM acc_trans WHERE " . "trans_id = {$trans_id} AND chart_id = {$chart_id_cash} ORDER BY transdate");
if ($sl_err) {
die($sl_err);
}
//
for ($irow = 0; $irow < SLRowCount($atres); ++$irow) {
$row = SLGetRow($atres, $irow);
$amount = sprintf('%01.2f', $row['amount']);
// negative
$charges += $amount;
$rowsource = $row['source'];
if (strtolower($rowsource) == 'co-pay') {
$rowsource = '';
}
receiptPaymentLine($row['transdate'], 0 - $amount, $rowsource);
}
}
// end not $INTEGRATED_AR
?>
<tr>
<td colspan='5'> </td>
</tr>
<tr>
<td> </td>
示例3: SLGetRow
$row = SLGetRow($t_res, $irow);
list($patient_id, $encounter_id) = explode(".", $row['invnumber']);
// Under some conditions we may skip invoices that matched the SQL query.
//
if ($row['trans_id'] == $last_trans_id) {
if ($skipping) {
continue;
}
// same invoice and not skipping, do nothing.
} else {
// new invoice
$skipping = false;
// If a diagnosis code was given then skip any invoices without
// that diagnosis.
if ($form_icdcode) {
if (!SLQueryValue("SELECT count(*) FROM invoice WHERE " . "invoice.trans_id = '" . $row['trans_id'] . "' AND " . "( invoice.description ILIKE 'ICD9:{$form_icdcode} %' OR " . "invoice.serialnumber ILIKE 'ICD9:{$form_icdcode}' )")) {
$skipping = true;
continue;
}
}
// If a facility was specified then skip invoices whose encounters
// do not indicate that facility.
if ($form_facility) {
$tmp = sqlQuery("SELECT count(*) AS count FROM form_encounter WHERE " . "pid = '{$patient_id}' AND encounter = '{$encounter_id}' AND " . "facility_id = '{$form_facility}'");
if (empty($tmp['count'])) {
$skipping = true;
continue;
}
}
// Find out who the practitioner is.
/***********************************************************
示例4: array
if ($thisauth && $auth_sensitivity) {
$binfo = array('', '', '', '', '');
if ($subresult2 = getBillingByEncounter($pid, $result4['encounter'], "code_type, code, modifier, code_text, fee")) {
// Get A/R info, if available, for this encounter.
$arinvoice = array();
$arlinkbeg = "";
$arlinkend = "";
if ($billing_view && $accounting_enabled) {
if ($INTEGRATED_AR) {
$tmp = sqlQuery("SELECT id FROM form_encounter WHERE " . "pid = ? AND encounter = ?", array($pid, $result4['encounter']));
$arid = 0 + $tmp['id'];
if ($arid) {
$arinvoice = ar_get_invoice_summary($pid, $result4['encounter'], true);
}
} else {
$arid = SLQueryValue("SELECT id FROM ar WHERE invnumber = " . "'{$pid}.{$result4['encounter']}'");
if ($arid) {
$arinvoice = get_invoice_summary($arid, true);
}
}
if ($arid) {
$arlinkbeg = "<a href='../../billing/sl_eob_invoice.php?id=" . htmlspecialchars($arid, ENT_QUOTES) . "'" . " target='_blank' class='text' style='color:#00cc00'>";
$arlinkend = "</a>";
}
}
// Throw in product sales.
$query = "SELECT s.drug_id, s.fee, d.name " . "FROM drug_sales AS s " . "LEFT JOIN drugs AS d ON d.drug_id = s.drug_id " . "WHERE s.pid = ? AND s.encounter = ? " . "ORDER BY s.sale_id";
$sres = sqlStatement($query, array($pid, $result4['encounter']));
while ($srow = sqlFetchArray($sres)) {
$subresult2[] = array('code_type' => 'PROD', 'code' => 'PROD:' . $srow['drug_id'], 'modifier' => '', 'code_text' => $srow['name'], 'fee' => $srow['fee']);
}
示例5: get_invoice_summary
function get_invoice_summary($trans_id, $with_detail = false)
{
global $sl_err, $sl_cash_acc;
$codes = array();
$chart_id_cash = SLQueryValue("select id from chart where accno = '{$sl_cash_acc}'");
if ($sl_err) {
die($sl_err);
}
if (!$chart_id_cash) {
die("There is no COA entry for cash account '{$sl_cash_acc}'");
}
// Request all cash entries belonging to the invoice.
$atres = SLQuery("select * from acc_trans where trans_id = {$trans_id} and chart_id = {$chart_id_cash}");
if ($sl_err) {
die($sl_err);
}
// Deduct payments for each procedure code from the respective balance owed.
$keysuffix = 5000;
for ($irow = 0; $irow < SLRowCount($atres); ++$irow) {
$row = SLGetRow($atres, $irow);
$code = strtoupper($row['memo']);
$ins_id = $row['project_id'];
if (!$code) {
$code = "Unknown";
}
$amount = $row['amount'];
$codes[$code]['bal'] += $amount;
// amount is negative for a payment
if ($ins_id) {
$codes[$code]['ins'] = $ins_id;
}
// Add the details if they want 'em.
if ($with_detail) {
if (!$codes[$code]['dtl']) {
$codes[$code]['dtl'] = array();
}
$tmpkey = $row['transdate'] . $keysuffix++;
$tmp = array();
$tmp['pmt'] = 0 - $amount;
$tmp['src'] = $row['source'];
if ($ins_id) {
$tmp['ins'] = $ins_id;
}
$codes[$code]['dtl'][$tmpkey] = $tmp;
}
}
// Request all line items with money or adjustment reasons belonging
// to the invoice.
$inres = SLQuery("SELECT * FROM invoice WHERE trans_id = {$trans_id} AND " . "( sellprice != 0 OR description LIKE 'Adjustment%' OR serialnumber = 'Claim' )");
if ($sl_err) {
die($sl_err);
}
// Add charges and adjustments for each procedure code into its total and balance.
$keysuffix = 1000;
for ($irow = 0; $irow < SLRowCount($inres); ++$irow) {
$row = SLGetRow($inres, $irow);
// $amount = $row['sellprice'];
$amount = sprintf('%01.2f', $row['sellprice'] * $row['qty']);
$ins_id = $row['project_id'];
$code = "Unknown";
if ($row['serialnumber'] == 'Claim') {
$code = 'Claim';
} else {
if (preg_match("/([A-Za-z0-9]\\d\\d\\S*)/", $row['serialnumber'], $matches)) {
$code = strtoupper($matches[1]);
} else {
if (preg_match("/([A-Za-z0-9]\\d\\d\\S*)/", $row['description'], $matches)) {
$code = strtoupper($matches[1]);
} else {
if (preg_match("/^TAX:/", $row['description'])) {
$code = 'TAX';
}
}
}
}
$codes[$code]['chg'] += $amount;
$codes[$code]['bal'] += $amount;
if ($amount < 0) {
$codes[$code]['adj'] -= $amount;
}
if ($ins_id) {
$codes[$code]['ins'] = $ins_id;
}
// Add the details if they want 'em.
if ($with_detail) {
if (!$codes[$code]['dtl']) {
$codes[$code]['dtl'] = array();
}
if (preg_match("/^Adjustment\\s*(\\S*)\\s*(.*)/", $row['description'], $matches)) {
$tmpkey = str_pad($matches[1], 10) . $keysuffix++;
$tmp = array();
$tmp['chg'] = $amount;
$tmp['rsn'] = $matches[2];
if ($ins_id) {
$tmp['ins'] = $ins_id;
}
$codes[$code]['dtl'][$tmpkey] = $tmp;
} else {
$tmpkey = " " . $keysuffix++;
$tmp = array();
//.........这里部分代码省略.........
示例6: exec
exec("{$STMT_PRINT_CMD} {$STMT_TEMP_FILE}");
if ($_POST['form_without']) {
$alertmsg = xl('Now printing') . ' ' . $stmt_count . ' ' . xl('statements; invoices will not be updated.');
} else {
$alertmsg = xl('Now printing') . ' ' . $stmt_count . ' ' . xl('statements and updating invoices.');
}
}
// end not debug
}
// end not form_download
}
// end statements requested
} else {
SLConnect();
// This will be true starting with SQL-Ledger 2.8.x:
$got_address_table = SLQueryValue("SELECT count(*) FROM pg_tables WHERE " . "schemaname = 'public' AND tablename = 'address'");
// Print or download statements if requested.
//
if (($_POST['form_print'] || $_POST['form_download'] || $_POST['form_pdf']) && $_POST['form_cb']) {
$fhprint = fopen($STMT_TEMP_FILE, 'w');
$where = "";
foreach ($_POST['form_cb'] as $key => $value) {
$where .= " OR ar.id = {$key}";
}
$where = substr($where, 4);
// Sort by patient so that multiple invoices can be
// represented on a single statement.
if ($got_address_table) {
$res = SLQuery("SELECT ar.*, customer.name, " . "address.address1, address.address2, " . "address.city, address.state, address.zipcode, " . "substring(trim(both from customer.name) from '% #\"%#\"' for '#') AS fname, " . "substring(trim(both from customer.name) from '#\"%#\" %' for '#') AS lname " . "FROM ar, customer, address WHERE ( {$where} ) AND " . "customer.id = ar.customer_id AND " . "address.trans_id = ar.customer_id " . "ORDER BY lname, fname, ar.customer_id, ar.transdate");
} else {
$res = SLQuery("SELECT ar.*, customer.name, " . "customer.address1, customer.address2, " . "customer.city, customer.state, customer.zipcode, " . "substring(trim(both from customer.name) from '% #\"%#\"' for '#') AS lname, " . "substring(trim(both from customer.name) from '#\"%#\" %' for '#') AS fname " . "FROM ar, customer WHERE ( {$where} ) AND " . "customer.id = ar.customer_id " . "ORDER BY lname, fname, ar.customer_id, ar.transdate");
示例7: xl
xl('Adjustments', 'e');
?>
</th>
<th align="right">
<?php
xl('Payments', 'e');
?>
</th>
</thead>
<?php
if (!$INTEGRATED_AR) {
$chart_id_cash = SLQueryValue("select id from chart where accno = '{$sl_cash_acc}'");
if ($sl_err) {
die($sl_err);
}
$chart_id_income = SLQueryValue("select id from chart where accno = '{$sl_income_acc}'");
if ($sl_err) {
die($sl_err);
}
}
if ($_POST['form_refresh']) {
$from_date = $form_from_date;
$to_date = $form_to_date;
$paymethod = "";
$paymethodleft = "";
$methodpaytotal = 0;
$grandpaytotal = 0;
$methodadjtotal = 0;
$grandadjtotal = 0;
if ($INTEGRATED_AR) {
// Get co-pays using the encounter date as the pay date. These will
示例8: row_delete
row_delete("payments", "id = '" . $payrow['id'] . "'");
}
} else {
if ($billing) {
if (!acl_check('acct', 'disc')) {
die("Not authorized!");
}
list($patient_id, $encounter_id) = explode(".", $billing);
if ($GLOBALS['oer_config']['ws_accounting']['enabled'] === 2) {
sqlStatement("DELETE FROM ar_activity WHERE " . "pid = '{$patient_id}' AND encounter = '{$encounter_id}'");
sqlStatement("DELETE ar_session FROM ar_session LEFT JOIN " . "ar_activity ON ar_session.session_id = ar_activity.session_id " . "WHERE ar_activity.session_id IS NULL");
row_modify("billing", "activity = 0", "pid = '{$patient_id}' AND " . "encounter = '{$encounter_id}' AND " . "code_type = 'COPAY' AND " . "activity = 1");
sqlStatement("UPDATE form_encounter SET last_level_billed = 0, " . "last_level_closed = 0, stmt_count = 0, last_stmt_date = NULL " . "WHERE pid = '{$patient_id}' AND encounter = '{$encounter_id}'");
} else {
slInitialize();
$trans_id = SLQueryValue("SELECT id FROM ar WHERE ar.invnumber = '{$billing}' LIMIT 1");
if ($trans_id) {
newEvent("delete", $_SESSION['authUser'], $_SESSION['authProvider'], 1, "Invoice {$billing} from SQL-Ledger");
SLQuery("DELETE FROM acc_trans WHERE trans_id = '{$trans_id}'");
if ($sl_err) {
die($sl_err);
}
SLQuery("DELETE FROM invoice WHERE trans_id = '{$trans_id}'");
if ($sl_err) {
die($sl_err);
}
SLQuery("DELETE FROM ar WHERE id = '{$trans_id}'");
if ($sl_err) {
die($sl_err);
}
} else {
示例9: arPostPayment
if ($form_source) {
$thissrc .= " {$form_source}";
}
}
$session_id = 0;
// Is this OK?
arPostPayment($form_pid, $enc, $session_id, $amount, '', 0, $thissrc, 0);
} else {
$thissrc = 'Pt/';
if ($form_method) {
$thissrc .= $form_method;
if ($form_source) {
$thissrc .= " {$form_source}";
}
}
$trans_id = SLQueryValue("SELECT id FROM ar WHERE " . "ar.invnumber = '{$form_pid}.{$enc}' LIMIT 1");
if (!$trans_id) {
die("Cannot find invoice '{$form_pid}.{$enc}'!");
}
slPostPayment($trans_id, $amount, date('Y-m-d'), $thissrc, '', 0, 0);
}
frontPayment($form_pid, $enc, $form_method, $form_source, 0, $amount);
}
}
}
}
?>
<?php
if ($_POST['form_save'] || $_REQUEST['receipt']) {
if ($_REQUEST['receipt']) {