Link to home
Start Free TrialLog in
Avatar of DS928
DS928Flag for United States of America

asked on

MySQL XML Printing

I have a receipt printer and I am trying to format the file.  Being new to this, I still don't have a handle on what does what to what.  This is the MySQL, PHP string that I am trying to modify, I am not sure where the line breaks are or how they are implemented.

$lines[] = "#2*". $order["OrderPolicyId"] ."*".$order["OrderId"] ."*". implode(';', $items)."*".str_replace(',', ' '.$order["lastname"]).";". str_replace( array(',', ';') , ' ', "*".$order["streetname"]).";". $order["DeliveryTime"] .' '. date("d-m-y", strtotime($order["OrderDate"])).";".$order["phone"].";*".str_replace(';', ' ', $order["comments"])."#";

Open in new window


I am attaching the XML file, once again I am not sure how they tie together.  Any help is appreciated.  Thank you.
ibacstel-1.xml
ibacstel-2.xml
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

There are no line breaks in the code snippet.  In the attached files, there is the \r character, which is a "carriage return" signal.  Do you have any documentation that came with the printer?
Avatar of DS928

ASKER

Thank you.  Have this...it seems to start around page 8.
iBacsTel-Remote-Printer-Develope.pdf
Wow, this looks like a fairly complicated research and development project.  Maybe contact them here:
http://ibacstel.com/development.php

I don't know if slash-direction matters, but their development docs seem to refer to /r and the sample files posted here contain \r -- maybe worth checking.
Avatar of DS928

ASKER

Maybe, maybe not.  I think it's being explained badly.  They are useless as far as tech support goes.  The snippet I posted defintly affects what is printed and what is not printed.  I am trying to figure out the logic behind the XML file and its relation to te code snippet.  I am attaching the PHP page with the full code.  Maybe that will help. Thank you.
database.php
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DS928

ASKER

Thank you. This makes it much clear!  But how does the XML file affect the PHP file?  The php is for content?  And the XML is for format?  If si how do you edit the XML file?
>>And the XML is for format?
That seems to be the case.  Section 5 and Section 12 talk about it.  It seems that the tool that Section 5 refers to is what is covered in Section 11.

From what I understood, those xml files have predefined formatting. Ex:
"Order No:".  But if you preferred "Order Number:" you would need to edit the xml files before you complete the steps in Section 11.

Then in section 12 it tells you to "Please select the xml files accordingly...Once these are selected, now you can go through the Settings and change the settings according to your needs"

Did you request the API and/or the command reference? Perhaps those will help you.
http://www.ibacstel.com/developers-guide.php
Avatar of DS928

ASKER

This company is not very helpful.  I have been trying for months to work this out with them.