input.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>INPUT</title>
</head>
<body>
<table align="center" border="1">
<form method="post" action="output.php">
<h3 align="center">INPUT</h3>
<tr>
<td>Nim</td>
<td><input type="text" name="nim"></td>
</tr>
<tr>
<td>Nama Mahasiswa</td>
<td><input type="text" name="nama"></td>
</tr>
<tr>
<td>Matakuliah</td>
<td><select name="matkul">
<option value>Pilih Matakuliah</option>
<option value="pemrograman web">pemrograman web</option>
<option value="keamanan jaringan">keamanan jaringan </option>
<option value="kalkulus">Kalkulus </option>
<option value="grafika komputer">grafika komputer </option>
<option value="database terdistribusi">database terdistribusi </option>
<option value="CRM">CRM</option>
</select></td>
</tr>
<tr>
<td>Jumlah Kehadiran</td>
<td><input type="text" name="hadir"></td>
</tr>
<tr>
<td>Nilai Tugas</td>
<td><input type="text" name="tugas"></td>
</tr>
<tr>
<td>Nilai UTS</td>
<td><input type="text" name="uts"></td>
</tr>
<tr>
<td>Nilai UAS</td>
<td><input type="text" name="uas"></td>
</tr>
<tr>
<tr>
<td colspan="2">
<input type="submit" name="proses" value="submit"/>
<input type="reset" name="Reset" value="Reset"/>
</td>
</tr>
</table>
</form>
</body>
</html>
output.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OUTPUT</title>
</head>
<body>
<h3 align="center">OUTPUT</h3>
<?php
$nim=$_POST["nim"];
$nama=$_POST["nama"];
$mk=$_POST["matkul"] ;
$hd=$_POST['hadir'];
$tugas=$_POST['tugas'];
$uts=$_POST['uts'];
$uas=$_POST['uas'];
?>
<?php
$na=(0.10*$hd)+(0.28*$tugas)+(0.35*$uts)+(0.35*$uas);
?>
<?php
if ($na <= 40 )
{
$nh = ‘E’ ;
}
else if ($na <= 50 )
{
$nh = ‘D’ ;
}
else if ($na <= 70 )
{
$nh = ‘C’ ;
}
else if ($na <= 80 )
{
$nh = ‘B’ ;
}
else
{
$nh = ‘A’ ;
}
?>
<table align="center" border="1" width="350">
<stronge>
<tr>
<td>NIM </td>
<td>: <?php echo$nim; ?></td>
<tr>
<td>NAMA</td>
<td>: <?php echo$nama;?></td>
<tr>
<td>MATA KULIAH</td>
<td>: <?php echo$mk; ?></td>
</tr>
<tr>
<td>JUMLAH KEHADIRAN</td>
<td>: <?php echo$hd; ?></td>
</tr>
<tr>
<td>NILAI TUGAS</td>
<td>: <?php echo$tugas;?></td>
</tr>
<tr>
<td>NILAI UTS</td>
<td>: <?php echo$uts;?></td>
</tr>
<tr>
<td>NILAI UAS</td>
<td>: <?php echo$uas;?></td>
</tr>
<tr>
<td>NILAI AKHIR</td>
<td>: <?php echo$na;?></td>
</tr>
<tr>
<td>NILAI HURUF</td>
<td>: <?php echo$nh;?></td>
</tr>
</stronge>
</table>
</body>
</html>
Tidak ada komentar:
Posting Komentar