Created
March 11, 2014 07:04
-
-
Save ruliarmando/9480888 to your computer and use it in GitHub Desktop.
check mata kuliah
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $kd_matkul = 'ABC'; // ini bisa diambil dari inputan atau form POST | |
| $nim = '100449983'; // ini bisa diambil dari inputan atau form POST | |
| $query_prasyarat = "select kd_matakuliah_prasayarat from mata_kuliah where kd_matakuliah = {$kd_matkul}"; | |
| $result = mysql_query($query_prasyarat) or die('query gagal'); | |
| $row = mysql_fetch_row($result); | |
| $query_nilai = "select bobot_nilai from nilai where nim = {$nim} and kd_matakuliah = {$row['kd_matakuliah_prasyarat']}"; | |
| $result = mysql_query($query_nilai) or die('query gagal'); | |
| $row = mysql_fetch_row($result); | |
| if(in_array($row['bobot_nilai'], array('A', 'B', 'C', 'D'))) | |
| { | |
| echo 'success'; | |
| } | |
| else | |
| { | |
| echo 'anda tidak boleh mengambil karena belum memenuhi syarat'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment