drouie2014 2019-04-22 22:28
浏览 56

为什么蓝牙快速打印机脚本会阻止页面执行完成

The following code prints to the bluetooth printer via the sendToQuickPrinter function perfectly, but the page does not run the PHP script below it. When the printer completes printing, I need the page to execute the php script to call a different page. Thanks

<script>
function sendToQuickPrinter(){
var text =
"<CENTER><MEDIUM2><?php echo $shop_name ?><BR>" +
"<CENTER><?php echo $display_date ?>        <?php echo $display_time ? 
<BR><BR>" +
"Description          Price<BR>" +
"<?php $i=0;while($i < $print_count){$i=$i+1; echo 
$p_name_array[$i].';; ;;'.$transaction_qty_array[$i].' @ 
'.number_format($p_price_array[$i],2).'<BR>';} ?>" +
"<BR>" +
"<CENTER>Sub-total      $<?php echo number_format($subtotal,2) ?><BR>" 
+
"<CENTER>Tax            $<?php echo number_format($subtax,2) ?><BR>" +
"<CENTER>Total          $<?php echo number_format($item_total,2) ?> 
<BR>" +
"<BR>" +
"<CENTER>Thank you for shopping with us, we appreciate your business! 
<BR>" +
"<CENTER><MEDIUM2> Have a great day!<BR>" +
"<BR>" +
"<CUT>" +
"DRAWER";
var textEncoded = encodeURI(text);
window.location.href="quickprinter://"+textEncoded;
}
sendToQuickPrinter();
</script>

<?php
$path = "cart.php";

function success_return($path, $shop_name, $longitude, $latitude) {  
    include($path);
}  

success_return($path, $shop_name, $longitude, $latitude);
exit;
?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度