1df05bc3 by sayhoChun

adduser/login API tested, img upload tested, paging revised

1 parent 984c7470
Showing 328 changed files with 415 additions and 419 deletions
......@@ -276,19 +276,8 @@ if(! class_exists("ApiBase") ) {
$sql = "
SELECT
U.*
,
CASE U.member_type
WHEN 'M' THEN
IFNULL((SELECT G.name FROM tbl_user_group G WHERE G.no = U.group_fk LIMIT 1), '')
WHEN 'V' THEN
IFNULL((SELECT G.name FROM tbl_user_group G WHERE G.no = U.group_fk LIMIT 1), '')
ELSE ''
END AS group_name
, IFNULL((SELECT F.file_vir_name FROM tbl_file F WHERE F.pa_no = U.no AND F.file_type = '{$this->FILE_TYPE_MEM}' LIMIT 1), '') AS user_img
, IFNULL((SELECT user_fk FROM tbl_room WHERE user_fk = '{$userNo}' AND `status` = 'Y'), 0) AS hasRoom
, IFNULL((SELECT vip_fk FROM tbl_building WHERE vip_fk = '{$userNo}' AND `status` = 'Y'), 0) AS hasBuilding
FROM v_alive_user U
WHERE U.no = '{$userNo}'
FROM tblUser U
WHERE U.userNo = '{$userNo}' AND status=1
LIMIT 0, 1
";
......@@ -300,25 +289,7 @@ if(! class_exists("ApiBase") ) {
}
else
{
if($userInfo["member_type"] == $this->MEM_TYPE_MEMBER || $userInfo["member_type"] == $this->MEM_TYPE_VIP)
{
$sql = "
SELECT
*
, (longitude / 1E6) AS longitude
, (latitude / 1E6) AS latitude
FROM tbl_user_group
WHERE `no` = '{$userInfo["group_fk"]}' AND `status` = 'Y'
LIMIT 1
";
$groupInfo = $this->getRow($sql);
if($groupInfo != null)
$userInfo["groupInfo"] = $groupInfo;
}
unset($userInfo["userPWD"]) ;
unset($userInfo["userPWDEnc"]) ;
unset($userInfo["userPwd"]) ;
}
return $userInfo;
......
......@@ -14,6 +14,17 @@ if (! class_exists("ApiBoard"))
//공지사항 리스트
function getListOfNotice(){
$sql="
SELECT COUNT(*)
FROM tblNotice
ORDER BY noticeNo DESC
";
$this->rownum=$this->getValue($sql, "rn");
$this->initPage();
$this->setPageForDevice($this->rownum);
$sql="
SELECT *
FROM tblNotice
......@@ -41,6 +52,15 @@ if (! class_exists("ApiBoard"))
//이벤트 리스트
function getListOfEvent(){
$sql="
SELECT COUNT(*)
FROM tblEvent
ORDER BY eventNo DESC
";
$this->rownum=$this->getValue($sql, "rn");
$this->initPage();
$this->setPageForDevice($this->rownum);
$sql="
SELECT *
FROM tblEvent
ORDER BY eventNo DESC
......@@ -74,16 +94,23 @@ if (! class_exists("ApiBoard"))
//자유게시판 게시물 작성
function saveBoard(){
$imgResult = $this->inFn_Common_fileSave($_FILES);
$title=$this->req["title"];
//$userFk = $this->appUser["no"];
$userFk=$this->req["userFk"];
$imgPathBoard1=$this->req["imgPathBoard1"];
$imgPathBoard2=$this->req["imgPathBoard2"];
$imgPathBoard3=$this->req["imgPathBoard3"];
$imgPathBoard1 = $imgResult["imgPathBoard1"]["saveURL"] != null ? $imgResult["imgPathBoard1"]["saveURL"] : $this->req["imgPathBoard1"];
$imgPathBoard2 = $imgResult["imgPathBoard2"]["saveURL"] != null ? $imgResult["imgPathBoard2"]["saveURL"] : $this->req["imgPathBoard2"];
$imgPathBoard3 = $imgResult["imgPathBoard3"]["saveURL"] != null ? $imgResult["imgPathBoard3"]["saveURL"] : $this->req["imgPathBoard3"];
$imgPathBoard4 = $imgResult["imgPathBoard4"]["saveURL"] != null ? $imgResult["imgPathBoard4"]["saveURL"] : $this->req["imgPathBoard4"];
$imgPathBoard5 = $imgResult["imgPathBoard5"]["saveURL"] != null ? $imgResult["imgPathBoard5"]["saveURL"] : $this->req["imgPathBoard5"];
$content=$this->req["content"];
$sql="
INSERT INTO tblBoard(userFk, title, imgPathBoard1, imgPathBoard2, imgPathBoard3, content, status, regDate)
INSERT INTO tblBoard(userFk, title, imgPathBoard1, imgPathBoard2, imgPathBoard3, imgPathBoard4, imgPathBoard5, content, status, regDate)
VALUES
(
'{$userFk}',
......@@ -91,6 +118,8 @@ if (! class_exists("ApiBoard"))
'{$imgPathBoard1}',
'{$imgPathBoard2}',
'{$imgPathBoard3}',
'{$imgPathBoard4}',
'{$imgPathBoard5}',
'{$content}',
1,
NOW()
......@@ -152,9 +181,10 @@ if (! class_exists("ApiBoard"))
//$boardNo = $this->req["no"];
$boardNo=1;
$sql="
SELECT *
FROM tblBoard
WHERE boardNo='{$boardNo}' AND status=1
SELECT B.*, U.userID, U.userName
FROM tblBoard B
JOIN tblUser U ON B.userFk=U.userNo
WHERE boardNo='{$boardNo}' AND B.status=1
LIMIT 1
";
$result=$this->getRow($sql);
......@@ -180,17 +210,21 @@ if (! class_exists("ApiBoard"))
//고객센터 게시물 저장
function saveCS(){
$imgResult = $this->inFn_Common_fileSave($_FILES);
$imgPathCS1 = $imgResult["imgPathCS1"]["saveURL"] != null ? $imgResult["imgPathCS1"]["saveURL"] : $this->req["imgPathCS1"];
$imgPathCS2 = $imgResult["imgPathCS2"]["saveURL"] != null ? $imgResult["imgPathCS2"]["saveURL"] : $this->req["imgPathCS2"];
$imgPathCS3 = $imgResult["imgPathCS3"]["saveURL"] != null ? $imgResult["imgPathCS3"]["saveURL"] : $this->req["imgPathCS3"];
$imgPathCS4 = $imgResult["imgPathCS4"]["saveURL"] != null ? $imgResult["imgPathCS4"]["saveURL"] : $this->req["imgPathCS4"];
$imgPathCS5 = $imgResult["imgPathCS5"]["saveURL"] != null ? $imgResult["imgPathCS5"]["saveURL"] : $this->req["imgPathCS5"];
$title=$this->req["title"];
//$userFk = $this->appUser["no"];
$userFk=$this->req["userFk"];
$targetType=$this->req["targetType"];
$imgPathCS1=$this->req["imgPathCS1"];
$imgPathCS2=$this->req["imgPathCS2"];
$imgPathCS3=$this->req["imgPathCS3"];
$content=$this->req["content"];
$sql="
INSERT INTO tblCustomerService(userFk, title, targetType, imgPathCS1, imgPathCS2, imgPathCS3, content, status, regDate)
INSERT INTO tblCustomerService(userFk, title, targetType, imgPathCS1, imgPathCS2, imgPathCS3, imgPathCS4, imgPathCS5, content, status, regDate)
VALUES
(
'{$userFk}',
......@@ -199,6 +233,8 @@ if (! class_exists("ApiBoard"))
'{$imgPathCS1}',
'{$imgPathCS2}',
'{$imgPathCS3}',
'{$imgPathCS4}',
'{$imgPathCS5}',
'{$content}',
1,
NOW()
......@@ -261,9 +297,10 @@ if (! class_exists("ApiBoard"))
//$csNo=$this->req["no"];
$csNo=2;
$sql="
SELECT *
FROM tblCustomerService
WHERE csNo='{$csNo}' AND status=1
SELECT CS.*, U.userID, U.userName
FROM tblCustomerService CS
JOIN tblUser U ON CS.userFk=U.userNo
WHERE csNo='{$csNo}' AND CS.status=1
LIMIT 1
";
$result=$this->getRow($sql);
......@@ -339,9 +376,9 @@ if (! class_exists("ApiBoard"))
$companyNo=1;
$sql="
SELECT *
FROM tblCompany
WHERE companyNo='{$companyNo}' AND status=1
SELECT C.*
FROM tblCompany C
WHERE companyNo='{$companyNo}' AND C.status=1
LIMIT 1
";
$result=$this->getRow($sql);
......@@ -525,11 +562,22 @@ if (! class_exists("ApiBoard"))
function getListOfMyProductionSpec(){
//$userFk=$this->appUser["no"];
$userFk=1;
$sql="
SELECT productionNo, companyName, requestDate
SELECT COUNT(*)
FROM tblProductionSpec
WHERE userFk='{$userFk}'
ORDER BY productionNO DESC
WHERE userFk='{$userFk}' AND status=1
ORDER BY productionNo DESC
";
$this->rownum=$this->getValue($sql, "rn");
$this->initPage();
$this->setPageForDevice($this->rownum);
$sql="
SELECT productionNo, companyName, requestDate
FROM tblProductionSpec
WHERE userFk='{$userFk}' AND status=1
ORDER BY productionNo DESC
";
$list=$this->getArray($sql);
......@@ -557,6 +605,17 @@ if (! class_exists("ApiBoard"))
}
$sql="
SELECT COUNT(*)
FROM tblProductionSpec
{$where}
ORDER BY productionNo DESC
";
$this->rownum=$this->getValue($sql, "rn");
$this->initPage();
$this->setPageForDevice($this->rownum);
$sql="
SELECT productionNo, companyName, requestDate
FROM tblProductionSpec
{$where}
......@@ -626,10 +685,22 @@ if (! class_exists("ApiBoard"))
$userNo=$this->appUser["no"];
$sql="
SELECT COUNT(*)
FROM tblProductionSpec PS
JOIN tblLike L ON PS.productionNo=L.productionNo
WHERE L.userNo='{$userNo}' AND PS.status=1
ORDER BY regDate DESC
";
$this->rownum=$this->getValue($sql, "rn");
$this->initPage();
$this->setPageForDevice($this->rownum);
$sql="
SELECT PS.productionNo, companyName, requestDate
FROM tblProductionSpec PS
JOIN tblLike L ON PS.productionNo=L.productionNo
WHERE L.userNo='{$userNo}'
WHERE L.userNo='{$userNo}' AND PS.status=1
ORDER BY regDate DESC
";
$result=$this->getArray($sql);
return $this->makeResultJson("1","", $result);
......
......@@ -46,7 +46,7 @@ if (! class_exists("ApiStatic")){
//메인 페이지 정보
function getMain(){
$sql="
SELECT imgPathMain, phrase1, phrase2, imgPathBuiltIn, imgPathInsulation, imgPathFreezerV, imgPathSpecial, imgPathPowerGate, imgPathWingBody, imgPathFreezerC
SELECT imgPathMainLogo, imgPathMain, phrase1, phrase2, imgPathBuiltIn, imgPathAxle, imgPathFreezerV, imgPathSpecial, imgPathPowerGate, imgPathWingBody, imgPathFreezerC
FROM tblMain
LIMIT 1
";
......@@ -81,9 +81,21 @@ if (! class_exists("ApiStatic")){
//메인 페이지 회사정보
function getKCBriefInfo(){
$sql="
SELECT address, telephone, fax, eMail
SELECT factoryName1, address1, telephone1, fax1, eMail1, factoryName2, address2, telephone2, fax2, eMail2
FROM tblKCSpecialVehicleInfo
";
$result=$this->getRow($sql);
return $this->makeResultJson("1", "", $result);
}
//전화연결시 본사 이름, 전화번호
function getKCContract(){
$sql="
SELECT factoryName1, telephone1, factoryName2, telephone2
FROM tblKCSpecialVehicleInfo
";
$result=$this->getRow($sql);
return $this->makeResultJson("1", "", $result);
}
//탑차 분류별 리스트
......@@ -104,6 +116,7 @@ if (! class_exists("ApiStatic")){
function getInfoOfVehicle(){
$vehicleNo=$this->req["vehicleNo"];
$vehicleNo=1;
echo $vehicleNo;
$sql="
SELECT *
......@@ -137,6 +150,16 @@ if (! class_exists("ApiStatic")){
$result=$this->getArray($sql);
return $this->makeResultJson("1", "", $result);
}
function getListOfEmergency(){
$sql="
SELECT *
FROM tblASEmergency
WHERE status=1
";
$result=$this->getArray($sql);
return $this->makeResultJson("1", "", $result);
}
}
......
......@@ -15,59 +15,23 @@ if (! class_exists("ApiUser"))
{
parent::__construct($req);
}
// 회원 포인트 조회 (http://106.240.232.36:8004/action_front.php?cmd=ApiUser.getInfoOfAvailPoint)
function getInfoOfAvailPoint()
{
$no = $this->appUser["no"];
$sql = "
SELECT
CASE
WHEN SUM(AMT) IS NULL
THEN 0
ELSE SUM(AMT)
END AS AVAIL_AMT
FROM tbl_point_trans
WHERE user_fk = '{$no}' AND trans_type='I'
";
$avail_amt = $this->getValue($sql, "AVAIL_AMT");
$sql = "
SELECT
CASE
WHEN SUM(AMT) IS NULL
THEN 0
ELSE SUM(AMT)
END AS PAY_AMT
FROM tbl_point_trans
WHERE user_fk = '{$no}' AND trans_type='O'
";
$pay_amt = $this->getValue($sql, "PAY_AMT");
$use_amt = $avail_amt - $pay_amt;
return $this->makeResultJson("1", "", $use_amt);
}
// 회원가입 여부 판단 (http://106.240.232.36:8004/action_front.php?cmd=ApiUser.initLogin&id=aa)
function initLogin()
{
$id = $this->req["id"];
$userID = $this->req["userID"];
$sql = "
SELECT id
FROM v_alive_user
WHERE id='{$id}'
SELECT userID
FROM tblUser
WHERE userID='{$userID}' AND status=1
LIMIT 0,1
";
$id = $this->getValue($sql, "id");
$userID = $this->getValue($sql, "userID");
$returnCode = - 1;
if ($id != "")
if ($userID != "")
{
$returnCode = 1;
}
......@@ -75,99 +39,127 @@ if (! class_exists("ApiUser"))
return $this->makeResultJson($returnCode, "");
}
// 회원 그룹 (http://106.240.232.36:8004/action_front.php?cmd=ApiUser.getListOfMemberGroup)
function getListOfMemberGroup()
{
$name = $this->req["name"];
$addQuery = "";
if ($name != "")
$addQuery .= " AND name like '%" . $name . "%'";
function removeSpecials($string){
return preg_replace("/[ #\&\+\-%@=\/\\\:;,\.'\"\^`~\_|\!\?\*$#<>()\[\]\{\}]/i", "", $string);
}
function checkIDRedundancy(){
$userID=$this->req["userID"];
$sql = "
SELECT *
FROM v_alive_user_group
WHERE 1=1 {$addQuery}
$sql="
SELECT *
FROM tblUser
WHERE userID='{$userID}' AND status=1
LIMIT 0, 1
";
$result=$this->getRow($sql);
$list = $this->getArray($sql);
if($result != null)
return $this->makeResultJson(-100, "사용할 수 없는 아이디 입니다");
else
return $this->makeResultJson(1, "사용할 수 있는 아이디 입니다");
if (sizeof($list) > 0)
return $this->makeResultJson("1", "", $list);
else
return $this->makeResultJson("-1000", "내역이 없습니다.");
}
function checkNickRedundancy(){
$nickName=$this->req["nickName"];
$sql="
SELECT *
FROM tblUser
WHERE nickName='{$nickName}' AND status=1
LIMIT 0, 1
";
$result=$this->getRow($sql);
if($result != null)
return $this->makeResultJson(-100, "사용할 수 없는 닉네임 입니다");
else
return $this->makeResultJson(1, "사용할 수 있는 닉네임 입니다");
}
// 회원 가입 (http://106.240.232.36:8004/action_front.php?cmd=ApiUser.memberJoin)
function memberJoin()
{
$id = $this->req["id"];
$name = $this->req["name"];
$tel = str_replace(" ", "", $this->req["tel"]);
$app_type = $this->req["app_type"];
$group_fk = $this->req["group_fk"];
$regiType = $this->req["regiType"];
$memType = $this->req["memType"];
$deviceID = $this->req["deviceID"];
$userID = $this->req["userID"];
$userPwd = $this->req["userPwd"];
$userPwdConfirm=$this->req["userPwdConfirm"];
$userName = $this->req["userName"];
$nickName = $this->req["nickName"];
$userTel = str_replace(" ", "", $this->req["userTel"]);
$userVehicleTON=$this->req["userVehicleTON"];
$userVehicleName=$this->req["userVehicleName"];
$userVehicleType=$this->req["userVehicleType"];
$userVehicleWish=$this->req["userVehicleWish"];
$deviceTypeID = $this->req["deviceTypeID"];
$storeTypeID = $this->req["storeTypeID"];
$deviceID = $this->req["deviceID"];
$registrationKey = $this->req["registrationKey"];
$appVersion = $this->req["appVersion"];
//if($nickName=="")
//$nickName=$userName;
// $status = ($memType == this.MEM_TYPE_NOMAL) ? "" : "" ;
$sql = "
SELECT *
FROM tbl_user
WHERE `id` = '{$id}' AND `status` = 'Y'
FROM tblUser
WHERE `userID` = '{$userID}' AND `status` = 1
LIMIT 1
";
$regInfo = $this->getRow($sql);
if($regInfo != null)
return $this->makeResultJson(-100, "이미 회원가입을 하셨습니다.");
return $this->makeResultJson(-100, "아이디 중복을 확인해 주세요");
// 멤버십 회원 가입 일경우 전화번호 필수
if ($this->MEM_TYPE_HOLD == $memType)
{
if($tel == "")
return $this->makeResultJson(-101, "제휴회원 요청시 전화번호는 필수 입력사항입니다.");
$sql = "
SELECT *
FROM tbl_user
WHERE `tel` = '{$tel}' AND `status` = 'Y' AND `member_type` != '{$this->MEM_TYPE_NOMAL}'
LIMIT 1
";
$telResult = $this->getRow($sql);
$sql="SELECT * FROM tblUser WHERE nickName='{$nickName} AND status=1'";
$regInfo=$this->getRow($sql);
if($regInfo != null)
return $this->makeResultJson(-101, "닉네임 중복을 확인해 주세요");
if($telResult != null)
return $this->makeResultJson(-102, "이미 가입된 멤버십 회원이십니다.");
if(strlen($userID)<6)
return $this->makeResultJson(-102, "아이디는 여섯자리 이상이어야 합니다");
if(strlen($userPwd) != strlen($this->removeSpecials($userPwd))) {
return $this->makeResultJson(-103, "비밀번호에는 특수문자가 포함될 수 없습니다.");
}
else if(strlen($userPwd) < 4)
return $this->makeResultJson(-104, "비밀번호는 네 자리 이상이어야 합니다");
if($userPwd != $userPwdConfirm)
return $this->makeResultJson(-105, "비밀번호가 일치하지 않습니다");
/*
if($userTel == "")
return $this->makeResultJson(-105, "전화번호는 필수 입력사항입니다.");
*/
$insAssoc = Array(
"id" => $id,
"name" => $name,
"tel" => $tel,
"app_type" => $app_type,
"group_fk" => $group_fk,
"member_type" => $memType,
"regi_type" => $regiType,
"device_id" => $deviceID,
"device_type_id" => $deviceTypeID,
"storeType_id" => $storeTypeID,
"reg_dt" => "now()",
"app_version" => $appVersion,
"registration_key" => $registrationKey,
"status" => "Y"
"userType"=>1,
"userID" => $userID,
"userPwd"=> $userPwd,
"userName" => $userName,
"nickName" => $nickName,
"userTel" => $userTel,
"userVehicleTON" => $userVehicleTON,
"userVehicleName" => $userVehicleName,
"userVehicleType" => $userVehicleType,
"userVehicleWish" => $userVehicleWish,
"deviceTypeID" => $deviceTypeID,
"deviceID" => $deviceID,
"registrationKey" => $registrationKey,
"push" => 1,
"appVersion" => $appVersion,
"lastLoginDate"=>"now()",
"status" => 1,
"regDate" => "now()"
);
$result = $this->techOfInsertForUpdate("tbl_user", $insAssoc);
$result = $this->techOfInsertForUpdate("tblUser", $insAssoc);
$no = $this->mysql_insert_id();
/*
$file_vir_name = "";
$file_org_name = "";
......@@ -192,7 +184,7 @@ if (! class_exists("ApiUser"))
);
$fileResult = $this->techOfInsertForUpdate("tbl_file", $insFile);
*/
if ($result > 0)
{
$returnCode = "1";
......@@ -207,115 +199,26 @@ if (! class_exists("ApiUser"))
return $this->makeResultJson($returnCode, $returnMessage, $userInfo);
}
/**
* 멤버쉽 신청
* @return string
*/
function reqMembership()
{
$memType=$this->req["memType"];
$name = $this->req["name"];
$tel = str_replace(" ", "", $this->req["tel"]);
$group_fk = $this->req["group_fk"];
$no = $this->appUser["no"];
$sql = "
SELECT *
FROM tbl_user
WHERE `no` = '{$no}' AND `status` = 'Y'
LIMIT 1
";
$userInfo = $this->getRow($sql);
if($userInfo == null)
{
return $this->makeResultJson("-10", "비정상 접근");
}
else if($userInfo["member_type"] != 'N')
{
return $this->makeResultJson("-100", "이미 멤버쉽을 신청하였습니다.");
}
else if($tel == "")
{
return $this->makeResultJson(-101, "제휴회원 요청시 전화번호는 필수 입력사항입니다.");
}
else
{
$sql = "
SELECT *
FROM tbl_user
WHERE `tel` = '{$tel}' AND `status` = 'Y' AND `member_type` != '{$this->MEM_TYPE_NOMAL}'
LIMIT 1
";
$telResult = $this->getRow($sql);
if($telResult != null)
return $this->makeResultJson(-102, "이미 가입된 멤버십 회원이십니다.");
// 파일 업로드
if ($_FILES != null && sizeof($_FILES) > 0)
{
// 삭제함
$sql = "
DELETE FROM tbl_file WHERE pa_no = '{$no}' AND file_type = '{$this->FILE_TYPE_MEM}'
";
$this->update($sql);
$updateFileData = $this->inFn_Common_fileSave($_FILES);
$file_vir_name = $updateFileData["file"]["saveURL"];
$file_org_name = $updateFileData["file"]["name"];
$insFile = Array(
"file_org_name" => $file_org_name,
"file_vir_name" => $file_vir_name,
"reg_dt" => "now()",
"pa_no" => $no,
"file_type" => $this->FILE_TYPE_MEM
);
$fileResult = $this->techOfInsertForUpdate("tbl_file", $insFile);
}
$sql = "
UPDATE tbl_user
SET
name = '{$name}'
, tel = '{$tel}'
, group_fk = '{$group_fk}'
, member_type = '{$memType}'
WHERE `no` = '{$no}'
";
$this->update($sql);
return $this->makeResultJson("1", "저장되었습니다.", $this->inFn_ApiBase_getInfoOfUser($no));
}
}
// 회원 로그인 (http://106.240.232.36:8004/action_front.php?cmd=ApiUser.userLogin)
function userLogin()
{
$id = $this->req["id"];
$userID = $this->req["userID"];
$deviceID = $this->req["deviceID"];
$deviceTypeID = $this->req["deviceTypeID"];
$storeTypeID = $this->req["storeTypeID"];
$registrationKey = $this->req["registrationKey"];
$appVersion = $this->req["appVersion"];
$param = Array(
$id,
$userID,
$deviceID,
$deviceTypeID,
$registrationKey,
$storeTypeID,
$appVersion
);
$sql = $this->strCallProc3("uspU_loginUser", $param);
$result = $this->getMultiArray($sql);
if ($result[0][0]["v_returnCode"] > 0)
......@@ -334,94 +237,46 @@ if (! class_exists("ApiUser"))
// 비동기 푸시키 갱신 API
function setUserRegistrationKey()
{
$no = $this->appUser["no"];
$registration_key = $this->req["registration_key"];
$userNo = $this->appUser["no"];
$registrationKey = $this->req["registrationKey"];
if ($no != "-1")
{
$sql = "
UPDATE tbl_user
SET registration_key = '{$registration_key}'
WHERE no = '{$no}'
UPDATE tblUser
SET registrationKey = '{$registrationKey}'
WHERE userNo = '{$userNo}'
";
$this->update($sql);
}
}
// 민원 정보공유 푸시 설정
function setCommentPushOnOff()
{
$no = $this->appUser["no"];
$is_push = $this->req["is_push"];
$sql = "
UPDATE tbl_user
SET comm_push = '{$is_push}'
WHERE `no` = '{$no}'
";
$result = $this->update($sql);
return $this->makeResultJson("1", "");
}
// 민원 정보공유 푸시 설정
function setInfoPushOnOff()
{
$no = $this->appUser["no"];
$is_push = $this->req["is_push"];
$sql = "
UPDATE tbl_user
SET info_push = '{$is_push}'
WHERE `no` = '{$no}'
";
$result = $this->update($sql);
return $this->makeResultJson("1", "");
}
// 푸시 설정
function setPushOnOff()
{
$no = $this->appUser["no"];
$is_push = $this->req["is_push"];
$userNo = $this->appUser["no"];
$push = $this->req["push"];
$sql = "
UPDATE tbl_user
SET is_push = '{$is_push}'
WHERE `no` = '{$no}'
SET push = '{$push}'
WHERE `userNo` = '{$userNo}'
";
$result = $this->update($sql);
return $this->makeResultJson("1", "");
}
// 렌트 푸시 설정
function setRentOnOff()
{
$no = $this->appUser["no"];
$is_rent = $this->req["is_push"];
$sql = "
UPDATE tbl_user
SET is_rent = '{$is_rent}'
WHERE `no` = '{$no}'
";
$result = $this->update($sql);
return $this->makeResultJson("1", "");
}
// 로그아웃
function userLogout()
{
$no = $this->appUser["no"];
$userNo = $this->appUser["no"];
// 푸시키 초기화
$sql = "
UPDATE tbl_user
SET registration_key = ''
WHERE no = '{$no}'
UPDATE tblUser
SET registrationKey = ''
WHERE userNo = '{$userNo}'
";
$this->update($sql);
......@@ -432,13 +287,18 @@ if (! class_exists("ApiUser"))
function modifyUserInfo()
{
$userNo = $this->appUser["no"];
$name = $this->req["name"];
$tel = $this->req["tel"];
$group_fk = $this->req["group_fk"] ;
$groupName = $this->req["groupName"] ;
$is_file_change = $this->req["is_file_change"]; // NEW / DEL / NON
//$is_file_change = $this->req["is_file_change"]; // NEW / DEL / NON
$userPwd = $this->req["userPwd"];
$userPwdConfirm = $this->req["userPwdConfirm"];
$userName = $this->req["userName"];
$nickName = $this->req["nickName"];
$userTel = str_replace(" ", "", $this->req["userTel"]);
$userVehicleTON=$this->req["userVehicleTON"];
$userVehicleName=$this->req["userVehicleName"];
$userVehicleType=$this->req["userVehicleType"];
$userVehicleWish=$this->req["userVehicleWish"];
/*
// 삭제함
if ($is_file_change != "NON")
{
......@@ -466,67 +326,31 @@ if (! class_exists("ApiUser"))
$fileResult = $this->techOfInsertForUpdate("tbl_file", $insFile);
}
*/
$sql="SELECT * FROM tblUser WHERE nickName='{$nickName} AND status=1'";
$regInfo=$this->getRow($sql);
if($regInfo != null)
return $this->makeResultJson(-100, "닉네임 중복을 확인해 주세요");
if($userPwd != $userPwdConfirm)
return $this->makeResultJson(-101, "비밀번호 가 일치하지 않습니다");
$sql = "
UPDATE tbl_user
SET
name = '{$name}'
, group_fk = '{$group_fk}'
, tel = '{$tel}'
WHERE `no` = '{$userNo}'
userPwd='{$userPwd}',
userName='{$userName}',
nickName='{$nickName}',
userTel='{$userTel}',
userVehicleTON='{$userVehicleTON}',
userVehicleName='{$userVehicleName}',
userVehicleType='{$userVehicleType}',
userVehicleWish='{$userVehicleWish}'
WHERE `userNo` = '{$userNo}'
";
$this->update($sql);
return $this->makeResultJson("1", "저장되었습니다.", $this->inFn_ApiBase_getInfoOfUser($userNo));
}
/**
* 회원 사용 포인트 내역 조회
*
* @return string
*/
function getListOfUserPoint()
{
$userNo = $this->appUser["no"];
$this->initPage();
$sql = "
SELECT COUNT(*)
FROM tbl_point_trans PT
JOIN tbl_shop S ON(PT.shop_fk = S.no)
WHERE PT.user_fk = '{$userNo}' AND PT.trans_type = 'O' AND PT.pay_type = '{$this->PAY_TYPE_USE}'
";
$this->rownum = $this->getValue($sql, "rn");
$this->setPage($this->rownum);
$sql = "
SELECT
PT.*
, S.name AS shop_name
FROM tbl_point_trans PT
JOIN tbl_shop S ON(PT.shop_fk = S.no)
WHERE PT.user_fk = '{$userNo}' AND PT.trans_type = 'O' AND PT.pay_type = '{$this->PAY_TYPE_USE}'
ORDER BY PT.no DESC
LIMIT {$this->startNum}, {$this->endNum}
";
$list = $this->getArray($sql);
$addData = Array(
"start_date" => date('Y.m.01', time()),
"end_date" => date('Y.m', time()) . "." . date('t', time()),
"avail_point" => $this->inFn_Common_getUserPointBalance($userNo)
);
if (sizeof($list) > 0)
return $this->makeResultJson("1", "", $list, $addData);
else
return $this->makeResultJson("-1000", "내역이 없습니다.", "", $addData);
return $this->makeResultJson("1", "저장되었습니다.", $this->inFn_ApiBase_getInfoOfUser($userNo));
}
/**
......@@ -537,9 +361,8 @@ if (! class_exists("ApiUser"))
$no = $this->req["no"];
$userInfo = $this->inFn_ApiBase_getInfoOfUser($no);
$addData = Array("avail_point" => $this->inFn_Common_getUserPointBalance($no));
return $this->makeResultJson("1", "", $userInfo, $addData);
return $this->makeResultJson("1", "", $userInfo);
}
function delUser(){
......@@ -547,7 +370,7 @@ if (! class_exists("ApiUser"))
$sql="
UPDATE tblUser
SET expireDate=DATE_FORMAT(NOW() + interval 3 MONTH, '%Y%m%d')
SET expireDate=DATE_FORMAT(NOW() + interval 3 DAY, '%Y%m%d')
WHERE userNo='{$userNo}' AND status=1
";
}
......
......@@ -51,8 +51,16 @@
<script type="text/javascript" src="/common/js/ajaxupload.3.6.js"></script>
<script type="text/javascript" src="/common/js/imgPreview.js"></script>
<script type="text/javascript" src="/common/js/jquery.form.js"></script>
<script src="/admin/inc/fileUpload/fileUploadJS.js"></script>
<script type="text/javascript">
$(document).ready(function(){
initFileUpload(101);
initFileUpload(102);
initFileUpload(103);
initFileUpload(104);
initFileUpload(105);
var FORM_TARGET_CLS_NM = ".data" ; // 폼을 동적 wrap 할 타겟 ID이름
var FORM_NAME = "alf" ; // 폼이름
var FORM_METHOD = "POST" ; // 폼 메쏘드
......@@ -86,17 +94,14 @@ $(document).ready(function(){
}) ;
$(".saveBoard").click2(function(){
$.ajax({
$("#jData").ajaxSubmit({
type: 'post',
url : "/action_front.php?cmd=ApiBoard.saveBoard",
async : false,
cache : false,
data:{
"title" : "제목제목제목",
"title" : "이미지",
"userFk" : 1,
"imgPathBoard1" : "경로1",
"imgPathBoard2" : "경로2",
"imgPathBoard3" : "경로3",
"content" : "내용내용내용"
},
success : function(data){
......@@ -131,6 +136,58 @@ $(document).ready(function(){
});
}) ;
$(".login").click2(function(){
$.ajax({
type: 'post',
url : "/action_front.php?cmd=ApiUser.userLogin",
async : false,
cache : false,
data:{
"userID" : "fishcreek",
"deviceID" : "device",
"deviceTypeID" : 2,
"registrationKey" : "regKeyregKeyregKeyregKeyregKeyregKeyregKeyregKeyregKey",
"appVersion" : "v1.0"
},
success : function(data){
alert(data.returnmessage);
},
error : function(req, res, error){
alert(req+res+error);
}
});
}) ;
$(".memberJoin").click2(function(){
$.ajax({
type: 'post',
url : "/action_front.php?cmd=ApiUser.memberJoin",
async : false,
cache : false,
data:{
"userID" : "ellivga",
"userPwd" : "device",
"userName" : "세호",
"nickName" : "device",
"userTel" : "01026264848",
"userVehicleTON" : 21,
"userVehicleName" : "내장탑차",
"userVehicleType" : "HY",
"userVehicleWish" : "냉동 컨테이너",
"deviceTypeID" : 2,
"deviceID" : "deviceIDIDIDIDIDID",
"registrationKey" : "regKeyregKeyregKeyregKeyregKeyregKeyregKeyregKeyregKey",
"appVersion" : "v1.1"
},
success : function(data){
alert(data.returnmessage);
},
error : function(req, res, error){
alert(req+res+error);
}
});
}) ;
$(".saveProductionSpec").click2(function(){
$.ajax({
type: 'post',
......@@ -233,6 +290,8 @@ $(document).ready(function(){
<span class="button bigrounded blue saveBoard btnleft_y">게시물 저장 </span>
<span class="button bigrounded blue saveCS btnleft_y">고객센터 게시물 저장 </span>
<span class="button bigrounded blue saveProductionSpec btnleft_y">제작사양서 저장 </span>
<span class="button bigrounded blue memberJoin btnleft_y">회원가입 </span>
<span class="button bigrounded blue login btnleft_y">로그인 </span>
</form>
<div class="data">
<table class="datacList" id="datacList">
......@@ -311,27 +370,74 @@ $(document).ready(function(){
<td class="center">agreeInfo</td>
<td class=""><?echo $agreeInfo;?></td>
</tr>
</table>
</table>
<form id="jData" method="post" enctype="multipart/form-data">
<table>
<tr>
<th style="height:25px;">이미지 1</th>
<td class="l">
<?
$fileIndex = "101";
$fileName = "imgPathBoard1";
$filePath = ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
$fileNumber = ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
?>
</td>
</tr>
<tr>
<th style="height:25px;">이미지 2</th>
<td class="l">
<?
$fileIndex = "102";
$fileName = "imgPathBoard2";
$filePath = ($shopImgList[1]["file_vir_name"] == "" ? "" : $shopImgList[1]["file_vir_name"]);
$fileNumber = ($shopImgList[1]["no"] == "" ? "0" : $shopImgList[1]["no"]);
include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
?>
</td>
</tr>
<tr>
<th style="height:25px;">이미지 3</th>
<td class="l">
<?
$fileIndex = "103";
$fileName = "imgPathBoard3";
$filePath = ($shopImgList[2]["file_vir_name"] == "" ? "" : $shopImgList[2]["file_vir_name"]);
$fileNumber = ($shopImgList[2]["no"] == "" ? "0" : $shopImgList[2]["no"]);
include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
?>
</td>
</tr>
<tr>
<th style="height:25px;">이미지 4</th>
<td class="l">
<?
$fileIndex = "104";
$fileName = "imgPathBoard4";
$filePath = ($shopImgList[3]["file_vir_name"] == "" ? "" : $shopImgList[3]["file_vir_name"]);
$fileNumber = ($shopImgList[3]["no"] == "" ? "0" : $shopImgList[3]["no"]);
include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
?>
</td>
</tr>
<tr>
<th style="height:25px;">이미지 5</th>
<td class="l">
<?
$fileIndex = "105";
$fileName = "imgPathBoard5";
$filePath = ($shopImgList[4]["file_vir_name"] == "" ? "" : $shopImgList[4]["file_vir_name"]);
$fileNumber = ($shopImgList[4]["no"] == "" ? "0" : $shopImgList[4]["no"]);
include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
?>
</td>
</tr>
</table>
</form>
</div>
<br>
<form name="test" id="test" method=GET>
<input type="text" id="name1" name="name1" /> : <input type="text" id="name1v" name="name1v" />
<br>
<input type="text" id="name2" name="name2" /> : <input type="text" id="name2v" name="name2v" />
<br>
<input type="text" id="name3" name="name3" /> : <input type="text" id="name3v" name="name3v" />
<br>
<input type="text" id="name4" name="name4" /> : <input type="text" id="name4v" name="name4v" />
<br>
<input type="text" id="name5" name="name5" /> : <input type="text" id="name5v" name="name5v" />
<br>
<input type="text" id="name6" name="name6" /> : <input type="text" id="name6v" name="name6v" />
<br>
<input type="text" id="name7" name="name7" /> : <input type="text" id="name7v" name="name7v" />
<br>
<a href="#" id="subm" name="subm">Submit</a>
<input type="reset" value="지우기" />
</form>
</div>
......
......@@ -86,13 +86,14 @@ if(! class_exists("LoginUtil")){
if($row != null){
$cookieStr =
$row['no'] . chr(self::$spliter) .
$row['id'] . chr(self::$spliter) .
$row['name'] . chr(self::$spliter) .
$row['group_fk'] . chr(self::$spliter) .
$row['member_type'] . chr(self::$spliter) .
$row['app_type'] . chr(self::$spliter) .
$row['regi_type'] . chr(self::$spliter) ;
$row['userNo'] . chr(self::$spliter) .
$row['userID'] . chr(self::$spliter) .
$row['userPwd'] . chr(self::$spliter) .
$row['userName'] . chr(self::$spliter) .
$row['userType'] . chr(self::$spliter) .
$row['userTel'] . chr(self::$spliter) .
$row['deviceTypeID'] . chr(self::$spliter) .
$row['deviceID'] . chr(self::$spliter) ;
$cookieStr = bin2hex($cookieStr) ; // 16진수로 암호화
......@@ -133,20 +134,21 @@ if(! class_exists("LoginUtil")){
$map['no'] = $aUser[0] ;
$map['id'] = $aUser[1] ;
$map['name'] = $aUser[2] ;
$map['group_fk'] = $aUser[3] ;
$map['member_type'] = $aUser[4] ;
$map['regi_type'] = $aUser[5] ;
$map['pwd'] = $aUser[2] ;
$map['name'] = $aUser[3] ;
$map['userType'] = $aUser[4] ;
$map['userTel'] = $aUser[5] ;
$map['deviceTypeID']= $aUeser[6];
}
$aUser = explode(chr(self::$spliter),$cookieStr);
$map['no'] = $aUser[0] ;
$map['id'] = $aUser[1] ;
$map['name'] = $aUser[2] ;
$map['group_fk'] = $aUser[3] ;
$map['member_type'] = $aUser[4] ;
$map["app_type"] = $aUser[5] ;
$map['regi_type'] = $aUser[6] ;
$map['pwd'] = $aUser[2] ;
$map['name'] = $aUser[3] ;
$map['userType'] = $aUser[4] ;
$map['userTel'] = $aUser[5] ;
$map['deviceTypeID']= $aUeser[6];
if( LoginUtil::isAppLogin() == false )
{
......