Please bare with me here. What I know about php is self taught and very basic. I didn't write the code myself but I just tweak the code where I can and when needed. The mysql database is called ics. There is a table called Printer which stores all the label printers info (unique id, name and ip address of every eltron/zebra printer attached to a print server). Each employee that prints labels selects the label printer they want to print to and the printer unique id is stored in the Employee table.
I'm not getting any errors. I get the label printed response but the label just doesn't print. By my understanding, rlpr is not a recognized statement by windows?
Here is the code from each file that has to do with the labels.
stockline.php
require 'ics.php';
require 'html.php';
require 'label.inc';
else if ( $_GET['print_label'] )
{
label_print(label_part($_GET['StockId']));
html_status("Printed Label for Control #$_GET[StockId]");
$PartNumber = $_SESSION['ICS_PartNumber'];
html.php
// html_button() generates a "button" as a small HTML table.
function html_button($url, $label)
{
?>
<table border="1" cellspacing="0" cellpadding="3"><tr class="menu">
<th><a class="menu" href="<?php echo $url; ?>"><?php echo $label; ?></a></th>
</tr></table>
<?php
}
?>
label.inc
/*
label.inc
This file contains four label template functions:
label_part($StockId),
label_receiving($StockId, $Copies),
label_shipping_address($SalesOrderId, $InvoiceId),
label_shipping_part($SalesOrderId, $SOItemId, $qty)
and one helper function:
label_print($label)
*/
function label_print($label)
{
$Printer = ics_select('Employee, Printer', 'Address',
"EmployeeId=$_SESSION[ICS_UserId] and LabelPrinter=PrinterId");
$pipe = popen("rlpr -H$Printer[Address]", "w");
fwrite($pipe, $label);
pclose($pipe);
}
below in this file is the code that constructs the label with the information from mysql but I don't think any of that is the issue because it works fine on linux.