以下为引用的内容:
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 |
|
|
rec_sql = "SELECT * FROM rec WHERE rec_plant = 'SJ01' ORDER BY rec_id DESC"; rec_res = mysql_query(rec_sql); rec_num = mysql_num_rows(rec_res);
if(rec_num>0){ for (i = 0; i < rec_num; i++){ re++; rec_row = mysql_fetch_array(rec_res);
part_sql = "SELECT pt_desc FROM part WHERE pt_part='".rec_row['rec_part']."' "; part_res = mysql_query(part_sql); part_row = mysql_fetch_array(part_res); echo'
'.(i+1).' |
'.rec_row['rec_vendor'].' |
'.rec_row['rec_part'].' |
'.part_row['pt_desc'].' |
'.rec_row['rec_pur_um'].' |
'.substr(rec_row['rec_req_date'], 0, 10).' |
'.number_format(rec_row['rec_req_qty'], 2).' |
'.number_format(rec_row['rec_rec_qty'],2).' |
'.number_format(rec_row['rec_rec_qty'],2).' |
'.substr(rec_row['rec_iqc_date'], 0 ,10).' |
'.rec_row['rec_notes'].' |
';
//每页只打印10条记录,如果记录数是10的倍数后,显示'***End of Report***'并开始打印下一页 if(re%10 == 0 and re != rec_num){ echo'
*** End of Report *** |
'; //下一页开始打印 echo '
Program : | bom_pro.php | '.SP10.' | Date/Time : | '.date("Y-m-d").'/'.date("H:i:s").' |
Plant : | SJ01 | '.SP10.' | User Name : | lucas |
Receiving Date : | '.date('Y-m-d').' | '.SP10.' | Page : | ';echo re/10+1;echo' |
|
'; } else{ echo'
|