Again, the simulation based on PHP. but for this post I try to share a tutorial / how to make the application.
considering and weighing because a lot of requests from friends who wanted the program, then there is no harm on this occasion I will guide how to make it. This application is actually very simple and easy to make, especially if your friends are already familiar with PHP, I'm sure it can in an instant. For it here I just wanted to share it with who have not mastered PHP.
Step One:
Download and Install XAMPP
Understanding how to read this post / Introduction On How To Install XAMPP and its
First Instance if the step is complete copy the script below.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simulasi Masuk SMPN Favorit di Kota Banjarnegara</title>
</head>
<body>
<table width="350" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="hasilnya.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Simulasi Masuk SMPN Favorit di Kota Banjarnegara </strong></td>
</tr>
<tr>
<td width="109">Nama Lengkap</td>
<td width="7">:</td>
<td width="210"><input name="nama" type="text" id="nama"></td>
</tr>
<tr>
<td>Matematika</td>
<td>:</td>
<td><input name="mtk" type="text" id="mtk" size="5" />
*Contoh: 8.5</td>
</tr>
<tr>
<td>Bhs.Indonesia</td>
<td>:</td>
<td><input name="ina" type="text" id="ina" size="5" />
*Contoh: 8.5</td>
</tr>
<tr>
<td>Sains</td>
<td>:</td>
<td><input name="ipa" type="text" id="ipa" size="5" />
*Contoh: 8.5</td>
</tr>
<tr>
<td>Pilihan ke 1</td>
<td>:</td>
<td><select name="pil_satu" class="select" id="select1">
<option>SMP N Pilihan ke-1</option>
<option value="SMP N 1 Banjarnegara">SMP N 1 Banjarnegara</option>
<option value="SMP N 2 Banjarnegara">SMP N 2 Banjarnegara</option>
<option value="SMP N 3 Banjarnegara">SMP N 3 Banjarnegara</option>
</select></td>
</tr>
<tr>
<td>Pilihan ke 2</td>
<td>:</td>
<td><select name="pil_dua" class="select" id="select2">
<option>SMP N Pilihan ke-2</option>
<option value="SMP N 1 Banjarnegara">SMP N 1 Banjarnegara</option>
<option value="SMP N 2 Banjarnegara">SMP N 2 Banjarnegara</option>
<option value="SMP N 3 Banjarnegara">SMP N 3 Banjarnegara</option>
</select></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Proses" style="cursor:pointer;" value="Proses Simulasi"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</body>
</html>
Open the Notepad application, and Paste (Ctrl v)
Save as in the form of a file like this:
File name : index.php
Save as Type : All Files
Encoding : UTF-8
Note:
Replace the text in red according to the school in your town!
The next step:
Do it like the way the above - Copy and Paste the script below.
if(isset($_POST['Proses']))
{
/*****************************************************************/
// untuk menampilkan nama siswa
$nama = $_POST['nama'];
// Untuk menampilkan nilai matematika
$mtk = $_POST['mtk'];
// Untuk menampilkan nilai bahasa indonesia
$ina = $_POST['ina'];
// Untuk menampilkan nilai ipa
$ipa = $_POST['ipa'];
// Untuk menampilkan pilihan pertama
$pil_satu = $_POST['pil_satu'];
// Untuk menampilkan pilihan kedua
$pil_dua = $_POST['pil_dua'];
// Untuk memproses penjumlahan nilai dari matematika + bhs indonesia + sains / ipa
$jumlahkan = $mtk + $ina + $ipa;
// Hasil penjumlahan = nilai
$nilai = $jumlahkan;
// pesan error
if(($pil_satu == null))
echo "<script language='javascript'>alert('Maaf...Pilihan Sekolah ke 1 Harus di isi'); window.location.href='javascript:history.back()'</script>";
else if(($pil_dua == null))
echo "<script language='javascript'>alert('Maaf...Pilihan Sekolah ke 2 Harus di isi'); window.location.href='javascript:history.back()'</script>";
else if(($nama == null))
echo "<script language='javascript'>alert('Maaf... Nama Kamu Harus di isi'); window.location.href='javascript:history.back()'</script>";
//JUDUL SIMULASINYA
echo"<title>Simulasi Nilai dari ".$nama."</title>";
// MEMBUAT TABEL NILAI YANG AKAN DI TAMPILKAN
echo"
<h2>Hasil Simulasi Masuk SMP N Favorit a/n $nama</h2>
<table width='400' border='0' cellpadding='0' cellspacing='3'>
<tr>
<td width='129' height='20'>Matematika</td>
<td width='255'>: $mtk</td>
</tr>
<tr>
<td height='20'>Bahasa Indonesia</td>
<td>: $ina</td>
</tr>
<tr>
<td height='20'>Sains</td>
<td>: $ipa</td>
</tr>
<tr>
<td><strong>Total Nilai</strong></td>
<td><font color=\"#FF0000\"><strong>: $nilai</strong></font></td>
</tr>
</table>";
// PASSING GRADE DARI 3 SMP FAVORIT
$PG_SMP1= '28.9';
$PG_SMP2= '26.7';
$PG_SMP3= '27.5';
// MENGHITUNG PROSENTASE PELUANG DITERIMA
$persen_SMP1 = number_format($nilai*100/$PG_SMP1 ,1);
$persen_SMP2 = number_format($nilai*100/$PG_SMP2 ,1);
$persen_SMP3 = number_format($nilai*100/$PG_SMP3 ,1);
// Keterangan Pilihan
$pilihan_1='Pilihan ke 1 : <b>'.$pil_satu.'</b>';
$pilihan_2='Pilihan ke 2 : <b>'.$pil_dua.'</b>';
// KETERANGAN DITERIMA / DITOLAK DI SMP YANG DIPILIH OLEH SISWA
$terima='<font color=blue><b>( DI TERIMA )</b></font> :';
$tolak='<font color=red><b>( BELUM DI TERIMA )</b></font> :';
// menampilkan batas nilai minimal
$ket='Minimal Nilai UASBN yang harus di raih oleh '.$nama.' :';
// MENAMPILKAN PELUANG
$peluang1='- Peluang diterima di '.$pil_satu.' :';
$peluang2='- Peluang diterima di '.$pil_dua.' :';
// SMP N 1 Banjarnegara
if(($pil_satu == 'SMP N 1 Banjarnegara')&&($nilai >= $PG_SMP1)) echo "$pilihan_1 <br>$ket <b> $PG_SMP1 </b> $peluang1 <b> $persen_SMP1 % </b> $terima <br>"; else if(($pil_satu == 'SMP N 1 Banjarnegara')&&($nilai <= $PG_SMP1)) echo "$pilihan_1 <br>$ket <b> $PG_SMP1 </b> $peluang1 <b> $persen_SMP1 % </b> $tolak <br>";
// SMP N 2 Banjarnegara
if(($pil_satu == 'SMP N 2 Banjarnegara')&&($nilai >= $PG_SMP2)) echo "$pilihan_1 <br>$ket <b> $PG_SMP2 </b> $peluang1 <b> $persen_SMP2 % </b> $terima <br>"; else if(($pil_satu == 'SMP N 2 Banjarnegara')&&($nilai <= $PG_SMP2)) echo "$pilihan_1 <br>$ket <b> $PG_SMP2 </b> $peluang1 <b> $persen_SMP2 % </b> $tolak <br>";
// SMP N 3 Banjarnegara
if(($pil_satu == 'SMP N 3 Banjarnegara')&&($nilai >= $PG_SMP3)) echo "$pilihan_1 <br>$ket <b> $PG_SMP3 </b> $peluang1 <b> $persen_SMP3 % </b> $terima <br>"; else if(($pil_satu == 'SMP N 3 Banjarnegara')&&($nilai <= $PG_SMP3)) echo "$pilihan_1 <br>$ket <b> $PG_SMP3 </b> $peluang1 <b> $persen_SMP3 % </b> $tolak <br>";
// SMP N 1 Banjarnegara
if(($pil_dua == 'SMP N 1 Banjarnegara')&&($nilai >= $PG_SMP1)) echo "$pilihan_2 <br>$ket <b> $PG_SMP1 </b> $peluang2 <b> $persen_SMP1 % </b> $terima <br>"; else if(($pil_dua == 'SMP N 1 Banjarnegara')&&($nilai <= $PG_SMP1)) echo "$pilihan_2 <br>$ket <b> $PG_SMP1 </b> $peluang2 <b> $persen_SMP1 % </b> $tolak <br>";
// SMP N 2 Banjarnegara
if(($pil_dua == 'SMP N 2 Banjarnegara')&&($nilai >= $PG_SMP2)) echo "$pilihan_2 <br>$ket <b> $PG_SMP2 </b> $peluang2 <b> $persen_SMP2 % </b> $terima <br>"; else if(($pil_dua == 'SMP N 2 Banjarnegara')&&($nilai <= $PG_SMP2)) echo "$pilihan_2 <br>$ket <b> $PG_SMP2 </b> $peluang2 <b> $persen_SMP2 % </b> $tolak <br>";
// SMP N 3 Banjarnegara
if(($pil_dua == 'SMP N 3 Banjarnegara')&&($nilai >= $PG_SMP3)) echo "$pilihan_2 <br>$ket <b> $PG_SMP3 </b> $peluang2 <b> $persen_SMP3 % </b> $terima <br>"; else if(($pil_dua == 'SMP N 3 Banjarnegara')&&($nilai <= $PG_SMP3)) echo "$pilihan_2 <br>$ket <b> $PG_SMP3 </b> $peluang2 <b> $persen_SMP3 % </b> $tolak <br>";
}
echo"</div></div>";
?>
Keep the name hasilnya.php
how:
Open the Notepad application, and Paste (Ctrl v)
Save as in the form of a file like this:
how:
Open the Notepad application, and Paste (Ctrl v)
Save as in the form of a file like this:
File name : hasilnya.php
Save as Type : All Files
Encoding : UTF-8
Save as Type : All Files
Encoding : UTF-8
Make a folder on the Demo
C: \ xampp \ htdocs \ demo
look at the picture below
C: \ xampp \ htdocs \ demo
look at the picture below
if you have saved Now open a browser and type in the URL with
http://localhost/demo/
it will appear as below.
http://localhost/demo/
it will appear as below.
Thus the way of making simulation applications with php.
Well ... the question is how to upload so that it can be accessed via blogspot
Look forward to the next post ... OK!
Well ... the question is how to upload so that it can be accessed via blogspot
Look forward to the next post ... OK!
Source: www.Mas-amien.blogspot.com
and Visit my another blog: www.e-nanra.blogspot.com , www.gohealthful.blogspot.com
0 comments:
Post a Comment