Pemrograman Web 2. Modul 6. Form Pengambilan KRS dengan menggunakan PHP + MYSql

1. File Pengambi2lan KRS  : Formkrs.html Shipping and Handling on All Personal Checks with code DWF008

<h3>Input KRS</h3>
<table border=1>
<form method=post action="tampilkrs.php">
No BP    </td><td>=<input type=text name="nobp"</td></tr>
Semester </td><td>=<input type=text name="semester"</td></tr>
Tahun    </td><td>=<input type=text name="tahun"</td></tr>
<input type =submit value="OK">
<input type=reset value ="Cancel"></td></tr>

2.  tampilkrs.php

include "konek.php";
$semester =$_POST['semester'];
$tahun =$_POST['tahun'];

echo"<table align = center border = 1>";

$sqlmhs=mysql_query("select * from mhs where nobp='$NOBP'");

echo "<tr><td colspan=4>NO BP=$datamhs[0]<br>";
echo "Nama     =$datamhs[1]<br>";
echo "Semester =$semester<br>";
echo "Tahun    =$tahun<br></tr><td>";

//set cookie

<form method=post action=inputkrs.php>
 <th>Nama Matakuliah </th>
 <th>Ambil </th></tr>
$sqlmtk=mysql_query("select * from mtk");
 echo "<tr><td>$data2[kode]</td>";
 echo "<td>$data2[nama]</td>";
 echo "<td>$data2[sks]</td>";
 echo "<td><input type=checkbox name=kode[]
<tr><td colspan=4><input type=submit Value="OK">
<input type=reset Value="Cancel"><td></tr>

3. inputkrs.php


$nobp= $_COOKIE['NOBP'];
$semester= $_COOKIE['semester'];
$tahun = $_COOKIE['tahun'];

$cek = mysql_query("select * from krs where nobp='$nobp'
 AND semester='$semester' AND tahun='$tahun'");
if($hasil > 0 )
 die("sudah pernah input");
echo"<table border=1>";
foreach($_POST['kode'] as $valkode){
 mysql_query("insert into krs (nobp,kodemk,semester,tahun) values ('$nobp','$valkode','$semester','$tahun')");
echo"<tr><td colspan=4>NOBP : $nobp<br>";
echo"Nama : $namamhs<br>";
echo"Semester : $semester<br>";
echo"Tahun : $tahun<br></td></tr>";

<tr>  <th>No.</th>
 <th>Nama Matakuliah</th>
$sqlkrs = mysql_query("SELECT * FROM krs, mtk WHERE nobp='$nobp'
 AND krs.kodemk = mtk.kode
 AND krs.semester='$semester' AND krs.tahun='$tahun'");
$jumsks = 0;
$i = 1;
while($datakrs = mysql_fetch_array($sqlkrs)){
 echo "<tr><td>$i</td>";
 echo "<td>$datakrs[kode]</td>";
 echo "<td>$datakrs[nama]</td>";
 echo "<td>$datakrs[sks]</td></tr>";
 $jumsks = $jumsks + $datakrs['sks'];
echo "<tr><td colspan=3>JUMLAH</td><td>$jumsks</td></tr>";

Materi yang berhubungan :

1. Aplikasi Sistem Informasi Akademik
2. Form MAhasiswa
3. Form Dosen
4. Form Matakuliah
5. Jadwal Perkuliahan"
6. Form KRS
7. Form Nilai
8. Form LHS


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: