update qr code

This commit is contained in:
Aung Myo
2017-09-11 15:44:45 +06:30
parent a9d31935a1
commit 361e439664
3 changed files with 83 additions and 0 deletions

View File

@@ -33,6 +33,9 @@
</div>
<% end %>
<button id="member_acc_no" class="btn btn-success btn-md"><span class="fa fa-credit-card"></span> Member Card</button>
<button id="qr_code" class="btn btn-danger btn-md" data-toggle="modal" data-target="#myModal"><span class="fa fa-credit-card"></span> QR CODE</button>
</td>
</tr>
<tr>
@@ -91,6 +94,30 @@
<script type="text/javascript">
$(function() {
var video = document.querySelector("#videoElement");
 
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;
 
if (navigator.getUserMedia) {      
    navigator.getUserMedia({video: true}, handleVideo, videoError);
}
 
function handleVideo(stream) {
    video.src = window.URL.createObjectURL(stream);
video.addEventListener('loadeddata', function (content) {
console.log(content);
});
// video.addEventListener('loadeddata', function() {
// console.log('Video dimensions: ' + video.videoWidth + ' x ' + video.videoHeight);
// }, false);
}
 
function videoError(e) {
    // do something
}
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
@@ -108,6 +135,28 @@ $(function() {
$("#filter_form").submit();
},100);
});
// QR Code Reader
$("#qr_code").on('click', function(e){
var code = "";
$("#sxQRModal").show();
setTimeout(function(){
console.log("hi")
getQRCode();
$("#sxQRModal").hide();
},100);
});
// Read qrcode from java
function getQRCode(){
code2lab.readQRCode();
}
// get CardNo from Java
function QRCodeNo(code){
alert(code);
}
});
$(document).on('click',".customer_tr",function(){