c7829abe by sayhoChun

end of day

1 parent 8b44cd93
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/php/LoginUtil.php" ; ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiBase.php" ; ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiUser.php" ; ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiProcess.php" ; ?>
......@@ -11,9 +10,10 @@
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBoard.php" ; ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminPush.php" ; ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminEtc.php" ; ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/php/AnyGo.php" ;?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiStatic.php" ;?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminProductionSpec.php" ; ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/php/LoginUtil.php" ; ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/php/AnyGo.php" ;?>
<?
$cmd = $_REQUEST[cmd] ;
......
......@@ -92,7 +92,7 @@
$.ajax({
url : "/action_front.php?cmd=AdminProductionSpec.saveProductionSpec",
async : false,\
async : false,
cache : false,
dataType : "json",
......
......@@ -23,7 +23,7 @@ if (! class_exists("ApiBoard"))
";
$this->rownum=$this->getValue($sql, "rn");
$this->initPage();
$this->initPageForDevice();
$this->setPageForDevice($this->rownum);
$sql="
......@@ -31,6 +31,7 @@ if (! class_exists("ApiBoard"))
FROM tblNotice
WHERE status=1
ORDER BY noticeNo DESC
LIMIT {$this->startNum}, {$this->endNum} ;
";
$result=$this->getArray($sql);
......@@ -60,7 +61,7 @@ if (! class_exists("ApiBoard"))
ORDER BY eventNo DESC
";
$this->rownum=$this->getValue($sql, "rn");
$this->initPage();
$this->initPageForDevice();
$this->setPageForDevice($this->rownum);
$sql="
......@@ -68,6 +69,7 @@ if (! class_exists("ApiBoard"))
FROM tblEvent
WHERE status=1
ORDER BY eventNo DESC
LIMIT {$this->startNum}, {$this->endNum} ;
";
$result=$this->getArray($sql);
return $this->makeResultJson("1", "", $result);
......@@ -85,11 +87,23 @@ if (! class_exists("ApiBoard"))
if($result != null){
$sql="
SELECT COUNT(*) rn
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$eventNo}' AND commentType='EV'
";
$this->rownum=$this->getValue($sql, "rn");
$this->initPageForDevice();
$this->setPageForDevice($this->rownum);
$sql="
SELECT C.*, U.userID, U.userNo
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$eventNo}' AND commentType='EV'
ORDER BY C.commentGroup DESC, C.gOrder ASC
LIMIT {$this->startNum}, {$this->endNum} ;
";
$commentList=$this->getArray($sql);
......@@ -181,7 +195,7 @@ if (! class_exists("ApiBoard"))
{$where}
ORDER BY boardNo DESC
";
$this->initPage();
$this->initPageForDevice();
$this->rownum = $this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
......@@ -216,11 +230,23 @@ if (! class_exists("ApiBoard"))
if($result != null){
$sql="
SELECT COUNT(*) rn
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$boardNo}' AND commentType='FB'
";
$this->rownum=$this->getValue($sql, "rn");
$this->initPageForDevice();
$this->setPageForDevice($this->rownum);
$sql="
SELECT C.*, U.userID, U.userNo
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$boardNo}' AND commentType='FB'
ORDER BY C.commentGroup DESC, C.gOrder ASC
LIMIT {$this->startNum}, {$this->endNum}
";
$commentList=$this->getArray($sql);
......@@ -377,7 +403,7 @@ if (! class_exists("ApiBoard"))
WHERE CS.status=1 AND CS.targetType=1
ORDER BY csNo DESC
";
$this->initPage();
$this->initPageForDevice();
$this->rownum = $this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
......@@ -413,11 +439,21 @@ if (! class_exists("ApiBoard"))
if($result != null){
$sql="
SELECT COUNT(*) rn
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$csNo}' AND commentType='CS'
";
$this->rownum=$this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
$sql="
SELECT U.userNo, U.userID, C.*
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$csNo}' AND commentType='CS'
ORDER BY C.commentGroup DESC, C.gOrder ASC
LIMIT {$this->startNum}, {$this->endNum}
";
$commentList=$this->getArray($sql);
......@@ -457,7 +493,7 @@ if (! class_exists("ApiBoard"))
{$where}
ORDER BY companyNo DESC
";
$this->initPage();
$this->initPageForDevice();
$this->rownum=$this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
......@@ -491,11 +527,22 @@ if (! class_exists("ApiBoard"))
if($result != null){
$sql="
SELECT COUNT(*) rn
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$companyNo}' AND commentType='CP'
";
$this->rownum=$this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
$sql="
SELECT U.userNo, U.userID, C.*
FROM tblComment C
JOIN tblUser U ON C.userFk=U.userNo
WHERE targetFk='{$companyNo}' AND commentType='CP'
ORDER BY C.commentGroup DESC, C.gOrder ASC
LIMIT {$this->startNum}, {$this->endNum}
";
$commentList=$this->getArray($sql);
......@@ -784,7 +831,7 @@ if (! class_exists("ApiBoard"))
WHERE userFk='{$userFk}' AND status=1
ORDER BY productionNo DESC
";
$this->initPage();
$this->initPageForDevice();
$this->rownum=$this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
......@@ -794,6 +841,7 @@ if (! class_exists("ApiBoard"))
FROM tblProductionSpec
WHERE userFk='{$userFk}' AND status=1
ORDER BY productionNo DESC
LIMIT {$this->startNum}, {$this->endNum}
";
$list=$this->getArray($sql);
......@@ -826,7 +874,7 @@ if (! class_exists("ApiBoard"))
{$where}
ORDER BY productionNo DESC
";
$this->initPage();
$this->initPageForDevice();
$this->rownum=$this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
......@@ -837,6 +885,7 @@ if (! class_exists("ApiBoard"))
FROM tblProductionSpec
{$where}
ORDER BY productionNo DESC
LIMIT {$this->startNum}, {$this->endNum}
";
$list=$this->getArray($sql);
......@@ -900,7 +949,7 @@ if (! class_exists("ApiBoard"))
WHERE L.userNo='{$userNo}' AND PS.status=1
ORDER BY regDate DESC
";
$this->initPage();
$this->initPageForDevice();
$this->rownum=$this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
......@@ -911,6 +960,7 @@ if (! class_exists("ApiBoard"))
JOIN tblLike L ON PS.productionNo=L.productionNo
WHERE L.userNo='{$userNo}' AND PS.status=1
ORDER BY regDate DESC
LIMIT {$this->startNum}, {$this->endNum}
";
$result=$this->getArray($sql);
return $this->makeResultJson("1","", $result);
......@@ -923,7 +973,7 @@ if (! class_exists("ApiBoard"))
WHERE status=1
ORDER BY regDate DESC
";
$this->initPage();
$this->initPageForDevice();
$this->rownum=$this->getValue($sql, "rn");
$this->setPageForDevice($this->rownum);
......@@ -933,6 +983,7 @@ if (! class_exists("ApiBoard"))
FROM tblProductionPortrait
WHERE status=1
ORDER BY regDate DESC
LIMIT {$this->startNum}, {$this->endNum}
";
$result=$this->getArray($sql);
return $this->makeResultJson("1", "", $result);
......
......@@ -104,7 +104,7 @@ if (! class_exists("ApiStatic")){
//탑차 분류별 리스트
function getListOfVehicle(){
$vehicleType=$this->req["vehicleType"];
$vehicleType="IS";
//$vehicleType="IS";
$sql="
SELECT vehicleNo, name, imgPathVehicle1, imgPathVehicle2, imgPathVehicle3, imgPathVehicle4, imgPathVehicle5
FROM tblVehicle
......@@ -118,9 +118,8 @@ if (! class_exists("ApiStatic")){
//탑차 정보
function getInfoOfVehicle(){
$vehicleNo=$this->req["vehicleNo"];
$vehicleNo=1;
echo $vehicleNo;
//echo $vehicleNo;
$sql="
SELECT *
FROM tblVehicle
......
......@@ -114,27 +114,27 @@ if (! class_exists("ApiUser"))
LIMIT 1
";
$regInfo = $this->getRow($sql);
//return json_encode($regInfo);
if(strlen($userID) < 6)
if(strlen($userID) < 6){
return $this->makeResultJson(-106, "아이디는 여섯 자리 이상이어야 합니다.");
}
if(strlen($userID) != strlen($this->removeSpecials($userID))) {
return $this->makeResultJson(-108, "아이디에는 특수문자가 포함될 수 없습니다.");
}
if($regInfo != null)
return $this->makeResultJson(-100, "아이디 중복을 확인해 주세요.");
if($regInfo != NULL)
return $this->makeResultJson(-100, "아이디 중복을 확인해 주세요.", $regInfo);
if($nickName == "")
if($nickName == NULL)
return $this->makeResultJson(-107, "닉네임을 입력해 주세요");
$sql="SELECT * FROM tblUser WHERE nickName='{$nickName} AND status=1'";
$regInfo=$this->getRow($sql);
if($regInfo != null)
return $this->makeResultJson(-101, "닉네임 중복을 확인해 주세요.");
if($regInfo != NULL)
return $this->makeResultJson(-101, "닉네임 중복을 확인해 주세요.", $regInfo);
if(strlen($userPwd) != strlen($this->removeSpecials($userPwd))) {
return $this->makeResultJson(-103, "비밀번호에는 특수문자가 포함될 수 없습니다.");
......@@ -242,6 +242,8 @@ if (! class_exists("ApiUser"))
$registrationKey = $this->req["registrationKey"];
$appVersion = $this->req["appVersion"];
$res="";
$param = Array(
$userID,
$deviceID,
......@@ -259,15 +261,20 @@ if (! class_exists("ApiUser"))
$userInfo = $this->inFn_ApiBase_getInfoOfUser($result[0][0]["v_userNumber"]);
//echo $userPwd;
//echo $userInfo["userID"];
if($userInfo["expireDate"]!=null)
$res=$this->checkExpire($userInfo["userNo"], $userInfo["expireDate"]);
if($res=1)
if($res==1)
return $this->makeResultJson(-999, "탈퇴된 회원입니다");
if($userInfo["userPwd"] != $userPwd)
return $this->makeResultJson("-1000", "비밀번호를 확인하세요");
return $this->makeResultJson("-1000", "비밀번호를 확인하세요", $userInfo["userPwd"]);
LoginUtil::doAppLogin($userInfo);
return $this->makeResultJson($result[0][0]["v_returnCode"], $result[0][0]["v_returnMsg"], $userInfo);
// return $this->makeResultJson($result[0][0]["v_returnCode"], $result[0][0]["v_returnMsg"], $this->appUser);
}
else
{
......@@ -361,7 +368,7 @@ if (! class_exists("ApiUser"))
{
$userNo = $this->appUser["no"];
//$is_file_change = $this->req["is_file_change"]; // NEW / DEL / NON
//$userNo=$this->req["userNo"];
// $userNo=$this->req["userNo"];
$userPwd = $this->req["userPwd"];
$userPwdConfirm = $this->req["userPwdConfirm"];
$nickName = $this->req["nickName"];
......@@ -370,35 +377,7 @@ if (! class_exists("ApiUser"))
$userVehicleName=$this->req["userVehicleName"];
$userVehicleType=$this->req["userVehicleType"];
$userVehicleWish=$this->req["userVehicleWish"];
/*
// 삭제함
if ($is_file_change != "NON")
{
$sql = "
DELETE FROM tbl_file WHERE pa_no = '{$userNo}' AND file_type = '{$this->FILE_TYPE_MEM}'
";
$this->update($sql);
}
// 파일 업로드
if ($is_file_change == "NEW" && ($_FILES != null && sizeof($_FILES) > 0))
{
$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" => $userNo,
"file_type" => $this->FILE_TYPE_MEM
);
$fileResult = $this->techOfInsertForUpdate("tbl_file", $insFile);
}
*/
$sql="SELECT * FROM tblUser WHERE nickName='{$nickName} AND status=1'";
$regInfo=$this->getRow($sql);
if($regInfo != null)
......@@ -438,7 +417,7 @@ if (! class_exists("ApiUser"))
";
$this->update($sql);
}
return $this->makeResultJson("1", "저장되었습니다.", $this->inFn_ApiBase_getInfoOfUser($userNo));
return $this->makeResultJson("1", "저장되었습니다.", $userNo);
}
/**
......
......@@ -63,6 +63,14 @@ if(! class_exists("HomeFrm") ) {
$this->endNum = $this->rowPerPage ;
}
function initPageForDevice()
{
$this->rowPerPageDevice = $this->req["rowPerPage"] == "" ? $this->rowPerPageDevice : $this->req["rowPerPage"];
$this->req["page"] = ($this->req["page"] == "" || $this->req["page"] == "0") ? "1" : $this->req["page"] ;
$this->startNum = ($this->req["page"] - 1) * $this->rowPerPageDevice ;
$this->endNum = $this->rowPerPageDevice ;
}
//페이지 설정
function setPage($rownum)
{
......
......@@ -11,7 +11,7 @@ if(! class_exists("LoginUtil")){
public static $spliter = 30 ; // Seperator Ascii code
//public static "211.110.140.155";
//public static $cookieDomain = "localhost";
public static $cookieDomain = "106.240.232.36" ;
public static $cookieDomain = "localhost" ;
static function getAdminUser()
{
......@@ -83,7 +83,6 @@ if(! class_exists("LoginUtil")){
if($row != null){
$cookieStr =
$row['userNo'] . chr(self::$spliter) .
$row['userID'] . chr(self::$spliter) .
$row['userPwd'] . chr(self::$spliter) .
......@@ -93,10 +92,11 @@ if(! class_exists("LoginUtil")){
$row['deviceTypeID'] . chr(self::$spliter) .
$row['deviceID'] . chr(self::$spliter) ;
// echo json_encode($row);
$cookieStr = bin2hex($cookieStr) ; // 16진수로 암호화
//setcookie("userMap",$cookieStr,-1,"/", '.richware.co.kr') ;
setcookie("userMap",$cookieStr,-1,"/", self::$cookieDomain) ;
setcookie("userMapForApp", $cookieStr, -1, "/", '') ;
return true ;
......@@ -111,8 +111,8 @@ if(! class_exists("LoginUtil")){
static function isAppLogin()
{
$aUser[0] = "";
if(isset($_COOKIE["userMap"])) {
$cookieStr = $_COOKIE["userMap"] ;
if(isset($_COOKIE["userMapForApp"])) {
$cookieStr = $_COOKIE["userMapForApp"] ;
$cookieStr = pack("H*",$cookieStr);
......@@ -123,11 +123,11 @@ if(! class_exists("LoginUtil")){
static function getAppUser(){
$cookieStr = isset($_COOKIE["userMap"]) ? $_COOKIE["userMap"] : "" ;
$cookieStr = isset($_COOKIE["userMapForApp"]) ? $_COOKIE["userMapForApp"] : "" ;
if(isset($_COOKIE["userMap"])){
if(isset($_COOKIE["userMapForApp"])){
$cookieStr = pack("H*",$cookieStr);
//echo $cookieStr;
$aUser = explode(chr(self::$spliter),$cookieStr);
$map['no'] = $aUser[0] ;
......@@ -158,7 +158,7 @@ if(! class_exists("LoginUtil")){
static function doAppLogout(){
setcookie("userMap","",time() - 3600,"/",self::$cookieDomain) ;
setcookie("userMapForApp","",time() - 3600,"/",self::$cookieDomain) ;
}
......