forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prescription_drugname_lookup.php
34 lines (30 loc) · 1.04 KB
/
prescription_drugname_lookup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
// Copyright (C) 2008 Jason Morrill <[email protected]>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This file use is used specifically to look up drug names when
// writing a prescription. See the file:
// templates/prescriptions/general_edit.html
// for additional information
//
// Important - Ensure that display_errors=Off in php.ini settings.
//
include_once("../../interface/globals.php");
include_once("{$GLOBALS['srcdir']}/sql.inc");
include_once("{$GLOBALS['srcdir']}/formdata.inc.php");
$q = formData("q","G",true);
if (!$q) return;
$limit = $_GET['limit'];
$sql = "select drug_id, name from drugs where ".
" name like ('".$q."%')".
" order by name ".
" limit ".$limit;
$rez = sqlStatement($sql);
while ($row = sqlFetchArray($rez)) {
echo $row['name']."|".$row['drug_id']."\n";
}
?>