Sie sind auf Seite 1von 75

1. Login.

php
<html> <title></title>
<link href="bootstrap.css" rel="stylesheet">
<link href="stylesheet.css" rel="stylesheet">
<style>
body {
background: url(gambar/kantor.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
<body style="">
<div class="login-container">
<div class="login-header bordered">
<h4>Sign in</h4>
</div>
<hr>
<form action="cek_login.php">
<div class="login-field">
<label for="username">Username</label>
<input type="text" name="username" id="username"
placeholder="Username">
<i class="icon-user"></i>
</div>
<div class="login-field">
<label for="password">Password</label>
<input type="password" name="password" id="password"
placeholder="Password">
<i class="icon-lock"></i>
</div>
<div class="login-button clearfix">
<button type="submit" class="pull-right btn btn-large blue">SIGN IN
</button>
</div>
</form>
</div>

</body></html>
2. Cek_login.php
<?php ob_start(); session_start();
include "koneksi.php";

$user = $_REQUEST['username'];
$pass = $_REQUEST['password'];

$sql_cek = "SELECT * FROM user WHERE username='$user'


AND password='$pass' ";
$qry_cek = mysql_query($sql_cek);

$ada_cek = mysql_num_rows($qry_cek);
$array = mysql_fetch_array($qry_cek);
if ($ada_cek >=1) {
session_start();
$_SESSION['id_user']=$array['id_user'];
$_SESSION['username']=$array['username'];
$_SESSION['level']=$array['level'];
header ("location: index.php");
exit;
}
else {
?>
<script language='javascript' type='text/javascript'> alert('username dan Password
Tidak Valid');
window.location='login.php';
</script>
<?php
exit;
}
?>
3. Index.php
<?php ob_start(); session_start();
date_default_timezone_set("Asia/Jakarta");
error_reporting(0);
include 'koneksi.php';

if($_SESSION['id_user']){

?>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dashboard</title>

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


<link href="css/datepicker3.css" rel="stylesheet">
<link rel="stylesheet" href="lib/css/default.css" />
<link href="css/styles.css" rel="stylesheet">

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

</head>

<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed"
data-toggle="collapse" data-target="#sidebar-collapse">
<span class="sr-only">Toggle
navigation</span>

<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><span>PTPN
IV</span><?php echo $_SESSION['level'];?></a>
<ul class="user-menu">
<li class="dropdown pull-right">
<a href="#" class="dropdown-toggle"
data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span> <?php
echo $_SESSION['level'];?> <span class="caret"></span></a>
<ul class="dropdown-menu"
role="menu">

<li><a href="logout.php"><span
class="glyphicon glyphicon-log-out"></span> Logout</a></li>
</ul>
</li>
</ul>
</div>

</div><!-- /.container-fluid -->


</nav>

<div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar">


<form role="search">
<div class="form-group">
<input type="text" class="form-control"
placeholder="Search">
</div>
</form>
<ul class="nav menu">
<?php

if($_SESSION['level'] == "Admin"){
?>
<li class="active"><a href="index.php"><span
class="glyphicon glyphicon-dashboard"></span> Dashboard</a></li>
<li class="parent ">
<a href="#">
<span class="glyphicon
glyphicon-list"></span> Forms<span data-toggle="collapse" href="#sub-item-1"
class="icon pull-right"><em class="glyphicon glyphicon-s glyphiconplus"></em></span>
</a>
<ul class="children collapse" id="sub-item-1">
<li>
<a class="" href="index.php?
page=form_user">
<span class="glyphicon
glyphicon-share-alt"></span> User
</a>
</li>
<li>
<a class="" href="index.php?
page=form_jabatan">
<span class="glyphicon
glyphicon-share-alt"></span>Jabatan
</a>
</li>
<li>
<a class="" href="index.php?
page=form_kriteria">
<span class="glyphicon
glyphicon-share-alt"></span> Kriteria
</a>
</li>
<li>

<a class="" href="index.php?


page=form_kriteria_pelamar">
<span class="glyphicon
glyphicon-share-alt"></span> Kriteria Pelamar
</a>
</li>
<li>
<a class="" href="index.php?
page=form_pelamar">
<span class="glyphicon
glyphicon-share-alt"></span> Pelamar
</a>
</li>
</ul>
</li>

<li><a href="index.php?page=data_user"><span
class="glyphicon glyphicon-list-alt"></span> Data User</a></li>
<li><a href="index.php?page=data_jabatan"><span
class="glyphicon glyphicon-list-alt"></span> Data Jabatan</a></li>
<li><a href="index.php?page=data_kriteria"><span
class="glyphicon glyphicon-list-alt"></span> Data Kriteria</a></li>
<li><a href="index.php?page=data_kriteria_pelamar"><span
class="glyphicon glyphicon-list-alt"></span> Data Kriteria Pelamar</a></li>
<li><a href="index.php?page=data_pelamar"><span
class="glyphicon glyphicon-list-alt"></span> Data Pelamar</a></li>

<?php } else if($_SESSION['level'] == "Pimpinan"){?>


<li><a href="index.php?page=data_kriteria"><span
class="glyphicon glyphicon-list-alt"></span> Data Kriteria</a></li>
<li><a href="index.php?page=prosess_saw"><span
class="glyphicon glyphicon-list-alt"></span> Proses SAW</a></li>
<li><a href="index.php?page=proses_ranking"><span
class="glyphicon glyphicon-list-alt"></span> Proses Perankingan</a></li>

<?php } else if($_SESSION['level'] == "HRD"){?>


<li><a href="index.php?page=data_kriteria"><span
class="glyphicon glyphicon-list-alt"></span> Data Kriteria</a></li>
<li><a href="index.php?page=prosess_saw"><span
class="glyphicon glyphicon-list-alt"></span> Proses SAW</a></li>
<li><a href="index.php?page=proses_ranking"><span
class="glyphicon glyphicon-list-alt"></span> Proses Perankingan</a></li>
<?php } ?>
</ul>
</div><!--/.sidebar-->

<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">


<div class="row">
<ol class="breadcrumb">
<li><a href="#"><span class="glyphicon glyphiconhome"></span></a></li>
<li class="active">Dashboard</li>
</ol>
</div><!--/.row-->

<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Dashboard</h1>
</div>
</div><!--/.row-->

<div class="row">
<div class="col-xs-12 col-md-6 col-lg-3">
<div class="panel panel-blue panel-widget ">
<div class="row no-padding">

<div class="col-sm-3 col-lg-5 widgetleft">


<em class="glyphicon glyphiconlist glyphicon-l"></em>
</div>
<?php
$kriteria=mysql_query("SELECT * from kriteria ");
$jum_kriteria=mysql_num_rows($kriteria);
?>
<div class="col-sm-9 col-lg-7 widgetright">
<div class="large"> <?php echo
$jum_kriteria; ?></div>
<div class="textmuted">Kriteria</div>
</div>

</div>
</div>
</div>
<div class="col-xs-12 col-md-6 col-lg-3">
<div class="panel panel-orange panel-widget">
<div class="row no-padding">
<div class="col-sm-3 col-lg-5 widgetleft">
<em class="glyphicon glyphiconlist glyphicon-l"></em>
</div>
<?php
$jabatan=mysql_query("SELECT * from jabatan ");

$jum_jabatan=mysql_num_rows($jabatan);
?>
<div class="col-sm-9 col-lg-7 widgetright">
<div class="large"><?php echo
$jum_jabatan; ?></div>
<div class="textmuted">Jabatan</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 col-lg-3">
<div class="panel panel-teal panel-widget">
<div class="row no-padding">
<div class="col-sm-3 col-lg-5 widgetleft">
<em class="glyphicon glyphiconuser glyphicon-l"></em>
</div>
<?php
$user=mysql_query("SELECT * from user ");
$jum_user=mysql_num_rows($user);
?>
<div class="col-sm-9 col-lg-7 widgetright">
<div class="large"><?php echo
$jum_user; ?></div>
<div class="textmuted">Users</div>
</div>
</div>
</div>

</div>
<div class="col-xs-12 col-md-6 col-lg-3">
<div class="panel panel-red panel-widget">
<div class="row no-padding">
<div class="col-sm-3 col-lg-5 widgetleft">
<em class="glyphicon glyphiconlist glyphicon-l"></em>
</div>
<?php
$pelamar=mysql_query("SELECT * from pelamar ");
$jum_pelamar=mysql_num_rows($pelamar);
?>
<div class="col-sm-9 col-lg-7 widgetright">
<div class="large"><?php echo
$jum_pelamar; ?></div>
<div class="textmuted">Pelamar</div>
</div>
</div>
</div>
</div>
</div><!--/.row-->

<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading"><center><b>
Control Panel</b> </center></div>
<div class="panel-body">
<div class="canvas-wrapper">

<?php
include "koneksi.php";
if(isset($_GET['page'])){
$page=htmlentities($_GET['page']);
}else{
$page="artikel";
}

$file="$page.php";
$cek=strlen($page);

if($cek>30 || !file_exists($file) || empty($page)){


include ("home.php");
}else{
include ($file);
}

?>

</div>
</div>
</div>
</div>
</div><!--/.row-->

<!--/.row-->

<!--/.row-->
</div> <!--/.main-->

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/chart.min.js"></script>
<script src="js/chart-data.js"></script>
<script src="js/easypiechart.js"></script>
<script src="js/easypiechart-data.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="lib/zebra_datepicker.js"></script>
<script type="text/javascript">

$(document).ready(function(){
$('#tanggal').Zebra_DatePicker({
format: 'd-F-Y',
months :
['Januari','Februari','Maret','April','Mei','Juni','Juli','Agustus','September','Oktober','No
vember','Desember'],
days : ['Minggu','Senin','Selasa','Rabu','Kamis','Jum\'at','Sabtu'],
days_abbr : ['Minggu','Senin','Selasa','Rabu','Kamis','Jum\'at','Sabtu']
});
});

</script>
</body>

</html>
<?php } else {
header('location:login.php');
}
?>

4. Data_user.php
<div class="box">
<div class="box-header">
<h3 class="box-title">Data Table User</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Username</th>
<th> Email</th>
<th> Level</th>
<th>Aksi</th>
</tr>
</thead>
<?php
$sql=mysql_query("SELECT * from user");
while ($data=mysql_fetch_array($sql)) {
?>
<tbody>
<tr>
<td><?php echo $data['username'];?></td>
<td><?php echo $data['email'];?></td>
<td><?php echo $data['level'];?></td>
<td><a href="index.php?page=delete_user&id_user=<?php echo
$data['id_user']; ?>" title="Remove" ><span class="label label-danger">Delete<i
class="fa fa-fw fa-remove"></i></span></a> <a href="index.php?
page=edit_user&id_user=<?php echo $data['id_user'];?>" title="Ubah"><span
class="label label-success">Edit <i class="fa fa-fw fa-edit"></i> </span></a>
</td>
</tr>
<?php
}
?>
</table>
</div><!-- /.box-body -->
</div>
5. Data_pelamar.php
<div class="box">
<div class="box-header">

<h3 class="box-title">Data Table Pelamar</h3>


</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Nama</th>
<th>Tempat Lahir</th>
<th>Tgl Lahir</th>
<th>Jenis Kelamin</th>
<th>Pendidikan</th>
<th>Alamat</th>
<th>Status</th>
<th>No. Telepon</th>
<th>Agama</th>
<th>Pengalaman Kerja</th>
<th>Jabatan</th>
<th>Gambar</th>
<th>Aksi</th>
</tr>
</thead>
<?php
$no = 1;
$sql=mysql_query("SELECT a.*,b.* from pelamar a, jabatan b where
a.id_jabatan=b.id_jabatan");
while ($data=mysql_fetch_array($sql)) {
?>
<tbody>
<tr>
<td><?php echo $no ?></td>
<td><?php echo $data['nama_pelamar'];?></td>
<td><?php echo $data['tempat_lahir'];?></td>
<td><?php echo $data['tgl_lahir'];?></td>
<td><?php echo $data['jenis_kelamin'];?></td>
<td><?php echo $data['pendidikan'];?></td>
<td><?php echo $data['alamat'];?></td>
<td><?php echo $data['status'];?></td>
<td><?php echo $data['nomor_telepon'];?></td>
<td><?php echo $data['agama'];?></td>
<td><?php echo $data['pengalaman_kerja'];?></td>
<td><?php echo $data['nama_jabatan'];?></td>
<td>
<img src='gambar/<?php echo $data['gambar'];?>' width='50'
height='50'>
</td>

<td><a href="index.php?page=delete_pelamar&id_pelamar=<?php
echo $data ['id_pelamar'] ; ?>" title="Remove" ><span class="label labeldanger">Delete<i class="fa fa-fw fa-remove"></i></span></a>
</td>
</tr>
</tbody>
<?php
$no++;
}
?>
</table>
</div><!-- /.box-body -->
</div>
6. Data_kriteria.php
<div class="box">
<div class="box-header">
<h3 class="box-title">Data Table Kriteria</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Kriteria</th>
<th>Kategori</th>
<th>Bobot</th>

<th>Aksi</th>
</tr>
</thead>
<?php
$sql=mysql_query("SELECT * from kriteria");
while ($data=mysql_fetch_array($sql)) {
?>

<tbody>
<tr>
<td><?php echo $data['nama_kriteria'];?></td>
<td><?php echo $data['kategori'];?></td>
<td><?php echo $data['bobot'];?></td>

<td><a href="index.php?page=delete_kriteria&id_kriteria=<?php
echo $data ['id_kriteria'] ; ?>" title="Remove" ><span class="label labeldanger">Delete<i class="fa fa-fw fa-remove"></i></span></a>
<a href="index.php?page=edit_bobot&id_kriteria=<?php echo $data
['id_kriteria'] ; ?>" title="Remove" ><span class="label label-success">Edit Bobot<i
class="fa fa-fw fa-remove"></i></span></a>

</td>
</tr>

<?php
}
?>
</table>
</div><!-- /.box-body -->
</div>

7. Data_kriteria_pelamar.php
<div class="box">
<div class="box-header">
<h3 class="box-title">Data Table Kriteria Pelamar</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>No</th>
<th>Nama Pelamar</th>
<th>Nama Kriteria</th>

<th>Nilai</th>
<th>Aksi</th>
</tr>
</thead>
<?php
$i=1;
$sql=mysql_query("SELECT a.*,b.*,c.* from kriteria_pelamar a,
pelamar b, kriteria c where a.id_pelamar=b.id_pelamar and
a.id_kriteria=c.id_kriteria");
while ($data=mysql_fetch_array($sql)) {
?>
<tbody>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $data['nama_pelamar'];?></td>
<td><?php echo $data['nama_kriteria'];?></td>
<td><?php echo $data['nilai'];?></td>
<td><a href="index.php?page=delete_kriteria&id_kriteria=<?php
echo $data ['id_kriteria_pelamar'] ; ?>" title="Remove" ><span class="label labeldanger">Delete<i class="fa fa-fw fa-remove"></i></span></a>
</td>
</tr>
<?php
$i++;
}
?>
</table>
</div><!-- /.box-body -->
</div>
8. Data_jabatan.php
<div class="box">
<div class="box-header">
<h3 class="box-title">Data Table Jabatan</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Jabatan</th>

<th>Aksi</th>
</tr>
</thead>
<?php
$sql=mysql_query("SELECT * from jabatan");
while ($data=mysql_fetch_array($sql)) {
?>

<tbody>
<tr>
<td><?php echo $data['nama_jabatan'];?></td>

<td><a href="index.php?page=delete_jabatan&id_jabatan=<?php
echo $data ['id_jabatan']; ?>" title="Remove" ><span class="label labeldanger">Delete<i class="fa fa-fw fa-remove"></i></span></a> <a href="index.php?
page=edit_jabatan&id_jabatan=<?php echo $data['id_jabatan'];?>"
title="Ubah"><span class="label label-success">Edit <i class="fa fa-fw fa-edit"></i>
</span></a>

</td>
</tr>

<?php
}
?>
</table>
</div><!-- /.box-body -->
</div>

9. Data_wawancara.php
<div class="box">
<div class="box-header">
<h3 class="box-title">Data Table Wawancara</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Subjek Penelitian</th>

<th>Aksi</th>
</tr>
</thead>
<?php
$sql=mysql_query("SELECT * from penilaian_wawancara");
while ($data=mysql_fetch_array($sql)) {
?>

<tbody>
<tr>
<td><?php echo $data['subjek_penilaian'];?></td>

<td><a href="index.php?
page=delete_wawancara&id_penilaian_wawancara=<?php echo
$data['id_penilaian_wawancara'];?>" title="Remove" ><span class="label labeldanger">Delete<i class="fa fa-fw fa-remove"></i></span></a>

</td>
</tr>

<?php
}
?>
</table>
</div><!-- /.box-body -->
</div>
10. Koneksi.php
<?php
$host = "localhost";
$username = "root";
$pass = "";
$db ="saw_ptpn";
$koneksi = mysql_connect($host,$username,$pass);
$tampil=mysql_select_db($db,$koneksi);
if ($tampil){
}
else
{
echo"gagal";
}
?>
11. Form_user.php
<?php
error_reporting(0);
include "koneksi.php";
if($_POST['submit']){
$username=$_POST['username'];
$email=$_POST['email'];
$level=$_POST['level'];
$sql =mysql_query("INSERT INTO user values ('','$username',
'password','$email','$level')") or die (mysql_error());
if ($sql) {
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" ariahidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i></i> Berhasil</h4>
Silahkan Input data lagi jika anda ingin menamba data

</div>
<?php
}
else {
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" ariahidden="true">&times;</button>
<h4><i class="icon fa fa-ban"></i> Gagal</h4>
Silahkan Coba lagi </div>
<?php
}
}
?>
<!-- form start -->
<form action="" method="POST" enctype="multipart/form-data">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">username</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="username" required name="username">
</div>
<div class="form-group">
<label for="exampleInputEmail1">password</label>
<input type="password" class="form-control"
id="exampleInputEmail1" placeholder="Password" required name="password">
</div>
<div class="form-group">
<label for="exampleInputEmail1">email</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="email" required name="email">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Level</label>
<select name="level" class="form-control">
<option value="Admin">Admin</option>';
<option value="HRD">HRD</option>';
<option value="Pimpinan">Pimpinan</option>';
<
</select>
</div>
<br />
<div class="checkbox">

<label>
<input type="checkbox"> Check me out
</label>
</div>
</div><!-- /.box-body -->
<div class="box-footer">
<input type="submit" class="btn btn-primary" value="submit"
name="submit">Submit</button>
</div>
</form>
12. Form_pelamar.php
<?php date_default_timezone_set("Asia/Jakarta");
error_reporting(0);
include "koneksi.php";
if($_POST['submit']){
$nama_pelamar = mysql_real_escape_string($_POST['nama_pelamar']);
$tempat_lahir = mysql_real_escape_string($_POST['tempat_lahir']);
$tgl_lahir = mysql_real_escape_string($_POST['tgl_lahir']);
$jenis_kelamin= mysql_real_escape_string($_POST['jenis_kelamin']);
$pendidikan = mysql_real_escape_string($_POST['pendidikan']);
$alamat
= mysql_real_escape_string($_POST['alamat']);
$status
= mysql_real_escape_string($_POST['status']);
$nomor_telepon= mysql_real_escape_string($_POST['nomor_telepon']);
$agama
= mysql_real_escape_string($_POST['agama']);
$pengalaman_kerja = mysql_real_escape_string($_POST['pengalaman_kerja']);
$id_jabatan = mysql_real_escape_string($_POST['id_jabatan']);
$folder ="gambar/";
$folder=$folder . basename ($_FILES['gambar'] ['name']);
$gambar=($_FILES['gambar']['name']);
if ($gambar!="")
{
mysql_query("INSERT INTO pelamar VALUES ('', '$nama_pelamar',
'$tempat_lahir', '$tgl_lahir', '$jenis_kelamin', '$pendidikan', '$alamat', '$status',
'$nomor_telepon','$agama','$pengalaman_kerja','$id_jabatan','$gambar')") or
die(mysql_error());
if (move_uploaded_file($_FILES['gambar']['tmp_name'], $folder))
{
echo "Berhasil";
?>
<?php
}
}
else
{

mysql_query("INSERT INTO pelamar VALUES (INSERT INTO pelamar


VALUES ('', '$nama_pelamar', '$tempat_lahir', '$tgl_lahir', '$jenis_kelamin',
'$pendidikan', '$alamat', '$status',
'$nomor_telepon','$agama','$pengalaman_kerja','$id_jabatan','$gambar')");
}
}
?>

<!-- form start -->


<form action="" method="POST" enctype="multipart/form-data">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">Nama Pelamar</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="Nama" required name="nama_pelamar">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Tempat lahir</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="tempat lahir" required name="tempat_lahir">
</div>
<div class="form-group">
<label for="calender">Tanggal Lahir</label>
<div class="col-sm-10 pull-right">
<input type="datetime" class="datepicker" id="tanggal"
placeholder="Tanggal lahir" required name="tgl_lahir">
</div>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Jenis Kelamin</label>
<select name="jenis_kelamin" class="form-control">
<option value="laki-laki">Laki-Laki</option>';
<option value="wanita">Wanita</option>';
</select>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Pendidikan</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="Pendidikan terakhir" required name="pendidikan">
</div>

<div class="form-group">
<label for="exampleInputEmail1">Alamat</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="Alamat" required name="alamat">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Status</label>
<select name="status" class="form-control">
<option value="Menikah">Menikah</option>';
<option value="Belum Menikah">Belum Menikah</option>';
</select>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Nomor Telepon</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="nomor telepom" required name="nomor_telepon">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Agama</label>
<select name="agama" class="form-control">
<option value="Kristen Protestan">Kristen Protestan</option>';
<option value="Kristen Katolik">Kristen Katolik</option>';
<option value="Islam">Islam</option>';
<option value="Buddha">Buddha</option>';
<option value="Hindu">Hindu</option>';
<option value="Kong Hu Cu">Kong Hu Cu</option>';
</select>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Pengalaman Kerja</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="pengalaman kerja" required name="pengalaman_kerja">
</div>
<div class="control-group">
<label class="control-label">Nama Jabatan</label>
<select name="id_jabatan" class="form-control">
<?php
$sql_jabtan = mysql_query("SELECT * FROM jabatan ORDER
BY id_jabatan ASC");
while($array_jabatan = mysql_fetch_array($sql_jabtan)){

if($_POST['id_jabatan'] == $array_jabatan['id_jabatan']){
echo '<option value="' . $array_jabatan['id_jabatan'] . '"
selected="selected">' . $array_jabatan['nama_jabatan'] . '</option>';
} else {
echo '<option value="' . $array_jabatan['id_jabatan'] . '">' .
$array_jabatan['nama_jabatan'] . '</option>';
}
}
?>
</select>
</div>
</br>
<div class="form-group">
<label for="preview_gambar">Gambar</label>
<div class="col-sm-10 pull-right">
<input type="file" id="preview_gambar" required name="gambar">
</div>
</div>
<div class="form-group">
<img src="#" id="gambar_nodin" width="400" height="400"
alt="Preview Gambar" />
</div>
<br />
</div><!-- /.box-body -->
<div class="box-footer">
<input type="submit" class="btn btn-primary" value="submit"
name="submit"></button>
</div>
</form>
<script type="text/javascript" src="http://code.jquery.com/jquery1.11.1.min.js"></script>
<script type="text/javascript">
function bacaGambar(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#gambar_nodin').attr('src', e.target.result);

}
reader.readAsDataURL(input.files[0]);
}
}

$("#preview_gambar").change(function(){
bacaGambar(this);
});
</script>
13. Form_kriteria.php
<?php
error_reporting(0);
include "koneksi.php";
if($_POST['submit']){
$nama_kriteria=$_POST['nama_kriteria'];
$kategori =$_POST['kategori'];
$bobot
=$_POST['bobot'];
$sql =mysql_query("INSERT INTO kriteria values
('','$nama_kriteria','$kategori','$bobot')") or die (mysql_error());
if ($sql) {
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" ariahidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i></i> Berhasil</h4>
Silahkan Input data lagi jika anda ingin menamba data
</div>
<?php
}
else {
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" ariahidden="true">&times;</button>
<h4><i class="icon fa fa-ban"></i> Gagal</h4>
Silahkan Coba lagi </div>
<?php
}
}

?>
<!-- form start -->
<form action="" method="POST" enctype="multipart/form-data">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">Nama Kriteria</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="nama_kriteria" required name="nama_kriteria">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Bobot</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="bobot" required name="bobot">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Kategori</label>
<select name="kategori" class="form-control">
<option value="benefit">Benefit</option>
<option value="cost">Cost</option>
</select>
</div>
<br />
<div class="checkbox">
<label>
<input type="checkbox"> Check me out
</label>
</div>
</div><!-- /.box-body -->
<div class="box-footer">
<input type="submit" class="btn btn-primary" value="submit"
name="submit">Submit</button>
</div>
</form>
14. Form_kriteria_pelamar.php
<?php
include "koneksi.php";
if($_POST['submit']){
$id_pelamar =$_POST['id_pelamar'];
$id_kriteria=$_POST['id_kriteria'];
$nilai =mysql_real_escape_string($_POST['nilai']);
$sql =mysql_query("INSERT INTO kriteria_pelamar values
('','$id_pelamar','$id_kriteria','$nilai')") or die (mysql_error());
if ($sql) {

?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" ariahidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i></i> Berhasil</h4>
Silahkan Input data lagi jika anda ingin menamba data
</div>
<?php
}
else {
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" ariahidden="true">&times;</button>
<h4><i class="icon fa fa-ban"></i> Gagal</h4>
Silahkan Coba lagi </div>
<?php
}
}
?>
<!-- form start -->
<form action="" method="POST" enctype="multipart/form-data">
<div class="box-body">
<div class="form-group">
<label class="control-label">Nama Pelamar</label>
<select name="id_pelamar" class="form-control">
<?php
$sql_pelamar = mysql_query("SELECT * FROM pelamar ORDER
BY id_pelamar ASC");
while($array_pelamar = mysql_fetch_array($sql_pelamar)){
if($_POST['id_pelamar'] == $array_pelamar['id_pelamar']){
echo '<option value="' . $array_pelamar['id_pelamar'] . '"
selected="selected">' . $array_pelamar['nama_pelamar'] . '</option>';
} else {
echo '<option value="' . $array_pelamar['id_pelamar'] . '">' .
$array_pelamar['nama_pelamar'] . '</option>';
}
}
?>
</select>
</div>
<div class="form-group">
<label class="control-label">Nama kriteria</label>

<select name="id_kriteria" class="form-control">


<?php
$sql_jabtan = mysql_query("SELECT * FROM kriteria ORDER
BY id_kriteria ASC");
while($array_kriteria = mysql_fetch_array($sql_jabtan)){
if($_POST['id_kriteria'] == $array_kriteria['id_kriteria']){
echo '<option value="' . $array_kriteria['id_kriteria'] . '"
selected="selected">' . $array_kriteria['nama_kriteria'] . '</option>';
} else {
echo '<option value="' . $array_kriteria['id_kriteria'] . '">' .
$array_kriteria['nama_kriteria'] . '</option>';
}
}
?>
</select>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Nilai</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="Nilai" required="required" name="nilai">
</div>
<br />
</div><!-- /.box-body -->
<div class="box-footer">
<input type="submit" class="btn btn-primary" value="submit"
name="submit">Submit</button>
</div>
</form>
15. Form_jabatan.php
<?php
error_reporting(0);
include "koneksi.php";
if($_POST['submit']){
$nama_jabatan=$_POST['nama_jabatan'];
$sql =mysql_query("INSERT INTO jabatan values ('','$nama_jabatan')") or die
(mysql_error());
if ($sql) {
?>
<div class="alert alert-success alert-dismissable">

<button type="button" class="close" data-dismiss="alert" ariahidden="true">&times;</button>


<h4><i class="icon fa fa-check"></i></i> Berhasil</h4>
Silahkan Input data lagi jika anda ingin menamba data
</div>
<?php
}
else {
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" ariahidden="true">&times;</button>
<h4><i class="icon fa fa-ban"></i> Gagal</h4>
Silahkan Coba lagi </div>
<?php
}
}
?>
<!-- form start -->
<form action="" method="POST" enctype="multipart/form-data">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">Nama Jabatan</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="nama_jabatan" required name="nama_jabatan">
</div>
<br />
<div class="checkbox">
<label>
<input type="checkbox"> Check me out
</label>
</div>
</div><!-- /.box-body -->
<div class="box-footer">
<input type="submit" class="btn btn-primary" value="submit"
name="submit">Submit</button>
</div>
</form>
16. Form_wawancara.php
<?php
error_reporting(0);
include "koneksi.php";
if($_POST['submit']){
$subjek_penilaian=$_POST['subjek_penilaian'];

$sql =mysql_query("INSERT INTO penilaian_wawancara values


('','$subjek_penilaian')") or die (mysql_error());
if ($sql) {
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" ariahidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i></i> Berhasil</h4>
Silahkan Input data lagi jika anda ingin menamba data
</div>
<?php
}
else {
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" ariahidden="true">&times;</button>
<h4><i class="icon fa fa-ban"></i> Gagal</h4>
Silahkan Coba lagi </div>
<?php
}
}
?>
<!-- form start -->
<form action="" method="POST" enctype="multipart/form-data">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">Subjek Penilaian</label>
<input type="text" class="form-control" id="exampleInputEmail1"
placeholder="subjek_penilaian" required name="subjek_penilaian">
</div>
<br />
<div class="checkbox">
<label>
<input type="checkbox"> Check me out
</label>
</div>
</div><!-- /.box-body -->
<div class="box-footer">
<input type="submit" class="btn btn-primary" value="submit"
name="submit">Submit</button>
</div>
</form>
17. Edit_user.php

<?php
include "koneksi.php";
$id_user=$_GET['id_user'];
$sql=mysql_query("SELECT * from user where id_user='$id_user'");
$hasil=mysql_fetch_array($sql);
?>
<form action="" method="POsT" enctype="multipart/form-data">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">username</label>
<input type="text" class="form-control" value="<?php echo $hasil
['username']; ?>" id="exampleInputEmail1" placeholder="username" required
name="username">
</div>
<div class="form-group">
<label for="exampleInputEmail1">email</label>
<input type="text" class="form-control" value="<?php echo $hasil
['email']; ?>" id="exampleInputEmail1" placeholder="email" required
name="email">
</div>
<div class="form-group">
<label for="exampleInputEmail1">level</label>
<input type="text" class="form-control" value="<?php echo $hasil
['level']; ?>" id="exampleInputEmail1" placeholder="level" required name="level">
</div>
<br />
<div class="checkbox">
<label>
<input type="checkbox"> Check me out
</label>
</div>
</div><!-- /.box-body -->
<div class="box-footer">
<input type="submit" class="btn btn-primary" value="submit"
name="submit">Submit</button>
</div>
</form>
<?php
error_reporting (E_ALL ^ E_NOTICE);
$post = (!empty($_POST)) ? true : false;
if($post){
$error = '';

if(empty($error)){
$username = $_POST['username'];
$email = $_POST['email'];
$level = $_POST['level'];
$tambah=mysql_query("UPDATE user SET username='$username', email='$email',
level='$level'
WHERE id_user='$id_user'") or die(mysql_error());
if($tambah){
?>
<meta http-equiv='refresh' content='0; url=index.php?page=data_user'>
<?php
}
else {
echo "gagal";
}
}
}
?>
18. Edit_bobot.php
<?php
include "koneksi.php";
$id_kriteria=$_GET['id_kriteria'];
$sql=mysql_query("SELECT * from kriteria where id_kriteria='$id_kriteria'");
$hasil=mysql_fetch_array($sql);
?>
<form action="" method="POST" enctype="multipart/form-data">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">Nama Kriteria</label>
<input type="text" class="form-control" value="<?php echo $hasil
['nama_kriteria']; ?>" id="exampleInputEmail1" required name="nama_jabatan"
disabled>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Kategori</label>
<input type="text" class="form-control" value="<?php echo $hasil
['kategori']; ?>" id="exampleInputEmail1" required name="kategori" disabled>

</div>
<div class="form-group">
<label for="exampleInputEmail1">Bobot</label>
<input type="text" class="form-control" value="<?php echo $hasil
['bobot']; ?>" id="exampleInputEmail1" required name="bobot">
</div>
<br />
</div><!-- /.box-body -->
<div class="box-footer">
<input type="submit" class="btn btn-primary" value="submit"
name="submit">Submit</button>
</div>
</form>
<?php
error_reporting (E_ALL ^ E_NOTICE);
$post = (!empty($_POST)) ? true : false;
if($post){
$error = '';

if(empty($error)){

$bobot = $_POST['bobot'];
$tambah=mysql_query("UPDATE kriteria SET bobot='$bobot' WHERE
id_kriteria='$id_kriteria'") or die(mysql_error());
if($tambah){
?>
<meta http-equiv='refresh' content='0; url=index.php?page=data_kriteria'>
<?php
}
else {

echo "gagal";
}
}
}
?>
19. Edit_jabatan.php
<?php
include "koneksi.php";
$id_jabatan=$_GET['id_jabatan'];
$sql=mysql_query("SELECT * from jabatan where id_jabatan='$id_jabatan'");
$hasil=mysql_fetch_array($sql);
?>
<form action="" method="POsT" enctype="multipart/form-data">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">Nama Jabatan</label>
<input type="text" class="form-control" value="<?php echo $hasil
['nama_jabatan']; ?>" id="exampleInputEmail1" placeholder="username" required
name="nama_jabatan">
</div>
<br />
</div><!-- /.box-body -->
<div class="box-footer">
<input type="submit" class="btn btn-primary" value="submit"
name="submit">Submit</button>
</div>
</form>
<?php
error_reporting (E_ALL ^ E_NOTICE);
$post = (!empty($_POST)) ? true : false;
if($post){
$error = '';

if(empty($error)){

$nama_jabatan = $_POST['nama_jabatan'];
$tambah=mysql_query("UPDATE jabatan SET nama_jabatan='$nama_jabatan'
WHERE id_jabatan='$id_jabatan'") or die(mysql_error());
if($tambah){
?>
<meta http-equiv='refresh' content='0; url=index.php?page=data_jabatan'>
<?php
}
else {
echo "gagal";
}
}
}
?>
20. Delete_user.php
<?php
include "koneksi.php";
$id_user =$_GET['id_user'];
$sql=mysql_query("DELETE from user where id_user='$id_user'") or
die(mysql_error());
if ($sql) {
echo "Berhasil Dihapus";
}
else
{
echo "GAGAL";
}
?>
<script type="text/javascript">
window.location ="index.php?page=data_user"
</script>
21. Delete_pelamar.php
<?php
include "koneksi.php";
$id_pelamar =$_GET['id_pelamar'];

$sql=mysql_query("DELETE from pelamar where id_pelamar='$id_pelamar'") or


die(mysql_error());
if ($sql) {
echo "Berhasil Dihapus";
}
else
{
echo "GAGAL";
}
?>
<script type="text/javascript">
window.location ="index.php?page=data_pelamar"
</script>
22. Delete_kriteria.php
<?php
include "koneksi.php";
$id_kriteria =$_GET['id_kriteria'];
$sql=mysql_query("DELETE from kriteria where id_kriteria='$id_kriteria'") or
die(mysql_error());
if ($sql) {
echo "Berhasil Dihapus";
}
else
{
echo "GAGAL";
}
?>
<script type="text/javascript">
window.location ="index.php?page=data_kriteria"
</script>
23. Delete_wawancara.php
<?php
include "koneksi.php";
$id_penilaian_wawancara =$_GET['id_penilaian_wawancara'];
$sql=mysql_query("DELETE from penilaian_wawancara where
id_penilaian_wawancara='$id_penilaian_wawancara'") or die(mysql_error());
if ($sql) {
echo "Berhasil Dihapus";
}
else
{
echo "GAGAL";

}
?>
<script type="text/javascript">
window.location ="index.php?page=data_waancara"
</script>
24. Delete_jabatan.php
<?php
include "koneksi.php";
$id_jabatan =$_GET['id_jabatan'];
$sql=mysql_query("DELETE from jabatan where id_jabatan='$id_jabatan'") or
die(mysql_error());
if ($sql) {
echo "Berhasil Dihapus";
}
else
{
echo "GAGAL";
}
?>
<script type="text/javascript">
window.location ="index.php?page=data_jabatan"
</script>
25. Proses_saw.php
<div class="box">
<div class="box-header">
<center><h3 class="box-title">Proses Simple Addiptive Weighting PTPN
IV Medan</h3></center>
</div><!-- /.box-header -->
<?php error_reporting(0);
include 'koneksi.php';
$delete_matrix = mysql_query("DELETE FROM matrix");
$delete_matrix2 = mysql_query("DELETE FROM hasil_saw");
$kriteria1 = array();
$bobot1 = array();
$kategori1 = array();
$result = mysql_query("SELECT * FROM kriteria ORDER BY
id_kriteria ASC");

$sql_kriteria = mysql_query("SELECT * FROM kriteria ORDER BY


id_kriteria ASC");
$kr=1;
while($array_kriteria = mysql_fetch_array($sql_kriteria)){
$kriteria1 = array($kr=>$array_kriteria['id_kriteria']);
$kriteria_1 .= $kriteria1[1];
$kriteria_2 .= $kriteria1[2];
$kriteria_3 .= $kriteria1[3];
$kriteria_4 .= $kriteria1[4];
$kriteria_5 .= $kriteria1[5];
$bobot1 = array($kr=>$array_kriteria['bobot']);
$bobot_1 .= $bobot1[1];
$bobot_2 .= $bobot1[2];
$bobot_3 .= $bobot1[3];
$bobot_4 .= $bobot1[4];
$bobot_5 .= $bobot1[5];
$kategori1 = array($kr=>$array_kriteria['kategori']);
$kategori_1 .= $kategori1[1];
$kategori_2 .= $kategori1[2];
$kategori_3 .= $kategori1[3];
$kategori_4 .= $kategori1[4];
$kategori_5 .= $kategori1[5];
$kr++;
}
$bobot_1 = $bobot_1 / 100;
$bobot_2 = $bobot_2 / 100;
$bobot_3 = $bobot_3 / 100;
$bobot_4 = $bobot_4 / 100;
$bobot_5 = $bobot_5 / 100;
$sql_pelamar = mysql_query("SELECT * FROM pelamar ORDER BY
id_pelamar ASC");
while($array_pelamar=mysql_fetch_array($sql_pelamar)){
$id_pelamar = $array_pelamar['id_pelamar'];
$sql_kriteria_pelamar_1 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_1' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar_1 =
mysql_fetch_array($sql_kriteria_pelamar_1);
if($array_kriteria_pelamar_1['nilai'] == "Lengkap"){
$nilai1 = 1;

}
else if($array_kriteria_pelamar_1['nilai'] == "Tidak Lengkap"){
$nilai1 = 0.5;
}
$sql_kriteria_pelamar_2 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_2' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar2 =
mysql_fetch_array($sql_kriteria_pelamar_2);
if($array_kriteria_pelamar2['nilai'] >= 81){
$nilai2 = 1;
}
else if($array_kriteria_pelamar2['nilai'] >= 71){
$nilai2 = 0.8;
}
else if($array_kriteria_pelamar2['nilai'] >= 61){
$nilai2 = 0.6;
}
else if($array_kriteria_pelamar2['nilai'] >= 51){
$nilai2 = 0.4;
}
else if($array_kriteria_pelamar2['nilai'] < 51){
$nilai2 = 0.2;
}
$sql_kriteria_pelamar_3 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_3' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar3 =
mysql_fetch_array($sql_kriteria_pelamar_3);
if($array_kriteria_pelamar3['nilai'] >= 32){
$nilai3 = 0.2;
}
else if($array_kriteria_pelamar3['nilai'] >= 28){
$nilai3 = 0.4;
}
else if($array_kriteria_pelamar3['nilai'] >= 24){
$nilai3 = 0.7;
}
else if($array_kriteria_pelamar3['nilai'] < 24){
$nilai3 = 1;
}
$sql_kriteria_pelamar_4 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_4' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar4 =
mysql_fetch_array($sql_kriteria_pelamar_4);

if($array_kriteria_pelamar4['nilai'] >= 81){


$nilai4 = 1;
}
else if($array_kriteria_pelamar4['nilai'] >= 71){
$nilai4 = 0.8;
}
else if($array_kriteria_pelamar4['nilai'] >= 61){
$nilai4 = 0.6;
}
else if($array_kriteria_pelamar4['nilai'] >= 51){
$nilai4 = 0.4;
}
else if($array_kriteria_pelamar4['nilai'] < 51){
$nilai4 = 0.2;
}
$sql_kriteria_pelamar_5 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_5' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar5 =
mysql_fetch_array($sql_kriteria_pelamar_5);
if($array_kriteria_pelamar5['nilai'] >= 48){
$nilai5 = 1;
}
else if($array_kriteria_pelamar5['nilai'] >= 32){
$nilai5 = 0.8;
}
else if($array_kriteria_pelamar5['nilai'] >= 20){
$nilai5 = 0.6;
}
else if($array_kriteria_pelamar5['nilai'] >= 12){
$nilai5 = 0.4;
}
else if($array_kriteria_pelamar5['nilai'] < 12){
$nilai5 = 0.2;
}
$sql_cek = mysql_query("SELECT * FROM matrix WHERE
id_pelamar='$id_pelamar'") or die(mysql_error());
if(mysql_num_rows($sql_cek)){
echo '';
} else {
$sql_insert_matrix = mysql_query("INSERT INTO matrix VALUES
('', '$id_pelamar','$nilai1','$nilai2','$nilai3','$nilai4', '$nilai5')") or die(mysql_error());
}
}

?>
<div class="box-header">
<h3 class="box-title">Hasil Normalisasi I</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>No</th>
<th>Nama pelamar</th>
<th>Kriteria 1</th>
<th>Kriteria 2</th>
<th>Kriteria 3</th>
<th>Kriteria 4</th>
<th>Kriteria 5</th>
</tr>
</thead>
<?php
$j=1;
$sql_pelamar_matrix = mysql_query("select a.*,b.* from
pelamar a, matrix b WHERE a.id_pelamar=b.id_pelamar order by b.id_pelamar asc");
while($array_pelamar_matrix =
mysql_fetch_array($sql_pelamar_matrix)){
?>
<tbody>
<tr>
<td><?php echo $j;?></td>
<td><?php echo
$array_pelamar_matrix['nama_pelamar'];?></td>
<td><?php echo
$array_pelamar_matrix['matrix_berkas'];?></td>
<td><?php echo
$array_pelamar_matrix['matrix_ujian'];?></td>
<td><?php echo
$array_pelamar_matrix['matrix_usia'];?></td>
<td><?php echo
$array_pelamar_matrix['matrix_wawancara'];?></td>
<td><?php echo $array_pelamar_matrix['matrix_pengalaman_kerja'];?
></td>
</tr>
</tbody>
<?php
$j++;
}

?>
</table>
</div>
<?php
if($kategori_1 == "cost"){
$crMin1 = mysql_query("SELECT min(matrix_berkas) as
minK1 FROM matrix");
$arrayMin1 = mysql_fetch_array($crMin1);
$nilaik1 = $arrayMin1['minK1'];
} else if($kategori_1 == "benefit"){
$crMax1 = mysql_query("SELECT max(matrix_berkas) as
maxK1 FROM matrix");
$arrayMax1 = mysql_fetch_array($crMax1);
$nilaik1 = $arrayMax1['maxK1'];
}
if($kategori_2 == "cost"){
$crMin2 = mysql_query("SELECT min(matrix_ujian) as
minK2 FROM matrix");
$arrayMin2 = mysql_fetch_array($crMin2);
$nilaik2 = $arrayMin2['minK2'];
} else if($kategori_2 == "benefit"){
$crMax2 = mysql_query("SELECT max(matrix_ujian) as
maxK2 FROM matrix");
$arrayMax2 = mysql_fetch_array($crMax2);
$nilaik2 = $arrayMax2['maxK2'];
}
if($kategori_3 == "cost"){
$crMin3 = mysql_query("SELECT min(matrix_usia) as minK3
FROM matrix");
$arrayMin3 = mysql_fetch_array($crMin3);
$nilaik3 = $arrayMin3['minK3'];
} else if($kategori_3 == "benefit"){
$crMax3 = mysql_query("SELECT max(matrix_usia) as
maxK3 FROM matrix");
$arrayMax3 = mysql_fetch_array($crMax3);
$nilaik3 = $arrayMax3['maxK3'];
}
if($kategori_4 == "cost"){
$crMin4 = mysql_query("SELECT min(matrix_wawancara) as
minK4 FROM matrix");
$arrayMin4 = mysql_fetch_array($crMin4);

$nilaik4 = $arrayMin4['minK4'];
} else if($kategori_4 == "benefit"){
$crMax4 = mysql_query("SELECT max(matrix_wawancara)
as maxK4 FROM matrix");
$arrayMax4 = mysql_fetch_array($crMax4);
$nilaik4 = $arrayMax4['maxK4'];
}
if($kategori_5 == "cost"){
$crMin5 = mysql_query("SELECT
min(matrix_pengalaman_kerja) as minK5 FROM matrix");
$arrayMin5 = mysql_fetch_array($crMin5);
$nilaik5 = $arrayMin5['minK5'];
} else if($kategori_5 == "benefit"){
$crMax5 = mysql_query("SELECT
max(matrix_pengalaman_kerja) as maxK5 FROM matrix");
$arrayMax5 = mysql_fetch_array($crMax5);
$nilaik5 = $arrayMax5['maxK5'];
}
$sql2 = mysql_query("SELECT a.*,b.* FROM matrix a,
pelamar b where a.id_pelamar=b.id_pelamar order by a.id_pelamar ASC");
?>
<div class="box-header">
<h3 class="box-title">Hasil Normalisasi II (Cost-Benefit)</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>No</th>
<th>Nama
pelamar</th>
<th>Kriteria
1</th>
<th>Kriteria
2</th>
<th>Kriteria
3</th>
<th>Kriteria
4</th>
<th>Kriteria
5</th>
</tr>
</thead>

<?php
$no = 1;
while ($dt2 =
mysql_fetch_array($sql2)) {
if($kategori_1 == "cost"){
$crMin1 =
mysql_query("SELECT min(matrix_berkas) as minK1 FROM matrix");
$arrayMin1 =
mysql_fetch_array($crMin1);
$nilaik1 =
$arrayMin1['minK1'];
$hasil_normal1 =
$nilaik1/$dt2['matrix_berkas'];
} else if($kategori_1 ==
"benefit"){
$crMax1 =
mysql_query("SELECT max(matrix_berkas) as maxK1 FROM matrix");
$arrayMax1 =
mysql_fetch_array($crMax1);
$nilaik1 =
$arrayMax1['maxK1'];
$hasil_normal1 =
$dt2['matrix_berkas']/$nilaik1;
}
if($kategori_2 == "cost"){
$crMin2 =
mysql_query("SELECT min(matrix_ujian) as minK2 FROM matrix");
$arrayMin2 =
mysql_fetch_array($crMin2);
$nilaik2 =
$arrayMin2['minK2'];
$hasil_normal2 =
$nilaik2/$dt2['matrix_ujian'];
} else if($kategori_2 ==
"benefit"){
$crMax2 =
mysql_query("SELECT max(matrix_ujian) as maxK2 FROM matrix");
$arrayMax2 =
mysql_fetch_array($crMax2);
$nilaik2 =
$arrayMax2['maxK2'];
$hasil_normal2 =
$dt2['matrix_ujian']/$nilaik2;
}
if($kategori_3 == "cost"){

$crMin3 =
mysql_query("SELECT min(matrix_usia) as minK3 FROM matrix");
$arrayMin3 =
mysql_fetch_array($crMin3);
$nilaik3 =
$arrayMin3['minK3'];
$hasil_normal3 =
$nilaik3/$dt2['matrix_usia'];
} else if($kategori_3 ==
"benefit"){
$crMax3 =
mysql_query("SELECT max(matrix_usia) as maxK3 FROM matrix");
$arrayMax3 =
mysql_fetch_array($crMax3);
$nilaik3 =
$arrayMax3['maxK3'];
$hasil_normal3 =
$dt2['matrix_usia']/$nilaik3;
}
if($kategori_4 == "cost"){
$crMin4 =
mysql_query("SELECT min(matrix_wawancara) as minK4 FROM matrix");
$arrayMin4 =
mysql_fetch_array($crMin4);
$nilaik4 =
$arrayMin4['minK4'];
$hasil_normal4 =
$nilaik4/$dt2['matrix_wawancara'];
} else if($kategori_4 ==
"benefit"){
$crMax4 =
mysql_query("SELECT max(matrix_wawancara) as maxK4 FROM matrix");
$arrayMax4 =
mysql_fetch_array($crMax4);
$nilaik4 =
$arrayMax4['maxK4'];
$hasil_normal4 =
$dt2['matrix_wawancara']/$nilaik4;
}
if($kategori_5 == "cost"){
$crMin5 =
mysql_query("SELECT min(matrix_pengalaman_kerja) as minK5 FROM matrix");
$arrayMin5 =
mysql_fetch_array($crMin5);
$nilaik5 =
$arrayMin5['minK5'];

$hasil_normal5 =
$nilaik5/$dt2['matrix_pengalaman_kerja'];
} else if($kategori_5 ==
"benefit"){
$crMax5 =
mysql_query("SELECT max(matrix_pengalaman_kerja) as maxK5 FROM matrix");
$arrayMax5 =
mysql_fetch_array($crMax5);
$nilaik5 =
$arrayMax5['maxK5'];
$hasil_normal5 =
$dt2['matrix_pengalaman_kerja']/$nilaik5;
}
echo "<tbody>";
echo "<tr>";
echo
"<td>$no</td>";
echo "<td>".
$dt2['nama_pelamar']."</td>";
echo
"<td>".
$hasil_normal1."</td>
<td>".
$hasil_normal2."</td>
<td>".
$hasil_normal3."</td>
<td>".
$hasil_normal4."</td>
<td>".
$hasil_normal5."</td>
";
echo "</tr>";
echo "</tbody>";
$no++;
}
?>
</table>
</div>
<div class="box-header">
<h3 class="box-title">Hasil Akhir Perkalian Bobot</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>

<tr>
<th>Nama pelamar</th>
<th>Kriteria 1</th>
<th>Kriteria 2</th>
<th>Kriteria 3</th>
<th>Kriteria 4</th>
<th>Kriteria 5</th>
<th>Hasil</th>
</tr>
</thead>
<?php
$sql3 = mysql_query("SELECT a.*,b.* FROM matrix a,
pelamar b where a.id_pelamar=b.id_pelamar order by a.id_pelamar ASC");
$no = 1;
while ($dt3 =
mysql_fetch_array($sql3)) {
$id_pelamar3 =
$dt3['id_pelamar'];
if($kategori_1 == "cost"){
$crMin1 =
mysql_query("SELECT min(matrix_berkas) as minK1 FROM matrix");
$arrayMin1 =
mysql_fetch_array($crMin1);
$nilaik1 =
$arrayMin1['minK1'];
$hasil_normal1 =
$nilaik1/$dt3['matrix_berkas'];
} else
if($kategori_1 == "benefit"){
$crMax1 =
mysql_query("SELECT max(matrix_berkas) as maxK1 FROM matrix");
$arrayMax1 =
mysql_fetch_array($crMax1);
$nilaik1 =
$arrayMax1['maxK1'];
$hasil_normal1 =
$dt3['matrix_berkas']/$nilaik1;
}
if($kategori_2 == "cost"){
$crMin2 =
mysql_query("SELECT min(matrix_ujian) as minK2 FROM matrix");
$arrayMin2 =
mysql_fetch_array($crMin2);

$nilaik2 =
$arrayMin2['minK2'];
$hasil_normal2 =
$nilaik2/$dt3['matrix_ujian'];
} else
if($kategori_2 == "benefit"){
$crMax2 =
mysql_query("SELECT max(matrix_ujian) as maxK2 FROM matrix");
$arrayMax2 =
mysql_fetch_array($crMax2);
$nilaik2 =
$arrayMax2['maxK2'];
$hasil_normal2 =
$dt3['matrix_ujian']/$nilaik2;
}
if($kategori_3 == "cost"){
$crMin3 =
mysql_query("SELECT min(matrix_usia) as minK3 FROM matrix");
$arrayMin3 =
mysql_fetch_array($crMin3);
$nilaik3 =
$arrayMin3['minK3'];
$hasil_normal3 =
$nilaik3/$dt3['matrix_usia'];
} else
if($kategori_3 == "benefit"){
$crMax3 =
mysql_query("SELECT max(matrix_usia) as maxK3 FROM matrix");
$arrayMax3 =
mysql_fetch_array($crMax3);
$nilaik3 =
$arrayMax3['maxK3'];
$hasil_normal3 =
$dt3['matrix_usia']/$nilaik3;
}
if($kategori_4 == "cost"){
$crMin4 =
mysql_query("SELECT min(matrix_wawancara) as minK4 FROM matrix");
$arrayMin4 =
mysql_fetch_array($crMin4);
$nilaik4 =
$arrayMin4['minK4'];
$hasil_normal4 =
$nilaik4/$dt3['matrix_wawancara'];
} else
if($kategori_4 == "benefit"){

$crMax4 =
mysql_query("SELECT max(matrix_wawancara) as maxK4 FROM matrix");
$arrayMax4 =
mysql_fetch_array($crMax4);
$nilaik4 =
$arrayMax4['maxK4'];
$hasil_normal4 =
$dt3['matrix_wawancara']/$nilaik4;
}
if($kategori_5 == "cost"){
$crMin5 =
mysql_query("SELECT min(matrix_pengalaman_kerja) as minK5 FROM matrix");
$arrayMin5 =
mysql_fetch_array($crMin5);
$nilaik5 =
$arrayMin5['minK5'];
$hasil_normal5 =
$nilaik5/$dt3['matrix_pengalaman_kerja'];
} else
if($kategori_5 == "benefit"){
$crMax5 =
mysql_query("SELECT max(matrix_pengalaman_kerja) as maxK5 FROM matrix");
$arrayMax5 =
mysql_fetch_array($crMax5);
$nilaik5 =
$arrayMax5['maxK5'];
$hasil_normal5 =
$dt3['matrix_pengalaman_kerja']/$nilaik5;
}
$hasil =
($hasil_normal1*$bobot_1)+($hasil_normal2*$bobot_2)+
($hasil_normal3*$bobot_3)+
($hasil_normal4*$bobot_4)+($hasil_normal5*$bobot_5);

echo "<tbody>";
echo "<tr>";
echo "<td>".
$dt3['nama_pelamar']."</td>";
echo
"<td>".
$hasil_normal1*$bobot_1."</td>

<td>".
$hasil_normal2*$bobot_2."</td>
<td>".
$hasil_normal3*$bobot_3."</td>
<td>".
$hasil_normal4*$bobot_4."</td>
<td>".
$hasil_normal5*$bobot_5."</td>
<td>".
$hasil."</td>
";
echo "</tr>";
echo "</tbody>";
$no++;
}
?>
</table>
</div>
</div>
26. Cetak_saw.php
<?php error_reporting(E_ALL ^ E_NOTICE);?>
<style type="text/css">
table.hovertable2 {
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:13px;
color:#333333;
}
table.hovertable2 th {
background-color:#FFF;
padding: 8px;
}
table.hovertable2 tr {
background-color:#FFF;
}
table.hovertable2 td {
padding: 8px;
}
table.hovertable {
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:13px;

color:#333333;
border-width: 1px;
border-color:#000;
border-collapse: collapse;
}
table.hovertable th {
background-color:#F0F8FF;
border-width: 1px;
padding: 8px;
border-style: solid;
border-color:#000;
}
table.hovertable tr {
background-color:#FFF;
}
table.hovertable td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color:#000;
}
.h11 { font-family:Arial, Helvetica, sans-serif;
font-size:16px;
color:#000;
font-weight:bold;
}
.heading {
border:0;
}
</style>
<?php error_reporting (0);
include 'koneksi.php';
$delete_matrix = mysql_query("DELETE FROM matrix");
$delete_matrix2 = mysql_query("DELETE FROM hasil_saw");
$kriteria1 = array();
$bobot1 = array();
$kategori1 = array();
$result = mysql_query("SELECT * FROM kriteria ORDER BY id_kriteria
ASC");
$sql_kriteria = mysql_query("SELECT * FROM kriteria ORDER BY
id_kriteria ASC");
$kr=1;
while($array_kriteria = mysql_fetch_array($sql_kriteria)){
$kriteria1 = array($kr=>$array_kriteria['id_kriteria']);

$kriteria_1 .= $kriteria1[1];
$kriteria_2 .= $kriteria1[2];
$kriteria_3 .= $kriteria1[3];
$kriteria_4 .= $kriteria1[4];
$kriteria_5 .= $kriteria1[5];
$bobot1 = array($kr=>$array_kriteria['bobot']);
$bobot_1 .= $bobot1[1];
$bobot_2 .= $bobot1[2];
$bobot_3 .= $bobot1[3];
$bobot_4 .= $bobot1[4];
$bobot_5 .= $bobot1[5];
$kategori1 = array($kr=>$array_kriteria['kategori']);
$kategori_1 .= $kategori1[1];
$kategori_2 .= $kategori1[2];
$kategori_3 .= $kategori1[3];
$kategori_4 .= $kategori1[4];
$kategori_5 .= $kategori1[5];
$kr++;
}
$bobot_1 = $bobot_1 / 100;
$bobot_2 = $bobot_2 / 100;
$bobot_3 = $bobot_3 / 100;
$bobot_4 = $bobot_4 / 100;
$bobot_5 = $bobot_5 / 100;
$sql_pelamar = mysql_query("SELECT * FROM pelamar ORDER BY
id_pelamar ASC");
while($array_pelamar=mysql_fetch_array($sql_pelamar)){
$id_pelamar = $array_pelamar['id_pelamar'];
$sql_kriteria_pelamar_1 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_1' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar_1 =
mysql_fetch_array($sql_kriteria_pelamar_1);
if($array_kriteria_pelamar_1['nilai'] == "Lengkap"){
$nilai1 = 1;
}
else if($array_kriteria_pelamar_1['nilai'] == "Tidak Lengkap"){
$nilai1 = 0.5;
}

$sql_kriteria_pelamar_2 = mysql_query("SELECT * FROM


kriteria_pelamar WHERE id_kriteria='$kriteria_2' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar2 =
mysql_fetch_array($sql_kriteria_pelamar_2);
if($array_kriteria_pelamar2['nilai'] >= 81){
$nilai2 = 1;
}
else if($array_kriteria_pelamar2['nilai'] >= 71){
$nilai2 = 0.8;
}
else if($array_kriteria_pelamar2['nilai'] >= 61){
$nilai2 = 0.6;
}
else if($array_kriteria_pelamar2['nilai'] >= 51){
$nilai2 = 0.4;
}
else if($array_kriteria_pelamar2['nilai'] < 51){
$nilai2 = 0.2;
}
$sql_kriteria_pelamar_3 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_3' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar3 =
mysql_fetch_array($sql_kriteria_pelamar_3);
if($array_kriteria_pelamar3['nilai'] >= 32){
$nilai3 = 0.2;
}
else if($array_kriteria_pelamar3['nilai'] >= 28){
$nilai3 = 0.4;
}
else if($array_kriteria_pelamar3['nilai'] >= 24){
$nilai3 = 0.7;
}
else if($array_kriteria_pelamar3['nilai'] < 24){
$nilai3 = 1;
}
$sql_kriteria_pelamar_4 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_4' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar4 =
mysql_fetch_array($sql_kriteria_pelamar_4);
if($array_kriteria_pelamar4['nilai'] >= 81){
$nilai4 = 1;
}
else if($array_kriteria_pelamar4['nilai'] >= 71){
$nilai4 = 0.8;

}
else if($array_kriteria_pelamar4['nilai'] >= 61){
$nilai4 = 0.6;
}
else if($array_kriteria_pelamar4['nilai'] >= 51){
$nilai4 = 0.4;
}
else if($array_kriteria_pelamar4['nilai'] < 51){
$nilai4 = 0.2;
}
$sql_kriteria_pelamar_5 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_5' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar5 =
mysql_fetch_array($sql_kriteria_pelamar_5);
if($array_kriteria_pelamar5['nilai'] >= 48){
$nilai5 = 1;
}
else if($array_kriteria_pelamar5['nilai'] >= 32){
$nilai5 = 0.8;
}
else if($array_kriteria_pelamar5['nilai'] >= 20){
$nilai5 = 0.6;
}
else if($array_kriteria_pelamar5['nilai'] >= 12){
$nilai5 = 0.4;
}
else if($array_kriteria_pelamar5['nilai'] < 12){
$nilai5 = 0.2;
}
$sql_cek = mysql_query("SELECT * FROM matrix WHERE
id_pelamar='$id_pelamar'") or die(mysql_error());
if(mysql_num_rows($sql_cek)){
echo '';
} else {
$sql_insert_matrix = mysql_query("INSERT INTO matrix VALUES
('', '$id_pelamar','$nilai1','$nilai2','$nilai3','$nilai4',
'$nilai5')") or die(mysql_error());
}
}
$j=1;
$sql_pelamar_matrix = mysql_query("select a.*,b.* from pelamar a,
matrix b WHERE a.id_pelamar=b.id_pelamar order by b.id_pelamar asc");

while($array_pelamar_matrix =
mysql_fetch_array($sql_pelamar_matrix)){
?>
<?php
$j++;
}
if($kategori_1 == "cost"){
$crMin1 = mysql_query("SELECT min(matrix_berkas) as
minK1 FROM matrix");
$arrayMin1 = mysql_fetch_array($crMin1);
$nilaik1 = $arrayMin1['minK1'];
} else if($kategori_1 == "benefit"){
$crMax1 = mysql_query("SELECT max(matrix_berkas) as
maxK1 FROM matrix");
$arrayMax1 = mysql_fetch_array($crMax1);
$nilaik1 = $arrayMax1['maxK1'];
}
if($kategori_2 == "cost"){
$crMin2 = mysql_query("SELECT min(matrix_ujian) as
minK2 FROM matrix");
$arrayMin2 = mysql_fetch_array($crMin2);
$nilaik2 = $arrayMin2['minK2'];
} else if($kategori_2 == "benefit"){
$crMax2 = mysql_query("SELECT max(matrix_ujian) as
maxK2 FROM matrix");
$arrayMax2 = mysql_fetch_array($crMax2);
$nilaik2 = $arrayMax2['maxK2'];
}
if($kategori_3 == "cost"){
$crMin3 = mysql_query("SELECT min(matrix_usia) as minK3
FROM matrix");
$arrayMin3 = mysql_fetch_array($crMin3);
$nilaik3 = $arrayMin3['minK3'];
} else if($kategori_3 == "benefit"){
$crMax3 = mysql_query("SELECT max(matrix_usia) as
maxK3 FROM matrix");
$arrayMax3 = mysql_fetch_array($crMax3);
$nilaik3 = $arrayMax3['maxK3'];
}
if($kategori_4 == "cost"){

$crMin4 = mysql_query("SELECT min(matrix_wawancara) as


minK4 FROM matrix");
$arrayMin4 = mysql_fetch_array($crMin4);
$nilaik4 = $arrayMin4['minK4'];
} else if($kategori_4 == "benefit"){
$crMax4 = mysql_query("SELECT max(matrix_wawancara)
as maxK4 FROM matrix");
$arrayMax4 = mysql_fetch_array($crMax4);
$nilaik4 = $arrayMax4['maxK4'];
}
if($kategori_5 == "cost"){
$crMin5 = mysql_query("SELECT
min(matrix_pengalaman_kerja) as minK5 FROM matrix");
$arrayMin5 = mysql_fetch_array($crMin5);
$nilaik5 = $arrayMin5['minK5'];
} else if($kategori_5 == "benefit"){
$crMax5 = mysql_query("SELECT
max(matrix_pengalaman_kerja) as maxK5 FROM matrix");
$arrayMax5 = mysql_fetch_array($crMax5);
$nilaik5 = $arrayMax5['maxK5'];
}
$sql2 = mysql_query("SELECT a.*,b.* FROM matrix a,
pelamar b where a.id_pelamar=b.id_pelamar order by a.id_pelamar ASC");
?>
<?php
$no = 1;
while ($dt2 =
mysql_fetch_array($sql2)) {
if($kategori_1 == "cost"){
$crMin1 =
mysql_query("SELECT min(matrix_berkas) as minK1 FROM matrix");
$arrayMin1 =
mysql_fetch_array($crMin1);
$nilaik1 =
$arrayMin1['minK1'];
$hasil_normal1 =
$nilaik1/$dt2['matrix_berkas'];
} else if($kategori_1 ==
"benefit"){
$crMax1 =
mysql_query("SELECT max(matrix_berkas) as maxK1 FROM matrix");
$arrayMax1 =
mysql_fetch_array($crMax1);

$nilaik1 =
$arrayMax1['maxK1'];
$hasil_normal1 =
$dt2['matrix_berkas']/$nilaik1;
}
if($kategori_2 == "cost"){
$crMin2 =
mysql_query("SELECT min(matrix_ujian) as minK2 FROM matrix");
$arrayMin2 =
mysql_fetch_array($crMin2);
$nilaik2 =
$arrayMin2['minK2'];
$hasil_normal2 =
$nilaik2/$dt2['matrix_ujian'];
} else if($kategori_2 ==
"benefit"){
$crMax2 =
mysql_query("SELECT max(matrix_ujian) as maxK2 FROM matrix");
$arrayMax2 =
mysql_fetch_array($crMax2);
$nilaik2 =
$arrayMax2['maxK2'];
$hasil_normal2 =
$dt2['matrix_ujian']/$nilaik2;
}
if($kategori_3 == "cost"){
$crMin3 =
mysql_query("SELECT min(matrix_usia) as minK3 FROM matrix");
$arrayMin3 =
mysql_fetch_array($crMin3);
$nilaik3 =
$arrayMin3['minK3'];
$hasil_normal3 =
$nilaik3/$dt2['matrix_usia'];
} else if($kategori_3 ==
"benefit"){
$crMax3 =
mysql_query("SELECT max(matrix_usia) as maxK3 FROM matrix");
$arrayMax3 =
mysql_fetch_array($crMax3);
$nilaik3 =
$arrayMax3['maxK3'];
$hasil_normal3 =
$dt2['matrix_usia']/$nilaik3;
}
if($kategori_4 == "cost"){

$crMin4 =
mysql_query("SELECT min(matrix_wawancara) as minK4 FROM matrix");
$arrayMin4 =
mysql_fetch_array($crMin4);
$nilaik4 =
$arrayMin4['minK4'];
$hasil_normal4 =
$nilaik4/$dt2['matrix_wawancara'];
} else if($kategori_4 ==
"benefit"){
$crMax4 =
mysql_query("SELECT max(matrix_wawancara) as maxK4 FROM matrix");
$arrayMax4 =
mysql_fetch_array($crMax4);
$nilaik4 =
$arrayMax4['maxK4'];
$hasil_normal4 =
$dt2['matrix_wawancara']/$nilaik4;
}
if($kategori_5 == "cost"){
$crMin5 =
mysql_query("SELECT min(matrix_pengalaman_kerja) as minK5 FROM matrix");
$arrayMin5 =
mysql_fetch_array($crMin5);
$nilaik5 =
$arrayMin5['minK5'];
$hasil_normal5 =
$nilaik5/$dt2['matrix_pengalaman_kerja'];
} else if($kategori_5 ==
"benefit"){
$crMax5 =
mysql_query("SELECT max(matrix_pengalaman_kerja) as maxK5 FROM matrix");
$arrayMax5 =
mysql_fetch_array($crMax5);
$nilaik5 =
$arrayMax5['maxK5'];
$hasil_normal5 =
$dt2['matrix_pengalaman_kerja']/$nilaik5;
}
$no++;
}
$sql3 = mysql_query("SELECT a.*,b.* FROM matrix a, pelamar b
where a.id_pelamar=b.id_pelamar order by a.id_pelamar ASC");
$no = 1;

while ($dt3 =
mysql_fetch_array($sql3)) {
$id_pelamar3 =
$dt3['id_pelamar'];
if($kategori_1 == "cost"){
$crMin1 =
mysql_query("SELECT min(matrix_berkas) as minK1 FROM matrix");
$arrayMin1 =
mysql_fetch_array($crMin1);
$nilaik1 =
$arrayMin1['minK1'];
$hasil_normal1 =
$nilaik1/$dt3['matrix_berkas'];
} else
if($kategori_1 == "benefit"){
$crMax1 =
mysql_query("SELECT max(matrix_berkas) as maxK1 FROM matrix");
$arrayMax1 =
mysql_fetch_array($crMax1);
$nilaik1 =
$arrayMax1['maxK1'];
$hasil_normal1 =
$dt3['matrix_berkas']/$nilaik1;
}
if($kategori_2 == "cost"){
$crMin2 =
mysql_query("SELECT min(matrix_ujian) as minK2 FROM matrix");
$arrayMin2 =
mysql_fetch_array($crMin2);
$nilaik2 =
$arrayMin2['minK2'];
$hasil_normal2 =
$nilaik2/$dt3['matrix_ujian'];
} else
if($kategori_2 == "benefit"){
$crMax2 =
mysql_query("SELECT max(matrix_ujian) as maxK2 FROM matrix");
$arrayMax2 =
mysql_fetch_array($crMax2);
$nilaik2 =
$arrayMax2['maxK2'];
$hasil_normal2 =
$dt3['matrix_ujian']/$nilaik2;
}
if($kategori_3 == "cost"){

$crMin3 =
mysql_query("SELECT min(matrix_usia) as minK3 FROM matrix");
$arrayMin3 =
mysql_fetch_array($crMin3);
$nilaik3 =
$arrayMin3['minK3'];
$hasil_normal3 =
$nilaik3/$dt3['matrix_usia'];
} else
if($kategori_3 == "benefit"){
$crMax3 =
mysql_query("SELECT max(matrix_usia) as maxK3 FROM matrix");
$arrayMax3 =
mysql_fetch_array($crMax3);
$nilaik3 =
$arrayMax3['maxK3'];
$hasil_normal3 =
$dt3['matrix_usia']/$nilaik3;
}
if($kategori_4 == "cost"){
$crMin4 =
mysql_query("SELECT min(matrix_wawancara) as minK4 FROM matrix");
$arrayMin4 =
mysql_fetch_array($crMin4);
$nilaik4 =
$arrayMin4['minK4'];
$hasil_normal4 =
$nilaik4/$dt3['matrix_wawancara'];
} else
if($kategori_4 == "benefit"){
$crMax4 =
mysql_query("SELECT max(matrix_wawancara) as maxK4 FROM matrix");
$arrayMax4 =
mysql_fetch_array($crMax4);
$nilaik4 =
$arrayMax4['maxK4'];
$hasil_normal4 =
$dt3['matrix_wawancara']/$nilaik4;
}
if($kategori_5 == "cost"){
$crMin5 =
mysql_query("SELECT min(matrix_pengalaman_kerja) as minK5 FROM matrix");
$arrayMin5 =
mysql_fetch_array($crMin5);
$nilaik5 =
$arrayMin5['minK5'];

$hasil_normal5 =
$nilaik5/$dt3['matrix_pengalaman_kerja'];
} else
if($kategori_5 == "benefit"){
$crMax5 =
mysql_query("SELECT max(matrix_pengalaman_kerja) as maxK5 FROM matrix");
$arrayMax5 =
mysql_fetch_array($crMax5);
$nilaik5 =
$arrayMax5['maxK5'];
$hasil_normal5 =
$dt3['matrix_pengalaman_kerja']/$nilaik5;
}
$hasil =
($hasil_normal1*$bobot_1)+($hasil_normal2*$bobot_2)+
($hasil_normal3*$bobot_3)+
($hasil_normal4*$bobot_4)+($hasil_normal5*$bobot_5);
$sql_cek_hasil = mysql_query("SELECT * FROM hasil_saw
WHERE id_pelamar='$id_pelamar3'");
if(mysql_num_rows($sql_cek_hasil)){
echo '';
}
else {
$insert_hasil = mysql_query("INSERT INTO
hasil_saw VALUES ('','$id_pelamar3', '$hasil')");
}
$no++;
}
?>

<table width="1046" align="center">


<tr>
<th width="390" align="left" class="table-header-repeat line-left minwidth1"><p><img src="gambar/gambar.png" width="200" height="91" /></p></th>
<th width="628" align="right" class="table-header-repeat line-left minwidth1"><p>PTPN IV Medan PERpelamarAN </p>
<p>LAPORAN : DATA HASIL PERANGKINGAN POSYANDU DENGAN
METODE SAW</p></th>
<th width="12" class="table-header-repeat line-left minwidth-1">&nbsp;</th>
</tr>
</table>
<?php

include('koneksi.php');

?>
<br />
<table width="1046" align="center" class="hovertable">
<tr>
<th>Peringkat</th>
<th>Nama pelamar</th>
<th>Nilai SAW</th>
<th>Nilai SPK</th>
</tr>
<?php
$i=1;
$sql_pelamar_hasil = mysql_query("select a.*,b.* from
pelamar a, hasil_saw b WHERE a.id_pelamar=b.id_pelamar order by b.nilai_saw
desc") or die(mysql_error());
while($array_pelamar_hasil =
mysql_fetch_array($sql_pelamar_hasil)){
if ($i <= 8) {
$spk1 = "Lulus";
}else{
$spk1 ="Tidak Lulus";
}
?>
<tr>
<td><?php echo $i;?></td>
<td><?php echo
$array_pelamar_hasil['nama_pelamar'];?></td>
<td><span style="color:#F00"><?php echo
$array_pelamar_hasil['nilai_saw'];?></span></td>
<td><?php echo $spk1 ?></td>
</tr>
<?php $i++; } ?>
</table>
<p>&nbsp;</p>
<table width="1046" align="center" class="hovertable2">
<tr>
<th colspan="3" class="table-header-repeat line-left minwidth-1">&nbsp;</th>

<th width="358" class="table-header-repeat line-left minwidth-1"><p>Medan, <?


php echo date("d-m-Y");?></p>
<p><br />
Pimpinan,</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>(...................................)</p>
<p></p></th>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
27. Proses_ranking.php
<?php error_reporting(0);
include 'koneksi.php';
$delete_matrix = mysql_query("DELETE FROM matrix");
$delete_matrix2 = mysql_query("DELETE FROM hasil_saw");
$kriteria1 = array();
$bobot1 = array();
$kategori1 = array();
$result = mysql_query("SELECT * FROM kriteria ORDER BY id_kriteria
ASC");
$sql_kriteria = mysql_query("SELECT * FROM kriteria ORDER BY
id_kriteria ASC");
$kr=1;
while($array_kriteria = mysql_fetch_array($sql_kriteria)){
$kriteria1 = array($kr=>$array_kriteria['id_kriteria']);
$kriteria_1 .= $kriteria1[1];
$kriteria_2 .= $kriteria1[2];
$kriteria_3 .= $kriteria1[3];
$kriteria_4 .= $kriteria1[4];
$kriteria_5 .= $kriteria1[5];
$bobot1 = array($kr=>$array_kriteria['bobot']);
$bobot_1 .= $bobot1[1];
$bobot_2 .= $bobot1[2];
$bobot_3 .= $bobot1[3];
$bobot_4 .= $bobot1[4];
$bobot_5 .= $bobot1[5];

$kategori1 = array($kr=>$array_kriteria['kategori']);
$kategori_1 .= $kategori1[1];
$kategori_2 .= $kategori1[2];
$kategori_3 .= $kategori1[3];
$kategori_4 .= $kategori1[4];
$kategori_5 .= $kategori1[5];
$kr++;
}
$bobot_1 = $bobot_1 / 100;
$bobot_2 = $bobot_2 / 100;
$bobot_3 = $bobot_3 / 100;
$bobot_4 = $bobot_4 / 100;
$bobot_5 = $bobot_5 / 100;
$bobot_6 = $bobot_6 / 100;
$bobot_7 = $bobot_7 / 100;
$bobot_8 = $bobot_8 / 100;
$sql_pelamar = mysql_query("SELECT * FROM pelamar ORDER BY
id_pelamar ASC");
while($array_pelamar=mysql_fetch_array($sql_pelamar)){
$id_pelamar = $array_pelamar['id_pelamar'];
$sql_kriteria_pelamar_1 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_1' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar_1 =
mysql_fetch_array($sql_kriteria_pelamar_1);
if($array_kriteria_pelamar_1['nilai'] == "Lengkap"){
$nilai1 = 1;
}
else if($array_kriteria_pelamar_1['nilai'] == "Tidak Lengkap"){
$nilai1 = 0.5;
}
$sql_kriteria_pelamar_2 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_2' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar2 =
mysql_fetch_array($sql_kriteria_pelamar_2);
if($array_kriteria_pelamar2['nilai'] >= 81){
$nilai2 = 1;
}
else if($array_kriteria_pelamar2['nilai'] >= 71){

$nilai2 = 0.8;
}
else if($array_kriteria_pelamar2['nilai'] >= 61){
$nilai2 = 0.6;
}
else if($array_kriteria_pelamar2['nilai'] >= 51){
$nilai2 = 0.4;
}
else if($array_kriteria_pelamar2['nilai'] < 51){
$nilai2 = 0.2;
}
$sql_kriteria_pelamar_3 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_3' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar3 =
mysql_fetch_array($sql_kriteria_pelamar_3);
if($array_kriteria_pelamar3['nilai'] >= 32){
$nilai3 = 0.2;
}
else if($array_kriteria_pelamar3['nilai'] >= 28){
$nilai3 = 0.4;
}
else if($array_kriteria_pelamar3['nilai'] >= 24){
$nilai3 = 0.7;
}
else if($array_kriteria_pelamar3['nilai'] < 24){
$nilai3 = 1;
}
$sql_kriteria_pelamar_4 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_4' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar4 =
mysql_fetch_array($sql_kriteria_pelamar_4);
if($array_kriteria_pelamar4['nilai'] >= 81){
$nilai4 = 1;
}
else if($array_kriteria_pelamar4['nilai'] >= 71){
$nilai4 = 0.8;
}
else if($array_kriteria_pelamar4['nilai'] >= 61){
$nilai4 = 0.6;
}
else if($array_kriteria_pelamar4['nilai'] >= 51){
$nilai4 = 0.4;
}
else if($array_kriteria_pelamar4['nilai'] < 51){
$nilai4 = 0.2;

}
$sql_kriteria_pelamar_5 = mysql_query("SELECT * FROM
kriteria_pelamar WHERE id_kriteria='$kriteria_5' and id_pelamar='$id_pelamar'");
$array_kriteria_pelamar5 =
mysql_fetch_array($sql_kriteria_pelamar_5);
if($array_kriteria_pelamar5['nilai'] >= 48){
$nilai5 = 1;
}
else if($array_kriteria_pelamar5['nilai'] >= 32){
$nilai5 = 0.8;
}
else if($array_kriteria_pelamar5['nilai'] >= 20){
$nilai5 = 0.6;
}
else if($array_kriteria_pelamar5['nilai'] >= 12){
$nilai5 = 0.4;
}
else if($array_kriteria_pelamar5['nilai'] < 12){
$nilai5 = 0.2;
}
$sql_cek = mysql_query("SELECT * FROM matrix WHERE
id_pelamar='$id_pelamar'") or die(mysql_error());
if(mysql_num_rows($sql_cek)){
echo '';
} else {
$sql_insert_matrix = mysql_query("INSERT INTO matrix VALUES
('', '$id_pelamar','$nilai1','$nilai2','$nilai3','$nilai4', '$nilai5')") or die(mysql_error());
}
}
$j=1;
$sql_pelamar_matrix = mysql_query("select a.*,b.* from pelamar a, matrix b
WHERE a.id_pelamar=b.id_pelamar order by b.id_pelamar asc");
while($array_pelamar_matrix = mysql_fetch_array($sql_pelamar_matrix)){
?>
<?php
$j++;
}
if($kategori_1 == "cost"){
$crMin1 = mysql_query("SELECT min(matrix_berkas)
as minK1 FROM matrix");
$arrayMin1 = mysql_fetch_array($crMin1);
$nilaik1 = $arrayMin1['minK1'];

} else if($kategori_1 == "benefit"){


$crMax1 = mysql_query("SELECT
max(matrix_berkas) as maxK1 FROM matrix");
$arrayMax1 = mysql_fetch_array($crMax1);
$nilaik1 = $arrayMax1['maxK1'];
}
if($kategori_2 == "cost"){
$crMin2 = mysql_query("SELECT min(matrix_ujian)
as minK2 FROM matrix");
$arrayMin2 = mysql_fetch_array($crMin2);
$nilaik2 = $arrayMin2['minK2'];
} else if($kategori_2 == "benefit"){
$crMax2 = mysql_query("SELECT max(matrix_ujian)
as maxK2 FROM matrix");
$arrayMax2 = mysql_fetch_array($crMax2);
$nilaik2 = $arrayMax2['maxK2'];
}
if($kategori_3 == "cost"){
$crMin3 = mysql_query("SELECT min(matrix_usia) as
minK3 FROM matrix");
$arrayMin3 = mysql_fetch_array($crMin3);
$nilaik3 = $arrayMin3['minK3'];
} else if($kategori_3 == "benefit"){
$crMax3 = mysql_query("SELECT max(matrix_usia)
as maxK3 FROM matrix");
$arrayMax3 = mysql_fetch_array($crMax3);
$nilaik3 = $arrayMax3['maxK3'];
}
if($kategori_4 == "cost"){
$crMin4 = mysql_query("SELECT
min(matrix_wawancara) as minK4 FROM matrix");
$arrayMin4 = mysql_fetch_array($crMin4);
$nilaik4 = $arrayMin4['minK4'];
} else if($kategori_4 == "benefit"){
$crMax4 = mysql_query("SELECT
max(matrix_wawancara) as maxK4 FROM matrix");
$arrayMax4 = mysql_fetch_array($crMax4);
$nilaik4 = $arrayMax4['maxK4'];
}
if($kategori_5 == "cost"){
$crMin5 = mysql_query("SELECT
min(matrix_pengalaman_kerja) as minK5 FROM matrix");

$arrayMin5 = mysql_fetch_array($crMin5);
$nilaik5 = $arrayMin5['minK5'];
} else if($kategori_5 == "benefit"){
$crMax5 = mysql_query("SELECT
max(matrix_pengalaman_kerja) as maxK5 FROM matrix");
$arrayMax5 = mysql_fetch_array($crMax5);
$nilaik5 = $arrayMax5['maxK5'];
}
$sql2 = mysql_query("SELECT a.*,b.* FROM matrix a,
pelamar b where a.id_pelamar=b.id_pelamar order by a.id_pelamar ASC");
?>
<?php
$no = 1;
while ($dt2 =
mysql_fetch_array($sql2)) {
if($kategori_1 == "cost"){
$crMin1 =
mysql_query("SELECT min(matrix_berkas) as minK1 FROM matrix");
$arrayMin1 =
mysql_fetch_array($crMin1);
$nilaik1 =
$arrayMin1['minK1'];
$hasil_normal1 =
$nilaik1/$dt2['matrix_berkas'];
} else if($kategori_1 ==
"benefit"){
$crMax1 =
mysql_query("SELECT max(matrix_berkas) as maxK1 FROM matrix");
$arrayMax1 =
mysql_fetch_array($crMax1);
$nilaik1 =
$arrayMax1['maxK1'];
$hasil_normal1 =
$dt2['matrix_berkas']/$nilaik1;
}
if($kategori_2 == "cost"){
$crMin2 =
mysql_query("SELECT min(matrix_ujian) as minK2 FROM matrix");
$arrayMin2 =
mysql_fetch_array($crMin2);
$nilaik2 =
$arrayMin2['minK2'];
$hasil_normal2 =
$nilaik2/$dt2['matrix_ujian'];

} else if($kategori_2 ==
"benefit"){
$crMax2 =
mysql_query("SELECT max(matrix_ujian) as maxK2 FROM matrix");
$arrayMax2 =
mysql_fetch_array($crMax2);
$nilaik2 =
$arrayMax2['maxK2'];
$hasil_normal2 =
$dt2['matrix_ujian']/$nilaik2;
}
if($kategori_3 == "cost"){
$crMin3 =
mysql_query("SELECT min(matrix_usia) as minK3 FROM matrix");
$arrayMin3 =
mysql_fetch_array($crMin3);
$nilaik3 =
$arrayMin3['minK3'];
$hasil_normal3 =
$nilaik3/$dt2['matrix_usia'];
} else if($kategori_3 ==
"benefit"){
$crMax3 =
mysql_query("SELECT max(matrix_usia) as maxK3 FROM matrix");
$arrayMax3 =
mysql_fetch_array($crMax3);
$nilaik3 =
$arrayMax3['maxK3'];
$hasil_normal3 =
$dt2['matrix_usia']/$nilaik3;
}
if($kategori_4 == "cost"){
$crMin4 =
mysql_query("SELECT min(matrix_wawancara) as minK4 FROM matrix");
$arrayMin4 =
mysql_fetch_array($crMin4);
$nilaik4 =
$arrayMin4['minK4'];
$hasil_normal4 =
$nilaik4/$dt2['matrix_wawancara'];
} else if($kategori_4 ==
"benefit"){
$crMax4 =
mysql_query("SELECT max(matrix_wawancara) as maxK4 FROM matrix");
$arrayMax4 =
mysql_fetch_array($crMax4);

$nilaik4 =
$arrayMax4['maxK4'];
$hasil_normal4 =
$dt2['matrix_wawancara']/$nilaik4;
}
if($kategori_5 == "cost"){
$crMin5 =
mysql_query("SELECT min(matrix_pengalaman_kerja) as minK5 FROM matrix");
$arrayMin5 =
mysql_fetch_array($crMin5);
$nilaik5 =
$arrayMin5['minK5'];
$hasil_normal5 =
$nilaik5/$dt2['matrix_pengalaman_kerja'];
} else if($kategori_5 ==
"benefit"){
$crMax5 =
mysql_query("SELECT max(matrix_pengalaman_kerja) as maxK5 FROM matrix");
$arrayMax5 =
mysql_fetch_array($crMax5);
$nilaik5 =
$arrayMax5['maxK5'];
$hasil_normal5 =
$dt2['matrix_pengalaman_kerja']/$nilaik5;
}
$no++;
}
$sql3 = mysql_query("SELECT a.*,b.* FROM matrix a, pelamar b where
a.id_pelamar=b.id_pelamar order by a.id_pelamar ASC");
$no = 1;
while ($dt3 =
mysql_fetch_array($sql3)) {
$id_pelamar3 =
$dt3['id_pelamar'];
if($kategori_1 == "cost"){
$crMin1 =
mysql_query("SELECT min(matrix_berkas) as minK1 FROM matrix");
$arrayMin1 =
mysql_fetch_array($crMin1);
$nilaik1 =
$arrayMin1['minK1'];
$hasil_normal1 =
$nilaik1/$dt3['matrix_berkas'];

} else
if($kategori_1 == "benefit"){
$crMax1 =
mysql_query("SELECT max(matrix_berkas) as maxK1 FROM matrix");
$arrayMax1 =
mysql_fetch_array($crMax1);
$nilaik1 =
$arrayMax1['maxK1'];
$hasil_normal1 =
$dt3['matrix_berkas']/$nilaik1;
}
if($kategori_2 == "cost"){
$crMin2 =
mysql_query("SELECT min(matrix_ujian) as minK2 FROM matrix");
$arrayMin2 =
mysql_fetch_array($crMin2);
$nilaik2 =
$arrayMin2['minK2'];
$hasil_normal2 =
$nilaik2/$dt3['matrix_ujian'];
} else
if($kategori_2 == "benefit"){
$crMax2 =
mysql_query("SELECT max(matrix_ujian) as maxK2 FROM matrix");
$arrayMax2 =
mysql_fetch_array($crMax2);
$nilaik2 =
$arrayMax2['maxK2'];
$hasil_normal2 =
$dt3['matrix_ujian']/$nilaik2;
}
if($kategori_3 == "cost"){
$crMin3 =
mysql_query("SELECT min(matrix_usia) as minK3 FROM matrix");
$arrayMin3 =
mysql_fetch_array($crMin3);
$nilaik3 =
$arrayMin3['minK3'];
$hasil_normal3 =
$nilaik3/$dt3['matrix_usia'];
} else
if($kategori_3 == "benefit"){
$crMax3 =
mysql_query("SELECT max(matrix_usia) as maxK3 FROM matrix");
$arrayMax3 =
mysql_fetch_array($crMax3);

$nilaik3 =
$arrayMax3['maxK3'];
$hasil_normal3 =
$dt3['matrix_usia']/$nilaik3;
}
if($kategori_4 == "cost"){
$crMin4 =
mysql_query("SELECT min(matrix_wawancara) as minK4 FROM matrix");
$arrayMin4 =
mysql_fetch_array($crMin4);
$nilaik4 =
$arrayMin4['minK4'];
$hasil_normal4 =
$nilaik4/$dt3['matrix_wawancara'];
} else
if($kategori_4 == "benefit"){
$crMax4 =
mysql_query("SELECT max(matrix_wawancara) as maxK4 FROM matrix");
$arrayMax4 =
mysql_fetch_array($crMax4);
$nilaik4 =
$arrayMax4['maxK4'];
$hasil_normal4 =
$dt3['matrix_wawancara']/$nilaik4;
}
if($kategori_5 == "cost"){
$crMin5 =
mysql_query("SELECT min(matrix_pengalaman_kerja) as minK5 FROM matrix");
$arrayMin5 =
mysql_fetch_array($crMin5);
$nilaik5 =
$arrayMin5['minK5'];
$hasil_normal5 =
$nilaik5/$dt3['matrix_pengalaman_kerja'];
} else
if($kategori_5 == "benefit"){
$crMax5 =
mysql_query("SELECT max(matrix_pengalaman_kerja) as maxK5 FROM matrix");
$arrayMax5 =
mysql_fetch_array($crMax5);
$nilaik5 =
$arrayMax5['maxK5'];
$hasil_normal5 =
$dt3['matrix_pengalaman_kerja']/$nilaik5;
}

$hasil = ($hasil_normal1*$bobot_1)+
($hasil_normal2*$bobot_2)+($hasil_normal3*$bobot_3)+
($hasil_normal4*$bobot_4)+($hasil_normal5*$bobot_5);
$sql_cek_hasil = mysql_query("SELECT * FROM hasil_saw WHERE
id_pelamar='$id_pelamar3'");
if(mysql_num_rows($sql_cek_hasil)){
echo '';
}
else {
$insert_hasil = mysql_query("INSERT INTO hasil_saw
VALUES ('','$id_pelamar3', '$hasil')");
}
$no++;
}
?>
<div class="box">
<div class="box-header">
<h3 class="box-title">Proses Akhir Perangkingan Dengan Metode
SAW</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Peringkat</th>
<th>Nama pelamar</th>
<th>Nilai SAW</th>
</tr>
</thead>
<?php
$j=1;
$sql_pelamar_hasil =
mysql_query("select a.*,b.* from pelamar a, hasil_saw b WHERE
a.id_pelamar=b.id_pelamar order by b.nilai_saw desc");
while($array_pelamar_hasil =
mysql_fetch_array($sql_pelamar_hasil)){
?>

<tbody>
<tr>
<td><?php echo $j;?></td>
<td><?php echo
$array_pelamar_hasil['nama_pelamar'];?></td>
<td><span style="color:#F00"><?php echo
$array_pelamar_hasil['nilai_saw'];?></span></td>
</tr>
</tbody>
<?php
$j++;
}
?>
</table>
<center><a href="cetak_saw.php"
target="_blank">Cetak Hasil Perhitungan</a></center>
</div>
</div>
</div>
</div>
</div>
28. Logout.php
<?php session_start();
session_unset();
session_destroy();
header("location:login.php");
?>