LgcAssetBasket.jsp
11.6 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="RecordSet2" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="CountryComInfo" class="weaver.hrm.country.CountryComInfo" scope="page"/>
<!-- jsp:useBean id="AssetTypeComInfo" class="weaver.lgc.maintenance.AssetTypeComInfo" scope="page"/ -->
<jsp:useBean id="AssetUnitComInfo" class="weaver.lgc.maintenance.AssetUnitComInfo" scope="page"/>
<jsp:useBean id="CurrencyComInfo" class="weaver.fna.maintenance.CurrencyComInfo" scope="page"/>
<!--jsp:useBean id="AssetAssortmentComInfo" class="weaver.lgc.maintenance.AssetAssortmentComInfo" scope="page" / -->
<HTML><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<style type="text/css">
span.Step { font-weight: bold; color: black; }
span.StepActive { font-weight: bold; color: red; }
table.BtnBar { width: 100%; border-collapse: collapse; }
table.BtnBar TD { padding: 0px; }
</style>
<SCRIPT language="javascript" src="../../js/weaver_wev8.js"></script>
</head>
<%
String catalogid = Util.null2String(request.getParameter("catalogid"));
String theassortment = Util.null2String(request.getParameter("theassortment"));
String selectedid = Util.null2String(request.getParameter("selectedid"));
String thecountry = Util.null2String(request.getParameter("thecountry"));
String theattributes = Util.null2String(request.getParameter("theattributes"));
String isthenew = Util.null2String(request.getParameter("isthenew"));
String start = Util.null2String(request.getParameter("start"));
String webshoptype = Util.null2String(request.getParameter("webshoptype"));
String webshopmanageid = Util.null2String(request.getParameter("webshopmanageid"));
String imagefilename = "/images/hdLOG_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(727,user.getLanguage()) ;
String needfav ="1";
String needhelp ="";
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<table width=100% height=100% border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="10">
<col width="">
<col width="10">
<tr>
<td height="10" colspan="3"></td>
</tr>
<tr>
<td ></td>
<td valign="top">
<TABLE class=Shadow>
<tr>
<td valign="top">
<form action="" method="post" id=frmmain>
<input name="operation" type="hidden">
<input name="thecookiename" type="hidden">
<input name="catalogid" type="hidden" value="<%=catalogid%>">
<input name="theassortment" type="hidden" value="<%=theassortment%>">
<input name="selectedid" type="hidden" value="<%=selectedid%>">
<input name="thecountry" type="hidden" value="<%=thecountry%>">
<input name="theattributes" type="hidden" value="<%=theattributes%>">
<input name="isthenew" type="hidden" value="<%=isthenew%>">
<input name="start" type="hidden" value="<%=start%>">
<input name="webshoptype" type="hidden" value="<%=webshoptype%>">
<input name="webshopmanageid" type="hidden" value="<%=webshopmanageid%>">
<input name="webshopreturn" type="hidden" value="0">
<input name="theassetcountry" type="hidden">
<input name="assetid" type="hidden">
</form>
<table class="BtnBar" width="100%">
<tr>
<td width="40%">
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(16632,user.getLanguage())+",javascript:myfun1.click(),_top} " ;
RCMenuHeight += RCMenuHeightStep ;
%>
<button class="Btn" accesskey="1" id=myfun1 onclick="location.href='LgcCatalogsView.jsp?id=<%=catalogid%>&theassortment=<%=theassortment%>&selectedid=<%=selectedid%>&thecountry=<%=thecountry%>&theattributes=<%=theattributes%>&isthenew=0&start=<%=start%>'"><u>1</u>-商店</button></td>
<td align="right" width="60%">
<% if(webshoptype.equals("1")) {%>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(16634,user.getLanguage())+",javascript:myfun2.click(),_top} " ;
RCMenuHeight += RCMenuHeightStep ;
%>
<button class="Btn" id=myfun2 accesskey="2" onclick="onConfirm()"><u>2</u>-确认></button>
<%} else {%>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(16633,user.getLanguage())+"song-huo-xin-xi,javascript:myfun3.click(),_top} " ;
RCMenuHeight += RCMenuHeightStep ;
%>
<button class="Btn" id=myfun3 accesskey="2" onclick="onUserinfo()"><u>2</u>-送货信息></button>
<%}%>
</td>
</tr>
</table>
<form action="" method="post" id=frmchange>
<input name="operation" type="hidden">
<input name="catalogid" type="hidden" value="<%=catalogid%>">
<input name="theassortment" type="hidden" value="<%=theassortment%>">
<input name="selectedid" type="hidden" value="<%=selectedid%>">
<input name="thecountry" type="hidden" value="<%=thecountry%>">
<input name="theattributes" type="hidden" value="<%=theattributes%>">
<input name="isthenew" type="hidden" value="<%=isthenew%>">
<input name="start" type="hidden" value="<%=start%>">
<input name="webshoptype" type="hidden" value="<%=webshoptype%>">
<input name="webshopmanageid" type="hidden" value="<%=webshopmanageid%>">
<input name="webshopreturn" type="hidden" value="0">
<table class=ListStyle cellspacing=1>
<tr class=Header>
<th colspan="8">订单 </th>
</tr>
<tr class="Header">
<td>物品</td>
<td>单位</td>
<td>国家</td>
<td>数量</td>
<td>价格</td>
<td>税率</td>
<td>总计</td>
<td>删除</td>
</tr>
<TR class=Line><TD colSpan=8></TD></TR>
<%
Cookie thecookies[] = request.getCookies() ;
String userid = ""+user.getUID() ;
char separator = Util.getSeparator() ;
float pricecount = 0 ;
boolean isLight = false;
String thecurrencyid = "" ;
ArrayList assetids = new ArrayList() ;
ArrayList countryids = new ArrayList() ;
if(thecookies != null) {
for(int i=0 ; i<thecookies.length ; i++) {
String cookiename = thecookies[i].getName() ;
if(cookiename.indexOf("CoItem_"+userid+"_") <0) continue ;
String tempstr[] = Util.TokenizerString2(cookiename,"_") ;
String assetid = tempstr[2] ;
String countryid = tempstr[3] ;
assetids.add(assetid) ;
countryids.add(countryid) ;
String para = assetid+separator+ countryid ;
RecordSet.executeProc("LgcAsset_SelectById",para);
String assetname = "";
String assetunitid = "" ;
if(RecordSet.next()) {
assetname = Util.toScreen(RecordSet.getString("assetname"),user.getLanguage());
assetunitid = Util.null2String(RecordSet.getString("assetunitid"));
}
String assetcount = Util.null2String(Util.getCookie(request,cookiename)) ;
para = assetid + separator + countryid + separator + assetcount ;
RecordSet.executeProc("LgcAssetPrice_Select",para);
String unitprice = "" ;
String taxrate = "" ;
String currencyid = "" ;
if(RecordSet.next()) {
unitprice = Util.null2String(RecordSet.getString(1)) ;
taxrate = Util.null2String(RecordSet.getString(2)) ;
currencyid = Util.null2String(RecordSet.getString(3));
}
thecurrencyid = currencyid ;
int tempprice = new Float(Util.getFloatValue(assetcount) * Util.getFloatValue(unitprice) * (1+ Util.getFloatValue(taxrate)/100)*100 + 0.5).intValue() ;
float unitpricecount = tempprice/100 ;
pricecount += unitpricecount ;
if(isLight) {%>
<TR CLASS=DataLight>
<%} else { %>
<TR class=DataDark>
<%}%>
<TD>
<a href='/lgc/asset/LgcAsset.jsp?paraid=<%=assetid%>&assetcountryid=<%=countryid%>'><%=assetname%></a></TD>
<TD><%=Util.toScreen(AssetUnitComInfo.getAssetUnitname(assetunitid),user.getLanguage())%></TD>
<TD>
<% if(countryid.equals("0")) {%><%=SystemEnv.getHtmlLabelName(529,user.getLanguage())%>
<%} else {%>
<%=Util.toScreen(CountryComInfo.getCountrydesc(countryid),user.getLanguage())%><%}%> </TD>
<TD style="margin:0px">
<INPUT name="<%=cookiename%>" value="<%=assetcount%>" size=6 >
</TD>
<TD align=right><%=unitprice%></TD>
<TD align=right><%=taxrate%>%</TD>
<TD align=right><B><%=Util.toScreen(CurrencyComInfo.getCurrencyname(currencyid),user.getLanguage())%> <%=unitpricecount%></B></TD>
<TD style="margin:0px"><IMG src="\images\BacoDelete_wev8.gif" border=0 alt=Delete style="CURSOR:'HAND'" onclick="if(isdel()){onDelete('<%=cookiename%>');}"></TD>
</TR>
<%
isLight = !isLight;
}%>
<TR class="header" >
<TD colspan=5 align=right><SPAN style="font-size:8pt; color:black">如果你改变了订单数量,请点击该按钮进行计算</SPAN><BUTTON class=Calculate onclick="onCalculate()"></BUTTON></TD>
<TD align=right><B>总计:</B></TD>
<TD align=right><B><U><%=Util.toScreen(CurrencyComInfo.getCurrencyname(thecurrencyid),user.getLanguage())%> <%=pricecount%> </U></B></TD>
<TD> </TD>
</TR>
<%}%>
</table>
</form>
<br>
<TABLE class=ListStyle cellspacing=1>
<TR class=header>
<TH colspan=6>相关物品</TH>
</TR>
<TR class=Line><TD colSpan=6></TD></TR>
<%
for(int i=0 ; i< assetids.size() ; i++) {
String theassetid = (String)assetids.get(i) ;
String thecountryid = (String)countryids.get(i) ;
RecordSet.executeProc("LgcConfiguration_SByWebshop",theassetid);
while(RecordSet.next()) {
String relassetid = Util.null2String(RecordSet.getString(1)) ;
String relname = Util.toScreen(RecordSet.getString(2),user.getLanguage()) ;
String para = relassetid + separator + thecountryid ;
RecordSet2.executeProc("LgcAsset_SelectById",para);
String assetname = "";
String assetunitid = "";
String currencyid = "";
String salesprice = "";
if(RecordSet2.next()) {
assetname = Util.toScreen(RecordSet2.getString("assetname"),user.getLanguage());
assetunitid = Util.null2String(RecordSet2.getString("assetunitid"));
currencyid = Util.null2String(RecordSet2.getString("currencyid"));
salesprice = Util.null2String(RecordSet2.getString("salesprice"));
}
if(isLight) {%>
<TR CLASS=DataLight>
<%} else { %>
<TR class=DataDark>
<%}%>
<TD> <a href='/lgc/asset/LgcAsset.jsp?paraid=<%=relassetid%>&assetcountryid=<%=thecountryid%>'><%=assetname%></a></TD>
<TD><%=Util.toScreen(AssetUnitComInfo.getAssetUnitname(assetunitid),user.getLanguage())%></TD>
<TD>
<% if(thecountryid.equals("0")) {%>
<%=SystemEnv.getHtmlLabelName(529,user.getLanguage())%>
<%} else {%>
<%=Util.toScreen(CountryComInfo.getCountrydesc(thecountryid),user.getLanguage())%>
<%}%>
</TD>
<TD><%=relname%></TD>
<TD align=right><B><%=Util.toScreen(CurrencyComInfo.getCurrencyname(currencyid),user.getLanguage())%> <%=salesprice%></B></TD>
<TD style="margin:0px"><IMG src="\images\ShopAddToCart_wev8.gif" border=0 alt="Add to basket" style="CURSOR:'HAND'" onclick="onAdd('<%=relassetid%>','<%=thecountryid%>')"></TD>
</TR>
<%}}%>
</TABLE>
</td>
</tr>
</TABLE>
</td>
<td></td>
</tr>
<tr>
<td height="10" colspan="3"></td>
</tr>
</table>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<script language="javascript">
function onDelete(thecookname) {
frmmain.thecookiename.value = thecookname ;
frmmain.action = "LgcAssetBasketOperation.jsp" ;
frmmain.operation.value = "delete" ;
frmmain.submit() ;
}
function onAdd(theassetid,thecountryid) {
frmmain.assetid.value = theassetid ;
frmmain.theassetcountry.value = thecountryid ;
frmmain.action = "LgcAssetBasketOperation.jsp" ;
frmmain.operation.value = "addasset" ;
frmmain.submit() ;
}
function onCalculate() {
frmchange.action = "LgcAssetBasketOperation.jsp" ;
frmchange.operation.value = "change" ;
frmchange.submit() ;
}
function onUserinfo() {
frmchange.action = "LgcAssetBasketOperation.jsp" ;
frmchange.operation.value = "userinfo" ;
frmchange.submit() ;
}
function onConfirm() {
frmchange.action = "LgcAssetBasketOperation.jsp" ;
frmchange.operation.value = "confirm" ;
frmchange.submit() ;
}
</script>
</body></html>