LAMPIRAN A
DATA
2. Rekomendasi Penilaian
No.
Nilai/Bobot
Rekomendasi Tindakan
Prestasi
1
A / 4
Dipertahankan dan Dapat Diberikan Insentif
Kinerja 100 % Sangat Baik
2
B / 3
Diperhatikan untuk dapat dipertahankan dan
diberikan insentif kinerja 50 % Baik
3
C / 2
Dipertimbangkan untuk diperhatikan pada kinerja berikutnya diberikan insentif kinerja 10
%
Cukup
4
D / 1
Diperhatikan untuk pertimbangan mutasi pada
kinerja berikutnya Kurang
5
E / 0
Diperhatikan untuk pertimbangan
LAMPIRAN B
LISTING PROGRAM
1. Menu
<script src="js/jquery-1.11.1.min.js"></script>
<script>
$(document).ready(function(){
$("p").hide();
$(".data").click(function(){
$(".1").toggle(1000);
});
$(".nilai").click(function(){
$(".2").toggle(1000);
});
$(".topsis").click(function(){
$(".3").toggle(1000);
});
});
</script>
<style>
p{
margin-top:4px ;
margin-bottom:4px ;
}
</style>
<!-- The HTML login form -->
<input type="button" value="DATA" class="data" id="button"><br />
<p class="1"><a href="_data_user.php"><input type="button" value="User"
id="submit"></a></p>
<p class="1"><a href="_data_unit.php"><input type="button" value="Unit"
id="submit"></a></p>
<p
class="1"><a
href="_data_pegawai.php?asc=0"><input
type="button"
value="Pegawai" id="submit"></a></p>
<p
class="1"><a
href="_data_tupoksi.php"><input
type="button"
value="Tupoksi" id="submit"></a></p>
<p class="1"><a href="_data_PM.php"><input type="button" value="Program
Mandiri" id="submit"></a></p>
<p
class="1"><a
href="_data_final.php"><input
type="button"
value="Rekomendasi" id="submit"></a></p>
<input type="button" value="PENILAIAN" class="nilai" id="button"><br />
<p
class="2"><a
href="_nilai_tupoksi.php"><input
type="button"
value="Tupoksi" id="submit"></a></p>
<p class="2"><a href="_nilai_PM.php"><input type="button" value="Program
Mandiri" id="submit"></a></p>
<input type="button" value="TOPSIS" class="topsis" id="button"><br />
<p class="3"><a href="_topsis_PM.php"><input type="button" value="Program
Mandiri" id="submit"></a></p>
<p
class="3"><a
href="_topsis_tupoksi.php"><input
type="button"
value="Tupoksi" id="submit"></a></p>
<p class="3"><a href="_topsis_akhir.php"><input type="button" value="Hasil
Akhir" id="submit"></a></p>
<a href="index.php"><input type="button" value="Log Out" id="submit"></a>
</form>
<script>
function isNumberKey(evt){
var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false;
return true; }
</script>
<!DOCTYPE html> <body>
<?php
error_reporting(E_ERROR | E_PARSE); $servername = "localhost";
$username = "root"; $password = ""; $dbname = "topsis";
// Connect to server and select database.
$conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error); }
// get value of id that sent from address bar $id=$_GET['id'];
if($id == NULL){
echo "<script>window.location='../_topsis_Tupoksi.php'</script>" ; }
if (date("n") >= 1 && date("n") <= 6){
$peri = "Periode Awal " . date("Y") ;
$del = "A". date("Y") ;
}else{
$peri = "Periode Akhir " . date("Y") ;
$del = "B". date("Y") ;
}
// define variables and set to empty values for($i=0;$i<21;$i++){
${'bot'.$i} = "" ; }
// Retrieve wight data from database
$sql="SELECT * FROM bobot WHERE id = '$id'"; $result = $conn->query($sql);
if ($result->num_rows > 0) { // output data of each row
$f0 = $row['a0']; $f1 = $row['a1']; $f2 = $row['a2']; $f3 = $row['a3']; $f4 = $row['a4']; $f5 = $row['a5']; $f6 = $row['a6']; $f7 = $row['a7']; $f8 = $row['a8']; $f9 = $row['a9']; $f10 = $row['a10']; $f11 = $row['a11']; $f12 = $row['a12']; $f13 = $row['a13']; $f14 = $row['a14']; $f15 = $row['a15']; $f16 = $row['a16']; $f17 = $row['a17']; $f18 = $row['a18']; $f19 = $row['a19']; $f20 = $row['a20']; }
} else {
echo "0 results"; }
// Retrieve data from database
$sql="SELECT * FROM tupoksi WHERE id = '$id'"; $result = $conn->query($sql);
?>
<p align="center"><a href='../_topsis_tupoksi.php'><button>Kembali Ke Halaman Tupoksi</button></a></p>
<form method="post" action="">
<table><tr><td align="left" valign="top"> <table cellpadding="7px" border="0"> <tr valign="top">
<?php
if ($result->num_rows > 0) { // output data of each row
while($row = $result->fetch_assoc()) { ?>
<td>
<table border="1" cellpadding="7px"> <tr>
<td align="left" width="500px">Id: <input type="text" disabled="disabled" size="3" value="<?php echo $row['id'] ; ?>" />
Tupoksi: <input type="text" disabled="disabled" value="<?php echo $row['nama'] . " " . $row['unit'] ?>" /></td>
<td align="center" width="10px"></td>
</tr> <tr>
<td class="stylem" bgcolor="#CCCCCC">Poin - Poin Tupoksi</td> <td bgcolor="#CCCCCC"></td>
</tr> <tr> <?php
if ($row['a0'] != NULL){
echo "<td colspan='2'>" . $row['a0'] . "</td><td align='center'>
<input name='bot0' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f0 ."' />
</td></tr>"; $countpo = 1 ; $poin[0] = $row['a0']; }
if ($row['a1'] != NULL){
echo "<tr><td colspan='2'>" . $row['a1'] . "</td><td align='center'> <input name='bot1' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f1 ."' />
</td></tr>"; $countpo = 2 ; $poin[1] = $row['a1']; }
if ($row['a2'] != NULL){
echo "<tr><td colspan='2'>" . $row['a2'] . "</td><td align='center'> <input name='bot2' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f2 ."' />
</td></tr>"; $countpo = 3 ; $poin[2] = $row['a2']; }
if ($row['a3'] != NULL){
echo "<tr><td colspan='2'>" . $row['a3'] . "</td><td align='center'> <input name='bot3' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f3 ."' />
</td></tr>"; $countpo = 4 ; $poin[3] = $row['a3']; }
if ($row['a4'] != NULL){
echo "<tr><td colspan='2'>" . $row['a4'] . "</td><td align='center'> <input name='bot4' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f4 ."' />
</td></tr>"; $countpo = 5 ; $poin[4] = $row['a4']; }
if ($row['a5'] != NULL){
echo "<tr><td colspan='2'>" . $row['a5'] . "</td><td align='center'> <input name='bot5' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f5 ."' />
if ($row['a6'] != NULL){
echo "<tr><td colspan='2'>" . $row['a6'] . "</td><td align='center'> <input name='bot6' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f6 ."' />
</td></tr>"; $countpo = 7 ; $poin[6] = $row['a6']; }
if ($row['a7'] != NULL){
echo "<tr><td colspan='2'>" . $row['a7'] . "</td><td align='center'> <input name='bot7' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f7 ."' />
</td></tr>"; $countpo = 8 ; $poin[7] = $row['a7']; }
if ($row['a8'] != NULL){
echo "<tr><td colspan='2'>" . $row['a8'] . "</td><td align='center'> <input name='bot8' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f8 ."' />
</td></tr>"; $countpo = 9 ; $poin[8] = $row['a8']; }
if ($row['a9'] != NULL){
echo "<tr><td colspan='2'>" . $row['a9'] . "</td><td align='center'> <input name='bot9' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f9 ."' />
</td></tr>"; $countpo = 10 ; $poin[9] = $row['a9']; }
if ($row['a10'] != NULL){
echo "<tr><td colspan='2'>" . $row['a10'] . "</td><td align='center'> <input name='bot10' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f10 ."' />
</td></tr>"; $countpo = 11 ;
$poin[10] = $row['a10']; }
if ($row['a11'] != NULL){
echo "<tr><td colspan='2'>" . $row['a11'] . "</td><td align='center'> <input name='bot11' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f11 ."' />
</td></tr>"; $countpo = 12 ;
$poin[11] = $row['a11']; }
if ($row['a12'] != NULL){
echo "<tr><td colspan='2'>" . $row['a12'] . "</td><td align='center'> <input name='bot12' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f12 ."' />
</td></tr>"; $countpo = 13 ;
}
if ($row['a13'] != NULL){
echo "<tr><td colspan='2'>" . $row['a13'] . "</td><td align='center'> <input name='bot13' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f13 ."' />
</td></tr>"; $countpo = 14 ;
$poin[13] = $row['a13']; }
if ($row['a14'] != NULL){
echo "<tr><td colspan='2'>" . $row['a14'] . "</td><td align='center'> <input name='bot14' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f14 ."' />
</td></tr>"; $countpo = 15 ;
$poin[14] = $row['a14']; }
if ($row['a15'] != NULL){
echo "<tr><td colspan='2'>" . $row['a15'] . "</td><td align='center'> <input name='bot15' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f15 ."' />
</td></tr>"; $countpo = 16 ;
$poin[15] = $row['a15']; }
if ($row['a16'] != NULL){
echo "<tr><td colspan='2'>" . $row['a16'] . "</td><td align='center'> <input name='bot16' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f16 ."' />
</td></tr>"; $countpo = 17 ;
$poin[16] = $row['a16']; }
if ($row['a17'] != NULL){
echo "<tr><td colspan='2'>" . $row['a17'] . "</td><td align='center'> <input name='bot17' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f17 ."' />
</td></tr>"; $countpo = 18 ;
$poin[17] = $row['a17']; }
if ($row['a18'] != NULL){
echo "<tr><td colspan='2'>" . $row['a18'] . "</td><td align='center'> <input name='bot18' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event) placeholder='". $f18 ."' '/>
</td></tr>"; $countpo = 19 ;
$poin[18] = $row['a18']; }
if ($row['a19'] != NULL){
echo "<tr><td colspan='2'>" . $row['a19'] . "</td><td align='center'> <input name='bot19' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f19 ."' />
$poin[19] = $row['a19']; }
if ($row['a20'] != NULL){
echo "<tr><td colspan='2'>" . $row['a20'] . "</td><td align='center'> <input name='bot20' type='text' maxlength='2' size='2' onkeypress='return isNumberKey(event)' placeholder='". $f20 ."' />
</td></tr>"; $countpo = 21 ;
$poin[20] = $row['a20']; }
?> </tr> </table>
<input type="submit" value="Mulai Perhitungan" /> <input type="reset" value="Reset" />
</td> </tr> <tr>
<td colspan="2" align="right"></td> <?php
} } else {
echo "0 results"; }
?> </tr> </table>
</td><td valign="top" align="left" style="padding-top:8px">
<table border="1" cellpadding="7px" style="height: 400px; display: block; overflow: auto; ">
<tr><td colspan="<?php echo $countpo + 1 ;?>" align="center" class="stylem">Table Nilai Pegawai</td>
</tr>
<tr bgcolor="#CCCCCC"><td align="center">Nama</td><?php for($i = 1 ; $i < $countpo + 1 ; $i++){
echo "<td align='center'>P " . $i . "</td>" ; }
$t1 = 0 ;
$sq = "SELECT nama,NIP FROM pegawai WHERE NIP IN(SELECT NIP FROM nilai_tupoksi WHERE id_tupoksi= '$id' AND period='$del') ORDER BY NIP ASC"; $resule = $conn->query($sq);
if ($resule->num_rows > 0) {
while($rows = $resule->fetch_assoc()) {
echo "<tr><td>" .$rows['nama'] . "</td>" ; $id_p = $rows['NIP'] ;
?><input type="hidden" name="nama<?php echo $t1 ?>" value="<?php echo $rows['nama'] ?>" />
<input type="hidden" name="NIP<?php echo $t1 ?>" value="<?php echo $rows['NIP'] ?>" /><?php
$sqls = "SELECT * FROM nilai_tupoksi WHERE NIP='$id_p' AND period='$del'"; $results = $conn->query($sqls); if ($results->num_rows > 0) {
while($rows = $results->fetch_assoc()) {
for($i=0;$i<$countpo;$i++){ echo "<td align='center'>" . $rows['a'.$i] . "</td>" ;
?><input type="hidden" name="a<?php echo $t1.$i ?>" value="<?php echo $rows['a'.$i] ?>" /><?php
} }} echo "</tr>" ;
$peg[] = $rows['nama'] ;
$arr[] = array($peg) ;
$countpeg = count($arr) ; $t1 = $t1 + 1 ;
}} ?>
</tr> </table>
<br />
</td> </tr> </table> <?php
for($a=0;$a<$countpeg;$a++){ ${'nama'.$a} = "" ;
for($i=0;$i<$countpo;$i++){ ${'a'.$a.$i} = 0 ; }}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
for($t=0; $t < $countpo ;$t++){ ${'bot'.$t} = test_input($_POST['bot'.$t]) ; }
for($a=0;$a<$countpeg;$a++){
${'nama'.$a} = test_input($_POST['nama'.$a]) ; ${'NIP'.$a} = test_input($_POST['NIP'.$a]) ; for($i=0;$i<$countpo;$i++){
${'a'.$a.$i} = test_input($_POST['a'.$a.$i]) ; }}
}
function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data;
}
if(${'bot'.$i} == NULL){ $sho = 0 ;}else{ $sho = 1 ;} $showhasil = $sho + $showhasil ;
} ?>
<input name='id_tupoksi' value="<?php echo $id ;?>" type="hidden" /> </form>
<!-- Hasil -->
<?php if($showhasil < $countpo){ echo "Masukkan Seluruh Bobot Nilai</td></tr></table>" ;}?>
<table width="100%" id="hide" <?php if($showhasil < $countpo){echo "style='display:none'" ;} ?>>
<tr>
<td colspan="2"> <!-- Normalisasi --> <?php
// Normalisasi Tahap 1
for( $i = 0 ; $i < $countpo ; $i++ ){ for( $s=0; $s < $countpeg ; $s++){
${'terno'.$i} =
pow(${'a'.$s.$i},2) + ${'terno'.$i} ;
}}
// Normalisasi Tahap 2
for( $i = 0 ; $i < $countpo ; $i++ ){ for( $s=0; $s < $countpeg ; $s++){
${'norm'.$i.$s} =
${'a'.$s.$i}/ sqrt(${'terno'.$i}) ;
}}
?>
<span class="stylen">.Tabel Normalisasi</span> <br />
<table border="1" cellpadding="2" style="height: 400px; display: block; overflow: auto; ">
<tr align="center"><td>Nama</td><?php
for($i=1;$i<$countpo+1;$i++){
echo "<td align='center'>P " . $i . "</td>" ; }
?> </tr>
<?php
for( $s = 0 ; $s < $countpeg ; $s++ ){
echo "<tr><td align='left'>" . ${'nama'.$s} . "</td>" ; for( $i=0; $i < $countpo ; $i++){
echo "<td align='center'>" . ${'norm'.$i.$s}. "</td>" ;
} echo "</tr>"; }
?> </table>
<tr><td colspan="2">
<!-- Normalisasi Terbobot --> <br />
<span class="stylen">.Tabel Normalisasi Terbobot</span> <br />
<?php
for( $i = 0 ; $i < $countpo ; $i++ ){ for( $s=0; $s < $countpeg ; $s++){
${'norbot'.$i.$s} = ${'norm'.$i.$s} * ${'bot'.$i} ;
}} ?>
<table border="1" cellpadding="2" style="height: 400px; display: block; overflow: auto; ">
<tr align="center"><td>Nama</td><?php
for($i=1;$i<$countpo+1;$i++){
echo "<td align='center'>P " . $i . "</td>" ; }
?> </tr>
<?php
for( $s = 0 ; $s < $countpeg ; $s++ ){
echo "<tr><td align='left'>" . ${'nama'.$s} . "</td>" ; for( $i=0; $i < $countpo ; $i++){
echo "<td align='center'>" . ${'norbot'.$i.$s}. "</td>" ;
} echo "</tr>"; }
?> </table>
<!-- Normalisasi Terbobot --> </td></tr>
<tr><td colspan="2">
<!-- Nilai Solusi Ideal Positif & Negatif --> <br />
<span class="stylen">.Tabel Solusi Ideal</span> <br />
<?php
for($i=0;$i<$countpo;$i++){ ${'SolidMin'.$i} = 999 ; }
for( $i = 0 ; $i < $countpo ; $i++ ){
for( $s=0; $s < $countpeg ; $s++){
${'SolidPlus'.$i} = max( ${'norbot'.$i.$s}, ${'SolidPlus'.$i} ) ;
${'SolidMin'.$i} = min( ${'SolidMin'.$i}, ${'norbot'.$i.$s} ) ;
}}
?>
<tr align="center"><td>Solusi Ideal Positif</td><?php for($i=1;$i<$countpo+1;$i++){
echo "<td align='center'>P " . $i . "</td>" ; }
?> </tr>
<tr align="center"><td>A<sup>+</sup></td> <?php
for( $i=0; $i < $countpo ; $i++){
echo "<td align='center'>" . ${'SolidPlus'.$i}. "</td>" ;
} ?>
</tr>
<tr align="center"><td>Solusi Ideal Negatif</td><?php for($i=1;$i<$countpo+1;$i++){
echo "<td align='center'>P " . $i . "</td>" ; }
?> </tr>
<tr align="center"><td>A<sup>-</sup></td> <?php
for( $i=0; $i < $countpo ; $i++){
echo "<td align='center'>" . ${'SolidMin'.$i}. "</td>" ;
} ?>
</tr> </table>
<!-- Nilai Solusi Ideal Positif & Negatif --> </td></tr>
<tr><td width="30%">
<!-- Nilai Separasi Positif dan Negatif --> <br />
<span class="stylen">.Tabel Separasi Positif & Negatif</span> <br />
<?php
for($i=0;$i<$countpeg;$i++){
for($s=0;$s<$countpo;$s++){
${'sqrtP'.$i} = pow( ${'norbot'.$s.$i} - ${'SolidPlus'.$s}, 2 ) + ${'sqrtP'.$i} ; ${'sqrtM'.$i}= pow( ${'norbot'.$s.$i} - ${'SolidMin'.$s}, 2 ) + ${'sqrtM'.$i} ; }
${'SepaPo'.$i} = sqrt ( ${'sqrtP'.$i} ) ; ${'SepaNe'.$i} = sqrt ( ${'sqrtM'.$i} ) ; }
?>
<table border="1" cellpadding="2" style="height: 400px; display: block; overflow: auto; ">
<tr
align="center"><td>Nama</td><td>S<sup>+</sup></td><td>S<sup>-</sup></td></tr> <?php
for( $s = 0 ; $s < $countpeg ; $s++ ){
echo "<td align='center'>" . ${'SepaNe'.$s}. "</td>" ;
echo "</tr>"; }
?> </table>
<!-- Nilai Separasi Positif dan Negatif -->
</td><td align="left" valign="top" width="70%"> <!-- Nilai C+ -->
<br />
<span class="stylen">.Tabel Kedekatan Relatif dengan Solusi Ideal</span> <br />
<?php
for($i=0;$i<$countpeg;$i++){
${'Rela'.$i} = ${'SepaNe'.$i} / ( ${'SepaNe'.$i} + ${'SepaPo'.$i} ) ;
} ?>
<table border="1" cellpadding="2" style="height: 400px; display: block; overflow: auto; ">
<tr align="center"><td>Nama</td><td>C<sup>+</sup></td><td style="border:none; position:absolute">
<a href="../urutanTupo.php"><button type="button">Urutkan Nilai</button></a></td>
</tr> <?php
for( $s = 0 ; $s < $countpeg ; $s++ ){
echo "<tr><td align='left'>" . ${'nama'.$s} . "</td>" ; echo "<td align='center'>" . ${'Rela'.$s}. "</td>" ; echo "</tr>";
}
?> </table>
</td></tr></table> <?php
$conn->close(); ?>
<?php
if($showhasil < $countpo){ echo " " ;}else{
mysql_connect("localhost", "root", "")or die("cannot connect"); mysql_select_db("topsis")or die("cannot select DB");
for($i = 0; $i < $countpeg; $i++){
$sqs="UPDATE nilai_fin SET a1=${'Rela'.$i} WHERE NIP=${'NIP'.$i}";
$result=mysql_query($sqs)or die ("ERROR");
}
//another one
mysql_connect("localhost", "root", "")or die("cannot connect"); mysql_select_db("topsis")or die("cannot select DB");
$sqb="UPDATE bobot SET
8='$bot8',a9='$bot9',
a10='$bot10',a11='$bot11',a12='$bot12',a13='$bot13',a14='$bot14',a15='$bot15',a16='$b ot16',a17='$bot17',a18='$bot18',a19='$bot19',a20='$bot20' WHERE id = '$id'";
$resulb=mysql_query($sqb)or die ("ERROR");
} ?>
<!-- Nilai C+ --> <!-- Hasil -->