graham23s Posted August 1, 2008 Share Posted August 1, 2008 Hi Guys, on our ecommerce site we display the data coming from the completed orders table like: <?php case "view-test-order-details": // Grab the hidden var $order_id = (int)$_POST['hid_id']; // grab everthing asscociated with the id $q_order = "SELECT * FROM `fcp_orders_completed` WHERE `ID`='$order_id'"; $r_order = mysql_query($q_order); $a_order = mysql_fetch_array($r_order); $order_invoice_id = $a_order['ID']; $order_wp_id = $a_order['WP_CART_ID']; // print out invoice page print("<table class=\"tbl_invoice\" width=\"700\" cellpadding=\"5\" cellspacing=\"0\">"); print("<tr>"); print("<td align=\"left\" valign=\"top\" ><h1>INVOICE FCP IMAGE HERE!</h1></td><td align=\"right\">Razwan Shafi<br />Carmmunock Pharmacy<br />17 Busby Road<br />Glasgow<br />United Kingdom<br />Tel: 0141 644 1765</td>"); print("</tr>"); print("<tr>"); print("<td align=\"center\" colspan=\"2\"><hr /></td>"); print("</tr>"); print("<tr>"); print("<td align=\"left\">Invoice ID:</td><td align=\"right\"><b>$order_invoice_id</b></td>"); print("</tr>"); print("<tr>"); print("<td align=\"left\">Transaction ID:</td><td align=\"right\"><b>$order_wp_id</b></td>"); print("</tr>"); print("<tr>"); print("<td align=\"center\" colspan=\"2\"><hr /></td>"); print("</tr>"); print("<tr>"); print("<td align=\"center\" colspan=\"2\"><input type=\"submit\" name=\"print_invoice\" value=\"Print Invoice\"></td>"); print("</tr>"); print("</table>"); break; ?> im wondering how we would go about pressing the print button and only the invoice is printed off! any help would be great cheers Graham Link to comment https://forums.phpfreaks.com/topic/117752-printing-off-a-certain-area/ Share on other sites More sharing options...
lemmin Posted August 1, 2008 Share Posted August 1, 2008 Custom print templates allow you to customize what IE prints, but I don't know how it works in other browsers. http://msdn.microsoft.com/en-us/library/aa753280(VS.85).aspx Link to comment https://forums.phpfreaks.com/topic/117752-printing-off-a-certain-area/#findComment-605655 Share on other sites More sharing options...
chronister Posted August 2, 2008 Share Posted August 2, 2008 I would use CSS to accomplish this. Wrap the code you don't want printing in a div and give it an ID, create a css file and place the id in there with a display:none. Call the CSS file as media="print" and it will only be applied to printed pages. That is how I have accomplished these things previously. Nate Link to comment https://forums.phpfreaks.com/topic/117752-printing-off-a-certain-area/#findComment-605804 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.