2 // Copyright (C) 2010 MMF Systems, Inc>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 // SEGMENT FUNCTION START
11 // ISA Segment - EDI-270 format
13 function create_ISA($row,$X12info,$segTer,$compEleSep) {
17 $ISA[0] = "ISA"; // Interchange Control Header Segment ID
19 $ISA[1] = "00"; // Author Info Qualifier
21 $ISA[2] = str_pad("0000000",10," "); // Author Information
23 $ISA[3] = "00"; // Security Information Qualifier
24 // MEDI-CAL NOTE: For Leased-Line & Dial-Up use '01',
25 // for BATCH use '00'.
26 // '00' No Security Information Present
27 // (No Meaningful Information in I04)
29 $ISA[4] = str_pad("0000000000",10," "); // Security Information
31 $ISA[5] = str_pad("ZZ",2," "); // Interchange ID Qualifier
33 $ISA[6] = str_pad($X12info[2],15," "); // INTERCHANGE SENDER ID
35 $ISA[7] = str_pad("ZZ",2," "); // Interchange ID Qualifier
37 $ISA[8] = str_pad($X12info[3],15," "); // INTERCHANGE RECEIVER ID
39 $ISA[9] = str_pad(date('ymd'),6," "); // Interchange Date (YYMMDD)
41 $ISA[10] = str_pad(date('Hi'),4," "); // Interchange Time (HHMM)
43 $ISA[11] = "U"; // Interchange Control Standards Identifier
45 $ISA[12] = str_pad("00401",5," "); // Interchange Control Version Number
47 $ISA[13] = str_pad("000000001",9," "); // INTERCHANGE CONTROL NUMBER
49 $ISA[14] = str_pad("1",1," "); // Acknowledgment Request [0= not requested, 1= requested]
51 $ISA[15] = str_pad("P",1," "); // Usage Indicator [ P = Production Data, T = Test Data ]
53 $ISA['Created'] = implode('*', $ISA); // Data Element Separator
55 $ISA['Created'] = $ISA['Created'] ."*";
57 $ISA['Created'] = $ISA ['Created'] . $segTer . $compEleSep;
59 return trim($ISA['Created']);
63 // GS Segment - EDI-270 format
65 function create_GS($row,$X12info,$segTer,$compEleSep) {
69 $GS[0] = "GS"; // Functional Group Header Segment ID
71 $GS[1] = "HS"; // Functional ID Code [ HS = Eligibility, Coverage or Benefit Inquiry (270) ]
73 $GS[2] = $X12info[2]; // Application Sender’s ID
75 $GS[3] = $X12info[3]; // Application Receiver’s ID
77 $GS[4] = date('Ymd'); // Date [CCYYMMDD]
79 $GS[5] = date('His'); // Time [HHMM] – Group Creation Time
81 $GS[6] = "000000002"; // Group Control Number
83 $GS[7] = "X"; // Responsible Agency Code Accredited Standards Committee X12 ]
85 $GS[8] = "004010X092A1"; // Version –Release / Industry[ Identifier Code Query
87 $GS['Created'] = implode('*', $GS); // Data Element Separator
89 $GS['Created'] = $GS ['Created'] . $compEleSep;
91 return trim($GS['Created']);
95 // ST Segment - EDI-270 format
97 function create_ST($row,$X12info,$segTer,$compEleSep) {
101 $ST[0] = "ST"; // Transaction Set Header Segment ID
103 $ST[1] = "270"; // Transaction Set Identifier Code (Inquiry Request)
105 $ST[2] = "000000003"; // Transaction Set Control Number - Must match SE's
107 $ST['Created'] = implode('*', $ST); // Data Element Separator
109 $ST['Created'] = $ST ['Created'] . $compEleSep;
111 return trim($ST['Created']);
115 // BHT Segment - EDI-270 format
117 function create_BHT($row,$X12info,$segTer,$compEleSep) {
121 $BHT[0] = "BHT"; // Beginning of Hierarchical Transaction Segment ID
123 $BHT[1] = "0022"; // Subscriber Structure Code
125 $BHT[2] = "13"; // Purpose Code - This is a Request
127 $BHT[3] = "PROVTest600"; // Submitter Transaction Identifier
128 //This information is required by the information Receiver
129 //when using Real Time transactions.
130 //For BATCH this can be used for optional information.
132 $BHT[4] = str_pad(date('Ymd'),8," "); // Date Transaction Set Created
134 $BHT[5] = str_pad(date('His'),8," "); // Time Transaction Set Created
136 $BHT['Created'] = implode('*', $BHT); // Data Element Separator
138 $BHT['Created'] = $BHT ['Created'] . $compEleSep;
140 return trim($BHT['Created']);
144 // HL Segment - EDI-270 format
146 function create_HL($row, $nHlCounter,$X12info,$segTer,$compEleSep) {
150 $HL[0] = "HL"; // Hierarchical Level Segment ID
153 $HL[1] = $nHlCounter; // Hierarchical ID No.
158 $HL[3] = 20; // Description: Identifies the payor, maintainer, or source of the information.
159 $HL[4] = 1; // 1 Additional Subordinate HL Data Segment in This Hierarchical Structure.
161 else if($nHlCounter == 2)
163 $HL[2] = 1; // Hierarchical Parent ID Number
164 $HL[3] = 21; // Hierarchical Level Code. '21' Information Receiver
165 $HL[4] = 1; // 1 Additional Subordinate HL Data Segment in This Hierarchical Structure.
170 $HL[3] = 22; // Hierarchical Level Code.'22' Subscriber
171 $HL[4] = 0; // 0 no Additional Subordinate in the Hierarchical Structure.
174 $HL['Created'] = implode('*', $HL); // Data Element Separator
176 $HL['Created'] = $HL ['Created'] . $compEleSep;
178 return trim($HL['Created']);
182 // NM1 Segment - EDI-270 format
184 function create_NM1($row,$nm1Cast,$X12info,$segTer,$compEleSep) {
188 $NM1[0] = "NM1"; // Subscriber Name Segment ID
192 $NM1[1] = "PR"; // Entity ID Code - Payer [PR Payer]
193 $NM1[2] = "2"; // Entity Type - Non-Person
194 $NM1[3] = $row["payer_name"]; // Organizational Name
195 $NM1[4] = ""; // Data Element not required.
196 $NM1[5] = ""; // Data Element not required.
197 $NM1[6] = ""; // Data Element not required.
198 $NM1[7] = ""; // Data Element not required.
199 $NM1[8] = "46"; // 46 - Electronic Transmitter Identification Number (ETIN)
200 $NM1[9] = $X12info[3]; // Application Sender’s ID
202 else if($nm1Cast == '1P')
204 $NM1[1] = "IP"; // Entity ID Code - Provider [1P Provider]
205 $NM1[2] = "1"; // Entity Type - Person
206 $NM1[3] = $row['facility_name']; // Organizational Name
207 $NM1[4] = $row['provider_lname']; // Data Element not required.
208 $NM1[5] = $row['provider_fname']; // Data Element not required.
209 $NM1[6] = ""; // Data Element not required.
210 $NM1[7] = ""; // Data Element not required.
212 $NM1[9] = $row['provider_npi'];
214 else if($nm1Cast == 'IL')
216 $NM1[1] = "IL"; // Insured or Subscriber
217 $NM1[2] = "1"; // Entity Type - Person
218 $NM1[3] = $row['lname']; // last Name
219 $NM1[4] = $row['fname']; // first Name
220 $NM1[5] = $row['mname']; // middle Name
221 $NM1[6] = ""; // data element
222 $NM1[7] = ""; // data element
223 $NM1[8] = "MI"; // Identification Code Qualifier
224 $NM1[9] = $row['subscriber_ss']; // Identification Code
227 $NM1['Created'] = implode('*', $NM1); // Data Element Separator
229 $NM1['Created'] = $NM1['Created'] . $compEleSep;
231 return trim($NM1['Created']);
235 // REF Segment - EDI-270 format
237 function create_REF($row,$ref,$X12info,$segTer,$compEleSep) {
241 $REF[0] = "REF"; // Subscriber Additional Identification
245 $REF[1] = "4A"; // Reference Identification Qualifier
246 $REF[2] = $row['provider_pin']; // Provider Pin.
250 $REF[1] = "EJ"; // 'EJ' for Patient Account Number
251 $REF[2] = $row['pid']; // Patient Account No.
253 $REF['Created'] = implode('*', $REF); // Data Element Separator
255 $REF['Created'] = $REF['Created'] . $compEleSep;
257 return trim($REF['Created']);
261 // TRN Segment - EDI-270 format
263 function create_TRN($row,$tracno,$refiden,$X12info,$segTer,$compEleSep) {
267 $TRN[0] = "TRN"; // Subscriber Trace Number Segment ID
269 $TRN[1] = "1"; // Trace Type Code – Current Transaction Trace Numbers
271 $TRN[2] = $tracno; // Trace Number
273 $TRN[3] = "9000000000"; // Originating Company ID – must be 10 positions in length
275 $TRN[4] = $refiden; // Additional Entity Identifier (i.e. Subdivision)
277 $TRN['Created'] = implode('*', $TRN); // Data Element Separator
279 $TRN['Created'] = $TRN['Created'] . $compEleSep;
281 return trim($TRN['Created']);
285 // DMG Segment - EDI-270 format
287 function create_DMG($row,$X12info,$segTer,$compEleSep) {
291 $DMG[0] = "DMG"; // Date or Time or Period Segment ID
293 $DMG[1] = "D8"; // Date Format Qualifier - (D8 means CCYYMMDD)
295 $DMG[2] = $row['dob']; // Subscriber's Birth date
297 $DMG['Created'] = implode('*', $DMG); // Data Element Separator
299 $DMG['Created'] = $DMG['Created'] . $compEleSep;
301 return trim($DMG['Created']);
304 // DTP Segment - EDI-270 format
306 function create_DTP($row,$qual,$X12info,$segTer,$compEleSep) {
310 $DTP[0] = "DTP"; // Date or Time or Period Segment ID
312 $DTP[1] = $qual; // Qualifier - Date of Service
314 $DTP[2] = "D8"; // Date Format Qualifier - (D8 means CCYYMMDD)
317 $DTP[3] = $row['date']; // Date
319 $DTP[3] = $row['pc_eventDate']; // Date of Service
321 $DTP['Created'] = implode('*', $DTP); // Data Element Separator
323 $DTP['Created'] = $DTP['Created'] . $compEleSep;
325 return trim($DTP['Created']);
328 // EQ Segment - EDI-270 format
330 function create_EQ($row,$X12info,$segTer,$compEleSep) {
334 $EQ[0] = "EQ"; // Subscriber Eligibility or Benefit Inquiry Information
336 $EQ[1] = "30"; // Service Type Code
338 $EQ['Created'] = implode('*', $EQ); // Data Element Separator
340 $EQ['Created'] = $EQ['Created'] . $compEleSep;
342 return trim($EQ['Created']);
345 // SE Segment - EDI-270 format
347 function create_SE($row,$segmentcount,$X12info,$segTer,$compEleSep) {
351 $SE[0] = "SE"; // Transaction Set Trailer Segment ID
353 $SE[1] = $segmentcount; // Segment Count
355 $SE[2] = "000000003"; // Transaction Set Control Number - Must match ST's
357 $SE['Created'] = implode('*', $SE); // Data Element Separator
359 $SE['Created'] = $SE['Created'] . $compEleSep;
361 return trim($SE['Created']);
364 // GE Segment - EDI-270 format
366 function create_GE($row,$X12info,$segTer,$compEleSep) {
370 $GE[0] = "GE"; // Functional Group Trailer Segment ID
372 $GE[1] = "1"; // Number of included Transaction Sets
374 $GE[2] = "000000002"; // Group Control Number
376 $GE['Created'] = implode('*', $GE); // Data Element Separator
378 $GE['Created'] = $GE['Created'] . $compEleSep;
380 return trim($GE['Created']);
383 // IEA Segment - EDI-270 format
385 function create_IEA($row,$X12info,$segTer,$compEleSep) {
389 $IEA[0] = "IEA"; // Interchange Control Trailer Segment ID
391 $IEA[1] = "1"; // Number of included Functional Groups
393 $IEA[2] = "000000001"; // Interchange Control Number
395 $IEA['Created'] = implode('*', $IEA);
397 $IEA['Created'] = $IEA['Created'] . $compEleSep;
399 return trim($IEA['Created']);
402 function translate_relationship($relationship) {
403 switch ($relationship) {
416 // EDI-270 Batch file Generation
418 function print_elig($res,$X12info,$segTer,$compEleSep){
424 // For Header Segment
431 while ($row = sqlFetchArray($res))
437 $PATEDI = create_ISA($row,$X12info,$segTer,$compEleSep);
440 $PATEDI .= create_GS($row,$X12info,$segTer,$compEleSep);
443 $PATEDI .= create_ST($row,$X12info,$segTer,$compEleSep);
446 $PATEDI .= create_BHT($row,$X12info,$segTer,$compEleSep);
450 $PATEDI .= create_HL($row,1,$X12info,$segTer,$compEleSep);
451 $PATEDI .= create_NM1($row,'PR',$X12info,$segTer,$compEleSep);
453 // For Provider Segment
455 $PATEDI .= create_HL($row,2,$X12info,$segTer,$compEleSep);
456 $PATEDI .= create_NM1($row,'1P',$X12info,$segTer,$compEleSep);
457 $PATEDI .= create_REF($row,'1P',$X12info,$segTer,$compEleSep);
459 $nHlCounter = $nHlCounter + 2;
460 $segmentcount = 7; // segement counts - start from ST
463 // For Subscriber Segment
465 $PATEDI .= create_HL($row,$nHlCounter,$X12info,$segTer,$compEleSep);
466 $PATEDI .= create_TRN($row,$trcNo,$refiden,$X12info,$segTer,$compEleSep);
467 $PATEDI .= create_NM1($row,'IL',$X12info,$segTer,$compEleSep);
468 $PATEDI .= create_REF($row,'IL',$X12info,$segTer,$compEleSep);
469 $PATEDI .= create_DMG($row,$X12info,$segTer,$compEleSep);
471 // $PATEDI .= create_DTP($row,'102',$X12info,$segTer,$compEleSep);
473 $PATEDI .= create_DTP($row,'472',$X12info,$segTer,$compEleSep);
474 $PATEDI .= create_EQ($row,$X12info,$segTer,$compEleSep);
476 $segmentcount = $segmentcount + 7;
477 $nHlCounter = $nHlCounter + 1;
478 $rowCount = $rowCount + 1;
480 $refiden = $refiden + 1;
483 if($rowCount == sqlNumRows($res))
485 $segmentcount = $segmentcount + 1;
486 $PATEDI .= create_SE($row,$segmentcount,$X12info,$segTer,$compEleSep);
487 $PATEDI .= create_GE($row,$X12info,$segTer,$compEleSep);
488 $PATEDI .= create_IEA($row,$X12info,$segTer,$compEleSep);
497 function show_elig($res,$X12info,$segTer,$compEleSep){
500 echo " <div id='report_results'>
504 <th style='width:12%;'> ". htmlspecialchars( xl('Facility Name'), ENT_NOQUOTES) ."</th>
505 <th style='width:9%;' > ". htmlspecialchars( xl('Facility NPI'), ENT_NOQUOTES) ."</th>
506 <th style='width:15%;'> ". htmlspecialchars( xl('Insurance Comp'), ENT_NOQUOTES) ."</th>
507 <th style='width:8%;' > ". htmlspecialchars( xl('Policy No'), ENT_NOQUOTES) ."</th>
508 <th style='width:16%;'> ". htmlspecialchars( xl('Patient Name'), ENT_NOQUOTES) ."</th>
509 <th style='width:7%;' > ". htmlspecialchars( xl('DOB'), ENT_NOQUOTES) ."</th>
510 <th style='width:6%;' > ". htmlspecialchars( xl('Gender'), ENT_NOQUOTES) ."</th>
511 <th style='width:9%;' > ". htmlspecialchars( xl('SSN'), ENT_NOQUOTES) ."</th>
512 <th style='width:2%;' > </th>
519 while ($row = sqlFetchArray($res)) {
525 $background = '#FFF';
527 $background = '#FFF';
531 $elig[0] = $row['facility_name']; // Inquiring Provider Name calendadr
532 $elig[1] = $row['facility_npi']; // Inquiring Provider NPI
533 $elig[2] = $row['payer_name']; // Payer Name our insurance co name
534 $elig[3] = $row['policy_number']; // Subscriber ID
535 $elig[4] = $row['subscriber_lname']; // Subscriber Last Name
536 $elig[5] = $row['subscriber_fname']; // Subscriber First Name
537 $elig[6] = $row['subscriber_mname']; // Subscriber Middle Initial
538 $elig[7] = $row['subscriber_dob']; // Subscriber Date of Birth
539 $elig[8] = substr($row['subscriber_sex'], 0, 1); // Subscriber Sex
540 $elig[9] = $row['subscriber_ss']; // Subscriber SSN
541 $elig[10] = translate_relationship($row['subscriber_relationship']); // Pt Relationship to insured
542 $elig[11] = $row['lname']; // Dependent Last Name
543 $elig[12] = $row['fname']; // Dependent First Name
544 $elig[13] = $row['mname']; // Dependent Middle Initial
545 $elig[14] = $row['dob']; // Dependent Date of Birth
546 $elig[15] = substr($row['sex'], 0, 1); // Dependent Sex
547 $elig[16] = $row['pc_eventDate']; // Date of service
548 $elig[17] = "30"; // Service Type
549 $elig[18] = $row['pubpid']; // Patient Account Number pubpid
551 echo " <tr id='PR".$i."_". htmlspecialchars( $row['policy_number'], ENT_QUOTES)."'>
552 <td class ='detail' style='width:12%;'>". htmlspecialchars( $row['facility_name'], ENT_NOQUOTES) ."</td>
553 <td class ='detail' style='width:9%;'>". htmlspecialchars( $row['facility_npi'], ENT_NOQUOTES) ."</td>
554 <td class ='detail' style='width:15%;'>". htmlspecialchars( $row['payer_name'], ENT_NOQUOTES) ."</td>
555 <td class ='detail' style='width:8%;'>". htmlspecialchars( $row['policy_number'], ENT_NOQUOTES) ."</td>
556 <td class ='detail' style='width:16%;'>". htmlspecialchars( $row['subscriber_lname']." ".$row['subscriber_fname'], ENT_NOQUOTES) ."</td>
557 <td class ='detail' style='width:7%;'>". htmlspecialchars( $row['subscriber_dob'], ENT_NOQUOTES) ."</td>
558 <td class ='detail' style='width:6%;'>". htmlspecialchars( $row['subscriber_sex'], ENT_NOQUOTES) ."</td>
559 <td class ='detail' style='width:9%;'>". htmlspecialchars( $row['subscriber_ss'], ENT_NOQUOTES) ."</td>
560 <td class ='detail' style='width:2%;'>
561 <img src='../../images/deleteBtn.png' title=' .htmlspecialchars( xl('Delete Row'), ENT_QUOTES) . ' style='cursor:pointer;cursor:hand;' onclick='deletetherow(\"" . $i."_". htmlspecialchars( $row['policy_number'], ENT_QUOTES) . "\")'>
573 <td class='norecord' colspan=9>
574 <div style='padding:5px;font-family:arial;font-size:13px;text-align:center;'>". htmlspecialchars( xl('No records found'), ENT_NOQUOTES) . "</div>
582 // To Show Eligibility Verification data
584 function show_eligibility_information($pid)
587 $query = " SELECT eligr.response_description as ResponseMessage,
588 DATE_FORMAT(eligv.eligibility_check_date, '%d %M %Y') as VerificationDate,
589 eligv.copay, eligv.deductible, eligv.deductiblemet,
590 if(eligr.response_status = 'A','Active','Inactive') as Status,
592 FROM eligibility_verification eligv
593 INNER JOIN eligibility_response eligr on eligr.response_id = eligv.response_id
594 INNER JOIN insurance_data insd on insd.id = eligv.insurance_id
595 INNER JOIN insurance_companies insc on insc.id = insd.provider
597 AND eligr.response_status = 'A'
598 AND eligv.eligibility_check_date = (SELECT max(eligibility_check_date)
599 FROM eligibility_verification
600 WHERE insurance_id = eligv.insurance_id)";
601 $result = sqlStatement($query, array($pid) );
603 $row = sqlFetchArray($result);
605 $showString .= "<br><div class='text'>" .
607 htmlspecialchars( xl('Insurance Provider'), ENT_NOQUOTES) . ":</b> " .
608 (!empty($row['name']) ? htmlspecialchars( $row['name'], ENT_NOQUOTES) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
611 htmlspecialchars( xl('Status'), ENT_NOQUOTES) . ":</b> " .
612 (!empty($row['ResponseMessage']) ? htmlspecialchars( $row['ResponseMessage'], ENT_NOQUOTES) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
615 htmlspecialchars( xl('Last Verified On'), ENT_NOQUOTES) . ":</b> " .
616 (!empty($row['VerificationDate']) ? htmlspecialchars( $row['VerificationDate'], ENT_NOQUOTES) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
618 "<b>" . htmlspecialchars( xl('Copay'), ENT_NOQUOTES) . ":</b> " .
619 (!empty($row['copay']) ? htmlspecialchars( $row['copay'], ENT_NOQUOTES) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
620 "<br><b>" . htmlspecialchars( xl('Deductible'), ENT_NOQUOTES) . ":</b> " .
621 (!empty($row['deductible']) ? htmlspecialchars( $row['deductible'], ENT_NOQUOTES) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
622 "<br><b>" . htmlspecialchars( xl('Deductible Met'), ENT_NOQUOTES) . ":</b> " .
623 (!empty($row['deductiblemet']) ? ($row['deductiblemet'] == 'Y' ? htmlspecialchars( xl('Yes'), ENT_NOQUOTES) : htmlspecialchars( xl('No'), ENT_NOQUOTES)) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
632 // Function to save the values in eligibility_response table
634 function eligibility_response_save($segmentVal,$vendorID)
639 $query = " SELECT count(*) as RecordsCount
640 FROM eligibility_response
641 WHERE response_description = ? and
642 response_vendor_id = ?";
644 $resCount = sqlStatement($query, array($segmentVal, $vendorID) );
650 $row = sqlFetchArray($resCount);
652 $resCount = $row['RecordsCount'];
659 $query = "INSERT into eligibility_response SET response_description =?,
660 response_vendor_id = ?,
661 response_create_date = now(),
662 response_modify_date = now()";
663 $res = sqlStatement($query, array($segmentVal, $vendorID) );
668 // Function to save the values in eligibility_verification table
670 function eligibility_verification_save($segmentVal,$x12PartnerId,$patientId)
675 // For fetching the response Id
677 $query = " SELECT response_id
678 FROM eligibility_response
679 WHERE response_description = ? and
680 response_vendor_id = ?";
682 $resId = sqlStatement($query, array($segmentVal, $x12PartnerId) );
684 // For fetching the insuarace data Id
686 $query = " SELECT id,copay
688 WHERE type = 'primary' and
691 $insId = sqlStatement($query, array($patientId) );
696 $row = sqlFetchArray($resId);
698 $responseId = $row['response_id'];
704 $row = sqlFetchArray($insId);
706 $insuranceId = $row['id'];
707 $copay = $row['copay'];
714 if(isset($insuranceId) && !empty($insuranceId)){
716 //Set up the sql variable binding array (this prevents sql-injection attacks)
717 $sqlBindArray = array();
718 $query = "INSERT into eligibility_verification SET response_id = ? ,
720 array_push($sqlBindArray, $responseId, $insuranceId);
724 $query .= "copay = ?,";
725 array_push($sqlBindArray, $copay);
727 $query .= "eligibility_check_date = now(),
728 create_date = now()";
729 $res = sqlStatement($query, $sqlBindArray);
734 // Function to fetch the Patient information - eligibility
736 function eligibility_information($insuranceId)
741 FROM eligibility_verification
742 WHERE insuranceid = ?";
744 $result = sqlStatement($query, array($insuranceId) );
745 $row = sqlFetchArray($result);
749 // return array of X12 partners
751 function getX12Partner() {
752 $rez = sqlStatement("select * from x12_partners");
753 for($iter=0; $row=sqlFetchArray($rez); $iter++)
754 $returnval[$iter]=$row;
759 // return array of provider usernames
760 function getUsernames() {
761 $rez = sqlStatement("select distinct username, lname, fname,id from users " .
762 "where authorized = 1 and username != ''");
763 for($iter=0; $row=sqlFetchArray($rez); $iter++)
764 $returnval[$iter]=$row;
769 // return formated array
771 function arrFormated(&$item, $key){
772 $item = strstr($item, '_');
773 $item = substr($item,1,strlen($item)-1);