-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajax_getmember.php
66 lines (59 loc) · 1.71 KB
/
ajax_getmember.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
require_once("shared.php");
$rc = -1;
$msg = "";
$member = Array();
try
{
if (isset($_POST['uuid']) && isset($_POST['memberuuid']))
{
$uuid = $_POST['uuid'];
$memberuuid = $_POST['memberuuid'];
$userid = SharedGetUserIdFromUuid($uuid, $dblink);
$dbselect = "select " .
"u1.firstname," .
"u1.lastname," .
"u1.itype," .
"u1.email," .
"u1.mobile," .
"u1.phone," .
"u1.regno," .
"u1.company," .
"u1.address1," .
"u1.address2," .
"u1.city," .
"u1.postcode," .
"u1.state," .
"u1.comments," .
"u1.datecreated," .
"u1.datemodified " .
"from " .
"users u1 " .
"where " .
"u1.uuid=" . SharedNullOrQuoted($memberuuid, 50, $dblink);
error_log($dbselect);
if ($dbresult = SharedQuery($dbselect, $dblink))
{
if ($numrows = SharedNumRows($dbresult))
{
while ($dbrow = SharedFetchArray($dbresult))
$member = $dbrow;
$rc = 0;
}
else
$msg = "Unable to fetch member details...";
}
else
$msg = "Unable to query member details...";
}
else
$msg = "Missing parameters...";
}
catch (Exception $e)
{
$msg = "Unable to fetch member...";
}
$response = array("rc" => $rc, "msg" => $msg, "member" => $member);
$json = json_encode($response);
echo $json;
?>