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
67
68
69
70
71
72
73
74
75
76
77
78
79
|
<? // include Á¤ÀÇ include_once("dbconnect.php"); // DB Connect Information
// Notice Error ¹æÁö if(!isset($_POST['userId'])) $_POST['userId'] = ""; //»ç¿ëÀÚ ID if(!isset($_POST['serchtype'])) $_POST['serchtype'] = ""; //°Ë»ö±¸ºÐ( 0:id¿¡ ÇØ´çÇÏ´Â »ç¾÷ÀÚ¹øÈ£, 1:ÇöÀçÀÜ¿©Æ÷ÀÎÆ®, 2:¸¸±â³â¿ù, 3:»ç¿ë¿ä±Ý) if(!isset($_POST['pricetype'])) $_POST['pricetype'] = ""; //°Ë»ö±¸ºÐ( 1:ÀüÀÚ¼¼±Ý°è»ê¼, 2:¸ÞÀÏ¸í¼¼¼, 3:SMSÃæÀü, 4:±Þ¿©¸í¼¼E¸ÞÀÏ, 5:E¸ÞÀÏ °è»ê¼)
// º¯¼ö ¼±¾ð $userId = $_POST['userId']; // »ç¿ëÀÚ ID $serchtype = $_POST['serchtype']; // °Ë»ö±¸ºÐ $pricetype = $_POST['pricetype']; // ¿ä±ÝÁ¤º¸±¸ºÐ $userInfo = ""; // »ç¿ëÀÚ Á¤º¸ $priceInfo = ""; // »ç¿ë¿ä±ÝÁ¤º¸ $errorMsg = ""; // Error ¸Þ¼¼Áö
// ÇʼöÇ׸ñÀÌ ´©¶ô µÇ¾úÀ» °æ¿ì Error Message Ãâ·Â ÈÄ Á¾·á. if($userId == "" ){ echo $errorMsg = "ÇʼöÇ׸ñÀÌ ´©¶ô µÇ¾ú½À´Ï´Ù."; // µð¹ö±ë ¸ðµå /*/ foreach($_POST as $k => $value){ echo $k."=>".$v."<br>"; } */ exit; }
$sql = "select a.id as userid, b.custname as custname, b.custnum as custnum, a.curpoint as curpoint, a.expire_date as expire_date from cust_cash as a "; $sql = $sql . " inner join customers as b on a.id = b.id "; $sql = $sql . " where a.id = '{$userId}' LIMIT 1 ";
$result = mysql_query($sql, $conn); while($row = mysql_fetch_assoc($result)){ $userInfo = $row; }
if($userInfo['userid'] == "" || $userInfo['userid'] == null){ echo $errorMsg = "ÇØ´ç ¾ÆÀ̵𸦠ãÀ»¼ö ¾ø½À´Ï´Ù."; exit; }
if($serchtype == "0") //»ç¾÷ÀÚµî·Ï¹øÈ£ { echo "[ok];custnum=".$userInfo['custnum'].";"; exit; } else if($serchtype == "1") //ÇöÀçÆ÷ÀÎÆ® { echo "[ok];curpoint=".$userInfo['curpoint'].";"; exit; } else if($serchtype == "2") //¸¸±â³â¿ù { echo "[ok];expire_date=".$userInfo['expire_date'].";"; exit; } else if($serchtype == "3") //¿ä±ÝÁ¤º¸ { $sql = "select usepoint1, usepoint2, usepoint3, usepoint4 from cash_price where use_type_cde = '{$pricetype}' "; $result = mysql_query($sql, $conn); while($row = mysql_fetch_assoc($result)){ $priceInfo = $row; } if($priceInfo['usepoint1'] == "" || $priceInfo['usepoint1'] == null){ echo $errorMsg = "¿ä±ÝÁ¤º¸¸¦ °¡Á®¿ÀÁö ¸øÇß½À´Ï´Ù!"; exit; } echo "[ok];usepoint=".$priceInfo['usepoint1'].",".$priceInfo['usepoint2'].",".$priceInfo['usepoint3'].",".$priceInfo['usepoint4'].";"; exit;
} ?>
|