You just have a quoting issue. :
$UpdateText="updateReTotal(Tills,'pos_cash','{$till->till_id}');updateVariance('{$till->till_id}')";
echo '<script type="text/javascript">'
, "testFunctionForUpdateTotal('".$UpdateText."');"
, '</script>';
This is a good example of why you should avoid using echo
statements to output HTML. PHP is designed to allow you to embed PHP inside of your HTML and you should take advantage of that:
$UpdateText="updateReTotal(Tills,'pos_cash','{$till->till_id}');updateVariance('{$till->till_id}')";
?>
<script type="text/javascript">
testFunctionForUpdateTotal('<?= $UpdateText; ?>');
</script>';
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…