<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">

<?php
      include_once "koneksi.inc";
      $tahun = date("Y");
      $bulan = date("m");
      $tanggal = date("d");
      $jam = date("h");
      $menit = date("i");
      $detik = date("s");

      echo "<url>";
      echo "<loc>http://www.globalkomputer.com/</loc>";
      echo "<lastmod>$tahun-$bulan-$tanggal"."T$jam:$menit:$detik+07:00</lastmod>";
      echo "<changefreq>always</changefreq>";
      echo "<priority>0.5</priority>";
      echo "</url>";

      echo "<url>";
      echo "<loc>http://www.globalkomputer.com/home</loc>";
      echo "<lastmod>$tahun-$bulan-$tanggal"."T$jam:$menit:$detik+07:00</lastmod>";
      echo "<changefreq>always</changefreq>";
      echo "<priority>0.5</priority>";
      echo "</url>";

      $sql = "SELECT * FROM batasan";
      $res = mysqli_query($conn, $sql);
      while($row = mysqli_fetch_array($res)){ 
        echo "<url>";
        echo "<loc>http://www.globalkomputer.com/Bahasan/$row[nama_bat].html</loc>";
        echo "<lastmod>$tahun-$bulan-$tanggal"."T$jam:$menit:$detik+07:00</lastmod>";
        echo "<changefreq>always</changefreq>";
        echo "<priority>0.5</priority>";
        echo "</url>";
      }

      $sql = "SELECT * FROM batasan, topik WHERE 
             batasan.id_bat = topik.id_bat";
      $res = mysqli_query($conn, $sql);
      while($row = mysqli_fetch_array($res)){ 
        echo "<url>";
        echo "<loc>http://www.globalkomputer.com/Bahasan/$row[nama_bat]/Topik/$row[nama_topik].html</loc>";
        echo "<lastmod>$tahun-$bulan-$tanggal"."T$jam:$menit:$detik+07:00</lastmod>";
        echo "<changefreq>always</changefreq>";
        echo "<priority>0.5</priority>";
        echo "</url>";
      }

      $sql = "SELECT * FROM batasan, topik, subtopik WHERE 
             topik.id_topik = subtopik.id_topik &&  batasan.id_bat = topik.id_bat";
      $res = mysqli_query($conn,  $sql);
      while($row = mysqli_fetch_array($res)){ 
        echo "<url>";
        echo "<loc>http://www.globalkomputer.com/Bahasan/$row[nama_bat]/Topik/$row[nama_topik]/Subtopik/$row[nama_subtopik].html</loc>";
        echo "<lastmod>$tahun-$bulan-$tanggal"."T$jam:$menit:$detik+07:00</lastmod>";
        echo "<changefreq>always</changefreq>";
        echo "<priority>0.5</priority>";
        echo "</url>";
      }

      $sql = "SELECT * FROM batasan, produk WHERE 
             batasan.id_bat = produk.id_bat";
      $res = mysqli_query($conn, $sql);
      while($row = mysqli_fetch_array($res)){ 
        echo "<url>";
        echo "<loc>http://www.globalkomputer.com/Bahasan/$row[nama_bat]/Produk/$row[nama_prod].html</loc>";
        echo "<lastmod>$tahun-$bulan-$tanggal"."T$jam:$menit:$detik+07:00</lastmod>";
        echo "<changefreq>always</changefreq>";
        echo "<priority>0.5</priority>";
        echo "</url>";
      }
?>
</urlset>