%
'********************************************************
' º¯¼ö
'********************************************************
wEmpName = Request.QueryString("wEmpName")
wListKind = Request("wListKind")
wSearchYN = Request("wSearchYN")
wSearch = Request("wSearch")
wCity = Request("wCity")
wArea = Request("wArea")
wDanjiNo = Request("wDanjiNo")
wDanjiName = Request("wDanjiName")
wDanjiCnt = Request("wDanjiCnt")
wShopNo = Request("wShopNo")
wShopName = Request("wShopName")
wShopCnt = Request("wShopCnt")
wCountry = Request("wCountry")
wMaker = Request("wMaker")
wCarClassCode = Request("wCarClassCode")
wCarClassName = Request("wCarClassName")
wCarCode = Request("wCarCode")
wCarName = Request("wCarName")
wModelCode = Request("wModelCode")
wModelName = Request("wModelName")
wModelCnt = Request("wModelCnt")
wYYS = Request("wYYS")
wYYE = Request("wYYE")
wKmS = Request("wKmS")
wKmE = Request("wKmE")
wAmtS = Request("wAmtS")
wAmtE = Request("wAmtE")
wAmtYN = Request("wAmtYN")
wPhotoYN = Request("wPhotoYN")
wSagoYN = Request("wSagoYN")
wCarCheckYN = Request("wCarCheckYN")
wAutoGbn = Request("wAutoGbn")
wGas = Request("wGas")
wNumCC = Request("wNumCC")
wColor = Request("wColor")
wDetailGbn = Request("wDetailGbn")
wDetailTxt = Request("wDetailTxt")
wOption = Request("wOption")
wOrderTmp = Request("wOrderTmp")
wCurPage = Request("wCurPage")
wOrderSection = Request("wOrderSection")
wOrderState = Request("wOrderState")
wKind = Request("wKind")
wOldCarNo = Request("wOldCarNo")
wLnbGbn = "1"
If wPageSize > "100" Then
Response.End
End If
If wListKind = "" Then
wListKind ="icon"
End If
wSearch = " Where DemoType = '±¤°íÁ¦½Ã' And DemoYN = 'Y' And UseYN = 'Y' and carcode <> 0 and a.oldcarno = b.oldcarno "
If wCity <> "" Then
wSearch = wSearch & " and a.City = '"& wCity &"' "
wPageStr = wPageStr & "&wCity="& wCity
wPrint = wPrint &"&wCity="& wCity
End If
If wArea <> "" Then
wSearch = wSearch & " and a.Area = '"& wArea &"' "
wPageStr = wPageStr & "&wArea="& wArea
wPrint = wPrint &"&wArea="& wArea
End If
If wDanjiNo <> "" Then
wSearch = wSearch & " and a.DanjiNo = "& wDanjiNo &" "
wPageStr = wPageStr & "&wDanjiNo="& wDanjiNo &"&wDanjiName="& wDanjiName &"&wDanjiCnt="& wDanjiCnt
wPrint = wPrint &"&wDanjiNo="& wDanjiNo &"&wDanjiName="& wDanjiName &"&wDanjiCnt="& wDanjiCnt
End If
If wShopNo <> "" Then
wSearch = wSearch & " and a.ShopNo = "& wShopNo &" "
wPageStr = wPageStr & "&wShopNo="& wShopNo &"&wShopName="& wShopName &"&wShopCnt="& wShopCnt
wPrint = wPrint &"&wShopNo="& wShopNo &"&wShopName="& wShopName &"&wShopCnt="& wShopCnt
End If
If wCountry <> "" Then
If wCountry = "±¹»ê" Then
wSearch = wSearch & " and a.Country = 'Çѱ¹' "
Else
wSearch = wSearch & " and a.Country <> 'Çѱ¹' "
End If
wPageStr = wPageStr & "&wCountry="& wCountry
wPrint = wPrint &"&wCountry="& wCountry
End If
If wMaker <> "" Then
wSearch = wSearch & " and a.MakerCode = '"& wMaker &"' "
wPageStr = wPageStr & "&wMaker="& wMaker
wPrint = wPrint &"&wMaker="& wMaker
End If
If CStr(wCarClassCode) <> "" Then
If wCountry = "" Then
sql = ""
sql = sql & " select top 1 country from nextcar..tbl_carname where CarClassCode = '"& wCarClassCode &"' "
Set rs = dbc.execute(sql)
If rs.bof And rs.eof Then
Else
rsCountry = rs("Country")
End If
If rsCountry = "Çѱ¹" Then
wSearch = wSearch & " and a.CarClassCode = '"& wCarClassCode &"' "
Else
' wSearch = wSearch & " and a.CarClassCode = '"& wCarClassCode &"' "
' wSearch = wSearch & " and a.CarCode in (select carcode from autodb.nextcar.dbo.carname where carclasscode2 = '"& wCarClassCode &"') "
End If
ElseIf wCountry = "±¹»êÂ÷" Then
wSearch = wSearch & " and a.CarClassCode = '"& wCarClassCode &"' "
ElseIf wCountry = "¼öÀÔÂ÷" Then
' wSearch = wSearch & " and a.CarClassCode = '"& wCarClassCode &"' "
' wSearch = wSearch & " and a.CarCode in (select carcode from autodb.nextcar.dbo.carname where carclasscode2 = '"& wCarClassCode &"') "
End If
wPageStr = wPageStr & "&wCarClassCode="& wCarClassCode &"&wCarClassName="& wCarClassName
wPrint = wPrint &"&wCarClassCode="& wCarClassCode &"&wCarClassName="& wCarClassName
End If
If wCarCode <> "" Then
wSearch = wSearch & " and a.CarCode = '"& wCarCode &"' "
wPageStr = wPageStr & "&wCarCode="& wCarCode &"&wCarName="& wCarName
wPrint = wPrint &"&wCarCode="& wCarCode &"&wCarName="& wCarName
End If
If wModelCode <> "" Then
wSearch = wSearch & " and a.ModelCode = "& wModelCode &" "
wPageStr = wPageStr & "&wModelCode="& wModelCode &"&wModelName="& wModelName &"&wModelCnt="& wModelCnt
wPrint = wPrint &"&wModelCode="& wModelCode &"&wModelName="& wModelName &"&wModelCnt="& wModelCnt
End If
If wYYS <> "" Then
If wMMS = "" Then
wSearch = wSearch & " and substring(a.YYMM,1,4) >= '"& wYYS &"' "
Else
wSearch = wSearch & " and a.YYMM >= '"& wYYS & wMMS &"' "
End If
wPageStr = wPageStr & "&wYYS="& wYYS &"&wMMS="& wMMS
wPrint = wPrint &"&wYYS="& wYYS &"&wMMS="& wMMS
End If
If wYYE <> "" Then
If wMME = "" Then
wSearch = wSearch & " and substring(a.YYMM,1,4) <= '"& wYYE &"' "
Else
wSearch = wSearch & " and a.YYMM <= '"& wYYE & wMME &"' "
End If
wPageStr = wPageStr & "&wYYE="& wYYE &"&wMME="& wMME
wPrint = wPrint &"&wYYE="& wYYE &"&wMME="& wMME
End If
If wKmS <> "" And wKmE = "" Then
wSearch = wSearch & " and a.Km >= '"& wKmS &"' "
ElseIf wKmS = "" And wKmE <> "" Then
wSearch = wSearch & " and a.Km <= '"& wKmE &"' "
ElseIf wKmS <> "" And wKmE <> "" Then
wSearch = wSearch & " and a.Km between '"& wKmS &"' and '"& wKmE &"' "
End If
wPageStr = wPageStr & "&wKmS="& wKmS &"&wKmE="& wKmE
wPrint = wPrint &"&wKmS="& wKmS &"&wKmE="& wKmE
If wAmtYN = "Y" Then
wSearch = wSearch & " and a.DealerAmt > 31 "
wPageStr = wPageStr & "&wAmtYN="& wAmtYN
wPrint = wPrint & "&wAmtYN="& wAmtYN
End If
If wAmtS <> "" And wAmtE <> "" Then
wSearch = wSearch & " and a.DealerAmt between "& wAmtS &" and "& wAmtE &" "
wPageStr = wPageStr & "&wAmtS="& wAmtS & "&wAmtE=" & wAmtE
wPrint = wPrint & "&wAmtS="& wAmtS & "&wAmtE=" & wAmtE
End If
If wPhotoYN = "Y" Or gConfigPhotoYN = "Y" Then
wSearch = wSearch & " and charindex('U',a.ImageFlag) > 0 "
wPageStr = wPageStr & "&wPhotoYN="& wPhotoYN
wPrint = wPrint &"&wPhotoYN="& wPhotoYN
End If
If wSagoYN = "Y" Then
wSearch = wSearch & " and a.SagoYN = 'N' "
wPageStr = wPageStr & "&wSagoYN="& wSagoYN
wPrint = wPrint &"&wSagoYN="& wSagoYN
End If
If wCarCheckYN = "Y" Then
wSearch = wSearch & " and isnull(a.CarCheckNo,'') <> '' "
wPageStr = wPageStr & "&wCarCheckYN="& wCarCheckYN
wPrint = wPrint &"&wCarCheckYN="& wCarCheckYN
End If
If wAutoGbn <> "" Then
wSearch = wSearch & " and a.AutoGbn = '"& wAutoGbn &"' "
wPageStr = wPageStr & "&wAutoGbn="& wAutoGbn
wPrint = wPrint &"&wAutoGbn="& wAutoGbn
End If
If wGas <> "" Then
wSearch = wSearch & " and a.Gas = '"& wGas &"' "
wPageStr = wPageStr & "&wGas="& wGas
wPrint = wPrint &"&wGas="& wGas
End If
If wNumCC <> "" Then
arrNumCC = Split(wNumCC,",")
wSearch = wSearch & " and a.NumCC between "& arrNumCC(0) &" and "& arrNumCC(1) &" "
wPageStr = wPageStr & "&wNumCC="& wNumCC
wPrint = wPrint &"&wNumCC="& wNumCC
End If
If wColor <> "" Then
wSearch = wSearch & " and a.Color = '"& wColor &"' "
wPageStr = wPageStr & "&wColor="& wColor
wPrint = wPrint &"&wColor="& wColor
End If
If wKind <> "" Then
wSearch = wSearch & " and a.UseCode = '"& wKind &"' "
wPageStr = wPageStr & "&wKind="& wKind
wPrint = wPrint &"&wKind="& wKind
End If
If wEmpName <> "" Then
wSearch = wSearch & " and a.EmpName = '"& wEmpName &"' "
wPageStr = wPageStr & "&wEmpName="& wEmpName
wPrint = wPrint &"&wEmpName="& wEmpName
End If
If wOldCarNo <> "" Then
wSearch = wSearch & " and a.OldCarNo = '"& wOldCarNo &"' "
wPageStr = wPageStr & "&wOldCarNo="& wOldCarNo
wPrint = wPrint &"&wOldCarNo="& wOldCarNo
End If
intTCnt = 0
intPageCnt = 0
intPageView = 10
If wCurPage = "" Then wCurPage = 1 End If
If wPageSize = "" Then
intPageSize = 50
Else
intPageSize = wPageSize
End If
wPageStr = wPageStr & "&wPageSize="& wPageSize
If wOrderTmp = "" Then
' wOrder = "a.ImageFlag desc, a.carcheckNo desc, a.strDemoDay desc "
wOrder = "a.ImageFlag desc, a.strDemoDay desc"
Else
wOrder = wOrderTmp
End If
'********************************************************
' Â÷·® ¸ñ·Ï ÃÑ °³¼ö
'********************************************************
sql = ""
sql = sql & " SELECT COUNT(DemoNo) AS TotCnt "
sql = sql & " FROM UsedCar..TBL_Car_DemoMaster a (nolock), UsedCar..TBL_CertUsedCar b "& wSearch &" "
Set res = dbcon.Execute(sql)
intTCnt = CDbl(res("TotCnt"))
res.close
Set res = Nothing
'********************************************************
' ÆäÀÌ¡ ó¸®
'********************************************************
If intTCnt > 0 Then
If (intTCnt Mod intPageSize) = 0 Then
intPageCnt = int(intTCnt/intPageSize)
Else
intPageCnt = int(intTCnt/intPageSize)+1
End If
End If
wPageSt = (wCurPage-1)*intPageSize+1
wPageEd = wPageSt+intPageSize-1
sql = ""
sql = sql & " with result as ( "
sql = sql & " SELECT ROW_NUMBER() OVER (ORDER BY "& wOrder &") AS ROWNUM, a.*, "
sql = sql & " (SELECT ShortName FROM UsedCar..tbl_DanjiInfo WHERE DanjiNo = a.DanjiNo) AS DanjiName, "
sql = sql & " (SELECT ShopShortName FROM UsedCar..tbl_ShopInfo WHERE ShopNo = a.ShopNo) AS ShopName, "
sql = sql & " (SELECT MakerName FROM UsedCar..tbl_Car_Maker WHERE MakerCode = a.MakerCode) AS MakerName, "
sql = sql & " (SELECT CarName FROM UsedCar..tbl_Car_Name WHERE CarCode = a.CarCode) AS CarName, "
sql = sql & " (SELECT ModelName FROM UsedCar..tbl_Car_Model WHERE ModelCode = a.ModelCode) AS ModelName, "
sql = sql & " (SELECT GradeName FROM UsedCar..tbl_Car_Grade WHERE ModelCode = a.ModelCode and GradeCode = a.GradeCode) AS GradeName "
sql = sql & " FROM UsedCar..TBL_Car_DemoMaster a (nolock), UsedCar..TBL_CertUsedCar b "& wSearch &" "
sql = sql & " ) "
sql = sql & " select * from result where rownum BETWEEN "&wPageSt&" AND "&wPageEd&" order by rownum "
If Request.ServerVariables("REMOTE_ADDR") = "112.187.225.76" Then
' Response.write sql
End If
Set mres = dbcon.Execute(sql)
%>
(»ç)Àü±¹ÀÚµ¿Â÷¸Å¸Å»ç¾÷Á¶ÇÕ¿¬ÇÕȸ
Àüü <%=FormatNumber(intTCnt,0)%>´ë
»çÁø |
Â÷·®Á¤º¸ |
¹Ì¼Ç |
³â½Ä |
¿¬·á |
ÁÖÇà°Å¸® |
°¡°Ý |
´ã´çÀÚ(¿¬¶ôó) |
<% '¸Å¹°¼ö·®
If mres.eof Or mres.bof Then
Else
rowCnt = intTCnt - ((wCurPage - 1) * intPageSize)
i = 1
Do While mres.eof = False
mresDemoNo = mres("DemoNo")
mresMaker = mres("MakerName")
mresCarName = mres("CarName")
mresModelName = mres("ModelName")
mresGradeName = mres("GradeName")
mresImageFlag = mres("ImageFlag")
mresImagePath = mres("ImagePath")
mresSago = mres("SagoYN")
mresSagoMemo = mres("SagoMemo")
mresCarCheckYN = mres("CarCheckYN")
mresCarCheckNo = mres("CarCheckNo")
mresOptionText = mres("CarDetailOption")
mresLineDemo = mres("LineDemo")
mresYYMM = mres("YYMM")
mresColor = mres("Color")
mresAutoGbn = mres("AutoGbn")
mresGas = mres("Gas")
mresDealerAmt = mres("DealerAmt")
mresDemoAmt = mres("DemoAmt")
mresKm = mres("Km")
mresCity = mres("Area")
mresDanjiName = mres("DanjiName")
mresShopNo = mres("ShopNo")
mresShopName = mres("ShopName")
mresEmpNo = mres("EmpNo")
mresEmpName = mres("EmpName")
mresEmpHand = mres("EmpMobileNum")
mresDemoDay = mres("DemoDay")
mresStrDemoDay = mres("strDemoDay")
mresDealerAmt = mres("DealerAmt")
mresImagePath = mres("ImagePath")
mresCarDetailOption = mres("CarDetailOption")
mresGovNo = mres("GovNo")
mresOldCarNo = mres("OldCarNo")
strCarName = mresCarName&" "&mresModelName&" "&mresGradeName
strCarOpion = mresCarDetailOption
if mresKm > 9999 then
mresKm = Round(mresKm/10000,1) & "¸¸"
else
mresKm = fix(mresKm)
end If
wDemoDay = Mid(mresDemoDay,1,4)&"."&Mid(mresDemoDay,5,2)&"."&Mid(mresDemoDay,7,2)
If mresDemoAmt < 31 Then
wDemoAmt = "»ó´ã"
Else
wDemoAmt = FormatNumber(mresDemoAmt,0)&"¸¸¿ø"
End If
If mresGovNo = "70" Or mresGovNo = "11" Then
sql = ""
sql = sql & " SELECT DemoNo, GovNo, PhotoURL "
sql = sql & " FROM UsedCar..TBL_Car_DemoMaster_Sub "
sql = sql & " WHERE DemoNo = '"&mresDemoNo&"' and GovNo = '"&mresGovNo&"' "
Set rs1 = dbcon.execute(sql)
If rs1.eof And rs1.bof Then
rsPhotoURL = ""
BizInfoPhotoPath = ""
Else
rsPhotoURL = rs1("PhotoURL")
If rsPhotoURL <> "" Then
photoUrl = Split(rsPhotoURL,",")
BizInfoPhotoPath = Replace(photoUrl(0),".jpg","_th.jpg")
Else
BizInfoPhotoPath = ""
End If
End If
rs1.close
Else
BizInfoPhotoPath = ""
End If
sql = ""
sql = sql & " select * from usedcar..tbl_certusedcar where oldcarno = '"&mresOldCarNo&"' "
Set rsphoto = dbcon.execute(sql)
If rsphoto.eof And rsphoto.bof Then
strCarPhotoCmd = "cmd=thumb&w=100&h=65"
Else
strCarPhotoCmd = "cmd=mythumcmd&mywidth=100&myheight=65"
End If
rsphoto.close
%>
<% if BizInfoPhotoPath <> "" Then %>
<% Else %>
<% End If %>
|
[<%=mresMaker%>] <%=mresCarName%> <%=mresModelName%> <%=mresGradeName%>
<%=CutString(mresLineDemo,"..",54)%>
|
<%=mresAutoGbn%> |
<%=mresYYMM%> |
<%=mresGaS%> |
<%=mresKm%> |
<%=wDemoAmt%> |
<%=mresEmpName%> <%=mresEmpHand%> |
<%
mres.MoveNext
rowCnt = rowCnt - 1
i = i + 1
Loop
End If
mres.Close
Set mres = Nothing
%>
<% Call PageList(wCurPage, intPageCnt, intPageView, "/search/search_cert.asp", wPageStr) %>