<?

  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");             // Date in the past
  header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
  header("Cache-Control: no-cache, must-revalidate");           // HTTP/1.1
  header("Pragma: no-cache");                                   // HTTP/1.0


 $number="1512459";
 $cost=1;
 $payment=0;
 $fromcl="Шелашский Денис";
 $tocl="Автолюкс. Иовса Сергей 377392";
 $place=1;
 $totalplaces=1;
 $cityfrom="Киев а/в";
 $cityto="Одесса";
 $tf = "КО-4 на 18.09.2003";
 


 $descr = "Конверт";
 $spec = "нет";
 $declcs = 1;
 $ispoln = "Шелашский Д.Ю.";

 $tf = substr($tf,0,5).substr($tf,8,-4).substr($tf,-2,2);

 $df = substr($tf,-8)." в 22:00";

$a = fopen("lpt1", "a");
# $num = sprintf("%012d",$number);

$fromcl1 = addslashes(substr(stripslashes(str_replace("\r\n"," ",stripslashes(urldecode($fromcl)))),0,9));
$fromcl2 = addslashes(substr(stripslashes(str_replace("\r\n"," ",stripslashes(urldecode($fromcl)))),9,9));
$tocl1 = addslashes(substr(stripslashes(str_replace("\r\n"," ",stripslashes(urldecode($tocl)))),0,12));
$tocl2 = addslashes(substr(stripslashes(str_replace("\r\n"," ",stripslashes(urldecode($tocl)))),12,18));




$cityfrom=rawurldecode($cityfrom);
$cityto = substr(rawurldecode($cityto),0,14);


    $placecost="A280,240,0,b,1,1,";
    if ($cost==1)
    {
        $placecost.="N,\"Служебный\"\n";

    } else
    if ($payment==0) 
    {
      $placecost.="N,\"Опл: $cost грн\"\n";
    } else
    if ($payment==1)
    {
      $placecost.="N,\"Б/н: $cost грн\"\n";

    } else

    if ($payment==2)
    {
      $placecost.="R,\"Н/о: $cost грн\"\n";
    }



fwrite($a,"\n

Q32,0\n
\n
N\n
\n

A0,0,0,d,2,1,N,\"$tf\"\n
A0,36,0,c,3,3,N,\"$number\"\n

A20,144,0,b,1,1,N,\"Мест:\"\n
A140,145,0,4,1,1,R,\"$totalplaces\"\n

GG215,121,\"LOGO1\"\n

LO1,186,445,1\n
A20,192,0,b,1,1,N,\"Получатель:\"\n
A180,187,0,c,1,1,N,\"$tocl1\"\n
A20,219,0,c,1,1,N,\"$tocl2\"\n
LO1,257,445,1\n  0
\n

\n

$placecost
\n

A30,280,0,c,1,1,N,\"$cityfrom\"\n
A200,280,0,c,1,1,R,\"$cityto\"\n

LO1,330,445,2\n
A20,340,0,b,1,1,N,\"Описание:  [ $descr ]\"\n
A20,365,0,b,1,1,N,\"Особые условия:   [ $spec ]\"\n
A20,390,0,b,1,1,N,\"Задеклар. стоимость: [ $declcs грн. ]\"\n
A20,415,0,b,1,1,N,\"Отправление $df\"\n
LO1,451,445,1\n
A20,457,0,b,1,1,N,\"Отправитель:\"\n
A180,452,0,c,1,1,N,\"$fromcl1\"\n
A20,484,0,c,1,1,N,\"$fromcl2\"\n
LO1,522,445,1\n
A20,530,0,b,1,1,N,\"Подпись\"\n
A20,555,0,b,1,1,N,\"отправителя:\"\n
LO170,585,445,1\n

A20,600,0,b,1,1,N,\"Исполнитель: $ispoln\"\n
A20,640,0,b,1,1,N,\"Подпись\"\n
A20,665,0,b,1,1,N,\"исполнителя:\"\n
LO170,695,445,1\n

A20,705,0,b,1,1,N,\"Договор доставки на след. странице.\"\n

P1\n

C\n

\n");


fclose($a);

#  
?>

<html>
<body onLoad="window.close();">

</body>
</html>
