-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgetvendors.php
More file actions
34 lines (26 loc) · 763 Bytes
/
Copy pathgetvendors.php
File metadata and controls
34 lines (26 loc) · 763 Bytes
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
//08.25.2015 ghh - this function is responsible for returning a list of
//vendor names and ID's for this specific server
function getVendors( )
{
global $db;
$query = "select * from Vendors";
if (!$result = $db->sql_query($query))
{
RestLog("Error 16522 in query: $query\n".$db->sql_error());
RestUtils::sendResponse(500, "16522 - There was a problem attempting to locate the PO"); //Internal Server Error
return false;
}
$i = 0;
while ( $row = $db->sql_fetchrow( $result ) )
{
$vendors[$i]['VendorID'] = $row['VendorID'];
$vendors[$i]['VendorName'] = $row['VendorName'];
$i++;
}
RestLog("Successful Request\n");
//08.10.2012 naj - return code 200 OK.
RestUtils::sendResponse(200,json_encode( stripHTML( $vendors ) ));
return true;
}
?>