Code type module improvements:
[openemr.git] / interface / patient_file / encounter / superbill_custom_full.php
blob8d58ed0bef4b3f67b900dc4556a6313074927a73
1 <?php
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.
7 $fake_register_globals=false;
8 $sanitize_all_escapes=true;
10 require_once("../../globals.php");
11 require_once("../../../custom/code_types.inc.php");
12 require_once("$srcdir/sql.inc");
13 require_once("$srcdir/options.inc.php");
14 require_once("$srcdir/formatting.inc.php");
15 require_once("$srcdir/formdata.inc.php");
17 // Translation for form fields.
18 function ffescape($field) {
19 $field = add_escape_custom($field);
20 return trim($field);
23 // Format dollars for display.
25 function bucks($amount) {
26 if ($amount) {
27 $amount = oeFormatMoney($amount);
28 return $amount;
30 return '';
33 $alertmsg = '';
34 $pagesize = 100;
35 $mode = $_POST['mode'];
36 $code_id = 0;
37 $related_code = '';
38 $active = 1;
39 $reportable = 0;
40 $financial_reporting = 0;
42 if (isset($mode)) {
43 $code_id = empty($_POST['code_id']) ? '' : $_POST['code_id'] + 0;
44 $code = $_POST['code'];
45 $code_type = $_POST['code_type'];
46 $code_text = $_POST['code_text'];
47 $modifier = $_POST['modifier'];
48 $superbill = $_POST['form_superbill'];
49 $related_code = $_POST['related_code'];
50 $cyp_factor = $_POST['cyp_factor'] + 0;
51 $active = empty($_POST['active']) ? 0 : 1;
52 $reportable = empty($_POST['reportable']) ? 0 : 1; // dx reporting
53 $financial_reporting = empty($_POST['financial_reporting']) ? 0 : 1; // financial service reporting
55 $taxrates = "";
56 if (!empty($_POST['taxrate'])) {
57 foreach ($_POST['taxrate'] as $key => $value) {
58 $taxrates .= "$key:";
62 if ($mode == "delete") {
63 sqlStatement("DELETE FROM codes WHERE id = ?", array($code_id) );
64 $code_id = 0;
66 else if ($mode == "add" || $mode == "modify_complete") { // this covers both adding and modifying
67 $crow = sqlQuery("SELECT COUNT(*) AS count FROM codes WHERE " .
68 "code_type = '" . ffescape($code_type) . "' AND " .
69 "code = '" . ffescape($code) . "' AND " .
70 "modifier = '" . ffescape($modifier) . "' AND " .
71 "id != '" . add_escape_custom($code_id) . "'");
72 if ($crow['count']) {
73 $alertmsg = xl('Cannot add/update this entry because a duplicate already exists!');
75 else {
76 $sql =
77 "code = '" . ffescape($code) . "', " .
78 "code_type = '" . ffescape($code_type) . "', " .
79 "code_text = '" . ffescape($code_text) . "', " .
80 "modifier = '" . ffescape($modifier) . "', " .
81 "superbill = '" . ffescape($superbill) . "', " .
82 "related_code = '" . ffescape($related_code) . "', " .
83 "cyp_factor = '" . ffescape($cyp_factor) . "', " .
84 "taxrates = '" . ffescape($taxrates) . "', " .
85 "active = " . add_escape_custom($active) . ", " .
86 "financial_reporting = " . add_escape_custom($financial_reporting) . ", " .
87 "reportable = " . add_escape_custom($reportable);
88 if ($code_id) {
89 $query = "UPDATE codes SET $sql WHERE id = ?";
90 sqlStatement($query, array($code_id) );
91 sqlStatement("DELETE FROM prices WHERE pr_id = ? AND " .
92 "pr_selector = ''", array($code_id) );
94 else {
95 $code_id = sqlInsert("INSERT INTO codes SET $sql");
97 if (!$alertmsg) {
98 foreach ($_POST['fee'] as $key => $value) {
99 $value = $value + 0;
100 if ($value) {
101 sqlStatement("INSERT INTO prices ( " .
102 "pr_id, pr_selector, pr_level, pr_price ) VALUES ( " .
103 "?, '', ?, ?)", array($code_id,$key,$value) );
106 $code = $code_type = $code_text = $modifier = $superbill = "";
107 $code_id = 0;
108 $related_code = '';
109 $cyp_factor = 0;
110 $taxrates = '';
111 $active = 1;
112 $reportable = 0;
116 else if ($mode == "edit") { // someone clicked [Edit]
117 $sql = "SELECT * FROM codes WHERE id = ?";
118 $results = sqlStatement($sql, array($code_id) );
119 while ($row = sqlFetchArray($results)) {
120 $code = $row['code'];
121 $code_text = $row['code_text'];
122 $code_type = $row['code_type'];
123 $modifier = $row['modifier'];
124 // $units = $row['units'];
125 $superbill = $row['superbill'];
126 $related_code = $row['related_code'];
127 $cyp_factor = $row['cyp_factor'];
128 $taxrates = $row['taxrates'];
129 $active = 0 + $row['active'];
130 $reportable = 0 + $row['reportable'];
131 $financial_reporting = 0 + $row['financial_reporting'];
134 else if ($mode == "modify") { // someone clicked [Modify]
135 // this is to modify external code types, of which the modifications
136 // are stored in the codes table
137 $code_type_name_external = $_POST['code_type_name_external'];
138 $code_external = $_POST['code_external'];
139 $code_id = $_POST['code_id'];
140 $results = return_code_information($code_type_name_external,$code_external,false); // only will return one item
141 while ($row = sqlFetchArray($results)) {
142 $code = $row['code'];
143 $code_text = $row['code_text'];
144 $code_type = $code_types[$code_type_name_external]['id'];
145 $modifier = $row['modifier'];
146 // $units = $row['units'];
147 $superbill = $row['superbill'];
148 $related_code = $row['related_code'];
149 $cyp_factor = $row['cyp_factor'];
150 $taxrates = $row['taxrates'];
151 $active = $row['active'];
152 $reportable = $row['reportable'];
153 $financial_reporting = $row['financial_reporting'];
158 $related_desc = '';
159 if (!empty($related_code)) {
160 $related_desc = $related_code;
163 $fstart = $_REQUEST['fstart'] + 0;
164 if (isset($_REQUEST['filter'])) {
165 $filter = array();
166 $filter_key = array();
167 foreach ($_REQUEST['filter'] as $var) {
168 $var = $var+0;
169 array_push($filter,$var);
170 $var_key = convert_type_id_to_key($var);
171 array_push($filter_key,$var_key);
174 $search = $_REQUEST['search'];
175 $search_reportable = $_REQUEST['search_reportable'];
176 $search_financial_reporting = $_REQUEST['search_financial_reporting'];
178 //Build the filter_elements array
179 $filter_elements = array();
180 if (!empty($search_reportable)) {
181 $filter_elements['reportable'] = $search_reportable;
183 if (!empty($search_financial_reporting)) {
184 $filter_elements['financial_reporting'] = $search_financial_reporting;
187 if (isset($_REQUEST['filter'])) {
188 $count = main_code_set_search($filter_key,$search,NULL,NULL,false,NULL,true,NULL,NULL,$filter_elements);
191 if ($fstart >= $count) $fstart -= $pagesize;
192 if ($fstart < 0) $fstart = 0;
193 $fend = $fstart + $pagesize;
194 if ($fend > $count) $fend = $count;
197 <html>
198 <head>
199 <?php html_header_show(); ?>
200 <link rel="stylesheet" href="<?php echo attr($css_header);?>" type="text/css">
201 <script type="text/javascript" src="../../../library/dialog.js"></script>
202 <script type="text/javascript" src="../../../library/textformat.js"></script>
204 <script language="JavaScript">
206 // This is for callback by the find-code popup.
207 // Appends to or erases the current list of related codes.
208 function set_related(codetype, code, selector, codedesc) {
209 var f = document.forms[0];
210 var s = f.related_code.value;
211 if (code) {
212 if (s.length > 0) s += ';';
213 s += codetype + ':' + code;
214 } else {
215 s = '';
217 f.related_code.value = s;
218 f.related_desc.value = s;
221 // This invokes the find-code popup.
222 function sel_related() {
223 var f = document.forms[0];
224 var i = f.code_type.selectedIndex;
225 var codetype = '';
226 if (i >= 0) {
227 var myid = f.code_type.options[i].value;
228 <?php
229 foreach ($code_types as $key => $value) {
230 $codeid = $value['id'];
231 $coderel = $value['rel'];
232 if (!$coderel) continue;
233 echo " if (myid == $codeid) codetype = '$coderel';";
237 if (!codetype) {
238 alert('<?php echo addslashes( xl('This code type does not accept relations.') ); ?>');
239 return;
241 dlgopen('find_code_popup.php', '_blank', 500, 400);
244 // Some validation for saving a new code entry.
245 function validEntry(f) {
246 if (!f.code.value) {
247 alert('<?php echo addslashes( xl('No code was specified!') ); ?>');
248 return false;
250 <?php if ($GLOBALS['ippf_specific']) { ?>
251 if (f.code_type.value == 12 && !f.related_code.value) {
252 alert('<?php echo addslashes( xl('A related IPPF code is required!') ); ?>');
253 return false;
255 <?php } ?>
256 return true;
259 function submitAdd() {
260 var f = document.forms[0];
261 if (!validEntry(f)) return;
262 f.mode.value = 'add';
263 f.code_id.value = '';
264 f.submit();
267 function submitUpdate() {
268 var f = document.forms[0];
269 if (! parseInt(f.code_id.value)) {
270 alert('<?php echo addslashes( xl('Cannot update because you are not editing an existing entry!') ); ?>');
271 return;
273 if (!validEntry(f)) return;
274 f.mode.value = 'add';
275 f.submit();
278 function submitModifyComplete() {
279 var f = document.forms[0];
280 f.mode.value = 'modify_complete';
281 f.submit();
284 function submitList(offset) {
285 var f = document.forms[0];
286 var i = parseInt(f.fstart.value) + offset;
287 if (i < 0) i = 0;
288 f.fstart.value = i;
289 f.submit();
292 function submitEdit(id) {
293 var f = document.forms[0];
294 f.mode.value = 'edit';
295 f.code_id.value = id;
296 f.submit();
299 function submitModify(code_type_name,code,id) {
300 var f = document.forms[0];
301 f.mode.value = 'modify';
302 f.code_external.value = code;
303 f.code_id.value = id;
304 f.code_type_name_external.value = code_type_name;
305 f.submit();
310 function submitDelete(id) {
311 var f = document.forms[0];
312 f.mode.value = 'delete';
313 f.code_id.value = id;
314 f.submit();
317 function getCTMask() {
318 var ctid = document.forms[0].code_type.value;
319 <?php
320 foreach ($code_types as $key => $value) {
321 $ctid = attr($value['id']);
322 $ctmask = attr($value['mask']);
323 echo " if (ctid == '$ctid') return '$ctmask';\n";
326 return '';
329 </script>
331 </head>
332 <body class="body_top" >
334 <?php if ($GLOBALS['concurrent_layout']) {
335 } else { ?>
336 <a href='patient_encounter.php?codefrom=superbill' target='Main'>
337 <span class='title'><?php echo xlt('Superbill Codes'); ?></span>
338 <font class='more'><?php echo text($tback);?></font></a>
339 <?php } ?>
341 <form method='post' action='superbill_custom_full.php' name='theform'>
343 <input type='hidden' name='mode' value=''>
345 <br>
347 <center>
348 <table border='0' cellpadding='0' cellspacing='0'>
350 <tr>
351 <td colspan="3"> <?php echo xlt('Not all fields are required for all codes or code types.'); ?><br><br></td>
352 </tr>
354 <tr>
355 <td><?php echo xlt('Type'); ?>:</td>
356 <td width="5">
357 </td>
358 <td>
360 <?php if ($mode != "modify") { ?>
361 <select name="code_type">
362 <?php } ?>
364 <?php $external_sets = array(); ?>
365 <?php foreach ($code_types as $key => $value) { ?>
366 <?php if ( !($value['external']) ) { ?>
367 <?php if ($mode != "modify") { ?>
368 <option value="<?php echo attr($value['id']) ?>"<?php if ($code_type == $value['id']) echo " selected" ?>><?php echo xlt($value['label']) ?></option>
369 <?php } ?>
370 <?php } ?>
371 <?php if ($value['external']) {
372 array_push($external_sets,$key);
373 } ?>
374 <?php } // end foreach ?>
376 <?php if ($mode != "modify") { ?>
377 </select>
378 <?php } ?>
380 <?php if ($mode == "modify") { ?>
381 <input type='text' size='4' name='code_type' readonly='readonly' style='display:none' value='<?php echo attr($code_type) ?>' />
382 <?php echo attr($code_type_name_external) ?>
383 <?php } ?>
385 &nbsp;&nbsp;
386 <?php echo xlt('Code'); ?>:
388 <?php if ($mode == "modify") { ?>
389 <input type='text' size='6' name='code' readonly='readonly' value='<?php echo attr($code) ?>' />
390 <?php } else { ?>
391 <input type='text' size='6' name='code' value='<?php echo attr($code) ?>'
392 onkeyup='maskkeyup(this,getCTMask())'
393 onblur='maskblur(this,getCTMask())'
395 <?php } ?>
397 <?php if (modifiers_are_used()) { ?>
398 &nbsp;&nbsp;<?php echo xlt('Modifier'); ?>:
399 <?php if ($mode == "modify") { ?>
400 <input type='text' size='3' name='modifier' readonly='readonly' value='<?php echo attr($modifier) ?>'>
401 <?php } else { ?>
402 <input type='text' size='3' name='modifier' value='<?php echo attr($modifier) ?>'>
403 <?php } ?>
404 <?php } else { ?>
405 <input type='hidden' name='modifier' value=''>
406 <?php } ?>
408 &nbsp;&nbsp;
409 <input type='checkbox' name='active' value='1'<?php if (!empty($active) || ($mode == 'modify' && $active == NULL) ) echo ' checked'; ?> />
410 <?php echo xlt('Active'); ?>
411 </td>
412 </tr>
414 <tr>
415 <td><?php echo xlt('Description'); ?>:</td>
416 <td></td>
417 <td>
419 <?php if ($mode == "modify") { ?>
420 <input type='text' size='50' name="code_text" readonly="readonly" value='<?php echo attr($code_text) ?>'>
421 <?php } else { ?>
422 <input type='text' size='50' name="code_text" value='<?php echo attr($code_text) ?>'>
423 <?php } ?>
425 </td>
426 </tr>
428 <tr>
429 <td><?php echo xlt('Category'); ?>:</td>
430 <td></td>
431 <td>
432 <?php
433 generate_form_field(array('data_type'=>1,'field_id'=>'superbill','list_id'=>'superbill'), $superbill);
435 &nbsp;&nbsp;
436 <input type='checkbox' title='<?php echo xlt("Syndromic Surveillance Report") ?>' name='reportable' value='1'<?php if (!empty($reportable)) echo ' checked'; ?> />
437 <?php echo xlt('Diagnosis Reporting'); ?>
438 &nbsp;&nbsp;&nbsp;&nbsp;
439 <input type='checkbox' title='<?php echo xlt("Service Code Finance Reporting") ?>' name='financial_reporting' value='1'<?php if (!empty($financial_reporting)) echo ' checked'; ?> />
440 <?php echo xlt('Service Reporting'); ?>
441 </td>
442 </tr>
444 <tr<?php if (empty($GLOBALS['ippf_specific'])) echo " style='display:none'"; ?>>
445 <td><?php echo xlt('CYP Factor'); ?>:</td>
446 <td></td>
447 <td>
448 <input type='text' size='10' maxlength='20' name="cyp_factor" value='<?php echo attr($cyp_factor) ?>'>
449 </td>
450 </tr>
452 <tr<?php if (!related_codes_are_used()) echo " style='display:none'"; ?>>
453 <td><?php echo xlt('Relate To'); ?>:</td>
454 <td></td>
455 <td>
456 <input type='text' size='50' name='related_desc'
457 value='<?php echo attr($related_desc) ?>' onclick="sel_related()"
458 title='<?php echo xla('Click to select related code'); ?>' readonly />
459 <input type='hidden' name='related_code' value='<?php echo attr($related_code) ?>' />
460 </td>
461 </tr>
463 <tr>
464 <td><?php echo xlt('Fees'); ?>:</td>
465 <td></td>
466 <td>
467 <?php
468 $pres = sqlStatement("SELECT lo.option_id, lo.title, p.pr_price " .
469 "FROM list_options AS lo LEFT OUTER JOIN prices AS p ON " .
470 "p.pr_id = ? AND p.pr_selector = '' AND p.pr_level = lo.option_id " .
471 "WHERE list_id = 'pricelevel' ORDER BY lo.seq", array($code_id) );
472 for ($i = 0; $prow = sqlFetchArray($pres); ++$i) {
473 if ($i) echo "&nbsp;&nbsp;";
474 echo text(xl_list_label($prow['title'])) . " ";
475 echo "<input type='text' size='6' name='fee[" . attr($prow['option_id']) . "]' " .
476 "value='" . attr($prow['pr_price']) . "' >\n";
479 </td>
480 </tr>
482 <?php
483 $taxline = '';
484 $pres = sqlStatement("SELECT option_id, title FROM list_options " .
485 "WHERE list_id = 'taxrate' ORDER BY seq");
486 while ($prow = sqlFetchArray($pres)) {
487 if ($taxline) $taxline .= "&nbsp;&nbsp;";
488 $taxline .= "<input type='checkbox' name='taxrate[" . attr($prow['option_id']) . "]' value='1'";
489 if (strpos(":$taxrates", $prow['option_id']) !== false) $taxline .= " checked";
490 $taxline .= " />\n";
491 $taxline .= text(xl_list_label($prow['title'])) . "\n";
493 if ($taxline) {
495 <tr>
496 <td><?php echo xlt('Taxes'); ?>:</td>
497 <td></td>
498 <td>
499 <?php echo $taxline ?>
500 </td>
501 </tr>
502 <?php } ?>
504 <tr>
505 <td colspan="3" align="center">
506 <input type="hidden" name="code_id" value="<?php echo attr($code_id) ?>"><br>
507 <input type="hidden" name="code_type_name_external" value="<?php echo attr($code_type_name_external) ?>">
508 <input type="hidden" name="code_external" value="<?php echo attr($code_external) ?>">
509 <?php if ($mode == "modify") { ?>
510 <a href='javascript:submitModifyComplete();' class='link'>[<?php echo xlt('Update'); ?>]</a>
511 <?php } else { ?>
512 <a href='javascript:submitUpdate();' class='link'>[<?php echo xlt('Update'); ?>]</a>
513 &nbsp;&nbsp;
514 <a href='javascript:submitAdd();' class='link'>[<?php echo xlt('Add as New'); ?>]</a>
515 <?php } ?>
516 </td>
517 </tr>
519 </table>
520 <br>
521 <table border='0' cellpadding='5' cellspacing='0' width='96%'>
522 <tr>
524 <td class='text'>
525 <select name='filter[]' multiple='multiple'>
526 <?php
527 foreach ($code_types as $key => $value) {
528 echo "<option value='" . attr($value['id']) . "'";
529 if (in_array($value['id'],$filter)) echo " selected";
530 echo ">" . xlt($value['label']) . "</option>\n";
533 </select>
534 &nbsp;&nbsp;&nbsp;&nbsp;
536 <input type="text" name="search" size="5" value="<?php echo attr($search) ?>">&nbsp;
537 <input type="submit" name="go" value='<?php echo xla('Search'); ?>'>&nbsp;&nbsp;
538 <input type='checkbox' title='<?php echo xlt("Only Show Diagnosis Reporting Codes") ?>' name='search_reportable' value='1'<?php if (!empty($search_reportable)) echo ' checked'; ?> />
539 <?php echo xlt('Diagnosis Reporting Only'); ?>
540 &nbsp;&nbsp;&nbsp;&nbsp;
541 <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)) echo ' checked'; ?> />
542 <?php echo xlt('Service Reporting Only'); ?>
543 <input type='hidden' name='fstart' value='<?php echo attr($fstart) ?>'>
544 </td>
546 <td class='text' align='right'>
547 <?php if ($fstart) { ?>
548 <a href="javascript:submitList(-<?php echo attr($pagesize) ?>)">
549 &lt;&lt;
550 </a>
551 &nbsp;&nbsp;
552 <?php } ?>
553 <?php echo ($fstart + 1) . " - $fend of $count" ?>
554 &nbsp;&nbsp;
555 <a href="javascript:submitList(<?php echo attr($pagesize) ?>)">
556 &gt;&gt;
557 </a>
558 </td>
560 </tr>
561 </table>
563 </form>
565 <table border='0' cellpadding='5' cellspacing='0' width='96%'>
566 <tr>
567 <td><span class='bold'><?php echo xlt('Code'); ?></span></td>
568 <td><span class='bold'><?php echo xlt('Mod'); ?></span></td>
569 <td><span class='bold'><?php echo xlt('Act'); ?></span></td>
570 <td><span class='bold'><?php echo xlt('Dx Rep'); ?></span></td>
571 <td><span class='bold'><?php echo xlt('Serv Rep'); ?></span></td>
572 <td><span class='bold'><?php echo xlt('Type'); ?></span></td>
573 <td><span class='bold'><?php echo xlt('Description'); ?></span></td>
574 <td><span class='bold'><?php echo xlt('Short Description'); ?></span></td>
575 <?php if (related_codes_are_used()) { ?>
576 <td><span class='bold'><?php echo xlt('Related'); ?></span></td>
577 <?php } ?>
578 <?php
579 $pres = sqlStatement("SELECT title FROM list_options " .
580 "WHERE list_id = 'pricelevel' ORDER BY seq");
581 while ($prow = sqlFetchArray($pres)) {
582 echo " <td class='bold' align='right' nowrap>" . text(xl_list_label($prow['title'])) . "</td>\n";
585 <td></td>
586 <td></td>
587 </tr>
588 <?php
590 if (isset($_REQUEST['filter'])) {
591 $res = main_code_set_search($filter_key,$search,NULL,NULL,false,NULL,false,$fstart,($fend - $fstart),$filter_elements);
594 for ($i = 0; $row = sqlFetchArray($res); $i++) $all[$i] = $row;
596 if (!empty($all)) {
597 $count = 0;
598 foreach($all as $iter) {
599 $count++;
601 $has_fees = false;
602 foreach ($code_types as $key => $value) {
603 if ($value['id'] == $iter['code_type']) {
604 $has_fees = $value['fee'];
605 break;
609 echo " <tr>\n";
610 echo " <td class='text'>" . text($iter["code"]) . "</td>\n";
611 echo " <td class='text'>" . text($iter["modifier"]) . "</td>\n";
612 if ($iter["code_external"] > 0) {
613 // If there is no entry in codes sql table, then default to active
614 // (this is reason for including NULL below)
615 echo " <td class='text'>" . ( ($iter["active"] || $iter["active"]==NULL) ? xlt('Yes') : xlt('No')) . "</td>\n";
617 else {
618 echo " <td class='text'>" . ( ($iter["active"]) ? xlt('Yes') : xlt('No')) . "</td>\n";
620 echo " <td class='text'>" . ($iter["reportable"] ? xlt('Yes') : xlt('No')) . "</td>\n";
621 echo " <td class='text'>" . ($iter["financial_reporting"] ? xlt('Yes') : xlt('No')) . "</td>\n";
622 echo " <td class='text'>" . text($iter['code_type_name']) . "</td>\n";
623 echo " <td class='text'>" . text($iter['code_text']) . "</td>\n";
624 echo " <td class='text'>" . text($iter['code_text_short']) . "</td>\n";
626 if (related_codes_are_used()) {
627 // Show related codes.
628 echo " <td class='text'>";
629 $arel = explode(';', $iter['related_code']);
630 foreach ($arel as $tmp) {
631 list($reltype, $relcode) = explode(':', $tmp);
632 $code_description = lookup_code_descriptions($reltype.":".$relcode);
633 echo text($relcode) . ' ' . text(trim($code_description)) . '<br />';
635 echo "</td>\n";
638 $pres = sqlStatement("SELECT p.pr_price " .
639 "FROM list_options AS lo LEFT OUTER JOIN prices AS p ON " .
640 "p.pr_id = ? AND p.pr_selector = '' AND p.pr_level = lo.option_id " .
641 "WHERE list_id = 'pricelevel' ORDER BY lo.seq", array($iter['id']) );
642 while ($prow = sqlFetchArray($pres)) {
643 echo "<td class='text' align='right'>" . text(bucks($prow['pr_price'])) . "</td>\n";
646 if ($iter["code_external"] > 0) {
647 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";
649 else {
650 echo " <td align='right'><a class='link' href='javascript:submitDelete(" . attr($iter['id']) . ")'>[" . xlt('Delete') . "]</a></td>\n";
651 echo " <td align='right'><a class='link' href='javascript:submitEdit(" . attr($iter['id']) . ")'>[" . xlt('Edit') . "]</a></td>\n";
654 echo " </tr>\n";
661 </table>
663 </center>
665 <script language="JavaScript">
666 <?php
667 if ($alertmsg) {
668 echo "alert('" . addslashes($alertmsg) . "');\n";
671 </script>
673 </body>
674 </html>