$_SESSION[quatity]=implode("@",$arrayquatity);
for($i=0;$i<count($array)-1;$i++)
{
$id=$array[$i];
$num=$arrayquatity[$i];
if($id!="")
{
$sql=mysql_query("select * from shangpin where id='".$id."'",$conn);
$info=mysql_fetch_array($sql);
$total1=$num*$info[huiyuanjia];
$total+=$total1;
$_SESSION["total"]=$total;
?>
<tr>
<td height="25" bgcolor="#FFFFFF"><div align="center"><?php echo $info[mingcheng];?></div></td>
<td height="25" bgcolor="#FFFFFF"><div align="center">
<input type="text" name="<?php echo $info[id];?>" size="2" class="inputcss" value=<?php echo $num;?>>
</div></td>
<td height="25" bgcolor="#FFFFFF"><div align="center"><?php echo $info[shichangjia];?>元</div></td>
<td height="25" bgcolor="#FFFFFF"><div align="center"><?php echo $info[huiyuanjia];?>元</div></td>
<td height="25" bgcolor="#FFFFFF"><div align="center"><?php echo @(ceil(($info[huiyuanjia]/$info[shichangjia])*100))."%";?></div></td>
<td height="25" bgcolor="#FFFFFF"><div align="center"><?php echo $info[huiyuanjia]*$num."元";?></div></td>
<td height="25" bgcolor="#FFFFFF"><div align="center"><a href="removegwc.php?id=<?php echo $info[id]?>">移除</a></div></td>
</tr>
<?php
}
}
?>
<tr>
<td height="25" colspan="8" bgcolor="#FFFFFF"><div align="right">
<table width="500" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="125"><div align="center">
<input type="submit" value="更改商品数量" class="buttoncss">
</div></td>
<td width="125"><div align="center"><a href="gouwu2.php">去收银台</a></div></td>
<td width="125"><div align="center"><a href="gouwu1.php?qk=yes">清空购物车</a></div></td>
<td width="125"><div align="left">总计:<?php echo $total;?></div></td>
</tr>
</table>
</div></td>
</tr>
<?php
}
?>
</table></td>
</tr>
</form>
</table></td>
</tr>
</table>