LISTING PROGRAM
Kode Program Tampilan Menu Home:
<!DOCTYPE html> <html lang="en"> <head>
<title>Home</title> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.m in.css">
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js "></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min .js"></script>
<style>
.navbar {
margin-bottom: 0; border-radius: 0; }
.jumbotron {
margin-bottom: 0; background: white; color: blue;
font-family: cooper black; }
#map { width: 100%; height: 400px; }
.footer {
background-color: #f2f2f2; padding: 25px;
} </style>
<body id="myPage" spy="scroll" target=".navbar" data-offset="50">
<nav class="navbar navbar-inverse"> <div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> </button>
</div>
<div class="container text-left">
<p><img src="img/logo.jpg" style="float:right;"/></p>
<h1>Sistem Informasi Geografi Pemetaan SMA Negeri Kota Medan</h1> </div>
</div>
<div class="collapse navbar-collapse" id="myNavbar"> <ul class="nav navbar-nav">
<a href="home.php" class="btn btn-primary">Peta Umum</a> <button class="btn btn-primary" type="button"
data-toggle="dropdown">SMA
<span class="caret"></span></button> <ul class="dropdown-menu">
<li><a href="sma1.php">SMA Negeri 1 Medan</a></li> <li><a href="sma2.php">SMA Negeri 2 Medan</a></li> <li><a href="sma3.php">SMA Negeri 3 Medan</a></li> <li><a href="sma4.php">SMA Negeri 4 Medan</a></li> <li><a href="sma5.php">SMA Negeri 5 Medan</a></li> <li><a href="sma6.php">SMA Negeri 6 Medan</a></li> <li><a href="sma7.php">SMA Negeri 7 Medan</a></li> <li><a href="sma8.php">SMA Negeri 8 Medan</a></li> <li><a href="sma9.php">SMA Negeri 9 Medan</a></li> <li><a href="sma10.php">SMA Negeri 10 Medan</a></li> <li><a href="sma11.php">SMA Negeri 11 Medan</a></li> <li><a href="sma12.php">SMA Negeri 12 Medan</a></li> <li><a href="sma13.php">SMA Negeri 13 Medan</a></li> <li><a href="sma14.php">SMA Negeri 14 Medan</a></li> <li><a href="sma15.php">SMA Negeri 15 Medan</a></li> <li><a href="sma16.php">SMA Negeri 16 Medan</a></li> <li><a href="sma17.php">SMA Negeri 17 Medan</a></li> <li><a href="sma18.php">SMA Negeri 18 Medan</a></li> <li><a href="sma19.php">SMA Negeri 19 Medan</a></li> <li><a href="sma20.php">SMA Negeri 20 Medan</a></li> <li><a href="sma21.php">SMA Negeri 21 Medan</a></li> </ul>
</ul>
<ul class="nav navbar-nav navbar-right">
<a href="login.php" class="btn btn-primary"><span class="glyphicon glyphicon-user"> Admin</a>
</ul> </div> </div> </nav> </head> <body>
<div id="map"></div>
<script type="text/javascript" > var locations = [
['<li class="list-group-item text-info"><a href="sma1.php" target="_blank">SMA Negeri 1
Medan</a></li>',3.581665,98.669652,'SMA 1'],
['<li class="list-group-item text-info"><a href="sma2.php" target="_blank">SMA Negeri 2
['<li class="list-group-item text-info"><a href="sma3.php" target="_blank">SMA Negeri 3
Medan</a></li>',3.621047,98.672171,'SMA 3'],
['<li class="list-group-item text-info"><a href="sma4.php" target="_blank">SMA Negeri 4
Medan</a></li>',3.597270,98.655506,'SMA 4'],
['<li class="list-group-item text-info"><a href="sma5.php" target="_blank">SMA Negeri 5
Medan</a></li>',3.565382,98.698288,'SMA 5'],
['<li class="list-group-item text-info"><a href="sma6.php" target="_blank">SMA Negeri 6
Medan</a></li>',3.581198,98.692048,'SMA 6'],
['<li class="list-group-item text-info"><a href="sma7.php" target="_blank">SMA Negeri 7
Medan</a></li>',3.601223,98.678966,'SMA 7'],
['<li class="list-group-item text-info"><a href="sma8.php" target="_blank">SMA Negeri 8
Medan</a></li>',3.589207,98.698445,'SMA 8'],
['<li class="list-group-item text-info"><a href="sma9.php" target="_blank">SMA Negeri 9
Medan</a></li>',3.722039,98.688985,'SMA 9'],
['<li class="list-group-item text-info"><a href="sma10.php" target="_blank">SMA Negeri 10
Medan</a></li>',33.581935,98.691437,'SMA 10'],
['<li class="list-group-item text-info"><a href="sma11.php" target="_blank">SMA Negeri 11
Medan</a></li>',3.593780,98.732262,'SMA 11'],
['<li class="list-group-item text-info"><a href="sma12.php" target="_blank">SMA Negeri 12
Medan</a></li>',3.612036,98.640982,'SMA 12'],
['<li class="list-group-item text-info"><a href="sma13.php" target="_blank">SMA Negeri 13
Medan</a></li>',3.529755,98.682231,'SMA 13'],
['<li class="list-group-item text-info"><a href="sma14.php" target="_blank">SMA Negeri 14
Medan</a></li>',3.561366,98.717731,'SMA 14'],
['<li class="list-group-item text-info"><a href="sma15.php" target="_blank">SMA Negeri 15
Medan</a></li>',3.569174,98.614271,'SMA 15'],
['<li class="list-group-item text-info"><a href="sma16.php" target="_blank">SMA Negeri 16
Medan</a></li>',3.711465,98.642726,'SMA 16'],
['<li class="list-group-item text-info"><a href="sma17.php" target="_blank">SMA Negeri 17
Medan</a></li>',3.508470,98.615879,'SMA 17'],
['<li class="list-group-item text-info"><a href="sma18.php" target="_blank">SMA Negeri 18
Medan</a></li>',3.587762,98.693399,'SMA 18'],
['<li class="list-group-item text-info"><a href="sma19.php" target="_blank">SMA Negeri 19
Medan</a></li>',3.732379,98.678069,'SMA 19'],
['<li class="list-group-item text-info"><a href="sma20.php" target="_blank">SMA Negeri 20
Medan</a></li>',3.774376,98.705443,'SMA 20'],
['<li class="list-group-item text-info"><a href="sma21.php" target="_blank">SMA Negeri 21
var lokasi = {lat:3.5708507,lng:98.8796794}; var tanda =[];
function initMap(){ var map = new
google.maps.Map(document.getElementById('map'),{ zoom: 12,
center : lokasi });
var baris = locations.length; for(var i = 0; i < baris; i++){
tanda[i] = new google.maps.Marker({ position: {lat: locations[i][1],lng: locations[i][2]},
map : map,
html :locations[i][0], id : i,
title :locations[i][3], icon : "img/marker.png" });
tanda[i].addListener('click',function(){
var iw = new google.maps.InfoWindow({ id : this.id,
content : this.html,
position : this.getPosition() });
iw.open(map); });
} }
</script> <script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAcsLhfZJP07mh8 S3QdNKXlitVZepOE9DQ&
callback=initMap" async defer></script> </body>
</html>
Kode Program Tampilan Index:
<?php
header("location: home.php"); ?>
Kode Program untuk Koneksi ke database:
<?php
header("location: home.php"); ?>
Kode Program Form Login:
<?php
?> <html> <head>
<title>Home Admin</title>
<link rel="stylesheet" type="text/css" href="style.css"> </head>
<body>
<div class="container"> <div class="menu"> <nav>
<li><a href="home.php">Back</a></li> </div>
<div class="wrapper"> <div class="box">
<form action="proseslogin.php" method="POST"> <table>
<tr> <td>
<input type="text" name="username" placeholder="username"> </td>
</tr> <tr> <td>
<input type="password" name="password" placeholder="password"> </td>
</tr> <tr>
<td><input type="submit" value="login"></td> </tr>
<tr>
<td><span style="color:red"><?php echo $_GET['error']; ?></span></td> </tr>
</table> </form> </div> </div> </body> </html>
Kode Program Proses Login:
<?php
include ("koneksi.php");
$username = $_POST['username']; $password = $_POST['password'];
$query = ("SELECT * FROM `admin` WHERE username='$username' and password='$password'");
$queryexe = mysql_query($query); $exe = mysql_num_rows($queryexe); if ($exe) {
header("location:adminhome.php"); }
else{
Kode Program Form Logout:
<?php
header("location: index.php"); ?>
Kode Program Form Halaman Data Admin :
<?php
error_reporting(0); ?>
<html> <head>
<title>Home Admin</title>
<link rel="stylesheet" type="text/css" href="style.css"> </head>
<body>
<div class="container"> <div class="menu"> <nav>
<li><a href="admin.php">Home</a></li>
<li><a href="tambahadmin.php">Tambah Data</a></li> <li><a href="admin.php">Acount</a></li>
<li><a href="login.php">Logout</a></li> </nav>
</div>
<div class="content">
<table style="width:90%;margin-left:auto;margin-right:auto;background:#8d9db6;margin-top: 30px"> <tr style="background:#8d9db6">
<th>NO</th>
<th>Username</th> <th>Password</th> </tr>
<?php
include ("koneksi.php"); $batas = 2;
$pg = isset( $_GET['pg'] ) ? $_GET['pg'] : ""; if ( empty( $pg ) ) {
$posisi = 0; $pg = 1; }
else {
$posisi = ( $pg - 1 ) * $batas; }
$que = "SELECT * FROM `admin` limit $posisi, $batas"; $no = 1+$posisi;
$q = mysql_query($que);
while ($qq = mysql_fetch_assoc($q)) { ?>
<tr style="background:white"> <td><?php echo $no ?></td>
<td><?php echo $qq['Username'] ?></td> <td><?php echo $qq['Password'] ?></td>
<td style="text-align:center;background:#595959"> <a style="text-decoration:none;color:#66ff33"
||
<a style="text-decoration:none;color:#ff3300"
href="prosesdelete_admin.php?id=<?php echo $qq['Username']; ?>">delete</a>
</td> </tr>
<?php $no++;} ?> </table>
<table style="text-align:
center;background:#8d9db6;color:white;width:90%;margin-left:auto;margin-right:auto">
<tr>
<td colspan="4"> <?php
$jml_data = mysql_num_rows(mysql_query("SELECT * FROM `admin`")); $JmlHalaman = ceil($jml_data/$batas);
if ( $pg > 1 ) { $link = $pg-1;
$prev = "<a href='?pg=$link'>Perv </a>"; }
else {
$prev = "Prev "; }
for ( $i = 1; $i<= $JmlHalaman; $i++ ){ if ( $i == $pg ) {
$nmr .= $i . " "; }
else {
$nmr .= "<a href='?pg=$i'>$i</a> "; }
}
if ( $pg < $JmlHalaman ) { $link = $pg + 1;
$next = " <a href='?pg=$link'>Next</a>"; }
else {
$next = "Next"; }
echo $prev . $nmr . $next; ?>
</td> </tr> </table> </div> </div> </body> </html>
Kode Program Form Halaman Menu Tambah Data Admin:
<?php
error_reporting(0); ?>
<html> <head>
<title>Home Admin</title>
<link rel="stylesheet" type="text/css" href="style.css"> </head>
<div class="container"> <div class="menu"> <nav>
<li><a href="admin.php">Home</a></li>
<li><a href="tambahadmin.php">Tambah Data</a></li> <li><a href="admin.php">Acount</a></li>
<li><a href="login.php">Logout</a></li> </nav>
</div>
<div class="content"> <div class="box-create"> <h1>Tambah Data Admin</h1>
<form action="prosestambah_admin.php" method="POST"> <table>
<tr>
<td><input type="text" name="username" placeholder="username yang baru"></td>
</tr> <tr>
<td><input type="password" name="password" placeholder="password yang baru"></td>
</tr> <tr>
<td><input type="submit" value="Input"></td> </tr>
</table> </form> </div> </div> </div> </body> </html>
Kode Program Proses Edit Data Admin:
<?php
include ('koneksi.php');
$Username= $_POST['Username']; $Password = $_POST['Password'];
$que = "UPDATE `admin` SET Username='$Username', Password='$Password' WHERE Username='$Username'";
$q = mysql_query($que); if ($q) {
header("location: admin.php"); }
else {
die("Gagal Update");
header("location: admin.php"); }
?>
Kode Program Form Halaman Menu Edit Data Admin:
<?php
?> <html> <head>
<title>Home Admin</title>
<link rel="stylesheet" type="text/css" href="style.css"> </head>
<body>
<div class="container"> <div class="menu"> <nav>
<li><a href="adminhome.php">Home</a></li>
<li><a href="tambahadmin.php">Tambah Data</a></li> <li><a href="admin.php">Acount</a></li>
<li><a href="login.php">Logout</a></li> </nav>
</div>
<div class="content"> <div class="box-create">
<center><h1>Edit data</h1></center> <div class="form">
<form action="prosesedit_admin.php" method="POST"> <?php
include ('koneksi.php'); $id = $_GET['id'];
$que = "SELECT * FROM `admin` WHERE Username='$id'";
$q = mysql_query($que); $qq = mysql_fetch_array($q) ?>
<table> <tr>
<td>Username</td> <td>:</td>
<td><input type="text" name="Username" value="<?php echo $qq['Username']; ?>"></td>
</tr> <tr>
<td>Password</td> <td>:</td>
<td><input type="text" name="password" value="<?php echo $qq['Password']; ?>"></td>
</tr> <tr>
<td colspan="3"><input type="submit" value="edit"></td>
</tr> </table> </form> </div>
</div> </div>
<table> </table> </body>
Kode Program Proses Edit Data Admin:
<?php
include ('koneksi.php');
$Username= $_POST['Username']; $Password = $_POST['Password'];
$que = "UPDATE `admin` SET Username='$Username', Password='$Password' WHERE Username='$Username'";
$q = mysql_query($que); if ($q) {
header("location: admin.php"); }
else {
die("Gagal Update");
header("location: admin.php"); }
?>
Kode Program Form Halaman Data Sekolah:
<?php
error_reporting(0); ?>
<html> <head>
<title>Home Admin</title>
<link rel="stylesheet" type="text/css" href="style.css"> </head>
<body>
<div class="container"> <div class="menu"> <nav>
<li><a href="adminhome.php">Home</a></li>
<li><a href="admintambahdata.php">Tambah Data</a></li> <li><a href="admin.php">Acount</a></li>
<li><a href="login.php">Logout</a></li> </nav>
</div>
<div class="content">
<table style="width:90%;margin-left:auto;margin-right:auto;background:#8d9db6;margin-top: 30px"> <tr style="background:#8d9db6">
<th>NO</th> <th>NPSN</th>
<th>Jumlah Siswa</th> <th>Jumlah Guru</th> <th>Action</th> </tr>
<?php
include ("koneksi.php"); $batas = 7;
$pg = isset( $_GET['pg'] ) ? $_GET['pg'] : ""; if ( empty( $pg ) ) {
$posisi = 0; $pg = 1; }
else {
$posisi = ( $pg - 1 ) * $batas; }
$que = "SELECT * FROM `sekolah` limit $posisi, $batas"; $no = 1+$posisi;
$q = mysql_query($que);
while ($qq = mysql_fetch_assoc($q)) { ?>
<tr style="background:white"> <td><?php echo $no ?></td>
<td><?php echo $qq['NPSN'] ?></td>
<td><?php echo $qq['Nama_Sekolah'] ?></td> <td><?php echo $qq['Alamat_Sekolah'] ?></td> <td><?php echo $qq['Tahun_Berdiri'] ?></td> <td><?php echo $qq['Akreditasi'] ?></td> <td><?php echo $qq['No_Telepon'] ?></td> <td><?php echo $qq['Email'] ?></td> <td><?php echo $qq['Website'] ?></td> <td><?php echo $qq['Latitude'] ?></td> <td><?php echo $qq['Longitude'] ?></td> <td><?php echo $qq['Jumlah_Kelas'] ?></td> <td><?php echo $qq['Jumlah_Siswa'] ?></td> <td><?php echo $qq['Jumlah_Guru'] ?></td>
<td style="text-align:center;background:#595959"> <a style="text-decoration:none;color:#66ff33" href="edit.php?id=<?php echo $qq['NPSN']; ?>">edit</a>
||
<a style="text-decoration:none;color:#ff3300"
href="prosesdelete.php?id=<?php echo $qq['NPSN']; ?>">delete</a> </td>
</tr>
<?php $no++;} ?> </table>
<table style="text-align:
center;background:#8d9db6;color:white;width:90%;margin-left:auto;margin-right:auto">
<tr>
<td colspan="4"> <?php
$jml_data = mysql_num_rows(mysql_query("SELECT * FROM `sekolah`")); $JmlHalaman = ceil($jml_data/$batas);
if ( $pg > 1 ) { $link = $pg-1;
$prev = "<a href='?pg=$link'>Perv </a>"; }
else {
}
for ( $i = 1; $i<= $JmlHalaman; $i++ ){ if ( $i == $pg ) {
$nmr .= $i . " "; }
else {
$nmr .= "<a href='?pg=$i'>$i</a> "; }
}
if ( $pg < $JmlHalaman ) { $link = $pg + 1;
$next = " <a href='?pg=$link'>Next</a>"; }
else {
$next = "Next"; }
echo $prev . $nmr . $next; ?>
</td> </tr> </table> </div> </div> </body> </html>
Kode Program Form Halaman Menu Tambah Data Sekolah:
<?php
error_reporting(0); ?>
<html> <head>
<title>Home Admin</title>
<link rel="stylesheet" type="text/css" href="style.css"> </head>
<body>
<div class="container"> <div class="menu"> <nav>
<li><a href="adminhome.php">Home</a></li>
<li><a href="admintambahdata.php">Tambah Data</a></li> <li><a href="admin.php">Acount</a></li>
<li><a href="login.php">Logout</a></li> </nav>
</div>
<div class="content"> <div class="box-create"> <h1>Tambah Data</h1>
<form action="prosestambah.php" method="POST" enctype="multipart/form-data">
<table> <tr>
<td><input type="text" name="NPSN" placeholder="NPSN"></td> </tr>
<tr>
<td><input type="text" name="Nama_Sekolah" placeholder="Nama Sekolah"></td>
<tr>
<td><input type="text" name="Alamat_Sekolah" placeholder="Alamat Sekolah"></td>
</tr> <tr>
<td><input type="text" name="Tahun_Berdiri" placeholder="Tahun Berdiri"></td>
</tr> <tr>
<td><input type="text" name="Akreditasi" placeholder="Akreditasi"></td>
</tr> <tr>
<td><input type="text" name="No_Telepon" placeholder="No Telepon"></td>
</tr> <tr>
<td><input type="text" name="Email" placeholder="Email"></td> </tr>
<tr>
<td><input type="text" name="Website" placeholder="Website"></td> </tr>
<tr>
<td><input type="text" name="Latitude" placeholder="Latitude"></td> </tr>
<tr>
<td><input type="text" name="Longitude" placeholder="Longitude"></td> </tr>
<tr>
<td><input type="text" name="Jumlah_Kelas" placeholder="Jumlah Kelas"></td>
</tr> <tr>
<td><input type="text" name="Jumlah_Siswa" placeholder="Jumlah Siswa"></td>
</tr> <tr>
<td><input type="text" name="Jumlah_Guru" placeholder="Jumlah Guru"></td>
</tr> <tr>
<td><input type="submit" value="Input"></td> </tr>
</table> </form> </div> </div> </div> </body> </html>
Kode Program Form Halaman Menu Edit Data Sekolah:
<?php
error_reporting(0); ?>
<html> <head>
<link rel="stylesheet" type="text/css" href="style.css"> </head>
<body>
<div class="container"> <div class="menu"> <nav>
<li><a href="adminhome.php">Home</a></li>
<li><a href="admintambahdata.php">Tambah Data</a></li> <li><a href="admin.php">Acount</a></li>
<li><a href="login.php">Logout</a></li> </nav>
</div>
<div class="content"> <div class="box-create">
<center><h1>Edit data</h1></center> <div class="form">
<form action="prosesedit.php" method="POST"> <?php
include ('koneksi.php'); $id = $_GET['id'];
$que = "SELECT * FROM `sekolah` WHERE NPSN='$id'";
$q = mysql_query($que); $qq = mysql_fetch_array($q) ?>
<table> <tr>
<td>NPSN</td> <td>:</td>
<td><input type="text" name="NPSN" value="<?php echo $qq['NPSN']; ?>"></td>
</tr> <tr>
<td>Nama Sekolah</td> <td>:</td>
<td><input type="text"
name="Nama_Sekolah" value="<?php echo $qq['Nama_Sekolah']; ?>"></td> </tr>
<tr>
<td>Alamat Sekolah</td> <td>:</td>
<td><input type="text"
name="Alamat_Sekolah" value="<?php echo $qq['Alamat_Sekolah']; ?>"></td>
</tr> <tr>
<td>Tahun Berdiri</td> <td>:</td>
<td><input type="text" name="Tahun Berdiri" value="<?php echo $qq['Tahun_Berdiri']; ?>"></td>
</tr> <tr>
<td>Akreditasi</td> <td>:</td>
<td><input type="text"
<tr>
<td>No Telepon</td> <td>:</td>
<td><input type="text"
name="No_Telepon" value="<?php echo $qq['No_Telepon']; ?>"></td> </tr>
<tr>
<td>Email</td> <td>:</td>
<td><input type="text" name="Email" value="<?php echo $qq['Email']; ?>"></td>
</tr> <tr>
<td>Website</td> <td>:</td>
<td><input type="text" name="Website" value="<?php echo $qq['Website']; ?>"></td>
</tr> <tr>
<td>Latitude</td> <td>:</td>
<td><input type="text" name="Latitude" value="<?php echo $qq['Latitude']; ?>"></td>
</tr> <tr>
<td>Longitude</td> <td>:</td>
<td><input type="text" name="Longitude" value="<?php echo $qq['Longitude']; ?>"></td>
</tr> <tr>
<td>Jumlah Kelas</td> <td>:</td>
<td><input type="text"
name="Jumlah_Kelas" value="<?php echo $qq['Jumlah_Kelas']; ?>"></td> </tr>
<tr>
<td>Jumlah Siswa</td> <td>:</td>
<td><input type="text"
name="Jumlah_Siswa" value="<?php echo $qq['Jumlah_Siswa']; ?>"></td> </tr>
<tr>
<td>Jumlah Guru</td> <td>:</td>
<td><input type="text"
name="Jumlah_Guru" value="<?php echo $qq['Jumlah_Guru']; ?>"></td> </tr>
<tr>
<td colspan="3"><input type="submit" value="edit"></td>
</tr> </table> </form> </div>
</div> </div>
</table> </body>
</html>
Kode Program Proses Tambah Data Sekolah:
<?php
include ('koneksi.php'); $NPSN = $_POST['NPSN'];
$Nama_Sekolah = $_POST['Nama_Sekolah']; $Alamat_Sekolah = $_POST['Alamat_Sekolah']; $Tahun_Berdiri = $_POST['Tahun_Berdiri']; $Akreditasi = $_POST['Akreditasi'];
$No_Telepon = $_POST['No_Telepon']; $Email = $_POST['Email'];
$Website = $_POST['Website']; $Latitude = $_POST['Latitude']; $Longitude = $_POST['Longitude'];
$Jumlah_Kelas = $_POST['Jumlah_Kelas']; $Jumlah_Siswa = $_POST['Jumlah_Siswa']; $Jumlah_Guru = $_POST['Jumlah_Guru'];
$sql = mysql_query("INSERT INTO `sekolah`
VALUES('$NPSN','$Nama_Sekolah','$Alamat_Sekolah','$Tahun_Berdiri','$A kreditasi',
'$No_Telepon','$Email','$Website','$Latitude','$Longitude','$Jumlah_K elas','$Jumlah_Siswa','$Jumlah_Guru')");
header("location: adminhome.php"); ?>
Kode Program Proses Edit Data Sekolah:
<?php
include ('koneksi.php'); $NPSN = $_POST['NPSN'];
$Nama_Sekolah = $_POST['Nama_Sekolah']; $Alamat_Sekolah = $_POST['Alamat_Sekolah']; $Tahun_Berdiri = $_POST['Tahun_Berdiri']; $Akreditasi = $_POST['Akreditasi'];
$No_Telepon = $_POST['No_Telepon']; $Email = $_POST['Email'];
$Website = $_POST['Website']; $Latitude = $_POST['Latitude']; $Longitude = $_POST['Longitude'];
$Jumlah_Kelas = $_POST['Jumlah_Kelas']; $Jumlah_Siswa = $_POST['Jumlah_Siswa']; $Jumlah_Guru = $_POST['Jumlah_Guru']; $que = "UPDATE `sekolah` SET NPSN='$NPSN',
Nama_Sekolah='$Nama_Sekolah', Alamat_Sekolah='$Alamat_Sekolah', Tahun_Berdiri='$Tahun_Berdiri', Akreditasi='$Akreditasi',
Latitude='$Latitude', Longitude='$Longitude',
Jumlah_Kelas='$Jumlah_Kelas', Jumlah_Siswa=$Jumlah_Siswa, Jumlah_Guru='$Jumlah_Guru' WHERE NPSN='$NPSN'";
$q = mysql_query($que); if ($q) {
header("location: adminhome.php"); }
else {
die("Gagal Update");
header("location: adminhome.php"); }
?>
Kode Program Form SMA 1:
<!DOCTYPE html> <html lang="en"> <head>
<title>SMA 1</title> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.m in.css">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css">
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js "></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min .js"></script>
<style> body {
font: 400 15px/1.8 Lato, sans-serif; color: #777;
}
h3, h4 {
margin: 10px 0 30px 0; letter-spacing: 10px; font-size: 20px;
color: #111; }
.container {
padding: 80px 120px; }
.person {
border: 10px solid transparent; margin-bottom: 25px;
width: 80%; height: 80%; opacity: 0.7; }
.person:hover {
}
.carousel-inner img {
-webkit-filter: grayscale(90%); filter: grayscale(90%);
width: 100%; margin: auto; }
.carousel-caption h3 { color: #fff !important; }
@media (max-width: 600px) { .carousel-caption {
display: none; }
}
.bg-1 {
background: #2d2d30; color: #bdbdbd; }
.bg-1 h3 {color: #fff;}
.bg-1 p {font-style: italic;} .list-group-item:first-child { border-top-right-radius: 0; border-top-left-radius: 0; }
.list-group-item:last-child { border-bottom-right-radius: 0; border-bottom-left-radius: 0; }
.thumbnail {
padding: 0 0 15px 0; border: none;
border-radius: 0; }
.thumbnail p {
margin-top: 15px; color: #555; }
.btn {
padding: 10px 20px; background-color: #333; color: #f1f1f1;
border-radius: 0; transition: .2s; }
.btn:hover, .btn:focus { border: 1px solid #333; background-color: #fff; color: #000;
}
.modal-header, h4, .close { background-color: #333; color: #fff !important; text-align: center; font-size: 30px; }
.nav-tabs li a { color: #777; }
#map-canvas { width: 100%; height: 500px; }
.navbar {
font-family: Montserrat, sans-serif; margin-bottom: 0;
background-color: #2d2d30; border: 0;
font-size: 11px !important; letter-spacing: 4px;
opacity: 0.9; }
.navbar li a, .navbar .navbar-brand { color: #d5d5d5 !important;
}
.navbar-nav li a:hover { color: #fff !important; }
.navbar-nav li.active a { color: #fff !important;
background-color: #29292c !important; }
.navbar-default .navbar-toggle { border-color: transparent; }
.open .dropdown-toggle { color: #fff;
background-color: #555 !important; }
.dropdown-menu li a {
color: #000 !important; }
.dropdown-menu li a:hover {
background-color: red !important; }
footer {
background-color: #2d2d30; color: #f5f5f5;
padding: 32px; }
footer a {
color: #f5f5f5; }
footer a:hover { color: #777;
text-decoration: none; }
.form-control {
border-radius: 0; }
textarea {
resize: none; }
<body id="myPage" spy="scroll" target=".navbar" data-offset="50">
<nav class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> </button>
<a class="navbar-brand" href="home.php">SMA</a> </div>
<div class="collapse navbar-collapse" id="myNavbar"> <ul class="nav navbar-nav navbar-right">
<li><a href="#myPage">HOME</a></li> <li><a href="#profil">PROFILE</a></li> <li><a href="#galery">GALERY</a></li> <li><a href="#map">MAP</a></li>
<li><a href="#contact">CONTACT</a></li> </ul>
</div> </div> </nav>
<div id="myCarousel" class="carousel slide" data-ride="carousel"> <!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li> </ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox"> <div class="item active">
<img src="img/sma1(1)medan.jpg" alt="SMA" width="1200" height="700">
<div class="carousel-caption"> </div>
</div>
<div class="item">
<img src="img/sma1(2)medan.jpg" alt="SMA" width="1200" height="700">
<div class="carousel-caption"> </div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span> </a>
</div>
<!-- Container (The Band Section) -->
<div id="profil" class="container text-center"><br><br><br> <h3>PROFILE</h3>
<p>SEJARAH SEKOLAH</p>
<p>SMAN 1 Medan atau yang sering disingkat menjadi SMANSA terletak di jantung kota Medan,
tepatnya di Jl. Teuku Cik DiTiro No.1. <br> Awalnya, SMANSA pertama kali dibangun di Jl. Teuku Umar No.1
sekitar tanggal 18 Agustus - 1 September 1950. <br>Ada kenyataan yang sedikit mengejutkan ternyata SMANSA pernah menjadi SMA DARURAT <br> akibat dari aksi Polisional oleh Belanda, makanya SMANSA
dipindahkan ke Jl. Seram Biru. <br>
Tapi itu bukan halangan bagi SMANSA untuk jadi SMA favorit.</p><br> <p>VISI</p>
<p>BERIMAN, BERTAQWA DAN UNGGUL DALAM PRESTASI AKADEMIK DAN NON AKADEMIK SERTA BERWAWASAN LINGKUNGAN HIDUP</p><br>
<p>MISI</p>
<p>MELAKSANAKAN PEMBELAJARAN AKTIF, KREATIF DAN MENYENANGKAN UNTUK MENGHANTARKAN SISWA AGAR BERPRESTASI DALAM IPTEK OLAHRAGA DAN SENI BERLANDASKAN IMTAQ YANG SIAP BERSAING DI ERA GLOBALISASI SERTA PEDULI TERHADAP LINGKUNGAN HIDUP</p>
<br> </div>
<!-- Container (TOUR Section) --> <div id="galery" class="bg-1"> <div class="container"><br><br>
<h3 class="text-center">GALERY</h3><br><br> <div class="row">
<div class="col-sm-4">
<a href="#" data-toggle="collapse">
<img src="img/lab_bahasa.jpg" class="img-thumbnail" alt="Random Name" width="255" height="255">
</a> </div>
<div class="col-sm-4">
<a href="#" data-toggle="collapse">
<img src="img/lab_biologi.jpg" class="img-thumbnail" alt="Random Name" width="255" height="255">
</a> </div>
<div class="col-sm-4">
<a href="#" data-toggle="collapse">
<img src="img/lab_fisika.jpg" class="img-thumbnail" alt="Random Name" width="255" height="255">
</a> </div> </div>
<div class="row">
<div class="col-sm-4">
<img src="img/laboratorium_kimia.jpg" class="img-thumbnail" alt="Random Name" width="255" height="255">
</a> </div>
<div class="col-sm-4">
<a href="#" data-toggle="collapse">
<img src="img/perpustakaan.jpg" class="img-thumbnail" alt="Random Name" width="255" height="255">
</a> </div>
<div class="col-sm-4">
<a href="#" data-toggle="collapse">
<img src="img/lab_komputer.jpg" class="img-thumbnail" alt="Random Name" width="255" height="255">
</a> </div> </div>
<div class="row">
<div class="col-sm-4">
<a href="#" data-toggle="collapse">
<img src="img/sman1.jpg" class="img-thumbnail" alt="Random Name" width="255" height="255">
</a> </div>
<div class="col-sm-4">
<a href="#" data-toggle="collapse">
<img src="img/sma1(1)medan.jpg" class="img-thumbnail" alt="Random Name" width="255" height="255">
</a> </div>
<div class="col-sm-4">
<a href="#" data-toggle="collapse">
<img src="img/sma1(2)medan.jpg" class="img-thumbnail" alt="Random Name" width="255" height="255">
</a> </div> </div>
</div> </div>
<!-- Container (Contact Section) --> <!-- Add Google Maps -->
<div id="map"><br><br><br><br><br> <h3 class="text-center">MAP</h3> <div id="map-canvas"></div> <?php
include "koneksi.php"; ?>
<!DOCTYPE html> <html>
<head> <script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDZlXZTKQdvcno5 FHpkO86Rk-Nib9DXYOw&callback=initMap"></script>
<script> var marker;
var mapCanvas = document.getElementById('map-canvas'); var mapOptions = {
mapTypeId: google.maps.MapTypeId.ROADMAP }
var options = {
zoom: 10,
mapTypeId: google.maps.MapTypeId.ROADMAP };
var map = new google.maps.Map(mapCanvas, mapOptions); var infoWindow = new google.maps.InfoWindow; var bounds = new google.maps.LatLngBounds();
function bindInfoWindow(marker, map, infoWindow, html) { google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html);
infoWindow.open(map, marker); });
}
function addMarker(lat, lng, info) {
var pt = new google.maps.LatLng(lat, lng); bounds.extend(pt);
var marker = new google.maps.Marker({ map: map,
position: pt });
map.fitBounds(bounds);
bindInfoWindow(marker, map, infoWindow, info); }
<?php
$query = mysql_query("select * from sekolah where NPSN ='10210873'");
while ($data = mysql_fetch_array($query)) { $NPSN = $data['NPSN'];
$Nama_Sekolah = $data['Nama_Sekolah']; $Alamat_Sekolah = $data['Alamat_Sekolah']; $Tahun_Berdiri = $data['Tahun_Berdiri']; $Akreditasi = $data['Akreditasi'];
$No_Telepon = $data['No_Telepon']; $Email = $data['Email'];
$Website = $data['Website']; $Latitude = $data['Latitude']; $Longitude = $data['Longitude'];
$Jumlah_Kelas = $data['Jumlah_Kelas']; $Jumlah_Siswa = $data['Jumlah_Siswa']; $Jumlah_Guru = $data['Jumlah_Guru']; echo ("addMarker($Latitude, $Longitude,
'<b>NPSN=$NPSN<br/>Nama Sekolah= $Nama_Sekolah<br/>Alamat Sekolah=$Alamat_Sekolah<br/>Tahun
Berdiri=$Tahun_Berdiri<br/>Akreditasi=$Akreditasi<br/>No Telepon=$No_Telepon<br/>Email= $Email<br/>Website=
$Website<br/>Jumlah Kelas = $Jumlah_Kelas<br/>Jumlah Siswa =
$Jumlah_Siswa<br/>Jumlah Guru=$Jumlah_Guru</b>');\n"); }
google.maps.event.addDomListener(window, 'load', initialize); </script>
</head>
<div id="contact" class="container"><br><br><br> <h3 class="text-center">CONTACT</h3>
<p class="text-center"><span class="glyphicon glyphicon-map-marker"></span>JL. TEUKU CIK DITIRO NO. 1 MEDAN</p>
<p class="text-center"><span class="glyphicon glyphicon-phone-alt"></span>Phone: 614511765</p>
<p class="text-center"><span class="glyphicon glyphicon-envelope"></span>Email: msmansamedan@yahoo.com</p>
<p class="text-center"><a
href="http://www.smansamedan.sch.id"><span class="glyphicon
glyphicon-bookmark"></span>Website: http://www.smansamedan.sch.id</p> </div>
<body>
<div id="map-canvas"></div> <footer class="text-center">
<a class="up-arrow" href="#myPage" data-toggle="tooltip" title="TO TOP">
<span class="glyphicon glyphicon-chevron-up"></span> </a><br><br>
</footer> <script>
$(document).ready(function(){ // Initialize Tooltip
$('[data-toggle="tooltip"]').tooltip();
// Add smooth scrolling to all links in navbar + footer link $(".navbar a, footer a[href='#myPage']").on('click',
function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior event.preventDefault();
// Store hash
var hash = this.hash;
// Using jQuery's animate() method to add smooth page scroll // The optional number (900) specifies the number of
milliseconds it takes to scroll to the specified area $('html, body').animate({
scrollTop: $(hash).offset().top }, 900, function(){
// Add hash (#) to URL when done scrolling (default click behavior)
window.location.hash = hash; });
})