<?php include_once 'first.php'; ?>
<?php $tutur = new tutur(); ?>
<?php if(!isset($_GET['nama'])){
	header('Location: pencarian.php');
} ?>
<?php $id = $_SESSION['id']; ?>


<!DOCTYPE html>
<html lang="en">
<head>
	<title>Arcade - Architecture</title>
	<meta charset="UTF-8">
	<meta name="description" content="Arcade - Architecture Template">
	<meta name="keywords" content="arcade, architecture, onepage, creative, html">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link href="img/favicon.ico" rel="shortcut icon"/>
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">

<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
  <link rel="stylesheet" href="css/bootstrap.min.css"/>
	<link rel="stylesheet" href="css/font-awesome.min.css"/>
	<link rel="stylesheet" href="css/animate.css"/>
	<link rel="stylesheet" href="css/owl.carousel.css"/>
	<link rel="stylesheet" href="css/style.css"/>
</head>
<body>
	<div id="preloder">
		<div class="loader"></div>
	</div>
  <?php $ok->header(); ?>
	<section class="hero-section">
		<div class="left-bar">
			<div class="left-bar-content">
				<div class="social-links">
					<a href="#"><i class="fa fa-pinterest"></i></a>
					<a href="#"><i class="fa fa-linkedin"></i></a>
					<a href="#"><i class="fa fa-instagram"></i></a>
					<a href="#"><i class="fa fa-facebook"></i></a>
					<a href="#"><i class="fa fa-twitter"></i></a>
				</div>
			</div>
		</div>
		<!-- hero slider area -->
		<div class="hero-slider">
			<div class="hero-slide-item set-bg" data-setbg="gambar/danau.jpg">
				<div class="slide-inner">
					<div class="slide-content">
					<h2>Partutur.on</h2>

					</div>
				</div>
			</div>
			<div class="hero-slide-item set-bg" data-setbg="gambar/danau2.jpg">
				<div class="slide-inner">
					<div class="slide-content">
					<h2>Partutur.on</h2>

					</div>
				</div>
			</div>
		</div>
		<div class="slide-num-holder" id="snh-1"></div>
		<div class="hero-right-text">Partutur</div>
	</section>
	<!-- Hero section end -->


	<!-- Intro section start -->


	<div class="projects-section pb50">
		<div class="container">
			<h1><?php echo $_GET['nama'] ?></h1>
			<?php $Ok = new tutur();
			 $kelamin = $Ok->cari_kelamin($id);
      		 $toga = $Ok->dapat_toga($id);
					 $togamamak = $Ok->dapat_toga_mamak($id);
      		 if(!strcmp($_GET['nama'], 'ito')){
						 ?>
						 <table class="w3-table w3-striped">
					    <tr>
					      <th>Nama</th>
					      <th>Marga / Boru</th>
								<th>Beibe</th>
					    </tr>
						 <?php

      		 	$sql = "SELECT data_user.nama as ok, marga.marga as magg , data_user.mamak as mams FROM data_user inner join marga where marga.toga = '$toga' and data_user.marga = marga.id_marga and  data_user.Jenis_kelamin !='$kelamin' or marga.toga = '$togamamak'	and data_user.mamak = marga.id_marga and  data_user.Jenis_kelamin !='$kelamin' ";
      		 	$check = $Ok->conn()->query($sql);
      		 	while($user_data =$check->fetch_assoc()){
							$sq = $user_data['mams'];
							$sqq = "SELECT marga as mr from marga where id_marga = '$sq'";
							$check1 = $Ok->conn()->query($sqq);
							$row =$check1->fetch_assoc();
      		 		echo "<tr><td>".$user_data['ok']."</td><td>".$user_data['magg']."</td><td>".$row['mr']."</tr>";
      		 	}
      		 }
					 if(!strcmp($_GET['nama'], 'pariban')){
						 ?>
						 <?php if($kelamin==1){
							 $sql = "SELECT data_user.nama as ok, marga.marga as magg , data_user.mamak as mams FROM data_user inner join marga where marga.toga = '$togamamak' and data_user.marga = marga.id_marga and  data_user.Jenis_kelamin !='$kelamin' ";
						 }else{
							 $sql = "SELECT data_user.nama as ok, marga.marga as magg , data_user.marga as mams FROM data_user inner join marga where marga.toga = '$toga' and data_user.mamak = marga.id_marga and  data_user.Jenis_kelamin !='$kelamin' ";
						 }
						  ?>
						 <table class="w3-table w3-striped">
					    <tr>
					      <th>Nama</th>
					      <th>Marga / Boru</th>
								<th>Beibe</th>
					    </tr>
						 <?php
      		 	// $sql = "SELECT data_user.nama as ok, marga.marga as magg , data_user.mamak as mams FROM data_user inner join marga where marga.toga = '$togamamak' and data_user.marga = marga.id_marga and  data_user.Jenis_kelamin !='$kelamin' ";
      		 	$check = $Ok->conn()->query($sql);
      		 	while($user_data =$check->fetch_assoc()){
							$sq = $user_data['mams'];
							$sqq = "SELECT marga as mr from marga where id_marga = '$sq'";
							$check1 = $Ok->conn()->query($sqq);
							$row =$check1->fetch_assoc();
							if($kelamin == 2){
								echo "<tr><td>".$user_data['ok']."</td><td>".$row['mr']."</td><td>".$user_data['magg']."</tr>";
							}else{
									echo "<tr><td>".$user_data['ok']."</td><td>".$user_data['magg']."</td><td>".$row['mr']."</tr>";
							}

						}
      		 }

					 if(!strcmp($_GET['nama'], 'appara')){
						 ?>
						 <table class="w3-table w3-striped">
					    <tr>
					      <th>Nama</th>
					      <th>Marga / Boru</th>
								<th>Beibe</th>
					    </tr>
						 <?php

      		 	$sql = "SELECT data_user.nama as ok, marga.marga as magg , data_user.mamak as mams FROM data_user inner join marga where marga.toga = '$toga' and data_user.marga = marga.id_marga and  data_user.Jenis_kelamin ='$kelamin' and data_user.id_nama != '$id' ";
      		 	$check = $Ok->conn()->query($sql);
      		 	while($user_data =$check->fetch_assoc()){
							$sq = $user_data['mams'];
							$sqq = "SELECT marga as mr from marga where id_marga = '$sq'";
							$check1 = $Ok->conn()->query($sqq);
							$row =$check1->fetch_assoc();
      		 		echo "<tr><td>".$user_data['ok']."</td><td>".$user_data['magg']."</td><td>".$row['mr']."</tr>";
      		 	}
      		 }

					 if(!strcmp($_GET['nama'], 'bere')){
						?>
						<table class="w3-table w3-striped">
						 <tr>
							 <th>Nama</th>
							 <th>Marga / Boru</th>
							 <th>Beibe</th>
						 </tr>
						<?php

				  	$sql = "SELECT data_user.nama as ok, marga.marga as magg , data_user.marga as mams FROM data_user inner join marga where marga.toga = '$toga' and data_user.mamak = marga.id_marga and  data_user.Jenis_kelamin !='$kelamin' ";
 					 $check = $Ok->conn()->query($sql);
					 while($user_data =$check->fetch_assoc()){
						 $sq = $user_data['mams'];
						 $sqq = "SELECT marga as mr from marga where id_marga = '$sq'";
						 $check1 = $Ok->conn()->query($sqq);
						 $row =$check1->fetch_assoc();
						 echo "<tr><td>".$user_data['ok']."</td><td>".$row['mr']."</td><td>".$user_data['magg']."</tr>";
					 }
					}
					if(!strcmp($_GET['nama'], 'lae')){
					 ?>
					 <table class="w3-table w3-striped">
						<tr>
							<th>Nama</th>
							<th>Marga / Boru</th>
							<th>Beibe</th>
						</tr>
					 <?php

					 $sql = "SELECT data_user.nama as ok, marga.marga as magg , data_user.mamak as mams FROM data_user inner join marga where marga.toga = '$togamamak' and data_user.marga = marga.id_marga and  data_user.Jenis_kelamin ='$kelamin' ";
					$check = $Ok->conn()->query($sql);
						while($user_data =$check->fetch_assoc()){
						$sq = $user_data['mams'];
						$sqq = "SELECT marga as mr from marga where id_marga = '$sq'";
						$check1 = $Ok->conn()->query($sqq);
						$row =$check1->fetch_assoc();
						echo "<tr><td>".$user_data['ok']."</td><td>".$user_data['magg']."</td><td>".$row['mr']."</tr>";
					}
				 }



			 ?>
		 </table>


		</div>
	</div>


<a href="cetak.php" type="submit" value="cetak">button</a>

	<!-- Projects section end -->

	<!-- Clients section start -->

	<!-- <div class="client-section spad">
		<div class="container">
			<div id="client-carousel" class="client-slider">
				<div class="single-brand">
					<a href="#">
						<img src="img/clients/1.png" alt="">
					</a>
				</div>
				<div class="single-brand">
					<a href="#">
						<img src="img/clients/2.png" alt="">
					</a>
				</div>
				<div class="single-brand">
					<a href="#">
						<img src="img/clients/3.png" alt="">
					</a>
				</div>
				<div class="single-brand">
					<a href="#">
						<img src="img/clients/4.png" alt="">
					</a>
				</div>
				<div class="single-brand">
					<a href="#">
						<img src="img/clients/5.png" alt="">
					</a>
				</div>
			</div>
		</div>
	</div> -->
	<!-- Clients section end -->


	<!-- Footer section start -->
	<footer class="footer-section" style="background-color: black;">
		<!-- <div class="footer-social">
			<div class="social-links">
				<a href="#"><i class="fa fa-pinterest"></i></a>
				<a href="#"><i class="fa fa-linkedin"></i></a>
				<a href="#"><i class="fa fa-instagram"></i></a>
				<a href="#"><i class="fa fa-facebook"></i></a>
				<a href="#"><i class="fa fa-twitter"></i></a>
			</div>
		</div> -->
		<!-- <div class="container">
			<div class="row">
				<div class="col-lg-9 offset-lg-3">
					<div class="row">
						<div class="col-md-4">
							<div class="footer-item">
								<ul>
									<li><a href="#">Home</a></li>
									<li><a href="#">About us</a></li>
									<li><a href="#">Services</a></li>
									<li><a href="#">Portfolio</a></li>
									<li><a href="#">Blog</a></li>
								</ul>
							</div>
						</div>
						<div class="col-md-4">
							<div class="footer-item">
								<ul>
									<li><a href="#">Terms & Conditions</a></li>
									<li><a href="#">FAQ</a></li>
									<li><a href="#">Help Desk</a></li>
									<li><a href="#">Job Aplications</a></li>
									<li><a href="#">Site Map</a></li>
								</ul>
							</div>
						</div>
						<div class="col-md-4">
							<div class="footer-item">
								<ul>
									<li><a href="#">Privacy</a></li>
									<li><a href="#">Contact us</a></li>
									<li><a href="#">Newsletter</a></li>
									<li><a href="#">Clients Testimonials</a></li>
									<li><a href="#">FAQ</a></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div> -->

		<!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. -->

    <!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. -->

	</footer>
	<!-- Footer section end -->




	<!--====== Javascripts & Jquery ======-->
	<script src="js/jquery-2.1.4.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/isotope.pkgd.min.js"></script>
	<script src="js/owl.carousel.min.js"></script>
	<script src="js/jquery.owl-filter.js"></script>
	<script src="js/magnific-popup.min.js"></script>
	<script src="js/circle-progress.min.js"></script>
	<script src="js/main.js"></script>
</body>
</html>
