PHP+CSS实现打印简单数据报表功能
功能:实现打印日报表的功能,定义了专门的打印样式,隐藏了不该打印的控件并实现了分页打印功能,表名:rec 字段:rec_id,rec_po,rec_part,rec_plant,rec_vendor,rec_pur_um,rec_req_date,rec_req_qty,rec_rec_qty,rec_iqc_date,rec_notes
完整源代码如下:
Daily Report
body {
margin: 9px;
padding: 0;
color: black;
text-decoration: none;
font-size: 10pt;
font-family: "Courier New";
}
input {
font-family: Arial;
}
th {
font-weight: normal;
border-bottom: 1px solid black;
}
td {
font-size: 9pt;
font-family: "Courier New";
}
td.pod {
font-size: 11pt;
font-family: "Courier New";
}
th.pod {
font-size: 11pt;
font-family: "Courier New";
}
td.endline {
border-top: 1px solid black;
}
.left {
text-align: left;
}
.right {
text-align: right;
}
.center {
text-align: center;
}
.top {
vertical-align: top;
}
@media print {
.noprint { display: none; }
}
define ("SP10" ,' ');
global re;
function db_link()
{
access_id = "root";
access_pwd = "831025";
db_name = "inv";
@ db = mysql_connect('localhost', access_id, access_pwd) or
die("Could not connect to database. Please contact with IT supporting team ASAP.");
mysql_query("SET NAMES 'GBK'");
mysql_select_db(db_name);
return db;
}
link=db_link();
?>
Program :
bom_report.php
Date/Time :
Plant :
SJ01
User Name :
liuxueping
Receiving Date :
Page :
1