<?php


	


/*
$contents_format='<xpml><page quantity="0" pitch="22.0 mm"></xpml>SIZE 62.5 mm, 22 mm
DIRECTION 0,0
REFERENCE 0,0
OFFSET 0 mm
SET PEEL OFF
SET CUTTER OFF
<xpml></page></xpml><xpml><page quantity="1" pitch="22.0 mm"></xpml>SET TEAR ON
CLS
CODEPAGE 1252
TEXT 466,154,"0",180,9,9,"THE ROCK SHOP"
TEXT 449,44,"0",180,6,6,"'.$_REQUEST["pdt_name"].'"
TEXT 438,22,"0",180,12,12,"'.$_REQUEST["pdt_price"].'"
TEXT 423,127,"0",180,8,8,"'.$_REQUEST["pdt_name"].'"
BARCODE 446,109,"128M",49,0,180,2,4,"'.$_REQUEST["pdt_barcode"].'"
TEXT 402,60,"0",180,6,6,"'.$_REQUEST["pdt_barcode"].'"
TEXT 208,154,"0",180,9,9,"THE ROCK SHOP"
TEXT 191,44,"0",180,6,6,"'.$_REQUEST["pdt_name"].'"
TEXT 180,22,"0",180,12,12,"'.$_REQUEST["pdt_price"].'"
TEXT 165,127,"0",180,8,8,"'.$_REQUEST["pdt_code"].'"
BARCODE 188,109,"128M",49,0,180,2,4,"'.$_REQUEST["pdt_barcode"].'"
TEXT 144,60,"0",180,6,6,"'.$_REQUEST["pdt_barcode"].'"
PRINT 1,1
<xpml></page></xpml><xpml><end/></xpml>';
*/



//$_REQUEST["pdt_name"]="1234567890123456789012345678901234567890";


//30-strlen($_REQUEST["pdt_name"]);

$_REQUEST["pdt_name"]=str_pad($_REQUEST["pdt_name"],22," ",STR_PAD_BOTH);
$_REQUEST["pdt_code"]=str_pad($_REQUEST["pdt_code"],22," ",STR_PAD_BOTH);


$contents_format='<xpml><page quantity="0" pitch="23.0 mm"></xpml>SIZE 62.5 mm, 23 mm
DIRECTION 0,0
REFERENCE 0,0
OFFSET 0 mm
SET PEEL OFF
SET CUTTER OFF
<xpml></page></xpml><xpml><page quantity="1" pitch="23.0 mm"></xpml>SET TEAR ON
CLS
CODEPAGE 1252


TEXT 472,155,"0",180,10,10,"THE ROCK SHOP"
TEXT 483,45,"1",180,1,1,"'.$_REQUEST["pdt_name"].'"
TEXT 440,30,"0",180,12,12,"'.$_REQUEST["pdt_price"].'"
TEXT 483,130,"1",180,1,1,"'.$_REQUEST["pdt_code"].'"
BARCODE 483,115,"128M",40,0,180,2,4,"'.$_REQUEST["pdt_barcode"].'"
TEXT 419,70,"0",180,8,8,"'.$_REQUEST["pdt_barcode"].'"



TEXT 214,155,"0",180,10,10,"THE ROCK SHOP"
TEXT 225,45,"1",180,1,1,"'.$_REQUEST["pdt_name"].'"
TEXT 182,30,"0",180,12,12,"'.$_REQUEST["pdt_price"].'"
TEXT 225,130,"1",180,1,1,"'.$_REQUEST["pdt_code"].'"
BARCODE 225,115,"128M",40,0,180,2,4,"'.$_REQUEST["pdt_barcode"].'"
TEXT 161,70,"0",180,8,8,"'.$_REQUEST["pdt_barcode"].'"


PRINT 1,1
<xpml></page></xpml><xpml><end/></xpml>';



//$contents_format=$_REQUEST["content"];

echo $contents_format;
$printer_name="TSC";

//1) using PHP Printer Driver: 
$handle = printer_open($printer_name);
printer_set_option($handle, PRINTER_MODE, "RAW");
printer_write($handle, $contents_format);
printer_close($handle);

echo "done";

				
?>