打印订单--bcty365

来源:互联网 发布:舰娘 mac魔改 编辑:程序博客网 时间:2024/06/02 01:19
<script language="javascript">  //****打印订单;  function openprintwindow(x,y,z){     window.open("printwindow.php?ddno="+x+"&pv="+z,"newframe","top=200,left=200,width=635,height="+(230+20*y)+",menubar=no,location=no,toolbar=no,scrollbars=no,status=no");  }</script>        <table width="630" height="25" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999">  <tr>    <td bgcolor="#FFFFFF"><table width="630" height="25" border="0" align="center" cellpadding="0" cellspacing="0">      <tr>        <td width="340"> </td>        <td width="75"> <img src="images/bg_14(11).jpg" width="69" height="20" onclick="javascript:openprintwindow('<?php echo base64_decode($_GET["ddno"]);?>','<?php echo $gnum;?>','p')" style="cursor:hand"/></td>        <td width="90"><img src="images/bg_14(12).jpg" width="69" height="20"  onclick="javascript:openprintwindow('<?php echo base64_decode($_GET["ddno"]);?>','<?php echo $gnum;?>','v')" style="cursor:hand"/></td>        <td width="125"><img src="images/bg_14(10).jpg" width="69" height="20" onclick="javascript:window.location.href='shopping_tjdd.php?ddno=<?php echo $_GET["ddno"];?>'" style="cursor:hand"/></td>      </tr>    </table>


<?php//***该打印订单生成了订单的图片***include_once("conn/conn.php");include_once("function.php");$ddnumber=$_GET["ddno"];$sql=mysql_query("select * from tb_dd where ddnumber='".$ddnumber."'",$conn);$info=mysql_fetch_array($sql);?><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title></title><link rel="stylesheet" type="text/css" href="css/style.css"></head><script>       function   printview()       {       document.all.WebBrowser1.ExecWB(7,1) ;  window.close();    }      </script>      <object   ID='WebBrowser1'   WIDTH=0   HEIGHT=0   CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object> <body topmargin="0" leftmargin="0" bottommargin="0" onLoad=" <?php if($_GET["pv"]=="p"){ ?>   window.print(); <?php  }elseif($_GET["pv"]=="v"){ ?>   printview()   <?php   } ?>   "><table width="630" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999">                                  <tr>              <td bgcolor="#FFFFFF"><table width="630" border="0" align="center" cellpadding="0" cellspacing="0">                <tr>                  <td height="25" colspan="2"><table width="250" height="20" border="0" align="left" cellpadding="0" cellspacing="0">                    <tr>                      <td width="15" bgcolor="#FFFFFF"><div align="center"></div></td>                      <td width="235" bgcolor="#CCCCCC"><div align="center">吉林省明日科技有限公司-编程词典订单</div></td>                    </tr>                  </table></td>                  <td height="25"> </td>                  <td height="25"><?php echo $info["createtime"];?></td>                </tr><tr>                  <td height="1" colspan="4" valign="top"><hr size="1" color="#CCCCCC" width="600"></td>                  </tr>                <tr>                  <td width="125" height="18"><div align="right">订单号:</div></td>                  <td height="18" colspan="3"> <?php echo $info["ddnumber"];?></td>                </tr>                <tr>                  <td height="18"><div align="right">收货人:</div></td>                  <td width="222" height="18"> <?php echo $info["recuser"];?></td>                  <td width="125" height="18"><div align="right">邮编:</div></td>                  <td width="208" height="18"> <?php echo $info["yb"];?></td>                </tr>                <tr>                  <td height="18"><div align="right">移动电话:</div></td>                  <td height="18"> <?php echo $info["mtel"];?></td>                  <td height="18"><div align="right">固定电话:</div></td>                  <td height="18"> <?php echo $info["gtel"];?></td>                </tr>                <tr>                  <td height="18"><div align="right">联系地址:</div></td>                  <td height="18" colspan="3"> <?php echo unhtml($info["address"]);?></td>                  </tr>                <tr>                  <td height="20" colspan="4"><br><table width="550" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">                    <tr>                      <td height="18" bgcolor="#CCCCCC"><div align="center">商品名称</div></td>                      <td bgcolor="#CCCCCC"><div align="center">单价(元)</div></td>                      <td bgcolor="#CCCCCC"><div align="center">数量</div></td>                      <td bgcolor="#CCCCCC"><div align="center">小计(元)</div></td>                    </tr>             <?php $array=explode("@",$info["spc"]); $arraynum=explode("@",$info["slc"]); $markid=0; for($i=0;$i<count($array);$i++){   if($array[$i]!=""){     $markid++;   } } if($markid==0){ ?>     <tr>                      <td height="18" colspan="4" bgcolor="#FFFFFF"><div align="center">暂无商品信息!</div></td>                     </tr><?php}else{       $totalprice=0;   $gnum=0;   for($i=0;$i<count($array);$i++){     if($array[$i]!=""){   $sqldd=mysql_query("select * from tb_bccd where id='".$array[$i]."'",$conn);   $infodd=mysql_fetch_array($sqldd)?>  <tr>                      <td height="18" bgcolor="#FFFFFF"> <?php echo unhtml($infodd["bccdname"]);?></td>                      <td height="18" bgcolor="#FFFFFF"><div align="center"><?php echo number_format($infodd["price"],2);?></div></td>                      <td height="18" bgcolor="#FFFFFF"><div align="center"><?php echo $arraynum[$i];?></div></td>                      <td height="18" bgcolor="#FFFFFF"><div align="center"><?php echo number_format($infodd["price"]*$arraynum[$i],2);?></div></td>                    </tr><?php        $totalprice+=$infodd["price"]*$arraynum["$i"];   $gnum++;     }   }}?>                  </table>      <table width="550" height="50" border="0" align="center" cellpadding="0" cellspacing="0">                      <tr>                        <td height="25"> </td>                        <td width="60" height="25"><div align="center">商品总计:</div></td>                        <td width="112"> <?php echo number_format($totalprice,2);?> 元</td>                      </tr>                                          <tr>                        <td height="25"> </td>                        <td height="25"><div align="right">邮费:</div></td>                        <td height="25"> <?php echo number_format($info["yprice"],2);?> 元</td>                      </tr>  <tr>                        <td width="378" height="1"></td>                        <td height="1" colspan="2" bgcolor="#CCCCCC"></td>                      </tr>  <tr>                        <td height="25" colspan="2"><div align="right"><strong>你需要支付的金额总计为:</strong></div></td>                        <td width="112"> <?php echo number_format($info["totalprice"],2);?> 元</td>                      </tr>                    </table>    </td>                </tr>                <tr>                  <td height="1" colspan="4" valign="top"><hr size="1" color="#CCCCCC" width="600"></td>                 </tr> <tr>                  <td height="2" colspan="4" valign="top"></td>                 </tr>              </table></td>    </tr>          </table></body></html>

0 0
原创粉丝点击