Solved

MySQL XML Printing

Posted on 2013-06-20
8
343 Views
Last Modified: 2013-07-05
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
0
Comment
Question by:DS928
  • 4
  • 2
  • 2
8 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39263989
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?
0
 

Author Comment

by:DS928
ID: 39264415
Thank you.  Have this...it seems to start around page 8.
iBacsTel-Remote-Printer-Develope.pdf
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39268179
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.
0
 

Author Comment

by:DS928
ID: 39268199
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
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 39288794
Read section 3 of the pdf file you attached (pages 3-5).  The printer will see %% as a newline:
- %% = New line
- /r = Bold and Bigger header text
- /- = Dotted Line like -----------------------------------

The line of php code you posted ads a string to the lines array.  That string begins and ends with '#'.  Based on the Section 3 of the PDF, that string uses the "Fixed Format".  So that is what you need to look at.
0
 

Author Comment

by:DS928
ID: 39288896
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?
0
 
LVL 82

Expert Comment

by:hielo
ID: 39289029
>>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
0
 

Author Comment

by:DS928
ID: 39302773
This company is not very helpful.  I have been trying for months to work this out with them.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
problems with mysql ODBC Connector and vbscript 4 23
WordPress syntax 2 24
updating the date data 12 19
How do I change the from header when sending a mail 1 16
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now