function getOptions() { $stmt = sqlStatement("SELECT field_id, title FROM layout_options " . "WHERE form_id = 'HIS' AND group_name LIKE '%Lifestyle%'"); $options = array(); for ($iter = 0; $row = sqlFetchArray($stmt); $iter++) { $id = $row['field_id']; $label = xl_layout_label($row['title']); $option = array("id" => $id, "label" => $label); array_push($options, $option); } return $options; }
if ($titlecols > 0) { end_cell(); $titlecols_esc = htmlspecialchars($titlecols, ENT_QUOTES); echo "<td width='70' valign='top' colspan='{$titlecols_esc}'"; echo $frow['uor'] == 2 ? " class='required'" : " class='bold'"; if ($cell_count == 2) { echo " style='padding-left:10pt'"; } echo ">"; $cell_count += $titlecols; } ++$item_count; echo "<b>"; // Modified 6-09 by BM - Translate if applicable if ($frow['title']) { echo htmlspecialchars(xl_layout_label($frow['title']), ENT_NOQUOTES) . ":"; } else { echo " "; } echo "</b>"; // Handle starting of a new data cell. if ($datacols > 0) { end_cell(); $datacols_esc = htmlspecialchars($datacols, ENT_QUOTES); echo "<td valign='top' colspan='{$datacols_esc}' class='text'"; if ($cell_count > 0) { echo " style='padding-left:5pt'"; } echo ">"; $cell_count += $datacols; }
echo "<b>" . xlt('Lists') . "</b><br />\n"; echo "<select multiple name='form_sel_lists[]' size='15'>"; $lres = sqlStatement("SELECT option_id, title FROM list_options WHERE " . "list_id = 'lists' ORDER BY title, seq"); while ($lrow = sqlFetchArray($lres)) { echo "<option value='" . attr($lrow['option_id']) . "'"; echo ">" . text(xl_list_label($lrow['title'])) . "</option>\n"; } echo "</select>\n"; // Multi-select for layouts. echo "</td><td valign='top'>\n"; echo "<b>" . xlt('Layouts') . "</b><br />\n"; echo "<select multiple name='form_sel_layouts[]' size='15'>"; $lres = sqlStatement("SELECT option_id, title FROM list_options WHERE " . "list_id = 'lbfnames' ORDER BY title, seq"); while ($lrow = sqlFetchArray($lres)) { echo "<option value='" . attr($lrow['option_id']) . "'"; echo ">" . text(xl_layout_label($lrow['title'])) . "</option>\n"; } echo "</select>\n"; echo "</td>\n</tr>\n</table>\n"; echo " <br /><input type='submit' value='" . xl('Continue') . "' />\n"; } if ($form_step == 102) { $tables = ''; if ($_POST['form_cb_services']) { $tables .= ' codes'; } if ($_POST['form_cb_products']) { $tables .= ' drugs drug_templates'; } if ($_POST['form_cb_prices']) { $tables .= ' prices';
// Handle starting of a new label cell. if ($titlecols > 0) { end_cell(); echo "<td colspan='{$titlecols}'"; echo $frow['uor'] == 2 ? " class='required'" : " class='bold'"; if ($cell_count == 2) { echo " style='padding-left:10pt'"; } echo ">"; $cell_count += $titlecols; } ++$item_count; echo "<b>"; // Modified 6-09 by BM - Translate if applicable if ($frow['title']) { echo xl_layout_label($frow['title']) . ":"; } else { echo " "; } echo "</b>"; // Handle starting of a new data cell. if ($datacols > 0) { end_cell(); echo "<td colspan='{$datacols}' class='text'"; if ($cell_count > 0) { echo " style='padding-left:5pt'"; } echo ">"; $cell_count += $datacols; } ++$item_count;
if ($cell_count == 2) { echo " style='padding-left:10pt'"; } if ($graphable) { echo " id='{$field_id}'"; } echo ">"; foreach ($historical_ids as $key => $dummy) { $historical_ids[$key] .= "<td valign='top' colspan='{$titlecols}' class='text' nowrap>"; } $cell_count += $titlecols; } ++$item_count; echo "<b>"; if ($frow['title']) { echo htmlspecialchars(xl_layout_label($frow['title']) . ":"); } else { echo " "; } echo "</b>"; // Note the labels are not repeated in the history columns. // Handle starting of a new data cell. if ($datacols > 0) { end_cell(); echo "<td valign='top' align='right' colspan='{$datacols}' class='text'"; if ($cell_count > 0) { echo " style='padding-left:5pt'"; } echo ">"; foreach ($historical_ids as $key => $dummy) { $historical_ids[$key] .= "<td valign='top' align='right' colspan='{$datacols}' class='text'>";
function generate_layout_validation($form_id) { $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = ? AND uor > 0 AND field_id != '' " . "ORDER BY group_name, seq", array($form_id)); while ($frow = sqlFetchArray($fres)) { if ($frow['uor'] < 2) { continue; } $data_type = $frow['data_type']; $field_id = $frow['field_id']; $fldtitle = $frow['title']; if (!$fldtitle) { $fldtitle = $frow['description']; } $fldname = htmlspecialchars("form_{$field_id}", ENT_QUOTES); switch ($data_type) { case 1: case 11: case 12: case 13: case 14: case 26: echo " if (f.{$fldname}.selectedIndex <= 0) {\n" . " if (f.{$fldname}.focus) f.{$fldname}.focus();\n" . " \t\terrMsgs[errMsgs.length] = '" . htmlspecialchars(xl_layout_label($fldtitle), ENT_QUOTES) . "'; \n" . " }\n"; break; case 27: // radio buttons echo " var i = 0;\n" . " for (; i < f.{$fldname}.length; ++i) if (f.{$fldname['i']}.checked) break;\n" . " if (i >= f.{$fldname}.length) {\n" . " \t\terrMsgs[errMsgs.length] = '" . htmlspecialchars(xl_layout_label($fldtitle), ENT_QUOTES) . "'; \n" . " }\n"; break; case 2: case 3: case 4: case 15: echo " if (trimlen(f.{$fldname}.value) == 0) {\n" . " \t\tif (f.{$fldname}.focus) f.{$fldname}.focus();\n" . " \t\t\$('#" . $fldname . "').parents('div.tab').each( function(){ var tabHeader = \$('#header_' + \$(this).attr('id') ); tabHeader.css('color','red'); } ); " . " \t\t\$('#" . $fldname . "').attr('style','background:red'); \n" . " \t\terrMsgs[errMsgs.length] = '" . htmlspecialchars(xl_layout_label($fldtitle), ENT_QUOTES) . "'; \n" . " } else { " . " \t\t\$('#" . $fldname . "').attr('style',''); " . " \t\t\$('#" . $fldname . "').parents('div.tab').each( function(){ var tabHeader = \$('#header_' + \$(this).attr('id') ); tabHeader.css('color',''); } ); " . " } \n"; break; } } }
public static function batch_despatch($var, $func, $data_credentials) { global $pid; if (UserService::valid($data_credentials)) { require_once "../../library/invoice_summary.inc.php"; require_once "../../library/options.inc.php"; require_once "../../library/acl.inc"; require_once "../../library/patient.inc"; if ($func == 'ar_responsible_party') { $patient_id = $pid; $encounter_id = $var['encounter']; $x['ar_responsible_party'] = ar_responsible_party($patient_id, $encounter_id); return UserService::function_return_to_xml($x); } elseif ($func == 'getInsuranceData') { $type = $var['type']; $given = $var['given']; $x = getInsuranceData($pid, $type, $given); return UserService::function_return_to_xml($x); } elseif ($func == 'generate_select_list') { $tag_name = $var['tag_name']; $list_id = $var['list_id']; $currvalue = $var['currvalue']; $title = $var['title']; $empty_name = $var['empty_name']; $class = $var['class']; $onchange = $var['onchange']; $x['generate_select_list'] = generate_select_list($tag_name, $list_id, $currvalue, $title, $empty_name, $class, $onchange); return UserService::function_return_to_xml($x); } elseif ($func == 'xl_layout_label') { $constant = $var['constant']; $x['xl_layout_label'] = xl_layout_label($constant); return UserService::function_return_to_xml($x); } elseif ($func == 'generate_form_field') { $frow = $var['frow']; $currvalue = $var['currvalue']; ob_start(); generate_form_field($frow, $currvalue); $x['generate_form_field'] = ob_get_contents(); ob_end_clean(); return UserService::function_return_to_xml($x); } elseif ($func == 'getInsuranceProviders') { $i = $var['i']; $provider = $var['provider']; $insurancei = getInsuranceProviders(); $x = $insurancei; return $x; } elseif ($func == 'get_layout_form_value') { $frow = $var['frow']; $_POST = $var['post_array']; $x['get_layout_form_value'] = get_layout_form_value($frow); return UserService::function_return_to_xml($x); } elseif ($func == 'updatePatientData') { $patient_data = $var['patient_data']; $create = $var['create']; updatePatientData($pid, $patient_data, $create); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'updateEmployerData') { $employer_data = $var['employer_data']; $create = $var['create']; updateEmployerData($pid, $employer_data, $create); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'newHistoryData') { newHistoryData($pid); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'newInsuranceData') { $_POST = $var[0]; foreach ($var as $key => $value) { if ($key >= 3) { $var[$key] = formData($value); } if ($key >= 1) { $parameters[$key] = $var[$key]; } } $parameters[12] = fixDate($parameters[12]); $parameters[27] = fixDate($parameters[27]); call_user_func_array('newInsuranceData', $parameters); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'generate_layout_validation') { $form_id = $var['form_id']; ob_start(); generate_layout_validation($form_id); $x = ob_get_clean(); return $x; } } else { throw new SoapFault("Server", "credentials failed"); } }
echo "'"; if ($cell_count == 2) { echo " style='padding-left:10pt'"; } // This ID is used by skip conditions and also show_graph(). echo " id='label_id_" . attr($field_id) . "'"; echo ">"; foreach ($historical_ids as $key => $dummy) { $historical_ids[$key] .= "<td valign='top' colspan='" . attr($titlecols) . "' class='text' nowrap>"; } $cell_count += $titlecols; } ++$item_count; echo "<b>"; if ($frow['title']) { echo text(xl_layout_label($frow['title']) . ":"); } else { echo " "; } echo "</b>"; // Note the labels are not repeated in the history columns. // Handle starting of a new data cell. if ($datacols > 0) { end_cell(); echo "<td valign='top' colspan='" . attr($datacols) . "' class='text'"; // This ID is used by skip conditions. echo " id='value_id_" . attr($field_id) . "'"; if ($cell_count > 0) { echo " style='padding-left:5pt'"; } echo ">";
<tr> <th class="srID" ><?php echo htmlspecialchars(xl('Hits'), ENT_NOQUOTES); ?> </th> <th class="srName" ><?php echo htmlspecialchars(xl('Name'), ENT_NOQUOTES); ?> </th> <?php // This gets address plus other fields that are mandatory, up to a limit of 5. $extracols = array(); $tres = sqlStatement("SELECT field_id, title FROM layout_options " . "WHERE form_id = 'DEM' AND field_id != '' AND " . "( uor > 1 OR uor > 0 AND edit_options LIKE '%D%' ) AND " . "field_id NOT LIKE 'title' AND " . "field_id NOT LIKE '_name' " . "ORDER BY group_name, seq, title LIMIT 9"); while ($trow = sqlFetchArray($tres)) { $extracols[$trow['field_id']] = $trow['title']; echo "<th class='srMisc'>" . htmlspecialchars(xl_layout_label($trow['title']), ENT_NOQUOTES) . "</th>\n"; } ?> </tr> </table> </div> <div id="searchResults"> <table> <tr> <?php $pubpid_matched = false; if ($result) { foreach ($result as $iter) {
function generate_layout_validation($form_id) { $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = ? AND uor > 0 AND field_id != '' " . "ORDER BY group_name, seq", array($form_id) ); while ($frow = sqlFetchArray($fres)) { $data_type = $frow['data_type']; $field_id = $frow['field_id']; $fldtitle = $frow['title']; if (!$fldtitle) $fldtitle = $frow['description']; $fldname = htmlspecialchars("form_$field_id", ENT_QUOTES); if ($data_type == 40) { $fldid = addslashes("form_$field_id"); // Move canvas image data to its hidden form field so the server will get it. echo " var canfld = f['$fldid'];\n" . " if (canfld) canfld.value = lbfCanvasGetData('$fldid');\n"; continue; } if ($frow['uor'] < 2) continue; switch($data_type) { case 1: case 11: case 12: case 13: case 14: case 26: case 33: echo " if (f.$fldname.selectedIndex <= 0) {\n" . " if (f.$fldname.focus) f.$fldname.focus();\n" . " errMsgs[errMsgs.length] = '" . addslashes(xl_layout_label($fldtitle)) . "'; \n" . " }\n"; break; case 27: // radio buttons echo " var i = 0;\n" . " for (; i < f.$fldname.length; ++i) if (f.$fldname[i].checked) break;\n" . " if (i >= f.$fldname.length) {\n" . " errMsgs[errMsgs.length] = '" . addslashes(xl_layout_label($fldtitle)) . "'; \n" . " }\n"; break; case 2: case 3: case 4: case 15: echo " if (trimlen(f.$fldname.value) == 0) {\n" . " if (f.$fldname.focus) f.$fldname.focus();\n" . " $('#" . $fldname . "').parents('div.tab').each( function(){ var tabHeader = $('#header_' + $(this).attr('id') ); tabHeader.css('color','red'); } ); " . " $('#" . $fldname . "').attr('style','background:red'); \n" . " errMsgs[errMsgs.length] = '" . addslashes(xl_layout_label($fldtitle)) . "'; \n" . " } else { " . " $('#" . $fldname . "').attr('style',''); " . " $('#" . $fldname . "').parents('div.tab').each( function(){ var tabHeader = $('#header_' + $(this).attr('id') ); tabHeader.css('color',''); } ); " . " } \n"; break; case 36: // multi select echo " var multi_select=f['$fldname"."[]']; \n " . " var multi_choice_made=false; \n". " for (var options_index=0; options_index < multi_select.length; options_index++) { ". " multi_choice_made=multi_choice_made || multi_select.options[options_index].selected; \n". " } \n" . " if(!multi_choice_made) errMsgs[errMsgs.length] = '" . addslashes(xl_layout_label($fldtitle)) . "'; \n" . ""; break; } } }
<tbody><tr height="22" class="showborder_head"> <th width="180px"><b><?php echo xlt('Username'); ?> </b></th> <th width="270px"><b><?php echo xlt('Full Name'); ?> </b></th> <th width="190px"><b><span class="bold"><?php echo xlt('Facility'); ?> </span></b></th> <?php foreach ($l_arr as $layout_entry) { echo "<th width='100px'><b><span class='bold'>" . text(xl_layout_label($layout_entry['title'])) . " </span></b></th>"; } ?> </tr> <?php while ($user = sqlFetchArray($u_res)) { foreach ($f_arr as $facility) { ?> <tr height="20" class="text" style="border-bottom: 1px dashed;"> <td class="text"><b><a href="facility_user_admin.php?user_id=<?php echo attr($user['id']); ?> &fac_id=<?php echo attr($facility['id']); ?> " class="iframe_small" onclick="top.restoreSession()"><span><?php
echo "</tr>\n"; } echo "<tr>\n"; } echo "<td>"; echo "<input type='checkbox' value='" . htmlspecialchars(${fieldId}, ENT_QUOTES) . "' name='searchFields'/> <b>" . htmlspecialchars($fieldTitle, ENT_NOQUOTES) . "</b>"; echo "</td>\n"; } $layoutCols = sqlStatement("SELECT field_id, title, description, group_name " . "FROM layout_options " . "WHERE form_id='DEM' " . "AND group_name not like ('%Employer%' ) AND uor != 0 " . "ORDER BY group_name,seq"); echo "<table>"; for ($iter = 0; $row = sqlFetchArray($layoutCols); $iter++) { $label = $row['title'] ? $row['title'] : $row['description']; if (!$label) { $label = $row['field_id']; } echoFilterItem($iter, $row['field_id'], xl_layout_label($label)); } echoFilterItem($iter++, 'pid', xl('Internal Identifier (pid)')); // Finish the row gracefully. while ($iter++ % 3) { echo "<td> </td>\n"; } echo "</tr>\n"; // Write a final line to solicit an optional service code. echo "<tr>\n"; echo "<td colspan='3'>"; echo "<input type='text' value='' name='search_service_code' size='8' /> " . "<b>" . htmlspecialchars(xl('Service Code')) . "</b> (" . htmlspecialchars(xl('if entered, select only those who have had this service')) . ")"; echo "</td>\n"; echo "</tr>\n"; echo "</table>"; ?>
</td> <td> <span class=text><?php echo text($fac_info['name']); ?> </span> </td> </tr> <?php foreach ($l_arr as $layout_entry) { ?> <tr> <td style="width:180px;"> <span class=text><?php echo text(xl_layout_label($layout_entry['title'])); ?> : </span> </td> <td style="width:270px;"> <?php $entry_data = sqlQuery("SELECT `field_value` FROM `facility_user_ids` " . "WHERE `uid` = ? AND `facility_id` = ? AND `field_id` = ?", array($user_info['id'], $fac_info['id'], $layout_entry['field_id'])); echo "<td><span class='text'>" . generate_form_field($layout_entry, $entry_data['field_value']) . " </td>"; ?> </td> </tr> <?php } ?>
function issue_ippf_gcac_form($issue, $thispid) { global $pprow, $item_count, $cell_count, $last_group; $shrow = getHistoryData($thispid); if ($issue) { $pprow = sqlQuery("SELECT * FROM lists_ippf_gcac WHERE id = '{$issue}'"); } else { $pprow = array(); } echo "<div id='ippf_gcac' style='display:none'>\n"; $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = 'GCA' AND uor > 0 " . "ORDER BY group_name, seq"); $last_group = ''; $cell_count = 0; $item_count = 0; $display_style = 'block'; while ($frow = sqlFetchArray($fres)) { $this_group = $frow['group_name']; $titlecols = $frow['titlecols']; $datacols = $frow['datacols']; $data_type = $frow['data_type']; $field_id = $frow['field_id']; $list_id = $frow['list_id']; $currvalue = ''; if ($frow['edit_options'] == 'H') { // This data comes from static history if (isset($shrow[$field_id])) { $currvalue = $shrow[$field_id]; } } else { if (isset($pprow[$field_id])) { $currvalue = $pprow[$field_id]; } } // Handle a data category (group) change. if (strcmp($this_group, $last_group) != 0) { end_group(); $group_seq = 'gca' . substr($this_group, 0, 1); $group_name = substr($this_group, 1); $last_group = $this_group; echo "<br /><span class='bold'><input type='checkbox' name='form_cb_{$group_seq}' value='1' " . "onclick='return divclick(this,\"div_{$group_seq}\");'"; if ($display_style == 'block') { echo " checked"; } echo " /><b>" . xl_layout_label($group_name) . "</b></span>\n"; echo "<div id='div_{$group_seq}' class='section' style='display:{$display_style};'>\n"; echo " <table border='0' cellpadding='0' width='100%'>\n"; $display_style = 'none'; } // Handle starting of a new row. if ($titlecols > 0 && $cell_count >= $CPR || $cell_count == 0) { end_row(); echo " <tr>"; } if ($item_count == 0 && $titlecols == 0) { $titlecols = 1; } // Handle starting of a new label cell. if ($titlecols > 0) { end_cell(); echo "<td valign='top' colspan='{$titlecols}' width='1%' nowrap"; echo $frow['uor'] == 2 ? " class='required'" : " class='bold'"; if ($cell_count == 2) { echo " style='padding-left:10pt'"; } echo ">"; $cell_count += $titlecols; } ++$item_count; echo "<b>"; if ($frow['title']) { echo xl_layout_label($frow['title']) . ":"; } else { echo " "; } echo "</b>"; // Handle starting of a new data cell. if ($datacols > 0) { end_cell(); echo "<td valign='top' colspan='{$datacols}' class='text'"; if ($cell_count > 0) { echo " style='padding-left:5pt'"; } echo ">"; $cell_count += $datacols; } ++$item_count; if ($frow['edit_options'] == 'H') { echo generate_display_field($frow, $currvalue); } else { generate_form_field($frow, $currvalue); } } end_group(); echo "</div>\n"; }
<tr> <th class="srID" ><?php xl('Hits', 'e'); ?> </th> <th class="srName" ><?php xl('Name', 'e'); ?> </th> <?php // This gets address plus other fields that are mandatory, up to a limit of 5. $extracols = array(); $tres = sqlStatement("SELECT field_id, title FROM layout_options " . "WHERE form_id = 'DEM' AND field_id != '' AND " . "( uor > 1 OR uor > 0 AND edit_options LIKE '%D%' ) AND " . "field_id NOT LIKE 'title' AND " . "field_id NOT LIKE '_name' " . "ORDER BY group_name, seq, title LIMIT 9"); while ($trow = sqlFetchArray($tres)) { $extracols[$trow['field_id']] = $trow['title']; echo "<th class='srMisc'>" . xl_layout_label($trow['title']) . "</th>\n"; } ?> </tr> </table> </div> <div id="searchResults"> <table> <tr> <?php $pubpid_matched = false; if ($result) { foreach ($result as $iter) {