a.php
<div id="divAll" name="divAll">
<form name="form1" method="post" action="b.php" onSubmit="{if(confirm('确定要提交所选定的记录开票吗?')){return true;}return false;}">
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="75" bgcolor="#666666"><table width="750" height="86" border="0" cellpadding="0" cellspacing="1">
<tr>
<td height="20" colspan="11" bgcolor="#666666"><div align="center" class="style1">可开具发票信息列表</div></td>
</tr>
<tr>
<td width="34" height="28" align="center" bgcolor="#FFFFFF">
<input name="ch_all" type="checkbox" onClick="selectAll(form1);" checked></td>
<td width="80" bgcolor="#FFFFFF"><div align="center">发货单号</div></td>
<td width="80" bgcolor="#FFFFFF"><div align="center">询价单号</div></td>
<td width="120" bgcolor="#FFFFFF"><div align="center">名称</div></td>
<td width="90" bgcolor="#FFFFFF"><div align="center">品牌</div></td>
<td width="70" bgcolor="#FFFFFF"><div align="center">型号</div></td>
<td width="68" bgcolor="#FFFFFF"><div align="center">发货数量</div></td>
<td width="67" bgcolor="#FFFFFF"><div align="center">可开票数量</div></td>
<td width="58" bgcolor="#FFFFFF"><div align="center">开票状态</div></td>
<td width="63" bgcolor="#FFFFFF"><div align="center">单价</div></td>
<td width="70" align="center" bgcolor="#FFFFFF">金额</td>
</tr>
<?php
$sql1=mysql_query("SELECT sendorder.sdorderid,sendorder.orderid,order_item.itemname,order_item.itemtype,order_item.pingpai,order_item.qty,sendorder.kp_sl,order_item.dj,order_item.je FROM
order_item INNER JOIN sendorder ON (order_item.orderid = sendorder.orderid) WHERE(sendorder.is_rk = TRUE AND sendorder.is_kp = False) OR ( sendorder.is_kp = TRUE and order_item.qty > sendorder.kp_sl)",$conn);
while($info1=mysql_fetch_array($sql1))
{
?>
<tr bgcolor="#FFFFFF" onMouseOver="this.bgColor='#ffff99'" onMouseOut="this.bgColor='#ffffff'">
<td height="25"><div align="center">
<input name="<?php echo $info1[orderid];?>" type="checkbox" value=<?php echo $info1[orderid];?> checked>
</div></td>
<td height="25">
<div align="center"><?php echo $info1[sdorderid];?></div></td>
<td><div align="center"><?php echo $info1[orderid];?></div></td>
<td height="25"><div align="center"><?php echo $info1[itemname];?></div></td>
<td height="25"><div align="center"><?php echo $info1[pingpai];?></div></td>
<td height="25"><div align="center"><?php echo $info1[itemtype];?></div></td>
<td><div align="center"><?php echo $info1[qty];?></div></td>
<td height="25"><div align="center" class="style2">
<input name="<?php echo $info1[orderid];?>" type="text" class="inputcss" id="<?php echo $info1[orderid];?>" style="background-color:#e8f4ff " onMouseOver="this.style.backgroundColor='#ffffff'" onMouseOut="this.style.backgroundColor='#e8f4ff'" value="<?php if($info1[qty]>$info1[kp_sl]) {echo $info1[qty]-$info1[kp_sl];} else {echo $info1[qty];}?>" size="10">
</div></td>
<td height="25"><div align="center" class="style2"><?php if($info1[qty]>$info1[kp_sl]) {echo "结转";} else {echo "未开票";}?></div></td>
<td height="25"><div align="center"><?php echo $info1[dj];?></div></td>
<td align="center"><?php echo $info1[je];?></td>
</tr>
<?php
}
?>
</table></td>
</tr>
</table>
<table width="750" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="165">
<div align="left"><input type="submit" value="提交发票" class="buttoncss">
<input type="reset" value="重新选择" class="buttoncss"></div></td>
<td width="585"><div align="right"> 共有可开具发票信息
<?php
echo $total;
?>
条
<?php }?>
</div></td>
</tr>
</table>
</form>
</div>b.php
<?php
while(list($name,$value)=each($_POST))
{
echo $value;
echo " ";
echo $name;
echo "<p>";
}
?>b.php把所有的记录都显示出来了,不管选没选中!要求把checkbox选中的记录包括input的值过滤出来,哪位大虾告诉我怎么做???
<div id="divAll" name="divAll">
<form name="form1" method="post" action="b.php" onSubmit="{if(confirm('确定要提交所选定的记录开票吗?')){return true;}return false;}">
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="75" bgcolor="#666666"><table width="750" height="86" border="0" cellpadding="0" cellspacing="1">
<tr>
<td height="20" colspan="11" bgcolor="#666666"><div align="center" class="style1">可开具发票信息列表</div></td>
</tr>
<tr>
<td width="34" height="28" align="center" bgcolor="#FFFFFF">
<input name="ch_all" type="checkbox" onClick="selectAll(form1);" checked></td>
<td width="80" bgcolor="#FFFFFF"><div align="center">发货单号</div></td>
<td width="80" bgcolor="#FFFFFF"><div align="center">询价单号</div></td>
<td width="120" bgcolor="#FFFFFF"><div align="center">名称</div></td>
<td width="90" bgcolor="#FFFFFF"><div align="center">品牌</div></td>
<td width="70" bgcolor="#FFFFFF"><div align="center">型号</div></td>
<td width="68" bgcolor="#FFFFFF"><div align="center">发货数量</div></td>
<td width="67" bgcolor="#FFFFFF"><div align="center">可开票数量</div></td>
<td width="58" bgcolor="#FFFFFF"><div align="center">开票状态</div></td>
<td width="63" bgcolor="#FFFFFF"><div align="center">单价</div></td>
<td width="70" align="center" bgcolor="#FFFFFF">金额</td>
</tr>
<?php
$sql1=mysql_query("SELECT sendorder.sdorderid,sendorder.orderid,order_item.itemname,order_item.itemtype,order_item.pingpai,order_item.qty,sendorder.kp_sl,order_item.dj,order_item.je FROM
order_item INNER JOIN sendorder ON (order_item.orderid = sendorder.orderid) WHERE(sendorder.is_rk = TRUE AND sendorder.is_kp = False) OR ( sendorder.is_kp = TRUE and order_item.qty > sendorder.kp_sl)",$conn);
while($info1=mysql_fetch_array($sql1))
{
?>
<tr bgcolor="#FFFFFF" onMouseOver="this.bgColor='#ffff99'" onMouseOut="this.bgColor='#ffffff'">
<td height="25"><div align="center">
<input name="<?php echo $info1[orderid];?>" type="checkbox" value=<?php echo $info1[orderid];?> checked>
</div></td>
<td height="25">
<div align="center"><?php echo $info1[sdorderid];?></div></td>
<td><div align="center"><?php echo $info1[orderid];?></div></td>
<td height="25"><div align="center"><?php echo $info1[itemname];?></div></td>
<td height="25"><div align="center"><?php echo $info1[pingpai];?></div></td>
<td height="25"><div align="center"><?php echo $info1[itemtype];?></div></td>
<td><div align="center"><?php echo $info1[qty];?></div></td>
<td height="25"><div align="center" class="style2">
<input name="<?php echo $info1[orderid];?>" type="text" class="inputcss" id="<?php echo $info1[orderid];?>" style="background-color:#e8f4ff " onMouseOver="this.style.backgroundColor='#ffffff'" onMouseOut="this.style.backgroundColor='#e8f4ff'" value="<?php if($info1[qty]>$info1[kp_sl]) {echo $info1[qty]-$info1[kp_sl];} else {echo $info1[qty];}?>" size="10">
</div></td>
<td height="25"><div align="center" class="style2"><?php if($info1[qty]>$info1[kp_sl]) {echo "结转";} else {echo "未开票";}?></div></td>
<td height="25"><div align="center"><?php echo $info1[dj];?></div></td>
<td align="center"><?php echo $info1[je];?></td>
</tr>
<?php
}
?>
</table></td>
</tr>
</table>
<table width="750" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="165">
<div align="left"><input type="submit" value="提交发票" class="buttoncss">
<input type="reset" value="重新选择" class="buttoncss"></div></td>
<td width="585"><div align="right"> 共有可开具发票信息
<?php
echo $total;
?>
条
<?php }?>
</div></td>
</tr>
</table>
</form>
</div>b.php
<?php
while(list($name,$value)=each($_POST))
{
echo $value;
echo " ";
echo $name;
echo "<p>";
}
?>b.php把所有的记录都显示出来了,不管选没选中!要求把checkbox选中的记录包括input的值过滤出来,哪位大虾告诉我怎么做???
<p>
<input type="checkbox" name="tf1" value="1">
<input type="checkbox" name="tf2" value="2">
<input type="checkbox" name="tf3" value="3">
<input type="checkbox" name="tf4" value="4">
<input type="checkbox" name="tf5" value="5">
<input type="hidden" name="check_num" value="5">
</p>
</form>
//test.php
for($i = 0 ; $i <= $check_num ; $i++)
{
$tf = "tf".$i;
echo $tf;
echo " = ";
echo $$tf;
echo "<br>\n";
}