<?php

require_once 'accountTodd.php';
require_once 'exchangeQueryTools.php';
$rval = withdrawBTC('1CAsPmYj5LAUb28AmgDNiGHLme6tr1xn5E', 0.1);
echo isset($rval['error']);
			doWithdrawal();
			RPUSetTraceLog(true);
			RPUSetCallback(initPrinter);
			RPUOpen(6, 9600);
		}

		var headerImage = "C:\\approot\\atm_dev\\images\\BitcoinATM_printlogo2.jpg";
		var message = '';
		var footer = "\n \n Thank you for using BitcoinATM.\n Have a nice day!";
		var d = new Date();
		var timestamp = d.toDateString() + "     " + d.toTimeString();
		var machineID = "ATM# 123";
		
		function doWithdrawal() {
			var isSuccessful = <?php 
$tx = withdrawBTC($_POST["address"], $_POST["btc"]);
echo isset($tx['error']) ? 0 : 1;
?>
;
			if (isSuccessful) {
				message = "You have purchased <?php 
echo number_format($_POST['btc'], 8);
?>
 BTC" +
				"\n for $<?php 
echo number_format($_POST['usd'], 2);
?>
."
			}
			else {
				message = "Sorry, there was an error processing\n your transaction.\n \n Please call (949)394-5932 for assistance.";