<section class="content" style="zoom : 88%;">
  	<div class="container-fluid">
  		<div class="row">
	      	<div class="col-12">
	        	<div class="card">
		          	<div class="card-header">
		            	<div class="row">
							<div class="col-sm-6">
								<h3 class="card-title">WhatsApp Gateway</h3>
							</div>
			            </div>
			        </div>
					<div class="row">
						<div class="col-md-6">
					    	<div class="card-body">
					    		<h4 class="text-center">Tautkan WhatsApp</h4>
					    		<div id="content"></div>
							</div>
						</div>
						<div class="col-md-6">
							<div class="card-body">
								<h5 class="text-center">Test Kirim Pesan</h5>
								<form method="post" enctype="multipart/form-data">
									<div class="form-group">
							           <label><small>Nomor WhatsApp</small></label>
							           <input type="text" class="form-control" name="no" id=no required="required">
							        </div>
									<div class="form-group">
										<label><small>Pesan</small></label>
										<textarea class="form-control" type="text" name="teskt" rows="10" style="width: 100%; height:100%;" required="required"></textarea>
									</div>
							        <input type="submit" name="send" class="btn btn-sm btn-success" value="Test Kirim Pesan">
								</form>
									<?php 
									if (isset($_POST['send'])) 
									{
										$nomor 		= explode(",", $_POST['no']);
								// 		array($_POST['no']);
										$message 	= $_POST['teskt'];

										$APIwa = new PesanWA();
										$APIwa->Send_Pesan($page[1],'sendMessage',$nomor,$message);
										if ($APIwa) {
											sweetAlert("Pesan akan segera di kirim", "success");
										}
									}
									?>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<script>
function loadContent() {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'list_data/qrcode_whatsapp.php?id=<?php echo $page[1]; ?>', true);  // Ganti 'content.html' dengan URL sumber kontenmu
xhr.onreadystatechange = function() {
    if (xhr.readyState === 4 && xhr.status === 200) {
        document.getElementById('content').innerHTML = xhr.responseText;
    }
};
xhr.send();
}

// Muat konten pertama kali saat halaman dimuat
window.onload = loadContent;

// Muat ulang konten setiap 5 detik (5000 ms)
setInterval(loadContent, 5000);

</script>