在我的表中main_stock
,我有一个字段newown
,输入可以是New Purchase或Existing Product。
我想newown
从选定的一天开始创建所有新购买字段的报告 -
首先,我有一个页面,他们可以从日历中选择日期curr_timestamp field
并单击提交。
当他们提交我需要将其带到 php 页面newpurchase_report.php
并显示当天添加的所有新购买的日期时,有什么帮助会很棒吗?
谢谢你
这是目前我的 newpurchases_report.php:
<?php
// connect to the database
$host = '...';
$username = '...';
$pass = '....';
mysql_connect($host,$username,$pass);
mysql_select_db("stock");
$curr_timestamp = $_GET['curr_timestamp'];
$thenumber = 1;
$data = mysql_query("SELECT * FROM main_stock WHERE curr_timestamp='$curr_timestamp' ORDER BY newown ASC ")
or die(mysql_error());
print "<table border cellpadding=1 width=95%>";
print "<span style='font-size: 22px;background-color : #ffff00;'>New Purchases</span>";
print "<tr>";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Number</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Data</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Master Category</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Category</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Product Description</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>New or Exsisting?/span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Barcode</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Serial No.</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Stockcode</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Status</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Hiretrack</span></td> ";
print "</tr> ";
while($info = mysql_fetch_array( $data ))
{
print "<tr> ";
print "<td><span style='font-size: 12px;'>". $thenumber++;"</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['curr_timestamp'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['mastercategory'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['category'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['product_desc'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['newown'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['barcode'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['serial'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['stockcode'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['status'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['hiretrack'] ."</span></td> ";
print "</tr> ";
}
print "</table> ";
// disconnect from the database
mysql_close();
?>
我不确定是这个页面需要编辑还是我的索引页面(您从日历中选择日期)?