jsp查询问题

09-12-29 fzwy

Items Array (產品)

Item ID items(0,1) K01

Description items(0,2) Keyboard

Unit Price items(0,3) 10.00

items(1,1) K02

items(1,2) Mouse

items(1,3) 20.00

items(2,1) K03

items(2,2) Printer

items(2,3) 500.00

items(3,1) K04

items(3,2) Scanner

items(3,3) 300.00

Trx_id trx(0,1) 1

Date trx(0,2) 01-06-08

Item_id trx(0,3) K01

Qty trx(0,4) 20

trx(1,1) 2

trx(1,2) 01-06-08

trx(1,3) K02

trx(1,4) 17

trx(2,1) 3

trx(2,2) 13-06-08

trx(2,3) K03

trx(2,4) 3

trx(3,1) 4

trx(3,2) 13-06-08

trx(3,3) K04

trx(3,4) 15

trx(4,1) 5

trx(4,2) 23-06-08

trx(4,3) K02

trx(4,4) 15

trx(5,1) 6

trx(5,2) 23-06-08

trx(5,3) K01

trx(5,4) 20

<% //test2a.jsp

string item=?????;

//items

string items[][]=new string[4][3];

items[0][0]="ko1"

items[0][1]="kevboard"

items[0][2]="10.00"

items[1][0]="ko2"

items[1][1]="mouse"

items[1][2]="20.00"

items[2][0]="ko3"

items[2][1]="printer"

items[2][2]="500.00"

items[3][0]="ko4"

items[3][1]="scanner"

items[3][2]="300.00"

//dailv transaction

string trx[][]==new string[6][4]

trx[0][0]="0001"

trx[0][1]="01-06-08"

trx[0][2]="ko1"

trx[0][3]="20"

trx[1][0]="0002"

trx[1][1]="01-06-08"

trx[1][2]="ko2"

trx[1][3]="17"

trx[2][0]="0003"

trx[2][1]="13-06-08"

trx[2][2]="ko3"

trx[2][3]="3"

trx[3][0]="0004"

trx[3][1]="13-06-08"

trx[3][2]="ko4"

trx[3][3]="15"

trx[4][0]="0005"

trx[4][1]="23-06-08"

trx[4][2]="ko2"

trx[4][3]="15"

trx[5][0]="0006"

trx[5][1]="23-06-08"

trx[5][2]="ko1"

trx[5][3]="20"

%>

<!--html-->

<html>

<body>

<table border=1>

<% .......................................................................................... %>

<tr>

<tr>item id </th>

<th>description </th>

<th aliqn="right">unit price </th>

<th aliqn="right">total qty </th>

<th aliqn="right">total amount </th>

</tr>

<% ................................................................................... %>

<table>

</body>

</html>

<%//test2b.jsp

//selected item

string item=?????;

string desc="";

//items

string items[][]=new string[4][3];

items[0][0]="ko1"

items[0][1]="kevboard"

items[0][2]="10.00"

items[1][0]="ko2"

items[1][1]="mouse"

items[1][2]="20.00"

items[2][0]="ko3"

items[2][1]="printer"

items[2][2]="500.00"

items[3][0]="ko4"

items[3][1]="scanner"

items[3][2]="300.00"

//get desc

.....................................................................................................

//dailv transaction

string trx[][]=new string[6][4];

trx[0][0]="0001";

trx[0][1]="01-06-08";

trx[0][2]="ko1";

trx[0][3]="20";

trx[1][0]="0002";

trx[1][1]="01-06-08";

trx[1][2]="ko2";

trx[1][3]="17";

trx[2][0]="0003";

trx[2][1]="13-06-08";

trx[2][2]="ko3";

trx[2][3]="3";

trx[3][0]="0004";

trx[3][1]="13-06-08";

trx[3][2]="ko4";

trx[3][3]="15";

trx[4][0]="0005";

trx[4][1]="23-06-08";

trx[4][2]="ko2";

trx[4][3]="15";

trx[5][0]="0006";

trx[5][1]="23-06-08";

trx[5][2]="ko1";

trx[5][3]="20";

%>

<!--html-->

<html>

<body>

<%=item%>- <%=desc%>

<table border=1>

<tr>

<th>data </th>

<th aliqn="right">qtv </th>

</tr>

<% ............................................................................................................. %>

<table>

</body>

> </html>

<%//twst2c.jsp

//selected item

string item=request.getparameter("item");

string date=request.getparameter("date");

string qty=request.getparameter("qty");

string up="0.00";

//items

string items[][]=new string[4][3];

items[0][0]="ko1";

items[0][1]="keyboard";

items[0][2]="10.00";

items[1][0]="ko2";

items[1][1]="mouse";

items[1][2]="20.00";

items[2][0]="ko3";

items[2][1]="printer";

items[2][2]="500.00";

items[3][0]="ko4";

items[3][1]="scanner";

items[3][2]="300.00";

//get unit price

............................................................................................................................................

%>

<!--html-->

<html>

<body>

<form action="test2c.jsp">

<table>

................................................................................................................

</table>

</form>

</body>

</html>

要有这样的效果

item id: k01 submit

item id de8cription unit price total qty total amount

ko1 keyboard 10.00 40 400.00

“.............”处该如何填啊?救命啊,