Anda di halaman 1dari 97

Langkah dalam membuat database silahkan buka browser misalkan mozilla firefox kemudian

ketik localhos/phpmyadmin sehingga akan seperti gambar dibawah ini :

Kemudian klik new sehingga akan tampil seperti gambar dibawah ini :

Kemudian klik buat, setelah selesai membuat database sekarang membuat tabel, langkah
langkahnya sebagai berikut :

1. Klik SQL
2. Ketik kode dibawah ini

CREATE TABLE `guru` (


`nip` int(20) NOT NULL,
`nama` varchar(50) NOT NULL,
`jenkel` varchar(100) NOT NULL,
`alamat` varchar(100) NOT NULL,
`tmt_lahir` varchar(30) DEFAULT NULL,
`tgl_lahir` date NOT NULL,
`kd_kelas` varchar(15) DEFAULT NULL,
PRIMARY KEY (`nip`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `jawaban` (


`kd_jawab` int(11) NOT NULL AUTO_INCREMENT,
`siswa` varchar(50) NOT NULL,
`mapel` varchar(50) NOT NULL,
`keterangan` text NOT NULL,
PRIMARY KEY (`kd_jawab`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `jawabtugas` (


`kd_jawab` int(11) NOT NULL AUTO_INCREMENT,
`urut` int(11) DEFAULT NULL,
`judul` varchar(50) DEFAULT NULL,
`nip` int(20) DEFAULT NULL,
`nis` varchar(50) DEFAULT NULL,
`kelas` varchar(50) DEFAULT NULL,
`mapel` varchar(100) DEFAULT NULL,
`file` text,
`keterangan` text,
`tgl` date DEFAULT NULL,
PRIMARY KEY (`kd_jawab`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

CREATE TABLE `kelas` (


`kd_kelas` varchar(15) NOT NULL,
`nama` varchar(50) NOT NULL,
PRIMARY KEY (`kd_kelas`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `mapel` (


`kd_mapel` int(50) NOT NULL,
`nama` varchar(100) NOT NULL,
PRIMARY KEY (`kd_mapel`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `nilai` (


`kd_nilai` int(11) NOT NULL AUTO_INCREMENT,
`kd_jawab` int(11) DEFAULT NULL,
`judul` varchar(100) DEFAULT NULL,
`nip` int(20) DEFAULT NULL,
`nis` varchar(50) DEFAULT NULL,
`kelas` varchar(50) DEFAULT NULL,
`mapel` varchar(100) DEFAULT NULL,
`nilai` int(11) DEFAULT NULL,
`tgl` date DEFAULT NULL,
PRIMARY KEY (`kd_nilai`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

CREATE TABLE `setting` (


`id_setting` int(11) NOT NULL AUTO_INCREMENT,
`nama` varchar(50) NOT NULL,
`kepsek` varchar(50) NOT NULL,
`alamat` text NOT NULL,
`telp` varchar(20) NOT NULL,
`nip` int(20) NOT NULL,
`email` varchar(50) NOT NULL,
`logo` text NOT NULL,
PRIMARY KEY (`id_setting`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

CREATE TABLE `siswa` (


`id` int(11) NOT NULL AUTO_INCREMENT,
`nis` varchar(50) NOT NULL,
`nama` varchar(100) NOT NULL,
`jenkel` varchar(15) NOT NULL,
`alamat` varchar(100) DEFAULT NULL,
`tempt_lahir` varchar(25) DEFAULT NULL,
`tgl_lahir` date NOT NULL,
`kd_kelas` varchar(15) DEFAULT NULL,
PRIMARY KEY (`id`,`nis`)
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=latin1;

CREATE TABLE `tugas` (


`urut` int(11) NOT NULL AUTO_INCREMENT,
`judul` varchar(50) DEFAULT NULL,
`kd_mapel` varchar(50) DEFAULT NULL,
`file` text,
`keterangan` text,
`kd_kelas` varchar(15) DEFAULT NULL,
`nip` int(20) DEFAULT NULL,
`status` enum('0','2','1') DEFAULT NULL,
`tgl` date DEFAULT NULL,
PRIMARY KEY (`urut`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;

CREATE TABLE `user` (


`username` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`nama` varchar(100) NOT NULL,
`level` enum('siswa','guru','admin') NOT NULL,
`gambar` varchar(100) DEFAULT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Selesai mengetik kode diatas silahkan klik kirim/GO


Setetah database dan tabel terbuat, makuk xampp folder xampp\htdocs

sipakan folder nilai dan didalam foder nilai buat folder dengan nama

admin, bootstrap dan image lalu buka Adobe Dreamweaver CS 6 kemudian pilih

bagian tab code lalu ketik kode dibawah ini

<!DOCTYPE html>

<!--[if IE 8 ]><html class="ie ie8" class="no-js" lang="en"> <![endif]-->

<!--[if (gte IE 9)|!(IE)]><!--><html class="no-js" lang="en"> <!--<![endif]-->

<head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<title>SMK 17 AGUSTUS 1945 SEMARANG</title>

<meta name="description" content="">

<!-- CSS FILES -->

<link rel="stylesheet" href="css/bootstrap.min.css"/>

<link rel="shortcut icon" href="">

<link rel="stylesheet" href="css/style.css">

<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" data-name="skins">

<link rel="stylesheet" type="text/css" href="css/flexslider.css">

<link rel="stylesheet" href="css/font-awesome.css"/>

<link rel="stylesheet" href="css/animate.css"/>

<link rel="stylesheet" type="text/css" href="css/switcher.css" media="screen" />

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->

<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

<!--[if lt IE 9]>

<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>

<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

</head>

<?php

include "conn.php";

$tampil="select * from setting order by id_setting desc";

$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {

$id = $data['logo'];

$telp = $data['telp'];

$email = $data['email'];

$alamat = $data['alamat'];

$nama = $data['nama'];

?>

<body class="home">

<!--Start Header-->

<header>

<!--================================

Navigation

-------------------------------------->

<div class="navbar navbar-default navbar-static-top" role="navigation">

<div class="navbar-header">

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-


collapse">

<span class="sr-only">Toggle navigation</span>

<span class="icon-bar"></span>

<span class="icon-bar"></span>

<span class="icon-bar"></span>
</button>

</div>

<div class="navbar-collapse collapse">

<div class="navbar-header visible-xs">

<div class="navbar-brand">Navigation Menu...</div>

<button type="button" class="navbar-toggle" data-toggle="collapse" data-


target=".navbar-collapse">

<span class="sr-only">Toggle navigation</span>

<span class="icon-bar"></span>

<span class="icon-bar"></span>

<span class="icon-bar"></span>

</button>

</div>

<ul class="nav navbar-nav">

<li class="active"><a href="?module=home">Home</a>

</li>

<li><a href="?module=contact">Contact</a></li>

<li><a href="login.php" >Login</a></li>

</ul>

</div>

</div>

<!--==-----------//Navigation------------>

<!------/Flex-Slider---------/-->

<div class="slider_block">

<div class="flexslider top_slider">

<ul class="slides">

<li class="slide1">

<div class="container">
<div class="flex_caption1 FromLeft">

</div>

</div>

</li>

<li class="slide2">

<div class="container">

<div class="slide flex_caption1 FromTop">

</div>

</div>

</li>

<li class="slide3">

<div class="container">

<div class="slide flex_caption1 FromTop">

</div>

</div>

</li>

<li class="slide4">

<div class="container">

<div class="slide flex_caption1 FromTop">

</div>

</div>

</li>

</ul>

</div>

</div>

<!-- //Slider Wraper -->

</header>
<!--End Header-->

<?php include 'isi.php'; ?>

<section class="footer_bottom">

<div class="container">

<div class="row">

<div class="col-lg-6 col-sm-6">

<p class="copyright">&copy; Copyright | <?php echo $nama;?></p>

</div>

</div>

</div>

</section>

<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>

<script src="js/bootstrap.min.js"></script>

<script src="js/jquery.easing.1.3.js"></script>

<script src="js/retina-1.1.0.min.js"></script>

<script type="text/javascript" src="js/jquery.cookie.js"></script> <!-- jQuery cookie -->

<script type="text/javascript" src="js/styleswitch.js"></script> <!-- Style Colors Switcher -->

<script type="text/javascript" src="js/jquery.flexslider-min.js"></script>

<script type="text/javascript" src="js/jquery.smartmenus.min.js"></script>

<script type="text/javascript" src="js/jquery.smartmenus.bootstrap.min.js"></script>

<script type="text/javascript" src="js/jquery.jcarousel.js"></script>

<script type="text/javascript" src="js/jflickrfeed.js"></script>

<script type="text/javascript" src="js/jquery.magnific-popup.min.js"></script>

<script type="text/javascript" src="js/jquery.isotope.min.js"></script>

<script type="text/javascript" src="js/swipe.js"></script>


<script src="js/main.js"></script>

<!-- WARNING: Wow.js doesn't work in IE 9 or less -->

<!--[if gte IE 9 | !IE ]><!-->

<script type="text/javascript" src="js/wow.min.js"></script>

<script>

// WOW Animation

new WOW().init();

</script>

<![endif]-->

<!-- Start Style Switcher -->

<div class="switcher"></div>

<!-- End Style Switcher -->

</body>

</html>

Simpan dengan nama index.php, setelah itu Membuat koneksi php dengan mysql dengan cara yang

sama pada Adobe Dreamweaver CS 6 pada bagian code ketik

<?php
$db_host = "localhost"; // sever local
$db_user = "root";// user mysql
$db_pass = "";// password mysql
$db_name = "nilai"; // nama databse

$koneksi = mysqli_connect($db_host, $db_user, $db_pass, $db_name);

if(mysqli_connect_error()){
echo 'Gagal melakukan koneksi ke Database : '.mysqli_connect_error();
}

?>
Save dengan nama conn.php, buat lembar baru ketikan code dibawah ini
<?php
$p=isset($_GET['module'])?$_GET['module']:null;
switch($p){
default:
include "home.php";
break;
case "contact":
include "contact.php";
break;
case "syarat":
include "profil.php";
break;

?>
Simpan dengan nama isi.php, buat lembar baru ketik code

<!--start wrapper-->
<section class="wrapper">
<section class="content contact">
<div class="container">

<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="section-title">
<h5>VISI dan MISI SMK 17 AGUSTUS 1945</h5>
<hr>
<p class="text-left">
<h5>VISI</h5>
<h3>Mendidik siswa-siswi menjadi manusia Indonesia beriman,bertaqwa kepada
Tuhan Yang Maha Esa, menguasai Ilmu Pengetahuan dan teknologi dengan mengamalkan Pancasila
dan UUD 1945. </h3>
<h5> MISI</h5><h3>
1. Mewujudkan system pendidikan yang demokrasi dan berkualitas guna mewujudkan bangsa
berakhlak mulia, bertanggungjawab serta berwawasan kebangsaan, kehidupan social budaya yang
berkepribadian bangsa.<br>
2. Mewujudkan sumber daya manusia yang beragama dalam kehidupan sehari-hari serta
memantapkan persaudaraan antar umat beragama.<br>
3. Mewujudkan kualitas sumber daya manusia yang produktif.mandiri, seta mampu daya saing dan
berwawasan lingkungan.</h3>
</p>
</div>
</div>
</div>

</div>
</section>
</section>
<!--end wrapper-->

<!--start footer-->

<!--end footer-->

Simpan dengan nama home.php, buat lembar baru ketik code dibawah ini

<?php

include "conn.php";

$tampil="select * from setting order by id_setting desc";


$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {


$id = $data['logo'];
$telp = $data['telp'];
$email = $data['email'];
$alamat = $data['alamat'];

}
?>

<!--start wrapper-->
<section class="wrapper">
<section class="content contact">
<div class="container">

<div class="row sub_content">


<div class="col-lg-4 col-md-4 col-sm-4 ">
<div class="contact-widget">
<span>
<i class="fa fa-map-marker"></i>
</span>
<div class="dividerHeading">
<h4>Alamat</h4>
</div>
<p><?php echo $alamat; ?></p>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 ">
<div class="contact-widget">
<span>
<i class="fa fa-phone"></i>
</span>
<div class="dividerHeading">
<h4>Telp</h4>
</div>
<p>Phone: <?php echo $telp; ?></p>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 ">
<div class="contact-widget">
<span>
<i class="fa fa-envelope-o"></i>
</span>
<div class="dividerHeading">
<h4>E-Mail</h4>
</div>
<p><?php echo $email;?></p>
</div>
</div>
</div>

</div>
</section>
</section>
<!--end wrapper-->

<!--start footer-->

<!--end footer-->
Simpan dengan nama contact.php, buat lembar baru ketik code
<?php

include ("conn.php");
$tampil="select * from setting order by id_setting desc";
$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {


$id = $data['nama'];
$gambar = $data ['logo'];

?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-
scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>Login | Nilai Online</title>
<link rel="shortcut icon" href="../<?php echo $gambar; ?>">
<!--=== CSS ===-->

<!-- Bootstrap -->


<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

<!-- Theme -->


<link href="assets1/css/main.css" rel="stylesheet" type="text/css" />
<link href="assets1/css/plugins.css" rel="stylesheet" type="text/css" />
<link href="assets1/css/responsive.css" rel="stylesheet" type="text/css" />
<link href="assets1/css/icons.css" rel="stylesheet" type="text/css" />

<!-- Login -->


<link href="assets1/css/login.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" href="assets1/css/fontawesome/font-awesome.min.css">


<!--[if IE 7]>
<link rel="stylesheet" href="assets1/css/fontawesome/font-awesome-ie7.min.css">
<![endif]-->

<!--[if IE 8]>
<link href="assets1/css/ie8.css" rel="stylesheet" type="text/css" />
<![endif]-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700' rel='stylesheet'
type='text/css'>

<!--=== JavaScript ===-->

<script type="text/javascript" src="assets1/js/libs/jquery-1.10.2.min.js"></script>

<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>


<script type="text/javascript" src="assets1/js/libs/lodash.compat.min.js"></script>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->


<!--[if lt IE 9]>
<script src="assets1/js/libs/html5shiv.js"></script>
<![endif]-->

<!-- Beautiful Checkboxes -->


<script type="text/javascript" src="plugins/uniform/jquery.uniform.min.js"></script>

<!-- Form Validation -->


<script type="text/javascript" src="plugins/validation/jquery.validate.min.js"></script>

<!-- Slim Progress Bars -->


<script type="text/javascript" src="plugins/nprogress/nprogress.js"></script>

<!-- App -->


<script type="text/javascript" src="assets1/js/login.js"></script>
<script>
$(document).ready(function(){
"use strict";

Login.init(); // Init login JavaScript


});
</script>
</head>

<body class="login">
<!-- Logo -->
<div class="logo">
<img src="admin/<?php echo "$gambar";?>" alt="logo" width="60" height="85" />
<strong>NILAI</strong>
| ONLINE</div>
<!-- /Logo -->

<!-- Login Box -->


<div class="box">
<div class="content">
<!-- Login Formular -->
<form class="form-vertical login-form" action="proseslogin.php"
method="post">
<!-- Title -->
<h3 class="form-title">Masuk ke akun anda</h3>

<!-- Error Message -->


<div class="alert fade in alert-danger" style="display: none;">
<i class="icon-remove close" data-dismiss="alert"></i>
Enter any username and password.
</div>

<!-- Input Fields -->


<div class="form-group">
<!--<label for="username">Username:</label>-->
<div class="input-icon">
<i class="icon-user"></i>
<input type="text" name="username" class="form-
control" placeholder="Username" autofocus="autofocus" data-rule-required="true" data-msg-
required="Please enter your username." />
</div>
</div>
<div class="form-group">
<!--<label for="password">Password:</label>-->
<div class="input-icon">
<i class="icon-lock"></i>
<input type="password" name="password"
class="form-control" placeholder="Password" data-rule-required="true" data-msg-required="Please
enter your password." />
</div>
</div>
<!-- /Input Fields -->

<!-- Form Actions -->


<div class="form-actions">
<label class="checkbox pull-left"><input type="checkbox"
class="uniform" name="remember"> Remember me</label>
<button type="submit" class="submit btn btn-primary pull-
right">
Sign In <i class="icon-angle-right"></i>
</button>
</div>
</form>
<!-- /Login Formular -->
<!-- Register Formular (hidden by default) -->

<!-- /Register Formular -->


</div> <!-- /.content -->

<!-- Forgot Password Form -->


<div class="inner-box">
<div class="content">
<!-- Close Button -->
<i class="icon-remove close hide-default"></i>

<!-- Link as Toggle Button -->


<a href="#" class="forgot-password-link"><?php echo
"$id";?></a>

<!-- Forgot Password Formular -->


<form class="form-vertical forgot-password-form hide-default"
action="login.php" method="post">
<!-- Input Fields -->
<div class="form-group">
<!--<label for="email">Email:</label>-->
<div class="input-icon">
<i class="icon-envelope"></i>
<input type="text" name="email"
class="form-control" placeholder="Enter email address" data-rule-required="true" data-rule-
email="true" data-msg-required="Please enter your email." />
</div>
</div>
<!-- /Input Fields -->

<button type="submit" class="submit btn btn-default btn-


block">
Reset your Password
</button>
</form>
<!-- /Forgot Password Formular -->

<!-- Shows up if reset-button was clicked -->


<div class="forgot-password-done hide-default">
<i class="icon-ok success-icon"></i> <!-- Error-Alternative: <i
class="icon-remove danger-icon"></i> -->
<span>Great. We have sent you an email.</span>
</div>
</div> <!-- /.content -->
</div>
<!-- /Forgot Password Form -->
</div>
<!-- /Login Box -->

<!-- Single-Sign-On (SSO) -->

<!-- /Single-Sign-On (SSO) -->

<!-- Footer -->

<!-- /Footer -->


</body>
</html>
Simpan dengan nama login.php, buat lembar baru ketik code dibawah ini
<?php
include ("conn.php");
date_default_timezone_set('Asia/Jakarta');
ob_start();
session_start();

$username = $_POST['username'];
$password = $_POST['password'];

//$username = mysqli_real_escape_string($username);
//$password = mysqli_real_escape_string($password);

if (empty($username) && empty($password)) {


header('location:index.php?error1');
break;
} else if (empty($username)) {
header('location:index.php?error=2');
break;
} else if (empty($password)) {
header('location:index.php?error=3');
break;
}

$q = mysqli_query($koneksi, " SELECT * FROM userdata WHERE username = '$username' AND


password = '$password'");
$row = mysqli_fetch_array ($q);

if (mysqli_num_rows($q) == 1) {
$_SESSION['id'] = $row['id'];
$_SESSION['username'] = $username;
$_SESSION['nama'] = $row['nama'];
$_SESSION['level'] = $row['level'];
$_SESSION['gambar'] = $row['gambar'];

header('location:admin/index.php?module=home');
// echo "selamat ada Login sebagai $nama ";
} else {
header('location:index.php?error=4');
}
?>
Simpan dengan nama proseslogin.php, buat lembar baru ketik code dibawah ini
<?php
ob_start();
session_start();
include ("../conn.php");

$tampil="select * from setting order by id_setting desc";


$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {


$id = $data['nama'];
$gambar = $data ['logo'];

?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->

<!-- BEGIN HEAD -->


<head>
<meta charset="UTF-8" />
<title>Aplikasi | Nilai</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />

<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<!-- GLOBAL STYLES -->

<!-- GLOBAL STYLES -->


<link rel="stylesheet" href="../assets/plugins/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="../assets/css/main.css" />
<link rel="stylesheet" href="../assets/css/theme.css" />
<link rel="stylesheet" href="../assets/css/MoneAdmin.css" />
<link rel="stylesheet" href="../assets/plugins/Font-Awesome/css/font-awesome.css" />
<!--END GLOBAL STYLES -->

<!-- PAGE LEVEL STYLES -->


<link href="../assets/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet" />

<link rel="stylesheet" href="../assets/css/bootstrap-fileupload.min.css" />


<link rel="stylesheet" href="../assets/plugins/validationengine/css/validationEngine.jquery.css" />

<link rel="stylesheet" href="../assets/css/bootstrap-fileupload.min.css" />

<!-- END PAGE LEVEL STYLES -->


<link href="../assets/css/jquery-ui.css" rel="stylesheet" />
<link rel="stylesheet" href="../assets/plugins/uniform/themes/default/css/uniform.default.css" />
<link rel="stylesheet" href="../assets/plugins/inputlimiter/jquery.inputlimiter.1.0.css" />
<link rel="stylesheet" href="../assets/plugins/chosen/chosen.min.css" />
<link rel="stylesheet" href="../assets/plugins/colorpicker/css/colorpicker.css" />
<link rel="stylesheet" href="../assets/plugins/tagsinput/jquery.tagsinput.css" />
<link rel="stylesheet" href="../assets/plugins/daterangepicker/daterangepicker-bs3.css" />
<link rel="stylesheet" href="../assets/plugins/datepicker/css/datepicker.css" />
<link rel="stylesheet" href="../assets/plugins/timepicker/css/bootstrap-timepicker.min.css" />
<link rel="stylesheet" href="../assets/plugins/switch/static/stylesheets/bootstrap-switch.css" />
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>

<!-- END HEAD -->


<!-- BEGIN BODY -->
<body class="padTop53 " >

<!-- MAIN WRAPPER -->


<div id="wrap">

<!-- HEADER SECTION -->


<div id="top">

<nav class="navbar navbar-inverse navbar-fixed-top " style="padding-top: 10px;">


<a data-original-title="Show/Hide Menu" data-placement="bottom" data-tooltip="tooltip"
class="accordion-toggle btn btn-primary btn-sm visible-xs" data-toggle="collapse" href="#menu"
id="menu-toggle">
<i class="icon-align-justify"></i>
</a>
<!-- LOGO SECTION -->
<header class="navbar-header">

<a href="index.php" class="navbar-brand">


<img src="<?php echo $gambar;?>" alt="" width="40" height="40" /></a>
<em> <?php echo $id; ?></em>
</header>
<?php
include "../conn.php";
$kelas = $_SESSION['username'];
$sql1 = "SELECT * FROM
userdata
INNER JOIN siswa ON userdata.username = siswa.nis where siswa.nis = '$kelas'";
$tampil1 = mysqli_query($koneksi,$sql1);

while ($tampilkan1 = mysqli_fetch_array($tampil1)) {


$kelas = $tampilkan1['kd_kelas'];

}
$tampil=mysqli_query($koneksi, "SELECT
tugas.urut,
tugas.judul,
tugas.kd_mapel,
tugas.file,
tugas.keterangan,
tugas.kd_kelas,
tugas.nip,
tugas.`status`,
tugas.tgl
FROM
tugas
where tugas.kd_kelas = '$kelas'
");
$total=mysqli_num_rows($tampil)
?>
<!-- END LOGO SECTION -->
<ul class="nav navbar-top-links navbar-right">

<!-- MESSAGES SECTION -->


<li class="dropdown">

<ul class="dropdown-menu dropdown-messages">


<?php
$kelas = $_SESSION['username'];
$sql1 = "SELECT * FROM
userdata
INNER JOIN siswa ON userdata.username = siswa.nis where siswa.nis = '$kelas'";
$tampil1 = mysqli_query($koneksi,$sql1);

while ($tampilkan1 = mysqli_fetch_array($tampil1)) {


$kelas = $tampilkan1['kd_kelas'];

// Tampilkan data dari Database


$sql = "SELECT * FROM tugas where kd_kelas = '$kelas'";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($tampilkan = mysqli_fetch_array($tampil)) {

?>

<?php } ?>

</ul>
</li>
<!--END MESSAGES SECTION -->

<!--TASK SECTION -->

<!--END TASK SECTION -->

<!--ALERTS SECTION -->

<!-- END ALERTS SECTION -->

<!--ADMIN SETTINGS SECTIONS -->

<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="icon-user "></i>&nbsp; <i class="icon-chevron-down "></i>
</a>

<ul class="dropdown-menu dropdown-user">


<li><a href="?module=edituser&edit=<?php echo $_SESSION['username'] ; ?>"><i
class="icon-user"></i> User Profile </a>
</li>

<li class="divider"></li>
<li><a href="../logout.php"><i class="icon-signout"></i> Logout </a>
</li>
</ul>

</li>
<!--END ADMIN SETTINGS -->
</ul>

</nav>

</div>
<!-- END HEADER SECTION -->

<!-- MENU SECTION -->


<div id="left">
<div class="media user-media well-small">
<a class="user-link" href="#">
<img class="media-object img-thumbnail user-img" alt="User Picture" src="<?php echo
$_SESSION['gambar']; ?>" width="80" height="80" />
</a>
<br />
<div class="media-body">
<h5 class="media-heading"> <?php echo $_SESSION['nama']; ?></h5>
<ul class="list-unstyled user-info">

<li>
<a class="btn btn-success btn-xs btn-circle" style="width: 10px;height: 12px;"></a>
Online

</li>

</ul>
</div>
<br />
</div>
<?php if ($_SESSION['level']=='admin' || $_SESSION['level']=='guru'|| $_SESSION['level']=='siswa' ){
?>
<ul id="menu" class="collapse">

<li class="panel">
<a href="?module=home" >
<i class="icon-dashboard"></i> Dashboard

</a>
</li>
<?php }if ($_SESSION['level']=='admin' ){ ?>
<li class="panel ">
<a href="?module=guru" data-parent="#menu" data-toggle="collapse" class="accordion-
toggle" data-target="#component-nav">
<i class=" icon-user"> </i> Guru

</a>

</li>
<li class="panel ">
<a href="?module=siswa" data-parent="#menu" data-toggle="collapse" class="accordion-
toggle collapsed" data-target="#form-nav">
<i class="icon-group"></i> Siswa
</a>

</li>
<?php }if ($_SESSION['level']=='guru'){ ?>
<li class="panel">
<a href="#" data-parent="#menu" data-toggle="collapse" class="accordion-toggle" data-
target="#pagesr-nav">
<i class="icon-home"></i> Akademik

<span class="pull-right">
<i class="icon-angle-left"></i>
</span>

</a>

<ul class="collapse" id="pagesr-nav">

<li><a href="?module=tugas"><i class="icon-angle-right"></i> Tugas </a></li>


<li><a href="?module=nilai"><i class="icon-angle-right"></i> Nilai </a></li>
<li><a href="?module=tampilnilai"><i class="icon-angle-right"></i> Tampil Nilai
</a></li>
</ul>
</li>
<?php }if ($_SESSION['level']=='siswa'){ ?>
<li class="panel">
<a href="#" data-parent="#menu" data-toggle="collapse" class="accordion-toggle" data-
target="#pagesr-nav">
<i class="icon-home"></i> Akademik

<span class="pull-right">
<i class="icon-angle-left"></i>
</span>

</a>

<ul class="collapse" id="pagesr-nav">

<li><a href="?module=tugassiswa"><i class="icon-angle-right"></i> Tugas </a></li>


<li><a href="?module=uploadtugas"><i class="icon-angle-right"></i> Upload tugas
</a></li>
<li><a href="?module=tampilnilais"><i class="icon-angle-right"></i> Tampil Nilai
</a></li>

</ul>
</li>
<?php }if ($_SESSION['level']=='admin'){ ?>
<li class="panel">
<a href="#" data-parent="#menu" data-toggle="collapse" class="accordion-toggle" data-
target="#pagesr-nav">
<i class="icon-home"></i> Akademik

<span class="pull-right">
<i class="icon-angle-left"></i>
</span>

</a>

<ul class="collapse" id="pagesr-nav">


<li><a href="?module=mapel"><i class="icon-angle-right"></i> Mapel </a></li>
<li><a href="?module=kelas"><i class="icon-angle-right"></i> Kelas </a></li>

</ul>
</li>
<?php }if ($_SESSION['level']=='guru'){ ?>
<li class="panel">
<a href="#" data-parent="#menu" data-toggle="collapse" class="accordion-toggle" data-
target="#chart-nav">
<i class="icon-print"></i> Cetak
<span class="pull-right">
<i class="icon-angle-left"></i>
</span>
</a>
<ul class="collapse" id="chart-nav">

<li><a href="?module=lapnilai"><i class="icon-angle-right"></i> lap.Nilai </a></li>


</ul>
</li>
<?php }if ($_SESSION['level']=='admin'){ ?>
<li><a href="?module=setting"><i class="icon-gear"></i> Settings </a>
</li>

<?php }if ($_SESSION['level']=='admin' || $_SESSION['level']=='guru' ||


$_SESSION['level']=='siswa'){ ?>

<li><a href="../logout.php"><i class="icon-signin"></i> Logout </a></li>


</ul>
<?php } ?>
</div>

<!--END MENU SECTION -->

<!--PAGE CONTENT -->


<div id="content">

<?php include "isi.php"; ?>

</div>

</div>
<!--END PAGE CONTENT -->

</div>

<!--END MAIN WRAPPER -->

<!-- FOOTER -->


<div id="footer">
<p>&copy; Aplikasi Nilai &nbsp;2017 &nbsp;</p>
</div>
<!--END FOOTER -->
<!-- GLOBAL SCRIPTS -->
<script src="../assets/plugins/jquery-2.0.3.min.js"></script>
<script src="../assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="../assets/plugins/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<!-- END GLOBAL SCRIPTS -->
<!-- PAGE LEVEL SCRIPTS -->
<script src="../assets/plugins/dataTables/jquery.dataTables.js"></script>
<script src="../assets/plugins/dataTables/dataTables.bootstrap.js"></script>

<!-- PAGE LEVEL SCRIPTS -->

<script src="../assets/plugins/validationengine/js/jquery.validationEngine.js"></script>
<script src="../assets/plugins/validationengine/js/languages/jquery.validationEngine-
en.js"></script>
<script src="../assets/plugins/jquery-validation-1.11.1/dist/jquery.validate.min.js"></script>
<script src="../assets/js/validationInit.js"></script>
<script src="../assets/plugins/jasny/js/bootstrap-fileupload.js"></script>
<script src="../assets/js/jquery-ui.min.js"></script>
<script src="../assets/plugins/uniform/jquery.uniform.min.js"></script>
<script src="../assets/plugins/inputlimiter/jquery.inputlimiter.1.3.1.min.js"></script>
<script src="../assets/plugins/chosen/chosen.jquery.min.js"></script>
<script src="../assets/plugins/colorpicker/js/bootstrap-colorpicker.js"></script>
<script src="../assets/plugins/tagsinput/jquery.tagsinput.min.js"></script>
<script src="../assets/plugins/validVal/js/jquery.validVal.min.js"></script>
<script src="../assets/plugins/daterangepicker/daterangepicker.js"></script>
<script src="../assets/plugins/daterangepicker/moment.min.js"></script>
<script src="../assets/plugins/datepicker/js/bootstrap-datepicker.js"></script>
<script src="../assets/plugins/timepicker/js/bootstrap-timepicker.min.js"></script>
<script src="../assets/plugins/switch/static/js/bootstrap-switch.min.js"></script>
<script src="../assets/plugins/jquery.dualListbox-1.3/jquery.dualListBox-1.3.min.js"></script>
<script src="../assets/plugins/autosize/jquery.autosize.min.js"></script>
<script src="../assets/plugins/jasny/js/bootstrap-inputmask.js"></script>
<script src="../assets/js/formsInit.js"></script>
<script>
$(function () { formInit(); });
$(document).ready(function () {
$('#dataTables-example').dataTable();
});
$(function () { formValidation(); });
;
</script>

<!-- END GLOBAL SCRIPTS -->

<!-- PAGE LEVEL SCRIPT-->

<!--END PAGE LEVEL SCRIPTS -->


<!-- END PAGE LEVEL SCRIPTS -->
</body>
<!-- END BODY -->
</html>
Simpan kefolder admin dengan nama index.php, buat lembar baru ketik code dibawwah ini
<?php

if ($_GET['module'] == "home") {
include "home.php";
}
//guru
else if ($_GET['module'] == "guru") {
include "guru.php";

//and guru
else if ($_GET['module'] == "siswa") {
include "siswa.php";

}
else if ($_GET['module'] == "editsiswa") {
include "editsiswa.php";

}
//mapel
else if ($_GET['module'] == "mapel") {
include "mapel.php";

}
else if ($_GET['module'] == "editmapel") {
include "editmapel.php";

}
//setting sekolahan
else if ($_GET['module'] == "setting") {
include "setting.php";

}
//llas

else if ($_GET['module'] == "editkelas") {


include "editkelas.php";

}
else if ($_GET['module'] == "kelas") {
include "kelas.php";

}
//tugas

else if ($_GET['module'] == "tugas") {


include "tugas.php";

}
else if ($_GET['module'] == "input-tugas") {
include "input-tugas.php";

}
else if ($_GET['module'] == "tugassiswa") {
include "tugassiswa.php";

}
else if ($_GET['module'] == "jawabsiswa") {
include "jawabsiswa.php";

}
else if ($_GET['module'] == "uploadtugas") {
include "uploadtugass.php";

//user
else if ($_GET['module'] == "edituser") {
include "edituser.php";

}
else if ($_GET['module'] == "editguru") {
include "editguru.php";

}
//nilai
else if ($_GET['module'] == "nilai") {
include "nilai.php";

}
else if ($_GET['module'] == "penilaian") {
include "penilaian.php";

}
else if ($_GET['module'] == "tampilnilai") {
include "tampilnilai.php";

}
else if ($_GET['module'] == "tampilnilais") {
include "tampilnilais.php";

}
else if ($_GET['module'] == "lapnilai") {
include "lapnilai.php";

}
else if ($_GET['module'] == "cetak") {
include "cetak.php";

}
?>
Simpan difolder admin dengan nama isi.php, buat lembar baru ketik code dibawah ini

<?php
include '../conn.php';

// $bulan=date('yyyy');
// Tampilkan data dari Database
$sql = "SELECT count('kode') as jml from mapel";

$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($data = mysqli_fetch_array($tampil)) {
$Kode = $data['jml'];

}
$sql1 = "SELECT count(`kd_kelas`) as sum from kelas";

$tampil1 = mysqli_query($koneksi,$sql1);
$no=1;
while ($data = mysqli_fetch_array($tampil1)) {
$Kode1 = $data['sum'];
}
$sql2 = "SELECT count('nip') as jumlah from guru";

$tampil2 = mysqli_query($koneksi,$sql2);
$no=1;
while ($data = mysqli_fetch_array($tampil2)) {
$Kode2 = $data['jumlah'];

}
$sql3 = "SELECT count(`nis`) as j from siswa";

$tampil3 = mysqli_query($koneksi,$sql3);
$no=1;
while ($data = mysqli_fetch_array($tampil3)) {
$Kode3 = $data['j'];

?>

<div class="inner" style="min-height: 700px;">


<div class="row">
<div class="col-lg-12">
<h3> Dashboard </h3>
</div>
</div>
<hr />
<!--BLOCK SECTION -->
<div class="row">
<div class="col-lg-12">
<div style="text-align: center;">

<a class="quick-btn" href="#">


<i class="icon-list-alt icon-2x"></i>
<span> Mapel</span>
<span class="label label-danger"><?php echo "$Kode"; ?></span>
</a>

<a class="quick-btn" href="#">


<i class="icon-user icon-2x"></i>
<span>Guru</span>
<span class="label label-success"><?php echo "$Kode2";?></span>
</a>
<a class="quick-btn" href="#">
<i class="icon-group icon-2x"></i>
<span>Siswa</span>
<span class="label label-warning"><?php echo "$Kode3";?></span>
</a>
<a class="quick-btn" href="#">
<i class="icon-home icon-2x"></i>
<span>Kelas</span>
<span class="label btn-metis-2"><?php echo "$Kode1"; ?></span>
</a>

</div>

</div>

</div>
<!--END BLOCK SECTION -->
<hr />
<!-- CHART & CHAT SECTION -->

</div>
<!--END CHAT & CHAT SECTION -->
<!-- COMMENT AND NOTIFICATION SECTION -->

<!-- END COMMENT AND NOTIFICATION SECTION -->

<!-- STACKING CHART SECTION -->

</div>
</div>

</div>
<!--END STACKING CHART SCETION -->

<!--TABLE, PANEL, ACCORDION AND MODAL -->

<!--TABLE, PANEL, ACCORDION AND MODAL -->

</div>

<!--END PAGE CONTENT -->

<!--END MAIN WRAPPER -->

<!-- FOOTER -->


Simpan ke folder admin dengan nama home.php, buat lembar baru ketik code dibawah ini

<div class="inner">
<div class="row">
<div class="col-lg-12">

<h2> Data Siswa </h2>

</div>
</div>

<hr />

<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-lg-4">
<div class="panel-body">
<button class="btn btn-warning" data-toggle="modal" data-target="#newReg">
Tambah
</button>

</div>

</div>

</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-
example">
<thead>
<tr>
<th>NO</th>
<th>NIS</th>
<th>NAMA</th>
<th>JENIS KELAMIN</th>

<th>KELAS</th>
<th>GAMBAR</th>
<th>AKSI</th>
</tr>
</thead>
<tbody>
<?php include '../conn.php';
// Tampilkan data dari Database
$sql = "SELECT
kelas.kd_kelas,
kelas.nama AS kelas,
siswa.id,
siswa.nis,
siswa.nama AS nmsiswa,
siswa.jenkel,
siswa.alamat,
siswa.tempt_lahir,
siswa.tgl_lahir,
userdata.username,
userdata.nama AS nmuser,
userdata.`level`,
userdata.gambar
FROM
kelas
INNER JOIN siswa ON kelas.kd_kelas = siswa.kd_kelas
INNER JOIN userdata ON userdata.username = siswa.nis";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($tampilkan = mysqli_fetch_array($tampil)) {

?>
<tr class="odd gradeX">
<td>
<?php echo $no++; ?>
</td>
<td><?php echo $tampilkan['nis'];?></td>
<td><?php echo $tampilkan['nmsiswa'];?></td>
<td><?php echo $tampilkan['jenkel'];?></td>
<td class="center"><?php echo $tampilkan['kelas'];?></td>
<td class="center"><?php echo $tampilkan['gambar'];?></td>
<td class="center"><div class="btn-group">
<a href="?module=editsiswa&edit=<?php echo $tampilkan['nis'];?>" class="bs-tooltip"
title="Hapus" ><i class=" icon-pencil" ></i></a>
<a href="hapussiswa.php?nis=<?php echo $tampilkan['nis'];?>" class="bs-
tooltip" title="Hapus" ><i class=" icon-trash" ></i></a>

</div></td>
</tr>

<?php
}
?>

</tbody>
</table>
</div>

</div>
</div>
</div>
</div>

<div class="modal fade" id="newReg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"


aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-
hidden="true">&times;</button>
<h4 class="modal-title" id="H4"> Input Data Siswa</h4>
</div>
<div class="modal-body">
<form method="post" action="sismpansiswa.php" class="form-horizontal"
enctype="multipart/form-data" >

<div class="form-group">
<label class="control-label col-lg-4">Nama Siswa</label>
<div class="col-lg-8">
<input type="text" id="required2" name="nama" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">nis</label>
<div class="col-lg-8">
<input type="text" id="required2" name="nis" class="form-control" />
</div>
</div>

<div class="form-group">
<label class="control-label col-lg-4">Password</label>

<div class="col-lg-8">
<input type="text" id="password2" name="password" class="form-
control" value="12345678" readonly="" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Jenis Kelamin</label>

<div class="col-lg-8">
<select class="form-control" name="jenkel">
<option>Laki-Laki</option>
<option>Wanita</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Kelas</label>

<div class="col-lg-8">
<select name="kelas" id="kelas" class="form-control required">
<option value=''>-Pilih-</option>;<?php
$sql = "SELECT * FROM kelas ";
$query = mysqli_query($koneksi,$sql);
while($rows=mysqli_fetch_array($query)){
echo "<option value='$rows[kd_kelas]'>$rows[kd_kelas] - $rows[nama]</option>";
}
?></select>
</div>
</div>

<div class="form-group">
<label class="control-label col-lg-4">Tempat Lahir</label>
<div class="col-lg-8">
<input type="text" id="required2" name="tml_lahir" class="form-control"
/>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Tanggal lahir</label>

<div class="col-lg-8">
<div class="input-group">
<input class="form-control" type="text" name="tgl" data-mask="99/99/9999" />
<span class="input-group-addon">99/99/9999</span>

</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Photo</label>
<div class="col-lg-8">
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="fileupload-new thumbnail" style="width: 200px; height: 150px;"><img
src="../assets/img/demoUpload.jpg" alt="" /></div>
<div class="fileupload-preview fileupload-exists thumbnail" style="max-width:
200px; max-height: 150px; line-height: 20px;"></div>
<div>
<span class="btn btn-file btn-primary"><span class="fileupload-new">Select
image</span><span class="fileupload-exists">Change</span><input name="nama_file" type="file"
id="nama_file" /></span>
<a href="#" class="btn btn-danger fileupload-exists" data-
dismiss="fileupload">Remove</a>
</div>
</div>
</div>
</div>

<div class="form-group">
<label for="autosize" class="control-label col-lg-4">Alamat</label>

<div class="col-lg-8">
<textarea id="autosize" class="form-control" name="alamat"></textarea>
</div>
</div>

<div class="modal-footer">
<button type="button" class="btn btn-default" data-
dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>

</form>

</div>

</div>
</div>
</div>

<!--END PAGE CONTENT -->

<!--END MAIN WRAPPER -->

<!-- FOOTER -->

<!-- END PAGE LEVEL SCRIPTS -->


Simpan kedalam folder admin kasih nama siswa.php, buat lembar baru ketik code dibawah ini
<?php
include "../conn.php";
$nama = $_REQUEST['nama'];
$nis = $_REQUEST['nis'];
$password = $_REQUEST['password'];
$tml_lahir = $_REQUEST['tml_lahir'];
$tgl = $_REQUEST['tgl'];
function ubahtanggal ($tgl){
$pisah = explode('/', $tgl);
$array = array($pisah[2], $pisah[0], $pisah[1]);
$satukan = implode('-', $array);
return $satukan;
}
$tgl_lahir = ubahtanggal($tgl);

$jenkel = $_REQUEST['jenkel'];
$kelas = $_REQUEST['kelas'];
$level = 'siswa';
$alamat = $_REQUEST['alamat'];

$namafolder="photo/";
$skelahiran = $_FILES['nama_file']['name'];

$uploadfile = $namafolder . $skelahiran;

// nama file temporary yang akan disimpan di server

$tmpName = $_FILES['nama_file']['tmp_name'];

// ukuran file yang diupload

$fileSize = $_FILES['nama_file']['size'];

// jenis file yang diupload

$fileType = $_FILES['nama_file']['type'];
//$gambar = $_GET['nama_file'];
//echo "$gambar";
// exit;

// HAPUS
$nis = strtolower($nis);
$sql_cek="SELECT * FROM siswa WHERE nis='$nis'";
$qry_cek=mysqli_query($koneksi, $sql_cek);
$jum_cek=mysqli_num_rows($qry_cek);
if ($jum_cek >= 1) {

//include "idx.php?module=input-petugas";
echo "<script>alert('nis : $nis SUDAH ADA PERNAH DISIMPAN! SILAHKAN INPUT YANG LAIN');
window.location = 'index.php?module=siswa'</script>";

exit;
}
$nis = strtolower($nis);
$sql_cek="SELECT * FROM userdata WHERE username='$nis'";
$qry_cek=mysqli_query($koneksi, $sql_cek);
$jum_cek=mysqli_num_rows($qry_cek);
if ($jum_cek >= 1) {

//include "idx.php?module=input-petugas";
echo "<script>alert('nis : $nis SUDAH ADA PERNAH DISIMPAN! SILAHKAN INPUT YANG LAIN');
window.location = 'index.php?module=siswa'</script>";

exit;
}
//tempat menyimpan file

if(empty($_FILES["nama_file"]["tmp_name"]))
{

$query = mysqli_query($koneksi, "INSERT INTO siswa (nis, nama, jenkel, tempt_lahir, tgl_lahir,
alamat, kd_kelas) VALUES ('$nis','$nama','$jenkel', '$tml_lahir', '$tgl_lahir', '$alamat', '$kelas')");
$query1 = mysqli_query($koneksi, "INSERT INTO userdata (username, password, nama, level)
VALUES ('$nis','$password','$nama', '$level')");
//echo "<script>alert('Data perusahaan berhasil disimpan!'); window.location =
'index.php?module=guru'</script>";
}
elseif (!empty($_FILES["nama_file"]["tmp_name"]))
{
// $gambar = $namafolder . basename($_FILES['nama_file']['name']);

if (move_uploaded_file($_FILES['nama_file']['tmp_name'], $uploadfile)) {
$query = mysqli_query($koneksi, "INSERT INTO siswa (nis, nama, jenkel, tempt_lahir, tgl_lahir,
alamat, kd_kelas) VALUES ('$nis','$nama','$jenkel', '$tml_lahir', '$tgl_lahir', '$alamat', '$kelas')");
$query1 = mysqli_query($koneksi, "INSERT INTO userdata (username, password, nama, level,
gambar) VALUES ('$nis','$password','$nama', '$level', '$namafolder$skelahiran')");
} else {
echo "<p>Gambar gagal dikirim</p>";
}

} else {
echo "Anda belum memilih gambar";
}

if ($query){
echo "<script>alert('Data Berhasil dimasukan!'); window.location =
'index.php?module=siswa'</script>";
} else {
echo "<script>alert('Data Gagal dimasukan!'); window.location =
'index.php?module=siswa'</script>";
}

?>
Simpan kefolder admin dengan nama simpansiswa.php, buat lembar baru ketik code dibawah ini

<!--END MENU SECTION -->

<!--PAGE CONTENT -->

<div class="inner">
<div class="row">
<div class="col-lg-12">

<h3 > EDIT DATA SISWA </h3>

<?php
$edit = $_GET['edit'] ;

include ("../conn.php");
$tampil="SELECT
kelas.kd_kelas,
kelas.nama AS kelas,
siswa.id,
siswa.nis,
siswa.nama AS nmsiswa,
siswa.jenkel,
siswa.alamat,
siswa.tempt_lahir,
siswa.tgl_lahir,
userdata.username,
userdata.nama AS nmuser,
userdata.`level`,
userdata.gambar
FROM
kelas
INNER JOIN siswa ON kelas.kd_kelas = siswa.kd_kelas
INNER JOIN userdata ON userdata.username = siswa.nis where userdata.username ='$edit'";
$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {

$nmsiswa= $data['nmsiswa'];
$nis=$data['nis'];
$tmt_lahir=$data['tempt_lahir'];
$tgl=$data['tgl_lahir'];
function ubahtanggal ($tgl){
$pisah = explode('-', $tgl);
$array = array($pisah[2], $pisah[1], $pisah[0]);
$satukan = implode('/', $array);
return $satukan;
}
$tgl_lahir = ubahtanggal($tgl);
$gambar=$data['gambar'];
$alamat = $data['alamat'];
$kelas = $data['kd_kelas'];
$jenkel = $data['jenkel'];

?>

</div>
</div>
<hr />

<div class="row">
<div class="col-lg-12">
<div class="box">
<header>
<div class="icons"><i class="icon-th-large"></i></div>

<div class="toolbar">
<ul class="nav">
<li>
<div class="btn-group">
<a class="accordion-toggle btn btn-xs minimize-box" data-
toggle="collapse"
href="#collapseOne">
<i class="icon-chevron-up"></i>
</a>
<button class="btn btn-xs btn-danger close-box">
<i class="icon-remove"></i>
</button>
</div>
</li>
</ul>
</div>

</header>
<div id="collapseOne" class="accordion-body collapse in body">
<form method="post" action="simpaneditsiswa.php" class="form-horizontal"
enctype="multipart/form-data" >

<div class="form-group">
<label class="control-label col-lg-4">Nama Siswa</label>
<div class="col-lg-4">
<input type="text" id="required2" name="nama" class="form-control"
value="<?php echo $nmsiswa;?>" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">nis</label>
<div class="col-lg-4">
<input type="text" id="required2" name="nis" class="form-control"
value="<?php echo $nis;?>" readonly="" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Jenis Kelamin</label>

<div class="col-lg-8">
<select name="jenkel" class="form-control">
<option name="jenkel" value="laki-laki" <?php if(($jenkel)== "laki-laki")
{echo "selected=\"selected\"";};?>> laki-laki </option>
<option name="jenkel" value="wanita" <?php if(($jenkel)== "wanita")
{echo "selected=\"selected\"";};?>> Wanita </option>

</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Kelas <?php echo $kelas; ?></label>

<div class="col-lg-8">
<select name="kelas" id="kelas" class="form-control required">
<?php
$kls = $kelas;

$sql = "SELECT *
FROM kelas
ORDER BY
kelas.kd_kelas = '$kls' DESC ";
$query = mysqli_query($koneksi,$sql);
while($rows=mysqli_fetch_array($query)){
if ($rows[kd_kelas]=='$kls'){
echo "<option value='$rows[kd_kelas]'> $rows[nama]</option>";
} else {
echo "<option value='$rows[kd_kelas]'> $rows[nama]</option>";
}
}
//kelasQ = mysql_query("SELECT * FROM kelas ORDER BY nama ASC");
// while($kelas = mysql_fetch_array($kelasQ)) {
// ($kelas['id_kelas']==$value['id_kelas']) ?
$s='selected':$s='';
// echo "<option value='$kelas[id_kelas]'
$s>$kelas[nama]</option>";

?></select>

</div>
</div>

<div class="form-group">
<label class="control-label col-lg-4">Tempat Lahir</label>
<div class="col-lg-4">
<input type="text" id="required2" name="tmpt_lahir" class="form-
control" value="<?php echo $tmt_lahir;?>" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Tanggal lahir</label>

<div class="col-lg-4">
<div class="input-group">
<input class="form-control" type="text" name="tgl" data-mask="99/99/9999"
value="<?php echo $tgl_lahir;?>" />
<span class="input-group-addon">99/99/9999</span>

</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Photo</label>
<div class="col-lg-8">
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="fileupload-new thumbnail" style="width: 200px; height: 150px;"><img
src="<?php echo $gambar;?>" alt="" /></div>
<div class="fileupload-preview fileupload-exists thumbnail" style="max-width:
200px; max-height: 150px; line-height: 20px;"></div>
<div>
<span class="btn btn-file btn-primary"><span class="fileupload-new">Select
image</span><span class="fileupload-exists">Change</span><input name="nama_file" type="file"
id="nama_file" /></span>
<a href="#" class="btn btn-danger fileupload-exists" data-
dismiss="fileupload">Remove</a>
</div>
</div>
</div>
</div>

<div class="form-group">
<label for="autosize" class="control-label col-lg-4">Alamat</label>
<div class="col-lg-8">
<textarea id="autosize" class="form-control" name="alamat"><?php echo
$alamat;?></textarea>
</div>
</div>

<div class="form-actions no-margin-bottom" style="text-align:center;">

<input type="submit" value="SIMPAN" class="btn btn-primary btn-lg " />


</div>

</form>
</div>
</div>
</div>
</div>

<?php } ?>

<!--END MAIN WRAPPER -->


Simpan kedalam folder admin dengan nama editsiswa.php, buat lembar baru ketik code dibawah ini
<?php
include "../conn.php";

$namafolder="photo/"; //tempat menyimpan file

if(empty($_FILES["nama_file"]["tmp_name"]))
{

$nama = $_POST['nama'];
$nis = $_POST['nis'];
$tmpt_lahir = $_POST['tmpt_lahir'];

$tgl = $_POST['tgl'];
function ubahtanggal ($tgl){
$pisah = explode('/', $tgl);
$array = array($pisah[2], $pisah[0], $pisah[1]);
$satukan = implode('-', $array);
return $satukan;
}
$tgl_lahir = ubahtanggal($tgl);
$alamat = $_POST['alamat'];

$query = mysqli_query($koneksi, "UPDATE guru SET nama='$nama', tmt_lahir='$tmpt_lahir',


tgl_lahir='$tgl_lahir', alamat='$alamat' where nis = '$nis'");
$query1 = mysqli_query($koneksi, "UPDATE userdata SET nama='$nama' where username=
'$nis'");
//echo "Gambar berhasil dikirim ke direktori".$gambar;
echo "<script>alert('Data berhasil diupdate!'); window.location =
'index.php?module=siswa'</script>";
}

elseif (!empty($_FILES["nama_file"]["tmp_name"]))
{
$jenis_gambar=$_FILES['nama_file']['type'];
$nama = $_POST['nama'];
$nis = $_POST['nis'];
$tmpt_lahir = $_POST['tmpt_lahir'];

$tgl = $_POST['tgl'];
function ubahtanggal ($tgl){
$pisah = explode('/', $tgl);
$array = array($pisah[2], $pisah[0], $pisah[1]);
$satukan = implode('-', $array);
return $satukan;
}
$tgl_lahir = ubahtanggal($tgl);
$alamat = $_POST['alamat'];

if($jenis_gambar=="image/jpeg" || $jenis_gambar=="image/jpg" || $jenis_gambar=="image/gif"


|| $jenis_gambar=="image/png")
{
$gambar = $namafolder . basename($_FILES['nama_file']['name']);
if (move_uploaded_file($_FILES['nama_file']['tmp_name'], $gambar)) {
$query = mysqli_query($koneksi, "UPDATE guru SET nama='$nama', tmt_lahir='$tmpt_lahir',
tgl_lahir='$tgl_lahir', alamat='$alamat' where nis = '$nis'");
$query1 = mysqli_query($koneksi, "UPDATE userdata SET nama='$nama', gambar ='$gambar'
where username= '$nis'");
//echo "Gambar berhasil dikirim ke direktori".$gambar;
echo "<script>alert('Data berhasil diupdate!'); window.location =
'index.php?module=siswa'</script>";
} else {
echo "<p>Gambar gagal dikirim</p>";
}
} else {
echo "Jenis gambar yang anda kirim salah. Harus .jpg .gif .png";
}
} else {
echo "Anda belum memilih gambar";
}
?>
Simpan ke dalam folder admin dengan nama simpaneditsiswa.php, buat lembar baru ketik code
dibawah ini
<?php
include "../conn.php";
$nis = $_GET['nis'];

$query1 = mysqli_query($koneksi, "DELETE FROM siswa WHERE nis='$nis'");

$query = mysqli_query($koneksi, "DELETE FROM userdata WHERE username='$nis'");


if ($query){
echo "<script>alert('Data Berhasil dihapus!'); window.location =
'index.php?module=siswa'</script>";
} else {
echo "<script>alert('Data Gagal dihapus!'); window.location =
index.php?module=siswa'</script>";
}
?>
Simpan kedalah folder admin dengan nama hapussiswa.php, buat lembar baru dengan ketik code
dibawah ini

<div class="inner">
<div class="row">
<div class="col-lg-12">

<h2> Data Guru </h2>

</div>
</div>
<hr />

<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-lg-4">

<div class="panel-body">
<button class="btn btn-warning" data-toggle="modal" data-target="#newReg">
Tambah
</button>

</div>

</div>

</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-
example">
<thead>
<tr>
<th>NO</th>
<th>NIP</th>
<th>NAMA</th>
<th>JENIS KELAMIN</th>
<th>ALAMAT</th>
<th>GAMBAR</th>
<th>AKSI</th>
</tr>
</thead>
<tbody>
<?php include '../conn.php';
// Tampilkan data dari Database
$sql = "SELECT * FROM guru INNER JOIN userdata ON guru.nip = userdata.username where `level` =
'guru'";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($tampilkan = mysqli_fetch_array($tampil)) {

?>
<tr class="odd gradeX">
<td>
<?php echo $no++; ?>
</td>
<td><?php echo $tampilkan['nip'];?></td>
<td><?php echo $tampilkan['nama'];?></td>
<td><?php echo $tampilkan['jenkel'];?></td>
<td class="center"><?php echo $tampilkan['alamat'];?></td>
<td class="center"><?php echo $tampilkan['gambar'];?></td>

<td class="center"><div class="btn-group">


<a href="?module=editguru&edit=<?php echo $tampilkan['nip'];?>"
class="bs-tooltip" title="Edit" ><i class=" icon-pencil" ></i></a>
<a href="hapususer.php?nip=<?php echo $tampilkan['nip'];?>" class="bs-
tooltip" title="Hapus" ><i class=" icon-trash" ></i></a>
</div></td>
</tr>

<?php
}
?>

</tbody>
</table>
</div>

</div>
</div>
</div>
</div>

<div class="modal fade" id="newReg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"


aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-
hidden="true">&times;</button>
<h4 class="modal-title" id="H4"> Input Data Guru</h4>
</div>
<div class="modal-body">
<form method="post" action="simpanuser.php" class="form-horizontal"
enctype="multipart/form-data" >

<div class="form-group">
<label class="control-label col-lg-4">Nama</label>
<div class="col-lg-8">
<input type="text" id="required2" name="nama" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">nip</label>
<div class="col-lg-8">
<input type="text" id="required2" name="nip" class="form-control" />
</div>
</div>

<div class="form-group">
<label class="control-label col-lg-4">Password</label>

<div class="col-lg-8">
<input type="text" id="password2" name="password" class="form-
control" value="12345678" readonly="" />
</div>
</div>

<div class="form-group">
<label class="control-label col-lg-4">Tempat Lahir</label>
<div class="col-lg-8">
<input type="text" id="required2" name="tml_lahir" class="form-control"
/>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Tanggal lahir</label>

<div class="col-lg-8">
<div class="input-group">
<input class="form-control" type="text" name="tgl" data-mask="99/99/9999" />
<span class="input-group-addon">99/99/9999</span>

</div>
</div>
</div>

<div class="form-group">
<label class="control-label col-lg-4">Jenis Kelamin</label>
<div class="col-lg-4">
<select name="jenkel" id="sport" class="validate[required] form-
control">
<option value="laki-laki">Laki-Laki</option>
<option value="wanita">Wanita</option>

</select>
</div>
</div>

<div class="form-group">
<label class="control-label col-lg-4">Photo</label>
<div class="col-lg-8">
<div class="fileupload fileupload-new" data-provides="fileupload" >
<div class="fileupload-new thumbnail" style="width: 200px; height: 150px;"><img
src="../assets/img/demoUpload.jpg" alt="" /></div>
<div class="fileupload-preview fileupload-exists thumbnail" style="max-width:
200px; max-height: 150px; line-height: 20px;" ></div>
<div>
<span class="btn btn-file btn-primary"><span class="fileupload-new">Select
image</span><span class="fileupload-exists">Change</span><input name="nama_file" type="file"
id="nama_file" /></span>
<a href="#" class="btn btn-danger fileupload-exists" data-
dismiss="fileupload">Remove</a>
</div>
</div>
</div>
</div>

<div class="form-group">
<label for="autosize" class="control-label col-lg-4">Alamat</label>

<div class="col-lg-8">
<textarea id="autosize" class="form-control" name="alamat"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-
dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>

</div>

</div>
</div>
</div>

Simpan ke dalam folder admin dengan nama guru.php, buat lembar baru ketik code dibawah ini
<?php
include "../conn.php";
$nama = $_REQUEST['nama'];
$nip = $_REQUEST['nip'];
$password = $_REQUEST['password'];
$tml_lahir = $_REQUEST['tml_lahir'];
$tgl = $_REQUEST['tgl'];
function ubahtanggal ($tgl){
$pisah = explode('/', $tgl);
$array = array($pisah[2], $pisah[0], $pisah[1]);
$satukan = implode('-', $array);
return $satukan;
}
$tgl_lahir = ubahtanggal($tgl);

$jenkel = $_REQUEST['jenkel'];
$level = 'guru';
$alamat = $_REQUEST['alamat'];

$namafolder="photo/";
$skelahiran = $_FILES['nama_file']['name'];

$uploadfile = $namafolder . $skelahiran;

// nama file temporary yang akan disimpan di server

$tmpName = $_FILES['nama_file']['tmp_name'];
// ukuran file yang diupload

$fileSize = $_FILES['nama_file']['size'];

// jenis file yang diupload

$fileType = $_FILES['nama_file']['type'];

//$gambar = $_GET['nama_file'];
//echo "$gambar";
// exit;

// HAPUS
$nip = strtolower($nip);
$sql_cek="SELECT * FROM guru WHERE nip='$nip'";
$qry_cek=mysqli_query($koneksi, $sql_cek);
$jum_cek=mysqli_num_rows($qry_cek);
if ($jum_cek >= 1) {

//include "idx.php?module=input-petugas";
echo "<script>alert('NIP : $nip SUDAH ADA PERNAH DISIMPAN! SILAHKAN INPUT YANG LAIN');
window.location = 'index.php?module=guru'</script>";

exit;
}

//tempat menyimpan file

if(empty($_FILES["nama_file"]["tmp_name"]))
{

$query = mysqli_query($koneksi, "INSERT INTO guru (nip, nama, jenkel, tmt_lahir, tgl_lahir, alamat)
VALUES ('$nip','$nama','$jenkel', '$tml_lahir', '$tgl_lahir', '$alamat')");
$query1 = mysqli_query($koneksi, "INSERT INTO userdata (username, password, nama, level)
VALUES ('$nip','$password','$nama', '$level')");
//echo "<script>alert('Data perusahaan berhasil disimpan!'); window.location =
'index.php?module=guru'</script>";
}
elseif (!empty($_FILES["nama_file"]["tmp_name"]))
{

// $gambar = $namafolder . basename($_FILES['nama_file']['name']);


if (move_uploaded_file($_FILES['nama_file']['tmp_name'], $uploadfile)) {
$query = mysqli_query($koneksi, "INSERT INTO guru (nip, nama, jenkel, tmt_lahir, tgl_lahir,
alamat) VALUES ('$nip','$nama','$jenkel', '$tml_lahir', '$tgl_lahir', '$alamat')");
$query1 = mysqli_query($koneksi, "INSERT INTO userdata (username, password, nama, level,
gambar) VALUES ('$nip','$password','$nama', '$level', '$namafolder$skelahiran')");
// echo "<script>alert('Data perusahaan berhasil disimpan!'); window.location =
'index.php?module=guru'</script>";
} else {
echo "<p>Gambar gagal dikirim</p>";
}

} else {
echo "Anda belum memilih gambar";
}

if ($query){
echo "<script>alert('Data Berhasil dimasukan!'); window.location =
'index.php?module=guru'</script>";
} else {
echo "<script>alert('Data Gagal dimasukan!'); window.location =
'index.php?module=guru'</script>";
}

?>
Simpan kefolder admin dengan nama simpanguru.php, buat lembar baru ketik code dibawah ini

<!--END MENU SECTION -->

<!--PAGE CONTENT -->

<div class="inner">
<div class="row">
<div class="col-lg-12">

<h3 > EDIT DATA GURU </h3>

<?php
$edit = $_GET['edit'] ;

include ("../conn.php");
$tampil="select * from userdata
INNER JOIN guru ON userdata.username = guru.nip where username ='$edit'";
$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {


$jenkel= $data['jenkel'];
$nama= $data['nama'];
$nip=$data['nip'];
$tmt_lahir=$data['tmt_lahir'];
$tgl=$data['tgl_lahir'];
function ubahtanggal ($tgl){
$pisah = explode('-', $tgl);
$array = array($pisah[2], $pisah[1], $pisah[0]);
$satukan = implode('/', $array);
return $satukan;
}
$tgl_lahir = ubahtanggal($tgl);
$gambar=$data['gambar'];
$alamat = $data['alamat'];

?>

</div>
</div>
<hr />

<div class="row">
<div class="col-lg-12">
<div class="box">
<header>
<div class="icons"><i class="icon-th-large"></i></div>

<div class="toolbar">
<ul class="nav">
<li>
<div class="btn-group">
<a class="accordion-toggle btn btn-xs minimize-box" data-
toggle="collapse"
href="#collapseOne">
<i class="icon-chevron-up"></i>
</a>
<button class="btn btn-xs btn-danger close-box">
<i class="icon-remove"></i>
</button>
</div>
</li>
</ul>
</div>

</header>
<div id="collapseOne" class="accordion-body collapse in body">
<form method="post" action="simpaneditguru.php" class="form-horizontal"
enctype="multipart/form-data" >

<div class="form-group">
<label class="control-label col-lg-4">Nama</label>
<div class="col-lg-4">
<input type="text" id="required2" name="nama" class="form-control"
value="<?php echo $nama;?>" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">nip</label>
<div class="col-lg-4">
<input type="text" id="required2" name="nip" class="form-control"
value="<?php echo $nip;?>" readonly="" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Jenis Kelamin</label>
<div class="col-lg-4">
<select name="jenkel" class="form-control">
<option name="jenkel" value="laki-laki" <?php if(($jenkel)== "laki-laki")
{echo "selected=\"selected\"";};?>> laki-laki </option>
<option name="jenkel" value="wanita" <?php if(($jenkel)== "wanita")
{echo "selected=\"selected\"";};?>> Wanita </option>

</select>
</div>
</div>

<div class="form-group">
<label class="control-label col-lg-4">Tempat Lahir</label>
<div class="col-lg-4">
<input type="text" id="required2" name="tmpt_lahir" class="form-
control" value="<?php echo $tmt_lahir;?>" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Tanggal lahir</label>

<div class="col-lg-4">
<div class="input-group">
<input class="form-control" type="text" name="tgl" data-mask="99/99/9999"
value="<?php echo $tgl_lahir;?>" />
<span class="input-group-addon">99/99/9999</span>

</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Photo</label>
<div class="col-lg-8">
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="fileupload-new thumbnail" style="width: 200px; height: 150px;"><img
src="<?php echo $gambar;?>" alt="" /></div>
<div class="fileupload-preview fileupload-exists thumbnail" style="max-width:
200px; max-height: 150px; line-height: 20px;"></div>
<div>
<span class="btn btn-file btn-primary"><span class="fileupload-new">Select
image</span><span class="fileupload-exists">Change</span><input name="nama_file" type="file"
id="nama_file" /></span>
<a href="#" class="btn btn-danger fileupload-exists" data-
dismiss="fileupload">Remove</a>
</div>
</div>
</div>
</div>

<div class="form-group">
<label for="autosize" class="control-label col-lg-4">Alamat</label>

<div class="col-lg-8">
<textarea id="autosize" class="form-control" name="alamat"><?php echo
$alamat;?></textarea>
</div>
</div>
<div class="form-actions no-margin-bottom" style="text-align:center;">

<input type="submit" value="SIMPAN" class="btn btn-primary btn-lg " />


</div>

</form>
</div>
</div>
</div>
</div>

Simpan kedalam folder admin dengan nama editguru.php, buat lembar baru ketik code dibawah ini
<?php
include "../conn.php";

$namafolder="photo/"; //tempat menyimpan file

if(empty($_FILES["nama_file"]["tmp_name"]))
{

$jenkel = $_POST['jenkel'];
$nama = $_POST['nama'];
$nip = $_POST['nip'];
$tmpt_lahir = $_POST['tmpt_lahir'];

$tgl = $_POST['tgl'];
function ubahtanggal ($tgl){
$pisah = explode('/', $tgl);
$array = array($pisah[2], $pisah[0], $pisah[1]);
$satukan = implode('-', $array);
return $satukan;
}
$tgl_lahir = ubahtanggal($tgl);
$alamat = $_POST['alamat'];

$query = mysqli_query($koneksi, "UPDATE guru SET nama='$nama', tmt_lahir='$tmpt_lahir',


jenkel='$jenkel', tgl_lahir='$tgl_lahir', alamat='$alamat' where nip = '$nip'");
$query1 = mysqli_query($koneksi, "UPDATE userdata SET nama='$nama' where username=
'$nip'");
//echo "Gambar berhasil dikirim ke direktori".$gambar;
echo "<script>alert('Data berhasil diupdate!'); window.location =
'index.php?module=guru'</script>";
}

elseif (!empty($_FILES["nama_file"]["tmp_name"]))
{
$jenis_gambar=$_FILES['nama_file']['type'];
$jenkel = $_POST['jenkel'];
$nama = $_POST['nama'];
$nip = $_POST['nip'];
$tmpt_lahir = $_POST['tmpt_lahir'];

$tgl = $_POST['tgl'];
function ubahtanggal ($tgl){
$pisah = explode('/', $tgl);
$array = array($pisah[2], $pisah[0], $pisah[1]);
$satukan = implode('-', $array);
return $satukan;
}
$tgl_lahir = ubahtanggal($tgl);
$alamat = $_POST['alamat'];

if($jenis_gambar=="image/jpeg" || $jenis_gambar=="image/jpg" || $jenis_gambar=="image/gif"


|| $jenis_gambar=="image/png")
{
$gambar = $namafolder . basename($_FILES['nama_file']['name']);
if (move_uploaded_file($_FILES['nama_file']['tmp_name'], $gambar)) {
$query = mysqli_query($koneksi, "UPDATE guru SET nama='$nama', tmt_lahir='$tmpt_lahir',
jenkel='$jenkel', tgl_lahir='$tgl_lahir', alamat='$alamat' where nip = '$nip'");
$query1 = mysqli_query($koneksi, "UPDATE userdata SET nama='$nama', gambar ='$gambar'
where username= '$nip'");
//echo "Gambar berhasil dikirim ke direktori".$gambar;
echo "<script>alert('Data berhasil diupdate!'); window.location =
'index.php?module=guru'</script>";
} else {
echo "<p>Gambar gagal dikirim</p>";
}
} else {
echo "Jenis gambar yang anda kirim salah. Harus .jpg .gif .png";
}
} else {
echo "Anda belum memilih gambar";
}
Simpan kedalam folder admin dengan nama simpaneditguru.php, buat lembar baru ketik code
dibawah ini
<?php
include "../conn.php";
$nip = $_GET['nip'];

$query1 = mysqli_query($koneksi, "DELETE FROM guru WHERE nip='$nip'");

$query = mysqli_query($koneksi, "DELETE FROM userdata WHERE username='$nip'");


if ($query){
echo "<script>alert('Data Berhasil dihapus!'); window.location =
'index.php?module=guru'</script>";
} else {
echo "<script>alert('Data Gagal dihapus!'); window.location =
index.php?module=guru'</script>";
}
?>
Simpan kedalam folder admin dengan nama hapusguru.php, buat lembar baru ketik code dibawah
ini

<div class="inner">
<div class="row">
<div class="col-lg-12">

<h2> Data Mapel </h2>

</div>
</div>

<hr />

<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-lg-4">
<div class="panel-body">
<button class="btn btn-warning" data-toggle="modal" data-target="#newReg">
Tambah
</button>

</div>

</div>

</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-
example">
<thead>
<tr>
<th>NO</th>
<th>Kode</th>
<th>NAMA</th>

<th>AKSI</th>
</tr>
</thead>
<tbody>
<?php include '../conn.php';
// Tampilkan data dari Database
$sql = "SELECT * FROM mapel";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($tampilkan = mysqli_fetch_array($tampil)) {

?>
<tr class="odd gradeX">
<td>
<?php echo $no++; ?>
</td>
<td><?php echo $tampilkan['kd_mapel'];?></td>
<td><?php echo $tampilkan['nama'];?></td>
<td class="center"><div class="btn-group">
<a href="?module=editmapel&edit=<?php echo
$tampilkan['kd_mapel'];?>" class="bs-tooltip" title="Hapus" ><i class=" icon-pencil" ></i></a>
<a href="hapusmapel.php?kode=<?php echo $tampilkan['kd_mapel'];?>"
class="bs-tooltip" title="Hapus" ><i class=" icon-trash" ></i></a>
</div></td>
</tr>

<?php
}
?>

</tbody>
</table>
</div>

</div>
</div>
</div>
</div>

<div class="modal fade" id="newReg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"


aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-
hidden="true">&times;</button>
<h4 class="modal-title" id="H4"> Input Data Mapel</h4>
</div>
<div class="modal-body">
<form method="post" action="simpanmapel.php" class="form-horizontal"
enctype="multipart/form-data" >

<div class="form-group">
<label class="control-label col-lg-4">Kode Mapel</label>
<div class="col-lg-8">
<input type="text" id="required2" name="kd_mapel" class="form-
control" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Mapel</label>
<div class="col-lg-8">
<input type="text" id="required2" name="mapel" class="form-control" />
</div>
</div>

<div class="modal-footer">
<button type="button" class="btn btn-default" data-
dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>

</form>

</div>

</div>
</div>
</div>

Simpan kedalam folder admin dengan nama mapel.php, buat lembar baru dengan ketik code
dibawah ini
<?php
include "../conn.php";
$nama = $_REQUEST['mapel'];
$kd_mapel = $_REQUEST['kd_mapel'];

// HAPUS
$kd_mapel = strtolower($kd_mapel);
$sql_cek="SELECT * FROM mapel WHERE kd_mapel='$kd_mapel'";
$qry_cek=mysqli_query($koneksi, $sql_cek);
$jum_cek=mysqli_num_rows($qry_cek);
if ($jum_cek >= 1) {

//include "idx.php?module=input-petugas";
echo "<script>alert('kode mapel : $kd_mapel SUDAH ADA PERNAH DISIMPAN! SILAHKAN INPUT
YANG LAIN'); window.location = 'index.php?module=mapel'</script>";

exit;
}

//tempat menyimpan file


$query = mysqli_query($koneksi, "INSERT INTO mapel (kd_mapel, nama) VALUES
('$kd_mapel','$nama')");

echo "<script>alert('Data berhasil disimpan!'); window.location =


'index.php?module=mapel'</script>";

?>
Simpan kedalam folder admin dengan nama simpanmapel.php, buat lembar baru ketik code
dibawah ini

<!--END MENU SECTION -->

<!--PAGE CONTENT -->

<div class="inner">
<div class="row">
<div class="col-lg-12">

<h3 > EDIT DATA MAPEL </h3>

<?php
$edit = $_GET['edit'] ;

include ("../conn.php");

$tampil="SELECT
*
FROM
mapel
where kd_mapel ='$edit'";
$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {

$kode = $data['kd_mapel'];
$nama = $data['nama'];
?>

</div>
</div>
<hr />

<div class="row">
<div class="col-lg-12">
<div class="box">
<header>
<div class="icons"><i class="icon-th-large"></i></div>

<div class="toolbar">
<ul class="nav">
<li>
<div class="btn-group">
<a class="accordion-toggle btn btn-xs minimize-box" data-
toggle="collapse"
href="#collapseOne">
<i class="icon-chevron-up"></i>
</a>
<button class="btn btn-xs btn-danger close-box">
<i class="icon-remove"></i>
</button>
</div>
</li>
</ul>
</div>

</header>
<div id="collapseOne" class="accordion-body collapse in body">
<form method="post" action="simpaneditmapel.php" class="form-horizontal"
enctype="multipart/form-data" >

<div class="form-group">
<label class="control-label col-lg-4">Kode Mapel</label>
<div class="col-lg-4">
<input type="text" id="required2" name="kode" class="form-control"
value="<?php echo $kode;?>" readonly="" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Nama Mapel</label>
<div class="col-lg-4">
<input type="text" id="required2" name="mapel" class="form-control"
value="<?php echo $nama;?>" />
</div>
</div>

<div class="form-actions no-margin-bottom" style="text-align:center;">

<input type="submit" value="SIMPAN" class="btn btn-primary btn-lg " />


</div>

</form>
</div>
</div>
</div>
</div>

<?php } ?>

<!--END MAIN WRAPPER -->


Simpan kedalam folder admin dengan nama editmapel.php, buat lembar baru ketik code dibawah ini
<?php
include "../conn.php";

$kode = $_POST['kode'];
$mapel = $_POST['mapel'];

$sql="UPDATE mapel SET nama='$mapel' WHERE kd_mapel='$kode'" or die(mysqli_error());


$res=mysqli_query($koneksi, $sql) or die (mysqli_error());
//echo "Gambar berhasil dikirim ke direktori".$gambar;
echo "<script>alert('Data berhasil disimpan!'); window.location =
'index.php?module=mapel'</script>";

?>
Simpan kedalam folder admin dengan nama simpaneditmapel.php, buat lembar baru ketik code
dibawah ini
<?php
include "../conn.php";
$kode = $_GET['kode'];

$query = mysqli_query($koneksi, "DELETE FROM mapel WHERE kd_mapel='$kode'");

if ($query){
echo "<script>alert('Data Berhasil dihapus!'); window.location =
'index.php?module=mapel'</script>";
} else {
echo "<script>alert('Data Gagal dihapus!'); window.location =
index.php?module=mapel'</script>";
}
?>
Simpan kedalam folder admin dengan nama hapusmapel.php, bual lembar baru ketik code dibawah
ini

<div class="inner">
<div class="row">
<div class="col-lg-12">

<h2> Data Kelas </h2>

</div>
</div>

<hr />

<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-lg-4">

<div class="panel-body">
<button class="btn btn-warning" data-toggle="modal" data-target="#newReg">
Tambah
</button>

</div>

</div>

</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-
example">
<thead>
<tr>
<th>NO</th>

<th>Nama Kelas</th>

<th>AKSI</th>
</tr>
</thead>
<tbody>
<?php include '../conn.php';
// Tampilkan data dari Database
$sql = "SELECT * FROM kelas";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($tampilkan = mysqli_fetch_array($tampil)) {

?>
<tr class="odd gradeX">
<td>
<?php echo $no++; ?>
</td>
<td><?php echo $tampilkan['nama'];?></td>

<td class="center"><div class="btn-group">


<a href="?module=editkelas&edit=<?php echo $tampilkan['kd_kelas'];?>"
class="bs-tooltip" title="edit" ><i class=" icon-pencil" ></i></a>
<a href="hapuskelas.php?kd_kelas=<?php echo $tampilkan['kd_kelas'];?>"
class="bs-tooltip" title="Hapus" ><i class=" icon-trash" ></i></a>
</div></td>
</tr>

<?php
}
?>

</tbody>
</table>
</div>

</div>
</div>
</div>
</div>

<div class="modal fade" id="newReg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"


aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-
hidden="true">&times;</button>
<h4 class="modal-title" id="H4"> Input Data Kelas</h4>
</div>
<div class="modal-body">
<form method="post" action="simpankelas.php" class="form-horizontal"
enctype="multipart/form-data" >

<div class="form-group">
<label class="control-label col-lg-4">Kode Kelas</label>
<div class="col-lg-8">
<input type="text" id="required2" name="kd_kelas" class="form-control"
/>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Nama</label>
<div class="col-lg-8">
<input type="text" id="required2" name="nama" class="form-control" />
</div>
</div>

<div class="modal-footer">
<button type="button" class="btn btn-default" data-
dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>

</form>

</div>

</div>
</div>
</div>

Simpan kedalam folder admin dengan nama kelas.php, buat lembar baru ketik code dibawah ini
<?php
include "../conn.php";
$nama = $_REQUEST['nama'];
$kd_kelas = $_REQUEST['kd_kelas'];

// HAPUS
$kd_kelas = strtolower($kd_kelas);
$sql_cek="SELECT * FROM kelas WHERE kd_kelas='$kd_kelas'";
$qry_cek=mysqli_query($koneksi, $sql_cek);
$jum_cek=mysqli_num_rows($qry_cek);
if ($jum_cek >= 1) {

//include "idx.php?module=input-petugas";
echo "<script>alert('kode kelas : $kd_kelas SUDAH ADA PERNAH DISIMPAN! SILAHKAN INPUT YANG
LAIN'); window.location = 'index.php?module=kelas'</script>";

exit;
}

//tempat menyimpan file


$query = mysqli_query($koneksi, "INSERT INTO kelas (kd_kelas, nama) VALUES
('$kd_kelas','$nama')");

echo "<script>alert('Data berhasil disimpan!'); window.location =


'index.php?module=kelas'</script>";

?>
Simpan kedalam folder admin dengan nama simpankelas.php, buat lembar baru ketik code dibawah
ini

<!--END MENU SECTION -->

<!--PAGE CONTENT -->

<div class="inner">
<div class="row">
<div class="col-lg-12">

<h3 > EDIT DATA KELAS </h3>

<?php
$edit = $_GET['edit'] ;

include ("../conn.php");

$tampil="SELECT
*
FROM
kelas
where kd_kelas ='$edit'";
$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {

$kode = $data['kd_kelas'];
$nama = $data['nama'];

?>
</div>
</div>
<hr />

<div class="row">
<div class="col-lg-12">
<div class="box">
<header>
<div class="icons"><i class="icon-th-large"></i></div>

<div class="toolbar">
<ul class="nav">
<li>
<div class="btn-group">
<a class="accordion-toggle btn btn-xs minimize-box" data-
toggle="collapse"
href="#collapseOne">
<i class="icon-chevron-up"></i>
</a>
<button class="btn btn-xs btn-danger close-box">
<i class="icon-remove"></i>
</button>
</div>
</li>
</ul>
</div>

</header>
<div id="collapseOne" class="accordion-body collapse in body">
<form method="post" action="simpaneditkelas.php" class="form-horizontal"
enctype="multipart/form-data" >

<div class="form-group">
<label class="control-label col-lg-4">Kode Kelas</label>
<div class="col-lg-4">
<input type="text" id="required2" name="kode" class="form-control"
value="<?php echo $kode;?>" readonly="" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Nama Kelas</label>
<div class="col-lg-4">
<input type="text" id="required2" name="kelas" class="form-control"
value="<?php echo $nama;?>" />
</div>
</div>

<div class="form-actions no-margin-bottom" style="text-align:center;">

<input type="submit" value="SIMPAN" class="btn btn-primary btn-lg " />


</div>

</form>
</div>
</div>
</div>
</div>

<?php } ?>
Simpan kedalam folder admin dengan nama editkelas.php, buat lembar baru ketik code dibawah ini
<?php
include "../conn.php";

$kode = $_POST['kode'];
$kelas = $_POST['kelas'];

$sql="UPDATE kelas SET nama='$kelas' WHERE kd_kelas='$kode'" or die(mysqli_error());


$res=mysqli_query($koneksi, $sql) or die (mysqli_error());
//echo "Gambar berhasil dikirim ke direktori".$gambar;

echo "<script>alert('Data berhasil disimpan!'); window.location =


'index.php?module=kelas'</script>";

?>
Simpan kedalam folder admin dengan nama simpaneditsiswa.php, buat lembar baru ketik code
dibawah ini
<?php
include "../conn.php";
$kode = $_GET['kd_kelas'];

$query = mysqli_query($koneksi, "DELETE FROM kelas WHERE kd_kelas='$kode'");

if ($query){
echo "<script>alert('Data Berhasil dihapus!'); window.location =
'index.php?module=kelas'</script>";
} else {
echo "<script>alert('Data Gagal dihapus!'); window.location =
index.php?module=kelas'</script>";
}
?>
Simpan kedalam folder admin dengan nama hapuskelas.php, buat lembar baru ketik code dibawah
ini

<!-- MAIN WRAPPER -->

<!-- END HEADER SECTION -->

<!-- MENU SECTION -->

<!--END MENU SECTION -->

<!--PAGE CONTENT -->

<div class="inner">
<div class="row">
<div class="col-lg-12">

<h2> Data Tugas </h2>

</div>
</div>
<hr />
<?php

include ("../conn.php");
$kd = $_SESSION['username'];

$tampil="select * from guru where nip = '$kd'";


$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {


$nip = $data['nip'];
// $gambar = $data ['logo'];

?>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-lg-4">

<div class="body collapse in" id="div1">


<a href="?module=input-tugas&kd=<?php echo $nip; ?>" class="btn btn-
warning">Tambah</a>

</div>

</div>

</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-
example">
<thead>
<tr>
<th>NO</th>
<th>Judul</th>
<th>Kelas</th>
<th>Guru</th>
<th>Mapel</th>
<th>Keterangan</th>
<th>File</th>
<th>Tanggal Upload</th>
<th>AKSI</th>
</tr>
</thead>
<tbody>
<?php include '../conn.php';
// Tampilkan data dari Database
$sql = "SELECT tugas.urut,
tugas.judul,
tugas.kd_mapel,
tugas.file,
tugas.keterangan,
tugas.kd_kelas,
tugas.nip,
tugas.`status`,
tugas.tgl,
mapel.kd_mapel,
mapel.nama AS mapel,
guru.nip,
guru.nama AS guru,
kelas.kd_kelas,
kelas.nama AS kelas
FROM
tugas
INNER JOIN guru ON tugas.nip = guru.nip
INNER JOIN kelas ON tugas.kd_kelas = kelas.kd_kelas
INNER JOIN mapel ON mapel.kd_mapel = tugas.kd_mapel where guru.nip ='$nip';

";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($tampilkan = mysqli_fetch_array($tampil)) {

?>
<tr class="odd gradeX">
<td>
<?php echo $no++; ?>
</td>
<td><?php echo $tampilkan['judul'];?></td>
<td><?php echo $tampilkan['kelas'];?></td>
<td><?php echo $tampilkan['guru'];?></td>
<td class="center"><?php echo $tampilkan['mapel'];?></td>
<td class="center"><?php echo $tampilkan['keterangan'];?></td>
<td class="center"><?php echo $tampilkan['file'];?></td>
<td class="center"><?php echo $tampilkan['tgl'];?></td>

<td class="center"><div class="btn-group">

<a href="hapustgs.php?urut=<?php echo $tampilkan['urut'];?>" class="bs-


tooltip" title="Hapus" ><i class=" icon-trash" ></i></a>
</div></td>
</tr>

<?php
}
?>

</tbody>
</table>
</div>

</div>
</div>
</div>
</div>

Simpan kedalam folder admin dengan nama tugas.php, buat lembar baru ketik code dibawa ini
<?php
include "../conn.php";
$judul = $_REQUEST['judul'];
$nip = $_REQUEST['nip'];
$kelas = $_REQUEST['kelas'];
$mapel = $_REQUEST['mapel'];

$status = '0';
$keterangan = $_REQUEST['keterangan'];

$namafolder="tugas/";
$skelahiran = $_FILES['nama_file']['name'];
$uploadfile = $namafolder . $skelahiran;

// nama file temporary yang akan disimpan di server

$tmpName = $_FILES['nama_file']['tmp_name'];

// ukuran file yang diupload

$fileSize = $_FILES['nama_file']['size'];

// jenis file yang diupload

$fileType = $_FILES['nama_file']['type'];

//$gambar = $_GET['nama_file'];
//echo "$gambar";
// exit;

//tempat menyimpan file

if(empty($_FILES["nama_file"]["tmp_name"]))
{

$query = mysqli_query($koneksi, "INSERT INTO tugas (kd_mapel, keterangan, kd_kelas, nip, status,
tgl, judul) VALUES ('$mapel','$keterangan','$kelas', '$nip', '$status', NOW(), '$judul')");

//echo "<script>alert('Data perusahaan berhasil disimpan!'); window.location =


'index.php?module=guru'</script>";
}
elseif (!empty($_FILES["nama_file"]["tmp_name"]))
{

// $gambar = $namafolder . basename($_FILES['nama_file']['name']);

if (move_uploaded_file($_FILES['nama_file']['tmp_name'], $uploadfile)) {
$query = mysqli_query($koneksi, "INSERT INTO tugas (kd_mapel, file, keterangan, kd_kelas, nip,
status, tgl, judul) VALUES ('$mapel','$skelahiran','$keterangan','$kelas', '$nip', '$status', NOW(),
'$judul')");
// echo "<script>alert('Data perusahaan berhasil disimpan!'); window.location =
'index.php?module=guru'</script>";
} else {
echo "<p>Gambar gagal dikirim</p>";
}

} else {
echo "Anda belum memilih gambar";
}

if ($query){
echo "<script>alert('Data Berhasil dimasukan!'); window.location =
'index.php?module=tugas'</script>";
} else {
echo "<script>alert('Data Gagal dimasukan!'); window.location =
'index.php?module=tugas'</script>";
}

?>
Simpan kedalam folder admin dengan nama simpantugas.php, buat lembar baru ketik code dibawah
ini

<!-- MAIN WRAPPER -->

<!-- END HEADER SECTION -->

<!-- MENU SECTION -->

<!--END MENU SECTION -->

<!--PAGE CONTENT -->

<div class="inner">
<div class="row">
<div class="col-lg-12">
<h2> Data Tugas </h2>

</div>
</div>

<hr />
<?php

include ("../conn.php");
$kd = $_SESSION['username'];

$tampil="select * from siswa where nis = '$kd'";


$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {


$kelas = $data['kd_kelas'];
$nis = $data ['nis'];

?>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-lg-4">

</div>

</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-
example">
<thead>
<tr>
<th>NO</th>
<th>Judul</th>
<th>Kelas</th>
<th>Guru</th>
<th>Mapel</th>
<th>Keterangan</th>
<th>File</th>
<th>Tanggal Upload</th>
<th>AKSI</th>
</tr>
</thead>
<tbody>
<?php include '../conn.php';
// Tampilkan data dari Database
$sql = "SELECT
siswa.id,
siswa.nis,
siswa.nama,
siswa.jenkel,
siswa.alamat,
siswa.tempt_lahir,
siswa.tgl_lahir,
siswa.kd_kelas,
tugas.urut,
tugas.judul,
tugas.kd_mapel,
tugas.file,
tugas.keterangan,
tugas.kd_kelas,
tugas.nip,
tugas.`status`,
tugas.tgl,
kelas.kd_kelas,
kelas.nama AS kelas,
guru.nip,
guru.nama AS guru,
mapel.kd_mapel,
mapel.nama AS mapel
FROM
siswa
INNER JOIN tugas ON siswa.kd_kelas = tugas.kd_kelas
INNER JOIN kelas ON kelas.kd_kelas = tugas.kd_kelas
INNER JOIN guru ON tugas.nip = guru.nip
INNER JOIN mapel ON tugas.kd_mapel = mapel.kd_mapel

where tugas.kd_kelas = '$kelas' and siswa.nis = '$nis';

";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($tampilkan = mysqli_fetch_array($tampil)) {

?>
<tr class="odd gradeX">
<td>
<?php echo $no++; ?>
</td>
<td><?php echo $tampilkan['judul'];?></td>
<td><?php echo $tampilkan['kelas'];?></td>
<td><?php echo $tampilkan['guru'];?></td>
<td class="center"><?php echo $tampilkan['mapel'];?></td>
<td class="center"><?php echo $tampilkan['keterangan'];?>
<td class="center"><?php echo "<a
href='tugas/$tampilkan[file]'>$tampilkan[file]</a>"; ?></td>
<td class="center"><?php echo $tampilkan['tgl'];?></td>

<td class="center"><div class="btn-group">


<a href="?module=jawabsiswa&edit=<?php echo $tampilkan['urut'];?>"
class="bs-tooltip" title="jawab" > jawab</a>
</div></td>
</tr>

<?php
}
?>

</tbody>
</table>
</div>

</div>
</div>
</div>
</div>
Simpan kedalam folder admin dengan nama tugassiswa.php, buat lembar baru ketik code dibawah
ini

<div class="inner">
<div class="row">
<div class="col-lg-12">

<h2> Data Tugas </h2>

</div>
</div>

<hr />
<?php

include ("../conn.php");
$kd = $_SESSION['username'];

$tampil="SELECT
siswa.id,
siswa.nis,
siswa.nama,
siswa.jenkel,
siswa.alamat,
siswa.tempt_lahir,
siswa.tgl_lahir,
siswa.kd_kelas,
kelas.kd_kelas,
kelas.nama as kelas
FROM
siswa
INNER JOIN kelas ON siswa.kd_kelas = kelas.kd_kelas where nis = '$kd'";
$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {

$kelas = $data['kelas'];
$nis = $data ['nis'];
}

?>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-lg-4">

</div>

</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-
example">
<thead>
<tr>
<th>NO</th>
<th>Judul</th>
<th>Kelas</th>
<th>Nip</th>
<th>Mapel</th>
<th>Keterangan</th>
<th>File</th>
<th>Tanggal Upload</th>

</tr>
</thead>
<tbody>
<?php include '../conn.php';
// Tampilkan data dari Database
$sql = "SELECT
jawabtugas.kd_jawab,
jawabtugas.urut,
jawabtugas.judul,
jawabtugas.nip,
jawabtugas.nis,
jawabtugas.kelas,
jawabtugas.mapel,
jawabtugas.file,
jawabtugas.keterangan,
jawabtugas.tgl

FROM
jawabtugas

where nis = '$nis';

";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($tampilkan = mysqli_fetch_array($tampil)) {

?>
<tr class="odd gradeX">
<td>
<?php echo $no++; ?>
</td>
<td><?php echo $tampilkan['judul'];?></td>
<td><?php echo $tampilkan['kelas'];?></td>
<td><?php echo $tampilkan['nip'];?></td>
<td class="center"><?php echo $tampilkan['mapel'];?></td>
<td class="center"><?php echo $tampilkan['keterangan'];?>
<td class="center"><?php echo "<a
href='tugas/$tampilkan[file]'>$tampilkan[file]</a>"; ?></td>
<td class="center"><?php echo $tampilkan['tgl'];?></td>

</tr>

<?php
}
?>

</tbody>
</table>
</div>

</div>
</div>
</div>
</div>

Simpan kedalam folder admin dengan nama uploadtugas.php, buat lembar baru ketik code dibawah
ini
<div class="inner">
<div class="row">
<div class="col-lg-12">

<h2> Penilaian </h2>

</div>
</div>

<hr />
<?php

include ("../conn.php");
$kd = $_SESSION['username'];

$tampil="select * from guru where nip = '$kd'";


$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {


$kelas = $data['kd_kelas'];
$nis = $data ['nip'];

?>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-lg-4">
</div>

</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-
example">
<thead>
<tr>
<th>NO</th>
<th>Judul</th>
<th>Kelas</th>
<th>Guru</th>
<th>Nis</th>
<th>Mapel</th>
<th>Keterangan</th>
<th>File</th>
<th>Tanggal Upload</th>
<th>AKSI</th>
</tr>
</thead>
<tbody>
<?php include '../conn.php';
// Tampilkan data dari Database
$sql = "SELECT
jawabtugas.kd_jawab,
jawabtugas.urut,
jawabtugas.judul,
jawabtugas.nip,
jawabtugas.nis,
jawabtugas.kelas,
jawabtugas.mapel,
jawabtugas.file,
jawabtugas.keterangan,
jawabtugas.tgl,
guru.nip,
guru.nama AS guru
FROM
jawabtugas
INNER JOIN guru ON jawabtugas.nip = guru.nip

where jawabtugas.nip = '$nis';


";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($tampilkan = mysqli_fetch_array($tampil)) {

?>
<tr class="odd gradeX">
<td>
<?php echo $no++; ?>
</td>
<td><?php echo $tampilkan['judul'];?></td>
<td><?php echo $tampilkan['kelas'];?></td>
<td><?php echo $tampilkan['guru'];?></td>
<td><?php echo $tampilkan['nis'];?></td>
<td class="center"><?php echo $tampilkan['mapel'];?></td>
<td class="center"><?php echo $tampilkan['keterangan'];?>
<td class="center"><?php echo "<a
href='tugas/$tampilkan[file]'>$tampilkan[file]</a>"; ?></td>
<td class="center"><?php echo $tampilkan['tgl'];?></td>

<td class="center"><div class="btn-group">


<a href="?module=penilaian&nilai=<?php echo $tampilkan['kd_jawab'];?>"
class="bs-tooltip" title="Nilai" > Nilai</a>
</div></td>
</tr>

<?php
}
?>

</tbody>
</table>
</div>

</div>
</div>
</div>
</div>

Simpan kedalam folder admin dengan nama nilai.php, buat lembar baru ketik code dibawah ini
<div class="inner">
<div class="row">
<div class="col-lg-12">
<h2> Penilaian </h2>

</div>
</div>

<hr />
<?php

include ("../conn.php");
$kd = $_SESSION['username'];

$tampil="select * from guru where nip = '$kd'";


$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {


$kelas = $data['kd_kelas'];
$nis = $data ['nip'];

?>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-lg-4">

</div>

</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-
example">
<thead>
<tr>
<th>NO</th>
<th>Judul</th>
<th>Kelas</th>
<th>Guru</th>
<th>Nis</th>
<th>Mapel</th>
<th>Nilai</th>

<th>Tanggal</th>

</tr>
</thead>
<tbody>
<?php include '../conn.php';
// Tampilkan data dari Database
$sql = "SELECT
guru.nip,
guru.nama as guru,
nilai.kd_nilai,
nilai.kd_jawab,
nilai.judul,
nilai.nip,
nilai.nis,
nilai.kelas,
nilai.mapel,
nilai.nilai,
nilai.tgl
FROM
nilai
INNER JOIN guru ON nilai.nip = guru.nip

where nilai.nip = '$nis';

";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($tampilkan = mysqli_fetch_array($tampil)) {

?>
<tr class="odd gradeX">
<td>
<?php echo $no++; ?>
</td>
<td><?php echo $tampilkan['judul'];?></td>
<td><?php echo $tampilkan['kelas'];?></td>
<td><?php echo $tampilkan['guru'];?></td>
<td><?php echo $tampilkan['nis'];?></td>
<td class="center"><?php echo $tampilkan['mapel'];?></td>
<td class="center"><?php echo $tampilkan['nilai'];?>

<td class="center"><?php echo $tampilkan['tgl'];?></td>

</tr>

<?php
}
?>

</tbody>
</table>
</div>

</div>
</div>
</div>
</div>
Simpan kedalam folder admin dengan nama tampilnilai.php , buat lembar baru ketik code
dibawah ini
<?php

include '../conn.php';
include '../inc.library.php';
$kd = $_SESSION['username'];
$tgl_bet = $_POST['tanggal'];
$a=substr ($tgl_bet, 0,2);
$b=substr ($tgl_bet, 3,2);
$c=substr ($tgl_bet, 6,4);
$d= $c."-".$a."-".$b;
$e=substr ($tgl_bet, 13,2);
$f=substr ($tgl_bet, 16,2);
$g=substr ($tgl_bet, 19,4);
$h= $g."-".$e."-".$f;
#echo $h." ".$d;
$tampil="select * from setting where id_setting = 1";
$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {


$logo = $data['logo'];
$nama = $data['nama'];
$alamat = $data ['alamat'];

}
?>

<section class="content">
<div class="text-center">
<h3><img src="<?php echo $logo ?>" alt="" width="40" height="40"/><?php
echo $nama ?></h3>
<b><?php echo $alamat ?></b>
</div><br/>

<div class="box box-default">


<div class="box-header with-border">
<span class="pull-lift">
<a class='btn btn-sm btn-default' href='downloadexcel.php?h=<?php echo $h;?>&d=<?php
echo $d;?>&kd=<?php echo $kd;?>'><i class='icon-download-alt'></i> Download Excel</a>

</span>
<span class="pull-right">
Tanggal: <?php echo IndonesiaTgl($h)." - ".IndonesiaTgl($d); ?>
</span>

</span>
</div>
<div class="box-body">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>No</th>
<th>Kelas</th>
<th>Mapel</th>
<th class="col-sm-3">Judul</th>
<th>Nilai</th>
<th>Siswa</th>
<th>Guru</th>
<th>Tanggal Input</th>
</tr>
</thead>

<tbody>
<?php
// Tampilkan data dari Database
$sql = "SELECT
nilai.tgl,
nilai.kd_nilai,
nilai.kd_jawab,
nilai.judul,
nilai.nip,
nilai.nis,
nilai.kelas,
nilai.mapel,
nilai.nilai,
siswa.nis,
siswa.nama as siswa,
guru.nip,
guru.nama as guru
FROM
nilai
INNER JOIN guru ON nilai.nip = guru.nip
INNER JOIN siswa ON nilai.nis = siswa.nis
where tgl between '".$d."' and '".$h."' and guru.nip ='".$kd."' ";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($k = mysqli_fetch_array($tampil)) {
$Kode = $k['kd_nilai'];?>

<tr>
<td><?php echo $no++; ?></td>
<td><?php echo $k['kelas']; ?></a></td>
<td><?php echo $k['mapel']; ?></td>
<td><?php echo $k['judul']; ?></td>

<td><?php echo $k['nilai']; ?></td>


<td><?php echo $k['siswa']; ?></td>
<td><?php echo $k['guru']; ?></td>
<td><?php echo Indonesia2Tgl($k['tgl']); ?></td>
<?php
}
?>
</tr>
</tbody>
</table>
</div><!-- /.box-body -->
</div>
</section><!-- /.content -->
Simpan kedalam folder admin dengan nama lapnilai.php, buat lembar baru ketik code dibawah ini
<?php
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".xls");
header( "Content-disposition: filename=nilai.xls");
//print "$header\n$data";
include '../conn.php';
include '../inc.library.php';

$d = $_REQUEST['d'];
$h = $_REQUEST['h'];
$kd = $_REQUEST['kd'];
/*$a=substr ($tgl_bet, 0,2);
$b=substr ($tgl_bet, 3,2);
$c=substr ($tgl_bet, 6,4);
$d= $c."-".$a."-".$b;
$e=substr ($tgl_bet, 13,2);
$f=substr ($tgl_bet, 16,2);
$g=substr ($tgl_bet, 19,4);
$h= $g."-".$e."-".$f;
#echo $h." ".$d; */
$tampil="select * from setting where id_setting = 1";
$hasil= MySQli_query ($koneksi, $tampil) or die (mysqli_error());

while ($data = mysqli_fetch_array ($hasil)) {


$logo = $data['logo'];
$nama = $data['nama'];
$alamat = $data ['alamat'];

}
?>

<section class="content">
<div class="text-center">
<h3><img src="photo/20328980.png" alt="" width="40"
height="40"/><?php echo $nama ?></h3>
<b><?php echo $alamat ?></b>
</div><br/>

<div class="box box-default">


<div class="box-header with-border">

<span class="pull-right">
Tanggal: <?php echo IndonesiaTgl($h)." - ".IndonesiaTgl($d); ?>
</span>

</span>
</div>
<div class="box-body">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>No</th>
<th>Kelas</th>
<th>Mapel</th>
<th class="col-sm-3">Judul</th>
<th>Nilai</th>
<th>Siswa</th>
<th>Guru</th>
<th>Tanggal Input</th>
</tr>
</thead>

<tbody>
<?php
// Tampilkan data dari Database
$sql = "SELECT
nilai.tgl,
nilai.kd_nilai,
nilai.kd_jawab,
nilai.judul,
nilai.nip,
nilai.nis,
nilai.kelas,
nilai.mapel,
nilai.nilai,
siswa.nis,
siswa.nama as siswa,
guru.nip,
guru.nama as guru
FROM
nilai
INNER JOIN guru ON nilai.nip = guru.nip
INNER JOIN siswa ON nilai.nis = siswa.nis
where tgl between '".$d."' and '".$h."' and guru.nip ='".$kd."' ";
$tampil = mysqli_query($koneksi,$sql);
$no=1;
while ($k = mysqli_fetch_array($tampil)) {
$Kode = $k['kd_nilai'];?>

<tr>
<td><?php echo $no++; ?></td>
<td><?php echo $k['kelas']; ?></a></td>
<td><?php echo $k['mapel']; ?></td>
<td><?php echo $k['judul']; ?></td>

<td><?php echo $k['nilai']; ?></td>


<td><?php echo $k['siswa']; ?></td>
<td><?php echo $k['guru']; ?></td>
<td><?php echo Indonesia2Tgl($k['tgl']); ?></td>
<?php
}
?>
</tr>
</tbody>
</table>
</div><!-- /.box-body -->
</div>
</section><!-- /.content -->
Simpan kedalam folder admin dengan nama downloadexcel.php