tampil data

gimana caranya biar data tampil di tabel ? sedangkan di database nya sudah masuk.

<?php
	session_start();
	if (empty($_SESSION["id_user"])) {
		header("location:../login/index.php");
	}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Divisi ERG | Tables :: Soila</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Augment Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
 	<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css' />
	<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
	<!-- Graph CSS -->
<link href="css/font-awesome.css" rel="stylesheet">
	<!-- jQuery -->
<link href='//fonts.googleapis.com/css?family=Roboto:700,500,300,100italic,100,400' rel='stylesheet' type='text/css'>
	<!-- lined-icons -->
<link rel="stylesheet" href="css/icon-font.min.css" type='text/css' />
	<!-- /js -->
<script src="js/jquery-1.10.2.min.js"></script>
<!-- //js-->
</head>
<body>
   <div class="page-container">
   <!--/content-inner-->
	<div class="left-content">
	   <div class="inner-content">
		<!-- header-starts -->
			<div class="header-section">
						<!--menu-right-->
						<div class="top_menu">
						        <div class="main-search">
											<form>
											   <input type="text" value="Search" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'Search';}" class="text"/>
												<input type="submit" value=""/>
											</form>
									<div class="close"><img src="images/cross.png" /></div>
								</div>
									<script type="text/javascript">
										 $('.main-search').hide();
										$('button').click(function (){
											$('.main-search').show();
											$('.main-search text').focus();
										}
										);
										$('.close').click(function(){
											$('.main-search').hide();
										});
									</script>
							<!--/profile_details-->
								<div class="profile_details_left">
									<ul class="nofitications-dropdown">
											<li class="dropdown note dra-down">
																		<script type="text/javascript">

																	function DropDown(el) {
																		this.dd = el;
																		this.placeholder = this.dd.children('span');
																		this.opts = this.dd.find('ul.dropdown > li');
																		this.val = '';
																		this.index = -1;
																		this.initEvents();
																	}
																	DropDown.prototype = {
																		initEvents : function() {
																			var obj = this;

																			obj.dd.on('click', function(event){
																				$(this).toggleClass('active');
																				return false;
																			});

																			obj.opts.on('click',function(){
																				var opt = $(this);
																				obj.val = opt.text();
																				obj.index = opt.index();
																				obj.placeholder.text(obj.val);
																			});
																		},
																		getValue : function() {
																			return this.val;
																		},
																		getIndex : function() {
																			return this.index;
																		}
																	}

																	$(function() {

																		var dd = new DropDown( $('#dd') );

																		$(document).click(function() {
																			// all dropdowns
																			$('.wrapper-dropdown-3').removeClass('active');
																		});

																	});

																</script>


										</li>
							<div class="clearfix"></div>
								</ul>
							</div>
							<div class="clearfix"></div>
							<!--//profile_details-->
						</div>
						<!--//menu-right-->
					<div class="clearfix"></div>
				</div>
					<!-- //header-ends -->
						<!--outter-wp-->
							<div class="outter-wp">
									<!--sub-heard-part-->
								  <!--//sub-heard-part-->

									<div class="graph-visual tables-main">
									<h3 class="inner-tittle two">Sistem Informasi Pengukuran Parameter Tanah & Lingkungan </h3>
								<a href="../fpdf/pdfpengukuran.php"><button type="button" class="btn btn-outline-info">Print PDF</button></a>
														  <div class="graph" style="overflow: scroll; height:500px">
															<div class="box-body">
															<table class="table">
												<table class="table table-bordered table-striped" id="example1">
																<thead>
																<tr>
																<th>User id</th>
																<th>Username</th>
																<th>Log id</th>
																<th>Time</th>
																<th>Date</th>
																<th>Lat</th>
																<th>Longi</th>
																<th>Alt</th>
																<th>Suhu</th>
																<th>Humidity</th>
																<th>Roll</th>
																<th>Pitch</th>
																<th>K.Tanah</th>
																<th>PH Tanah</th>
																<th>Luas</th>
																<th>Keliling</th>
																<th>Ket</th>
																<th>File_Name</th>
																<th>Daerah</th>
																</tr>
																</thead>
																<tbody>
<!--Query pengambilan data-->
<?php
//error_reporting(0);
$no = 1;
include "koneksi.php";
$query="SELECT * FROM data INNER JOIN daerah on data.id_daerah=daerah.id_daerah ORDER BY id DESC";
$hasil=mysqli_query($koneksi,$query);
while($r=mysqli_fetch_array($hasil,MYSQLI_ASSOC)){

	$no=$no++;

	$id_user = $r['id_user'];
	$cek_user = mysqli_query($koneksi,"SELECT * FROM login WHERE id_user = '$id_user'");
	$ambil_username = mysqli_fetch_array($cek_user,MYSQLI_ASSOC);
	?>
<tr>
	<td><?php echo $r['id_user']; ?></td>
	<td><?php echo $ambil_username['username']; ?></td>
	<td><?php echo $no; ?></td>
	<td><?php echo $r['Time'];?></td>
	<td><?php echo $r['Date'];?></td>
	<td><?php echo $r['lat'];?></td>
	<td><?php echo $r['longi'];?></td>
	<td><?php echo $r['Altitude'];?></td>
	<td><?php echo $r['Suhu'];?></td>
	<td><?php echo $r['Kelembapan'];?></td>
	<td><?php echo $r['Roll'];?></td>
	<td><?php echo $r['Pitch'];?></td>
	<td><?php echo $r['Kondisi_Tanah'];?></td>
	<td><?php echo $r['pH_Tanah'];?></td>
	<td><?php echo $r['luas'];?></td>
	<td><?php echo $r['keliling'];?></td>
	<td><?php echo $r['Ket'];?></td>
	<td><a href="../../gambar/<?php echo $r['File_name'];?>"><?php echo $r['File_name'];?></a></td>
	<td><?php echo $r['nama_daerah'];?></td>
	</tr>
	<?php
	$no++;
	}
	?>
																</tbody>
															</table>
															</div>

													</div>
										<!--//graph-visual-->
									</div>
									<!--//outer-wp-->
									 <!--footer section start-->
										<footer>
										   <p>© 2016 Divisi ERG Unikom | Design by <a href="http://web.ergunikom.net//" target="_blank">Divisi ERG</a></p>
										</footer>
									<!--footer section end-->
								</div>
							</div>
				<!--//content-inner-->
			<!--/sidebar-menu-->
				<div class="sidebar-menu">
					<header class="logo">
					<a href="#" class="sidebar-icon"> <span class="fa fa-bars"></span> </a> <a href="index.php"> <span id="logo"> <h1>SOILA</h1></span>
					<!--<img id="logo" src="" alt="Logo"/>-->
				  </a>
				</header>
			<div style="border-top:1px solid rgba(69, 74, 84, 0.7)"></div>
			<!--/down-->
							<div class="down">
									  <a href="index.php"><img src="images/yogi.jpg"></a>
									  <a href="index.php"><span class=" name-caret">Yogi Wiradinata</span></a>
									 <p>Admin WEB</p>
									<ul>
									<li><a class="tooltips" href="profile.php"><span>Profile</span><i class="lnr lnr-user"></i></a></li>
										<li><a class="tooltips" href="index.php"><span>Settings</span><i class="lnr lnr-cog"></i></a></li>
										<li><a class="tooltips" href="../index.php"><span>Log out</span><i class="lnr lnr-power-switch"></i></a></li>
										</ul>
									</div>
							   <!--//down-->
								<div class="menu">
									<ul id="menu" >
										<li><a href="index.php"><i class="fa fa-tachometer"></i> <span>Dashboard</span></a></li>
										 <li id="menu-academico" ><a href="#"><i class="fa fa-file-text-o"></i> <span>Tabel</span> <span class="fa fa-angle-right" style="float: right"></span></a>
											 <ul id="menu-academico-sub" >
												<li id="menu-academico-boletim" ><a href="table.php">Tabel Informasi Pengukuran</a></li>
												<li id="menu-academico-boletim" ><a href="table2.php">Tabel Data Pegawai</a></li>
											  </ul>
										 </li>
		<li id="menu-academico" ><a href="#"><i class="lnr lnr-book"></i> <span>Lokasi</span> <span class="fa fa-angle-right" style="float: right"></span></a>
										  <ul id="menu-academico-sub" >
											<li id="menu-academico-boletim" ><a href="test.php">PATH</a></li>
										  </ul>
									 </li>

		<li id="menu-comunicacao" ><a href="#"><i class="fa fa-smile-o"></i> <span>Lainnya</span><span class="fa fa-angle-double-right" style="float: right"></span></a>
   <ul id="menu-comunicacao-sub" >

<li id="menu-academico-boletim" ><a href="profile.php">Profile</a></li>
<li id="menu-mensagens" style="width:120px" ><a href="project.php">Projects <i class="fa fa-angle-right" style="float: right; margin-right: -8px; margin-top: 2px;"></i></a>
										</li>
									  </ul>
									</li>
								  </ul>
								</div>
							  </div>
							  <div class="clearfix"></div>
							</div>
							<script>
							var toggle = true;

							$(".sidebar-icon").click(function() {
							  if (toggle)
							  {
								$(".page-container").addClass("sidebar-collapsed").removeClass("sidebar-collapsed-back");
								$("#menu span").css({"position":"absolute"});
							  }
							  else
							  {
								$(".page-container").removeClass("sidebar-collapsed").addClass("sidebar-collapsed-back");
								setTimeout(function() {
								  $("#menu span").css({"position":"relative"});
								}, 400);
							  }

											toggle = !toggle;
										});
							</script>
<!--js -->
	<script src="js/jquery.nicescroll.js"></script>
	<script src="js/scripts.js"></script>
<!-- Bootstrap Core JavaScript -->
   <script src="js/bootstrap.min.js"></script>
   <!-- DataTables -->
<script src="datatables/jquery.dataTables.min.js"></script>
<script src="datatables/dataTables.bootstrap.min.js"></script>
<script>
  $(function () {
    $("#example1").DataTable();
    $('#example2').DataTable({
      "paging": true,
      "lengthChange": false,
      "searching": false,
      "ordering": true,
      "info": true,
      "autoWidth": false
    });
  });
</script>
</body>
</html>
avatar Aditiyafadillah33
@Aditiyafadillah33

48 Kontribusi 3 Poin

Dipost 7 tahun yang lalu

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban