EasyManua.ls Logo

Epson TM-T88V-DT

Epson TM-T88V-DT
64 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
52
Program Example
See the following programming data (file name: Test_print.php)
<?php
header('Content-Type: text/xml; charset=UTF-8');
define("REQUEST_XML_PATH", "demo/request/sample.xml");
define("RESPONSE_XML_PATH", "demo/response/sample.xml");
if (isset($_POST["ConnectionType"])) {
$http_request = $_POST["ConnectionType"];
}
if ($http_request == 'GetRequest') {
# send print data
# ID
$shop_id = $_POST["ID"];
# create print data
if (file_exists(REQUEST_XML_PATH)) {
# return print data
$handle = fopen(REQUEST_XML_PATH, "r");
fpassthru($handle);
fclose($handle);
# move file
rename(REQUEST_XML_PATH, RESPONSE_XML_PATH);
}
} else if ($http_request == 'SetResponse') {
# get print result
$xml = simplexml_load_string($_POST["ResponseFile"]);
if (count($xml->response) != 0) {
# save log
$fhandle = @fopen("ResultPrint.log", "wt");
foreach ($xml->response as $response) {
fprintf($fhandle, "success : %s\ncode : %s\n", $response['success'],
$response['code']);
}
fclose($fhandle);
}
} else {
# Ignore other connectionType than GetRequest and SetResponse.
}
?>

Table of Contents

Other manuals for Epson TM-T88V-DT

Related product manuals