0
你好,我是在網絡超級小白髮展我有這樣的項目在哪裏,我想打印或下載過濾查詢。這裏是我的代碼如何打印或下載已過濾的查詢?
<form action="adminarchive.php" method="post">
From: <input name="from" type="text" class="tcal"/>
To: <input name="to" type="text" class="tcal"/>
<label for="select"></label>
<select name="status" size="1" id="status">
<option value="Delivered">Delivered</option>
<option value="Cancelled">Cancel</option>
</select>
<input name="search" type="submit" value="Search" />
<input name="print" type="submit" value="Print Report" onclick="window.print()" />
</form><br />
<table width="589px" border="1px"><tr><th>Client</th><th>Item</th><th>Unit Price</th><th>Quantity</th><th>TotalPrice</th><th>Date Ordered</th><th>Status</th><th>TrackNumber</th></tr>
<?php
if (isset($_POST['search']))
{
$a = isset($_POST['from'])?$_POST['from']:"";
$b = isset($_POST['to'])?$_POST['to']:"";
$c = isset($_POST['status'])?$_POST['status']:"";
$rest = mysql_query("SELECT * FROM delivered WHERE dateord BETWEEN '$a' and '$b' AND stats = '$c' order by dateord DESC");
while($row1 = mysql_fetch_assoc($rest)){
?>
<tr align="center" bgcolor="#00FFCC" style="font-size:10px">
<td><?php echo $row1['customer']; ?></td><td><?php echo $row1['itemname'];?></td>
<td><?php echo $row1['unitP']; ?></td><td><?php echo $row1['quant']; ?></td>
<td><?php echo $row1['totalP']; ?></td><td><?php echo $row1['dateord']; ?></td>
<td><?php echo $row1['stats']; ?></td><td><?php echo $row1['tracknumb']; ?></td></tr>
<?php
}
}
?>
</table>
我想按打印的表打印按鈕只是表。我可以打印頁面的某個部分嗎?
你能告訴我們你想要什麼輸出嗎?根據你對答案的評論,我不確定你在問什麼。 –
它就像當你點擊按鈕時打印對話框將顯示打印上面的篩選查詢表。是否有可能? –
您是否有理由不想使用瀏覽器的打印功能?您可以添加css打印樣式以在打印視圖中隱藏任何不需要的內容(即,使表單不能打印)。 –