2 // This program is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU General Public License
4 // as published by the Free Software Foundation; either version 2
5 // of the License, or (at your option) any later version.
10 require_once("../../globals.php");
11 require_once("../../../custom/code_types.inc.php");
12 require_once("$srcdir/options.inc.php");
15 $thisauthview = acl_check('admin', 'superbill', false, 'view');
16 $thisauthwrite = acl_check('admin', 'superbill', false, 'write');
18 if (!($thisauthwrite ||
$thisauthview)) {
19 echo "<html>\n<body>\n";
20 echo "<p>" . xlt('You are not authorized for this.') . "</p>\n";
21 echo "</body>\n</html>\n";
25 $institutional = $GLOBALS['ub04_support'] == "1" ?
true : false;
27 // Translation for form fields.
28 function ffescape($field)
30 $field = add_escape_custom($field);
34 // Format dollars for display.
36 function bucks($amount)
39 $amount = oeFormatMoney($amount);
48 $mode = $_POST['mode'];
53 $financial_reporting = 0;
56 if (isset($mode) && $thisauthwrite) {
57 $code_id = empty($_POST['code_id']) ?
'' : $_POST['code_id'] +
0;
58 $code = $_POST['code'];
59 $code_type = $_POST['code_type'];
60 $code_text = $_POST['code_text'];
61 $modifier = $_POST['modifier'];
62 $superbill = $_POST['form_superbill'];
63 $related_code = $_POST['related_code'];
64 $cyp_factor = $_POST['cyp_factor'] +
0;
65 $active = empty($_POST['active']) ?
0 : 1;
66 $reportable = empty($_POST['reportable']) ?
0 : 1; // dx reporting
67 $financial_reporting = empty($_POST['financial_reporting']) ?
0 : 1; // financial service reporting
68 $revenue_code = $_POST['revenue_code'];
71 if (!empty($_POST['taxrate'])) {
72 foreach ($_POST['taxrate'] as $key => $value) {
77 if ($mode == "delete") {
78 sqlStatement("DELETE FROM codes WHERE id = ?", array($code_id));
80 } else if ($mode == "add" ||
$mode == "modify_complete") { // this covers both adding and modifying
81 $crow = sqlQuery("SELECT COUNT(*) AS count FROM codes WHERE " .
82 "code_type = '" . ffescape($code_type) . "' AND " .
83 "code = '" . ffescape($code) . "' AND " .
84 "modifier = '" . ffescape($modifier) . "' AND " .
85 "id != '" . add_escape_custom($code_id) . "'");
87 $alertmsg = xl('Cannot add/update this entry because a duplicate already exists!');
90 "code = '" . ffescape($code) . "', " .
91 "code_type = '" . ffescape($code_type) . "', " .
92 "code_text = '" . ffescape($code_text) . "', " .
93 "modifier = '" . ffescape($modifier) . "', " .
94 "superbill = '" . ffescape($superbill) . "', " .
95 "related_code = '" . ffescape($related_code) . "', " .
96 "cyp_factor = '" . ffescape($cyp_factor) . "', " .
97 "taxrates = '" . ffescape($taxrates) . "', " .
98 "active = " . add_escape_custom($active) . ", " .
99 "financial_reporting = " . add_escape_custom($financial_reporting) . ", " .
100 "revenue_code = '" . ffescape($revenue_code) . "', " .
101 "reportable = " . add_escape_custom($reportable);
103 $query = "UPDATE codes SET $sql WHERE id = ?";
104 sqlStatement($query, array($code_id));
105 sqlStatement("DELETE FROM prices WHERE pr_id = ? AND " .
106 "pr_selector = ''", array($code_id));
108 $code_id = sqlInsert("INSERT INTO codes SET $sql");
112 foreach ($_POST['fee'] as $key => $value) {
115 sqlStatement("INSERT INTO prices ( " .
116 "pr_id, pr_selector, pr_level, pr_price ) VALUES ( " .
117 "?, '', ?, ?)", array($code_id,$key,$value));
121 $code = $code_type = $code_text = $modifier = $superbill = "";
131 } else if ($mode == "edit") { // someone clicked [Edit]
132 $sql = "SELECT * FROM codes WHERE id = ?";
133 $results = sqlStatement($sql, array($code_id));
134 while ($row = sqlFetchArray($results)) {
135 $code = $row['code'];
136 $code_text = $row['code_text'];
137 $code_type = $row['code_type'];
138 $modifier = $row['modifier'];
139 // $units = $row['units'];
140 $superbill = $row['superbill'];
141 $related_code = $row['related_code'];
142 $revenue_code = $row['revenue_code'];
143 $cyp_factor = $row['cyp_factor'];
144 $taxrates = $row['taxrates'];
145 $active = 0 +
$row['active'];
146 $reportable = 0 +
$row['reportable'];
147 $financial_reporting = 0 +
$row['financial_reporting'];
149 } else if ($mode == "modify") { // someone clicked [Modify]
150 // this is to modify external code types, of which the modifications
151 // are stored in the codes table
152 $code_type_name_external = $_POST['code_type_name_external'];
153 $code_external = $_POST['code_external'];
154 $code_id = $_POST['code_id'];
155 $results = return_code_information($code_type_name_external, $code_external, false); // only will return one item
156 while ($row = sqlFetchArray($results)) {
157 $code = $row['code'];
158 $code_text = $row['code_text'];
159 $code_type = $code_types[$code_type_name_external]['id'];
160 $modifier = $row['modifier'];
161 // $units = $row['units'];
162 $superbill = $row['superbill'];
163 $related_code = $row['related_code'];
164 $revenue_code = $row['revenue_code'];
165 $cyp_factor = $row['cyp_factor'];
166 $taxrates = $row['taxrates'];
167 $active = $row['active'];
168 $reportable = $row['reportable'];
169 $financial_reporting = $row['financial_reporting'];
173 // If codes history is enabled in the billing globals save data to codes history table
174 if ($GLOBALS['save_codes_history'] && $alertmsg=='' &&
175 ( $mode == "add" ||
$mode == "modify_complete" ||
$mode == "delete" ) ) {
176 $action_type= empty($_POST['code_id']) ?
'new' : $mode;
177 $action_type= ($action_type=='add') ?
'update' : $action_type ;
178 $code = $_POST['code'];
179 $code_type = $_POST['code_type'];
180 $code_text = $_POST['code_text'];
181 $modifier = $_POST['modifier'];
182 $superbill = $_POST['form_superbill'];
183 $related_code = $_POST['related_code'];
184 $revenue_code = $_POST['revenue_code'];
185 $cyp_factor = $_POST['cyp_factor'] +
0;
186 $active = empty($_POST['active']) ?
0 : 1;
187 $reportable = empty($_POST['reportable']) ?
0 : 1; // dx reporting
188 $financial_reporting = empty($_POST['financial_reporting']) ?
0 : 1; // financial service reporting
189 $fee=json_encode($_POST['fee']);
190 $code_sql= sqlFetchArray(sqlStatement("SELECT (ct_label) FROM code_types WHERE ct_id=?", array($code_type)));
194 $code_name=$code_sql['ct_label'];
197 $categorey_id= $_POST['form_superbill'];
198 $categorey_sql=sqlFetchArray(sqlStatement("SELECT (title ) FROM list_options WHERE list_id='superbill'".
199 " AND option_id=?", array($categorey_id)));
203 if ($categorey_sql) {
204 $categorey_name=$categorey_sql['title'];
207 $date=date('Y-m-d H:i:s');
208 $date=oeFormatShortDate($date);
209 $results = sqlStatement(
210 "INSERT INTO codes_history ( " .
211 "date, code, modifier, active,diagnosis_reporting,financial_reporting,category,code_type_name,".
212 "code_text,code_text_short,prices,action_type, update_by ) VALUES ( " .
213 "?, ?,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,?)",
214 array($date,$code,$modifier,$active,$reportable,$financial_reporting,$categorey_name,$code_name,$code_text,'',$fee,$action_type,$_SESSION['authUser'])
220 if (!empty($related_code)) {
221 $related_desc = $related_code;
224 $fstart = $_REQUEST['fstart'] +
0;
225 if (isset($_REQUEST['filter'])) {
227 $filter_key = array();
228 foreach ($_REQUEST['filter'] as $var) {
230 array_push($filter, $var);
231 $var_key = convert_type_id_to_key($var);
232 array_push($filter_key, $var_key);
236 $search = $_REQUEST['search'];
237 $search_reportable = $_REQUEST['search_reportable'];
238 $search_financial_reporting = $_REQUEST['search_financial_reporting'];
240 //Build the filter_elements array
241 $filter_elements = array();
242 if (!empty($search_reportable)) {
243 $filter_elements['reportable'] = $search_reportable;
246 if (!empty($search_financial_reporting)) {
247 $filter_elements['financial_reporting'] = $search_financial_reporting;
250 if (isset($_REQUEST['filter'])) {
251 $count = main_code_set_search($filter_key, $search, null, null, false, null, true, null, null, $filter_elements);
254 if ($fstart >= $count) {
255 $fstart -= $pagesize;
262 $fend = $fstart +
$pagesize;
263 if ($fend > $count) {
270 <title
><?php
echo xlt("Codes"); ?
></title
>
271 <?php
html_header_show(); ?
>
273 <link rel
="stylesheet" href
="<?php echo attr($css_header);?>" type
="text/css">
274 <script type
="text/javascript" src
="../../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
275 <script type
="text/javascript" src
="../../../library/textformat.js"></script
>
276 <script type
="text/JavaScript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script
>
277 <link href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-ui-1-12-1/themes/base/jquery-ui.min.css" rel
="stylesheet" type
="text/css" />
278 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative'] ?>/jquery-ui-1-12-1/jquery-ui.min.js"></script
>
280 .ui
-autocomplete
{ max
-height
: 350px
; max
-width
: 35%
; overflow
-y
: auto
; overflow
-x
: hidden
; }
283 <?php
if ($institutional) { ?
>
286 $
( ".revcode" ).autocomplete({
288 source
: function( request
, response
) {
289 var term
= request
.term
;
290 request
.code_group
= "revenue_code";
291 if ( term in cache
) {
292 response( cache
[ term
] );
295 $
.getJSON( "<?php echo $GLOBALS['web_root'] ?>/interface/billing/ub04_helpers.php", request
, function( data
, status
, xhr
) {
296 cache
[ term
] = data
;
300 }).dblclick(function(event
) {
301 $
(this
).autocomplete('search'," ");
306 // This is for callback by the find-code popup.
307 // Appends to or erases the current list of related codes.
308 function set_related(codetype
, code
, selector
, codedesc
) {
309 var f
= document
.forms
[0];
310 var s
= f
.related_code
.value
;
312 if (s
.length
> 0) s +
= ';';
313 s +
= codetype +
':' + code
;
317 f
.related_code
.value
= s
;
318 f
.related_desc
.value
= s
;
321 // This invokes the find-code popup.
322 function sel_related() {
323 var f
= document
.forms
[0];
324 var i
= f
.code_type
.selectedIndex
;
327 var myid
= f
.code_type
.options
[i
].value
;
329 foreach ($code_types as $key => $value) {
330 $codeid = $value['id'];
331 $coderel = $value['rel'];
336 echo " if (myid == $codeid) codetype = '$coderel';";
341 alert('<?php echo addslashes(xl('This code type does not accept relations
.')); ?>');
344 dlgopen('find_code_popup.php', '_blank', 500, 400);
347 // Some validation for saving a new code entry.
348 function validEntry(f
) {
350 alert('<?php echo addslashes(xl('No code was specified
!')); ?>');
353 <?php
if ($GLOBALS['ippf_specific']) { ?
>
354 if (f
.code_type
.value
== 12 && !f
.related_code
.value
) {
355 alert('<?php echo addslashes(xl('A related IPPF code is required
!')); ?>');
362 function submitAdd() {
363 var f
= document
.forms
[0];
364 if (!validEntry(f
)) return;
365 f
.mode
.value
= 'add';
366 f
.code_id
.value
= '';
370 function submitUpdate() {
371 var f
= document
.forms
[0];
372 if (! parseInt(f
.code_id
.value
)) {
373 alert('<?php echo addslashes(xl('Cannot update because you are not editing an existing entry
!')); ?>');
376 if (!validEntry(f
)) return;
377 f
.mode
.value
= 'add';
381 function submitModifyComplete() {
382 var f
= document
.forms
[0];
383 f
.mode
.value
= 'modify_complete';
387 function submitList(offset
) {
388 var f
= document
.forms
[0];
389 var i
= parseInt(f
.fstart
.value
) + offset
;
395 function submitEdit(id
) {
396 var f
= document
.forms
[0];
397 f
.mode
.value
= 'edit';
398 f
.code_id
.value
= id
;
402 function submitModify(code_type_name
,code
,id
) {
403 var f
= document
.forms
[0];
404 f
.mode
.value
= 'modify';
405 f
.code_external
.value
= code
;
406 f
.code_id
.value
= id
;
407 f
.code_type_name_external
.value
= code_type_name
;
413 function submitDelete(id
) {
414 var f
= document
.forms
[0];
415 f
.mode
.value
= 'delete';
416 f
.code_id
.value
= id
;
420 function getCTMask() {
421 var ctid
= document
.forms
[0].code_type
.value
;
423 foreach ($code_types as $key => $value) {
424 $ctid = attr($value['id']);
425 $ctmask = attr($value['mask']);
426 echo " if (ctid == '$ctid') return '$ctmask';\n";
435 <body
class="body_top" >
437 <form method
='post' action
='superbill_custom_full.php' name
='theform'>
439 <input type
='hidden' name
='mode' value
=''>
444 <table border
='0' cellpadding
='0' cellspacing
='0'>
447 <td colspan
="3"> <?php
echo xlt('Not all fields are required for all codes or code types.'); ?
><br
><br
></td
>
451 <td
><?php
echo xlt('Type'); ?
>:</td
>
456 <?php
if ($mode != "modify") { ?
>
457 <select name
="code_type">
460 <?php
$external_sets = array(); ?
>
461 <?php
foreach ($code_types as $key => $value) { ?
>
462 <?php
if (!($value['external'])) { ?
>
463 <?php
if ($mode != "modify") { ?
>
464 <option value
="<?php echo attr($value['id']) ?>"<?php
if ($code_type == $value['id']) {
466 } ?
>><?php
echo xlt($value['label']) ?
></option
>
469 <?php
if ($value['external']) {
470 array_push($external_sets, $key);
472 <?php
} // end foreach ?>
474 <?php
if ($mode != "modify") { ?
>
478 <?php
if ($mode == "modify") { ?
>
479 <input type
='text' size
='4' name
='code_type' readonly
='readonly' style
='display:none' value
='<?php echo attr($code_type) ?>' />
480 <?php
echo attr($code_type_name_external) ?
>
484 <?php
echo xlt('Code'); ?
>:
486 <?php
if ($mode == "modify") { ?
>
487 <input type
='text' size
='6' name
='code' readonly
='readonly' value
='<?php echo attr($code) ?>' />
489 <input type
='text' size
='6' name
='code' value
='<?php echo attr($code) ?>'
490 onkeyup
='maskkeyup(this,getCTMask())'
491 onblur
='maskblur(this,getCTMask())'
495 <?php
if (modifiers_are_used()) { ?
>
496  
; 
;<?php
echo xlt('Modifier'); ?
>:
497 <?php
if ($mode == "modify") { ?
>
498 <input type
='text' size
='6' name
='modifier' readonly
='readonly' value
='<?php echo attr($modifier) ?>'>
500 <input type
='text' size
='6' name
='modifier' value
='<?php echo attr($modifier) ?>'>
503 <input type
='hidden' name
='modifier' value
=''>
507 <input type
='checkbox' name
='active' value
='1'<?php
if (!empty($active) ||
($mode == 'modify' && $active == null)) {
510 <?php
echo xlt('Active'); ?
>
515 <td
><?php
echo xlt('Description'); ?
>:</td
>
518 <?php
if ($mode == "modify") { ?
>
519 <input type
='text' size
='50' name
="code_text" readonly
="readonly" value
='<?php echo attr($code_text) ?>'>
521 <input type
='text' size
='50' name
="code_text" value
='<?php echo attr($code_text) ?>'>
523 <?php
if ($institutional) { ?
>
524 <?php
echo xlt('Revenue Code'); ?
>:
525 <?php
if ($mode == "modify") { ?
>
526 <input type
='text' size
='6' name
="revenue_code" readonly
="readonly" value
='<?php echo attr($revenue_code) ?>'>
528 <input type
='text' size
='6' class='revcode' name
="revenue_code" title
='<?php echo xla('Type to search
and select revenue code
'); ?>' value
='<?php echo attr($revenue_code) ?>'>
535 <td
><?php
echo xlt('Category'); ?
>:</td
>
539 generate_form_field(array('data_type'=>1,'field_id'=>'superbill','list_id'=>'superbill'), $superbill);
542 <input type
='checkbox' title
='<?php echo xlt("Syndromic Surveillance Report") ?>' name
='reportable' value
='1'<?php
if (!empty($reportable)) {
545 <?php
echo xlt('Diagnosis Reporting'); ?
>
546  
; 
; 
; 
;
547 <input type
='checkbox' title
='<?php echo xlt("Service Code Finance Reporting") ?>' name
='financial_reporting' value
='1'<?php
if (!empty($financial_reporting)) {
550 <?php
echo xlt('Service Reporting'); ?
>
554 <tr
<?php
if (empty($GLOBALS['ippf_specific'])) {
555 echo " style='display:none'";
557 <td
><?php
echo xlt('CYP Factor'); ?
>:</td
>
560 <input type
='text' size
='10' maxlength
='20' name
="cyp_factor" value
='<?php echo attr($cyp_factor) ?>'>
565 <tr
<?php
if (!related_codes_are_used()) {
566 echo " style='display:none'";
568 <td
><?php
echo xlt('Relate To'); ?
>:</td
>
571 <input type
='text' size
='50' name
='related_desc'
572 value
='<?php echo attr($related_desc) ?>' onclick
="sel_related()"
573 title
='<?php echo xla('Click to select related code
'); ?>' readonly
/>
574 <input type
='hidden' name
='related_code' value
='<?php echo attr($related_code) ?>' />
579 <td
><?php
echo xlt('Fees'); ?
>:</td
>
583 $pres = sqlStatement("SELECT lo.option_id, lo.title, p.pr_price " .
584 "FROM list_options AS lo LEFT OUTER JOIN prices AS p ON " .
585 "p.pr_id = ? AND p.pr_selector = '' AND p.pr_level = lo.option_id " .
586 "WHERE lo.list_id = 'pricelevel' AND lo.activity = 1 ORDER BY lo.seq, lo.title", array($code_id));
587 for ($i = 0; $prow = sqlFetchArray($pres); ++
$i) {
592 echo text(xl_list_label($prow['title'])) . " ";
593 echo "<input type='text' size='6' name='fee[" . attr($prow['option_id']) . "]' " .
594 "value='" . attr($prow['pr_price']) . "' >\n";
602 $pres = sqlStatement("SELECT option_id, title FROM list_options " .
603 "WHERE list_id = 'taxrate' AND activity = 1 ORDER BY seq");
604 while ($prow = sqlFetchArray($pres)) {
606 $taxline .= " ";
609 $taxline .= "<input type='checkbox' name='taxrate[" . attr($prow['option_id']) . "]' value='1'";
610 if (strpos(":$taxrates", $prow['option_id']) !== false) {
611 $taxline .= " checked";
615 $taxline .= text(xl_list_label($prow['title'])) . "\n";
621 <td
><?php
echo xlt('Taxes'); ?
>:</td
>
624 <?php
echo $taxline ?
>
631 <td colspan
="3" align
="center">
632 <input type
="hidden" name
="code_id" value
="<?php echo attr($code_id) ?>"><br
>
633 <input type
="hidden" name
="code_type_name_external" value
="<?php echo attr($code_type_name_external) ?>">
634 <input type
="hidden" name
="code_external" value
="<?php echo attr($code_external) ?>">
635 <?php
if ($thisauthwrite) { ?
>
636 <?php
if ($mode == "modify") { ?
>
637 <a href
='javascript:submitModifyComplete();' class='link'>[<?php
echo xlt('Update'); ?
>]</a
>
639 <a href
='javascript:submitUpdate();' class='link'>[<?php
echo xlt('Update'); ?
>]</a
>
641 <a href
='javascript:submitAdd();' class='link'>[<?php
echo xlt('Add as New'); ?
>]</a
>
648 <table border
='0' cellpadding
='5' cellspacing
='0' width
='96%'>
652 <select name
='filter[]' multiple
='multiple'>
654 foreach ($code_types as $key => $value) {
655 echo "<option value='" . attr($value['id']) . "'";
656 if (isset($filter) && in_array($value['id'], $filter)) {
660 echo ">" . xlt($value['label']) . "</option>\n";
664  
; 
; 
; 
;
666 <input type
="text" name
="search" size
="5" value
="<?php echo attr($search) ?>"> 
;
667 <input type
="submit" name
="go" value
='<?php echo xla('Search
'); ?>'> 
; 
;
668 <input type
='checkbox' title
='<?php echo xlt("Only Show Diagnosis Reporting Codes") ?>' name
='search_reportable' value
='1'<?php
if (!empty($search_reportable)) {
671 <?php
echo xlt('Diagnosis Reporting Only'); ?
>
672  
; 
; 
; 
;
673 <input type
='checkbox' title
='<?php echo xlt("Only Show Service Code Finance Reporting Codes") ?>' name
='search_financial_reporting' value
='1'<?php
if (!empty($search_financial_reporting)) {
676 <?php
echo xlt('Service Reporting Only'); ?
>
677 <input type
='hidden' name
='fstart' value
='<?php echo attr($fstart) ?>'>
680 <td
class='text' align
='right'>
681 <?php
if ($fstart) { ?
>
682 <a href
="javascript:submitList(<?php echo attr($pagesize) ?>)">
687 <?php
echo ($fstart +
1) . " - $fend of $count" ?
>
689 <a href
="javascript:submitList(<?php echo attr($pagesize) ?>)">
699 <table border
='0' cellpadding
='5' cellspacing
='0' width
='96%'>
701 <td
><span
class='bold'><?php
echo xlt('Code'); ?
></span
></td
>
702 <td
><span
class='bold'><?php
echo xlt('Mod'); ?
></span
></td
>
703 <?php
if ($institutional) { ?
>
704 <td
><span
class='bold'><?php
echo xlt('Revenue'); ?
></span
></td
>
706 <td
><span
class='bold'><?php
echo xlt('Act'); ?
></span
></td
>
707 <td
><span
class='bold'><?php
echo xlt('Dx Rep'); ?
></span
></td
>
708 <td
><span
class='bold'><?php
echo xlt('Serv Rep'); ?
></span
></td
>
709 <td
><span
class='bold'><?php
echo xlt('Type'); ?
></span
></td
>
710 <td
><span
class='bold'><?php
echo xlt('Description'); ?
></span
></td
>
711 <td
><span
class='bold'><?php
echo xlt('Short Description'); ?
></span
></td
>
712 <?php
if (related_codes_are_used()) { ?
>
713 <td
><span
class='bold'><?php
echo xlt('Related'); ?
></span
></td
>
716 $pres = sqlStatement("SELECT title FROM list_options " .
717 "WHERE list_id = 'pricelevel' AND activity = 1 ORDER BY seq, title");
718 while ($prow = sqlFetchArray($pres)) {
719 echo " <td class='bold' align='right' nowrap>" . text(xl_list_label($prow['title'])) . "</td>\n";
727 if (isset($_REQUEST['filter'])) {
728 $res = main_code_set_search($filter_key, $search, null, null, false, null, false, $fstart, ($fend - $fstart), $filter_elements);
731 for ($i = 0; $row = sqlFetchArray($res);
738 foreach ($all as $iter) {
742 foreach ($code_types as $key => $value) {
743 if ($value['id'] == $iter['code_type']) {
744 $has_fees = $value['fee'];
750 echo " <td class='text'>" . text($iter["code"]) . "</td>\n";
751 echo " <td class='text'>" . text($iter["modifier"]) . "</td>\n";
752 if ($institutional) {
753 echo " <td class='text'>" . ($iter['revenue_code'] > '' ?
text($iter['revenue_code']) : 'none') ."</td>\n";
755 if ($iter["code_external"] > 0) {
756 // If there is no entry in codes sql table, then default to active
757 // (this is reason for including NULL below)
758 echo " <td class='text'>" . ( ($iter["active"] ||
$iter["active"]==null) ?
xlt('Yes') : xlt('No')) . "</td>\n";
760 echo " <td class='text'>" . ( ($iter["active"]) ?
xlt('Yes') : xlt('No')) . "</td>\n";
763 echo " <td class='text'>" . ($iter["reportable"] ?
xlt('Yes') : xlt('No')) . "</td>\n";
764 echo " <td class='text'>" . ($iter["financial_reporting"] ?
xlt('Yes') : xlt('No')) . "</td>\n";
765 echo " <td class='text'>" . text($iter['code_type_name']) . "</td>\n";
766 echo " <td class='text'>" . text($iter['code_text']) . "</td>\n";
767 echo " <td class='text'>" . text($iter['code_text_short']) . "</td>\n";
769 if (related_codes_are_used()) {
770 // Show related codes.
771 echo " <td class='text'>";
772 $arel = explode(';', $iter['related_code']);
773 foreach ($arel as $tmp) {
774 list($reltype, $relcode) = explode(':', $tmp);
775 $code_description = lookup_code_descriptions($reltype.":".$relcode);
776 echo text($relcode) . ' ' . text(trim($code_description)) . '<br />';
782 $pres = sqlStatement("SELECT p.pr_price " .
783 "FROM list_options AS lo LEFT OUTER JOIN prices AS p ON " .
784 "p.pr_id = ? AND p.pr_selector = '' AND p.pr_level = lo.option_id " .
785 "WHERE lo.list_id = 'pricelevel' AND lo.activity = 1 ORDER BY lo.seq", array($iter['id']));
786 while ($prow = sqlFetchArray($pres)) {
787 echo "<td class='text' align='right'>" . text(bucks($prow['pr_price'])) . "</td>\n";
790 if ($thisauthwrite) {
791 if ($iter["code_external"] > 0) {
792 echo " <td align='right'><a class='link' href='javascript:submitModify(\"" . attr($iter['code_type_name']) . "\",\"" . attr($iter['code']) . "\",\"" . attr($iter['id']) . "\")'>[" . xlt('Modify') . "]</a></td>\n";
794 echo " <td align='right'><a class='link' href='javascript:submitDelete(" . attr($iter['id']) . ")'>[" . xlt('Delete') . "]</a></td>\n";
795 echo " <td align='right'><a class='link' href='javascript:submitEdit(" . attr($iter['id']) . ")'>[" . xlt('Edit') . "]</a></td>\n";
809 <script language
="JavaScript">
812 echo "alert('" . addslashes($alertmsg) . "');\n";