'; $icon_path = '/info/users/'; //Modal for adding a new Venue setup $member_modal .=''; $massage_block = ""; $form_block = ""; $massage_modal = ""; $content = '
'; //$content .= "
"; if ($shift_block){$shift_block.="";} $_POST = array(); //////////////////////////// //SCRIPT TO SHOW PASSWORD // //////////////////////////// $test_script = << function myPasswrd(n) { var y = "show_hide_password"+n; console.log(y); var x = document.getElementById(y).children[0]; var z = document.getElementById(y).children[1]; var a = z.getElementsByTagName("i"); console.log(a); if (x.type === "password") { x.type = "text"; //while (a.length) a[0].classList.remove('fa-eye'); a[0].classList.add('fa-eye-slash'); //a.classList.remove('fa-eye'); } else { x.type = "password"; a[0].classList.remove( "fa-eye-slash" ); a[0].classList.add( "fa-eye" ); } } //beeping sound for massage end var audiox = document.getElementById("myAudio"); //function to countdown remaining massage time function countdownTimeStart(endDate){ var countDownDate = new Date(endDate).getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance = countDownDate - now; // Time calculations for days, hours, minutes and seconds var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); // Output the result in an element with id="massage_time" if (hours>0){ minutes = minutes + (hours*60); } document.getElementById("massage_time").innerHTML = minutes + "m " + seconds + "s "; //hours + "h " + // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("massage_time").innerHTML = "COMPLETED"; $('#endModal').modal('show'); playAudio(); } }, 1000); } function playAudio() { audiox.play(); audiox.muted = false; } function pauseAudio() { audiox.pause(); audiox.muted = true; } $("#startmassage").submit(function() { var name = $("#player_name").val(); var tbl = $("#table_number").val(); var min = $("#massage_time").val(); if (!name) { $("#player_name").addClass("border border-danger"); //alert("Field is blank. Submit will be prevented."); return false; // no submission }else { $("#player_name").removeClass("border-danger"); } if (!tbl) { $("#table_number").addClass("border border-danger"); //alert("Field is blank. Submit will be prevented."); return false; // no submission }else { $("#table_number").removeClass("border-danger"); } if (!min) { $("#massage_time").addClass("border border-danger"); //alert("Field is blank. Submit will be prevented."); return false; // no submission } //alert("Field is filled. The form will submit."); return true; // form submits }); $("#start5").click(function() { $("#massage_time").val("5"); }); $("#start10").click(function() { $("#massage_time").val("10"); }); $("#start20").click(function() { $("#massage_time").val("20"); }); $("#expandOptions").click(function(event) { event.preventDefault(); $("#massage_time").attr('type', 'text'); $("#comp_code").attr('type', 'text'); $("#startCustom").attr('style', 'display:block;'); $("#expandOptions").attr('style', 'display:none;'); $("#start20").attr('style', 'display:none;'); $("#start10").attr('style', 'display:none;'); $("#start5").attr('style', 'display:none;'); $("#massage_time").val(""); }); //trigger form submission on endModal closing $('#endModal').on('hidden.bs.modal', function () { console.log("We got here"); $('#endmassage').submit(); }); EOT; $test_script .= ""; $content .= ""; $_POST = array(); save_session($user); $header = get_header(); $footer = get_footer(); $mainpage = $header.$massage_modal.$shift_block.$content.$footer.$scripts.$test_script; echo $mainpage; ?>