load->library('session'); } function nm_field($column,$tbl,$whereb, $wherea){ $q = "SELECT ".$column." as nm FROM ".$tbl." where ".$whereb." = '".$wherea."' " ; $query = $this->db->query($q); $nm= ''; if ($query->num_rows() != 0) { $row = $query->row(); $nm=$row->nm; } return $nm; } // START PENGGUNA function grid(){ //ISTRA $start = $this->input->post("start"); $limit = $this->input->post("limit"); // $nim = $this->input->post("nim"); $nmmhs = $this->input->post("nmmhs"); $kdjnskelamin = $this->input->post("kdjnskelamin"); $nmprodi = $this->input->post("nmprodi"); $thnmasuk = $this->input->post("thnmasuk"); $tgllulus = $this->input->post("tgllulus"); $ipk = $this->input->post("ipk"); $kdthnakademik = $this->input->post("kdthnakademik"); $where=''; $this->db->select('nim, kdprodi, nmmhs, kdjnskelamin, nmprodi, thnmasuk, tgllulus, ipk'); $this->db->from('v_transkripakademik'); if($kdthnakademik!=''){ $where['kdthnakademik']=$kdthnakademik; } if($nim!=''){ $where['nim']=$nim; } if($nmmhs!=''){ $where['nmmhs']=$nmmhs; } if($kdjnskelamin!=''){ $where['kdjnskelamin']=$kdjnskelamin; } if($nmprodi!=''){ $where['nmprodi']=$nmprodi; } if($thnmasuk!=''){ $where['thnmasuk']=$thnmasuk; } if($tgllulus!=''){ $where['tgllulus']=$tgllulus; } if($ipk!=''){ $where['ipk']=$ipk; } if ($start!=null){ $this->db->limit($limit,$start); }else{ $this->db->limit(2,0); } if($where!=''){ $this->db->like($where);//$this->db->where($where); } $q = $this->db->get(); $data = array(); if ($q->num_rows() > 0) { $data = $q->result(); } $ttl = $this->db->count_all('v_transkripakademik'); $build_array = array ("success"=>true,"results"=>$ttl,"data"=>array()); foreach($data as $row) { array_push($build_array["data"],array( 'nim'=>$row->nim, 'kdprodi'=>$row->kdprodi, 'nmmhs'=>$row->nmmhs, 'kdjnskelamin'=>$row->kdjnskelamin, 'nmprodi'=>$row->nmprodi,//$row->nmmkind, 'thnmasuk'=>$row->thnmasuk,//$row->nmmkind, 'tgllulus'=>$row->tgllulus, 'ipk'=>$row->ipk, //'pkelulusan'=>$row->pkelulusan, )); } echo json_encode($build_array); } function grid_detail(){ //ISTRA //kurikulum.kdprodi, //kurikulum.tahunmsk, $kdprodi = $this->input->post("kdprodi"); $tahunmsk = $this->input->post("thnmasuk"); $kdthnakademik = substr($this->input->post("kdthnakademik"),0,9); $nmjnssemester = trim($this->input->post("nmjnssemester")); $nim = $this->input->post("nim"); /* $q = $this->db->query("SELECT `kurikulum`.`kdprodi` AS `kdprodi` , `kurikulum`.`thnmasuk` AS `thnmasuk` , `kurikulum`.`kdmk` AS `kdmk` , `matakuliah`.`nmmkind` AS `nmmkind` , `matakuliah`.`nmmkeng` AS `nmmkeng` , ifnull((SELECT max(`nilai`.`nilaihuruf`) AS `nilaihuruf` FROM `nilai` WHERE ((`nilai`.`nim` = '".$nim."') AND (`nilai`.`kdprodi` = `kurikulum`.`kdprodi`) AND (`nilai`.`kdmk` = `kurikulum`.`kdmk`))),'-') AS `nilaihuruf` , ifnull((SELECT max(`nilai`.`bobotnilai`) AS `bobotnilai` FROM `nilai` WHERE ((`nilai`.`nim` = '".$nim."') AND (`nilai`.`kdprodi` = `kurikulum`.`kdprodi`) AND (`nilai`.`kdmk` = `kurikulum`.`kdmk`))),0) AS `bobotnilai` , `kurikulum`.`jmlsks` AS `jmlsks` , ifnull(((SELECT max(`nilai`.`bobotnilai`) AS `bobotnilai` FROM `nilai` WHERE ((`nilai`.`nim` = '".$nim."') AND (`nilai`.`kdprodi` = `kurikulum`.`kdprodi`) AND (`nilai`.`kdmk` = `kurikulum`.`kdmk`))) * `kurikulum`.`jmlsks`),0) AS `mutu` FROM (`kurikulum` JOIN `matakuliah` ON (((`kurikulum`.`kdprodi` = `matakuliah`.`kdprodi`) AND (`kurikulum`.`kdmk` = `matakuliah`.`kdmk`)))) WHERE `kurikulum`.kdprodi ='".$kdprodi."' AND `kurikulum`.thnmasuk ='".$tahunmsk."' ORDER BY `kurikulum`.`idsemester` , `kurikulum`.`kdmk`"); *///TONG DIHAPUS $q = $this->db->query("SELECT `nilai`.`kdprodi` AS `kdprodi` , `nilai`.`kdmk` AS `kdmk` , `matakuliah`.`nmmkind` AS `nmmkind` , `matakuliah`.`nmmkeng` AS `nmmkeng` , ifnull((SELECT min(`nilai`.`nilaihuruf`) AS `nilaihuruf` FROM `nilai` WHERE ((`nilai`.`nim` = '".$nim."') AND (`nilai`.`kdprodi` = `kurikulum`.`kdprodi`) AND (`nilai`.`kdmk` = `kurikulum`.`kdmk`))), '-') AS `nilaihuruf` , ifnull((SELECT max(`nilai`.`bobotnilai`) AS `bobotnilai` FROM `nilai` WHERE ((`nilai`.`nim` = '".$nim."') AND (`nilai`.`kdprodi` = `kurikulum`.`kdprodi`) AND (`nilai`.`kdmk` = `kurikulum`.`kdmk`))), 0) AS `bobotnilai` , `kurikulum`.`jmlsks` AS `jmlsks` , ifnull(((SELECT max(`nilai`.`bobotnilai`) AS `bobotnilai` FROM `nilai` WHERE ((`nilai`.`nim` = '".$nim."') AND (`nilai`.`kdprodi` = `kurikulum`.`kdprodi`) AND (`nilai`.`kdmk` = `kurikulum`.`kdmk`))) * `kurikulum`.`jmlsks`), 0) AS `mutu` FROM ((`nilai` JOIN `matakuliah` ON (((`nilai`.`kdprodi` = `matakuliah`.`kdprodi`) AND (`nilai`.`kdmk` = `matakuliah`.`kdmk`)))) JOIN `kurikulum` ON (((`kurikulum`.`kdprodi` = `nilai`.`kdprodi`) AND (`kurikulum`.`kdmk` = `nilai`.`kdmk`)))) WHERE ((`nilai`.`kdprodi` = '".$kdprodi."') AND (`nilai`.`nim` = '".$nim."') AND (`kurikulum`.thnmasuk ='".$tahunmsk."') AND ((`nilai`.`idstsetuju` = '1') OR isnull(`nilai`.`idstsetuju`))) GROUP BY `nilai`.`kdmk` ORDER BY `nilai`.`kdstsemester` , `nilai`.`kdmk`"); $data = array(); if ($q->num_rows() > 0) { $data = $q->result(); } $ttl = count($data); $build_array = array ("success"=>true,"results"=>$ttl,"data"=>array()); foreach($data as $row) { array_push($build_array["data"],array( 'kdmk'=>$row->kdmk, 'nmmk'=>$row->nmmkind, 'jmlsks'=>$row->jmlsks, 'nilaihuruf'=>$row->nilaihuruf, 'bobotnilai'=>$row->bobotnilai, 'mutu'=>$row->mutu,//$row->nmmkind, 'sm'=>(floatval($row->mutu)),//$row->nmmkind, //'dsnpengampu'=>$row->nmdosdgngelar, )); } echo json_encode($build_array); } function form_mhs(){ //ISTRA // $nama = $this->input->post("nama"); $userid = $this->input->post("userid"); $this->db->select("*"); $this->db->from("vv_mahasiswa_profile2"); if($userid!=''){ $where['nim']=$userid; $this->db->where($where); } $q = $this->db->get(); if ($q->num_rows() > 0) { $row = $q->row(); $nim=$row->nim; $nmmhs=$row->nmmhs; $kdfakultas=$row->kdfakultas; $nmfakultas=$row->nmfakultas; $nmprodi=$row->nmprodi; $kdprodi=$row->kdprodi; $tahunmsk=$row->thnmasuk; //in beda $persen='-';//'100', $stbayar='-'; $foto=$row->foto; $idjnssemester=$row->idjnssemester; $kdstsemester=$row->kdstsemester; $kdthnakademik=$row->kdthnakademik.' '.$row->nmjnssemester; $noijazah=$row->noijazah; $tglijazah=$row->tglijazah; $tgllulus=$row->tgllulus; $idpimpinan1=$this->nm_field('nmpimpinan', 'pimpinan', 'idpimpinan',$row->idpimpinan1); $idpimpinan2=$this->nm_field('nmpimpinan', 'pimpinan', 'idpimpinan',$row->idpimpinan2); $jdlskripsiind=base64_encode($row->jdlskripsiind); } else { $nim="-"; $nmmhs="-"; $kdfakultas="-"; $nmfakultas="-"; $nmprodi="-"; $kdprodi="-"; $tahunmsk="-"; $persen="-"; $stbayar="-"; $foto="-"; $idjnssemester="-"; $kdstsemester="-"; $kdthnakademik="-"; $noijazah='-'; $tglijazah='-'; $tgllulus='-'; $idpimpinan1='-'; $idpimpinan2='-'; $jdlskripsiind ='-'; } echo '{"nim":"'.$nim.'","nmmhs":"'.$nmmhs.'","kdfakultas":"'.$kdfakultas.'","nmfakultas":"'.$nmfakultas.'","nmprodi":"'.$nmprodi .'","kdprodi":"'.$kdprodi.'","tahunmsk":"'.$tahunmsk.'","persen":"'.$persen .'","stbayar":"'.$stbayar.'","foto":"'.$foto.'","idjnssemester":"'.$idjnssemester .'","kdstsemester":"'.$kdstsemester.'","kdthnakademik":"'.$kdthnakademik .'","noijazah":"'.$noijazah.'","tglijazah":"'.$tglijazah .'","tgllulus":"'.$tgllulus.'","idpimpinan1":"'.$idpimpinan1 .'","jdlskripsiind":"'.$jdlskripsiind.'","idpimpinan2":"'.$idpimpinan2.'"}'; } }