call for every 5 seconds and check new order then popup

==

<audio id="myAudio">
<source src="{{asset('public/assets/back-end/sound/notification.mp3')}}" type="audio/mpeg">
</audio>
<script>
var audio = document.getElementById("myAudio");

function playAudio() {
audio.play();
}

function pauseAudio() {
audio.pause();
}
</script>




<script>
@if(\App\CPU\Helpers::module_permission_check('order_management') && env('APP_MODE')!='dev')
setInterval(function () {
$.get({
url: '{{route('admin.get-order-data')}}',
dataType: 'json',
success: function (response) {
let data = response.data;
if (data.new_order > 0) {
playAudio();
$('#popup-modal').appendTo("body").modal('show');
}
},
});
}, 10000);
@endif

function check_order() {
location.href = '{{route('admin.orders.list',['status'=>'all'])}}';
}
</script>


== 

No comments:

Post a Comment

Event listening in react

 How we can listen to som eevents some envents fire like click or automatically user enters into input button , that is event on word type i...