<?php
    include('../config.php');
    include('../fungsi.php');
    
    $data=mysqli_fetch_row(mysqli_query($con,"select * from akunn where id=1"));
?>                    
<!DOCTYPE html>
<html>
<head>
	<title>Scan QRCode Diskont</title>
	<link rel="stylesheet" type="text/css" href="diskon.css">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	
</head>
<body>
	
	<!-- bagian header template -->
	<header>
		<h1 class="judul">Scan QRCode Diskont</h1>
		<p class="deskripsi">Arahkan QRCode ke Kamera Laptop/HP</p>
	</header>
	<!-- akhir bagian header template -->
	
	<div class="wrap">
		<!-- bagian menu		 -->
		<nav class="menu">
			<ul>
				<li>
					<a href="#">Home</a>
				</li>
				
			</ul>
		</nav>
		<!-- akhir bagian menu -->

		<!-- bagian sidebar website -->
		<aside class="sidebar">
			
			<div class="widget">
				<h2>Logo</h2>
				<p>
				<img width="250" class="img-rounded" src="<?php echo '../'.$data[18]; ?>">
				</p>
			</div>
			<div class="widget">
				<h2>Kontak CS Kami</h2>
				<p><?php echo $data[10]; ?> <br>
				<?php echo $data[7]; ?> <br>
				</p>
			</div>
		</aside>
		<!-- akhir bagian sidebar website -->

		<!-- bagian konten Blog -->
		<div class="blog">
			<div class="conteudo">
			    <div align="center" class="panel-body text-center" >
                    <canvas></canvas>
                    <hr>
                    <select></select>
                  </div>
                  
				<!-- <div class="post-info">
					Di Posting Oleh <b>abc</b> 
				</div>-->
				<img src="">
				<h2>Perhatian:</h2>
				<hr>
				<p>
					1. Diskont memiliki masa waktu. <br>
					2. Gunakan QR Code diskont secepatnya sebelum expire.<br>
					3. QRCode Diskont ini khusus yang berlangganan email.
				</p>				
				<!-- <a href="#" class="continue-lendo">Selengkapnya →</a> -->
			</div>
			
		</div>
		<!-- akhir konten -->
	</div>

<!-- Js Lib -->
<script type="text/javascript" src="tools/jquery.js"></script>
<script type="text/javascript" src="tools/qrcodelib.js"></script>
<script type="text/javascript" src="tools/webcodecamjquery.js"></script>
<script type="text/javascript">
    var arg = {
        resultFunction: function(result) {
            var redirect = 'cekdiskon.php';
            $.redirectPost(redirect, {kode: result.code});
        }
    };
    
    var decoder = $("canvas").WebCodeCamJQuery(arg).data().plugin_WebCodeCamJQuery;
    decoder.buildSelectMenu("select");
    decoder.play();
    
    $('select').on('change', function(){
        decoder.stop().play();
    });

    $.extend(
    {
        redirectPost: function(location, args)
        {
            var form = '';
            $.each( args, function( key, value ) {
                form += '<input type="hidden" name="'+key+'" value="'+value+'">';
            });
            $('<form action="'+location+'" method="POST">'+form+'</form>').appendTo('body').submit();
        }
    });

</script>
</body>
</html>