Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once '../function/core.php';
- $q = anti_inject(@$_GET['q']);
- if ($q == "kls") {
- $paket = anti_inject($_POST['paket']);
- $selectjur = select('*', 'tbl_kelas', "paket = '$paket'");
- $jurusan = array();
- while ($j = mysqli_fetch_object($selectjur)) :
- $jurusan[] = $j;
- endwhile;
- echo json_encode($jurusan);
- } else if($q == "mpl") {
- $kelas = anti_inject($_POST['kelas']);
- $kelas = substr($kelas, 0,2);
- if ($kelas == 10) {
- $sqlkls = select("*", "tbl_mapel", "kelas = 10");
- } else if($kelas == 11) {
- $sqlkls = select("*", "tbl_mapel", "kelas = 11");
- } else if($kelas == 12) {
- $sqlkls = select("*", "tbl_mapel", "kelas = 12");
- }
- $class = array();
- while ($c = mysqli_fetch_object($sqlkls)) {
- $class[] = $c;
- }
- echo json_encode($class);
- }
- ?>
Add Comment
Please, Sign In to add comment