load->library('session'); $this->load->library('rhlib'); } 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; } function grid(){ //ISTRA $kdstsemester = $this->input->post("kdstsemester"); $nim = $this->input->post("nim"); $where= array(); if($kdstsemester !=''){ $where['kdstsemester']=$kdstsemester; } if($nim !=''){ $where['nim']=$nim; } $this->db->select('*'); $this->db->from('v_nilai_semester'); $this->db->where($where); $q = $this->db->get(); $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->jmlsks) * 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; $nmfakultas=$row->nmfakultas; $nmprodi=$row->nmprodi; $kdprodi=$row->kdprodi; $idklsmhs=$row->idklsmhs; $tahunmsk=$row->thnmasuk; //in beda $persen='-';//'100', $stbayar='-'; $foto=$row->foto; $idjnssemester=$row->idjnssemester; $kdstsemester=$row->kdstsemester; $kdthnakademik=$row->kdthnakademik.' '.$row->nmjnssemester; $kdfakultas=$row->kdfakultas; } else { $nim="-"; $nmmhs="-"; $nmfakultas="-"; $nmprodi="-"; $kdprodi="-"; $idklsmhs="-"; $tahunmsk="-"; $persen="-"; $stbayar="-"; $foto="-"; $idjnssemester="-"; $kdstsemester="-"; $kdthnakademik="-"; $kdfakultas="-"; } echo '{"nim":"'.$nim.'","nmmhs":"'.$nmmhs.'","nmfakultas":"'.$nmfakultas.'","nmprodi":"'.$nmprodi .'","kdprodi":"'.$kdprodi.'","idklsmhs":"'.$idklsmhs.'","tahunmsk":"'.$tahunmsk.'","persen":"'.$persen .'","stbayar":"'.$stbayar.'","foto":"'.$foto.'","idjnssemester":"'.$idjnssemester .'","kdstsemester":"'.$kdstsemester.'","kdthnakademik":"'.$kdthnakademik .'","kdfakultas":"'.$kdfakultas.'"}'; } function kelengkapan(){ $nim = $this->input->post("nim"); $kdprodi = $this->input->post("kdprodi"); $idklsmhs = $this->input->post("idklsmhs"); $tahunmsk = $this->input->post("tahunmsk"); $kdstsemester = $this->input->post("kdstsemester"); $q = "SELECT get_kelengkapan('".$nim."','".$kdprodi."','".$idklsmhs."','".$tahunmsk."','".$kdstsemester."') as nm;"; $query = $this->db->query($q); $nm= ''; if ($query->num_rows() > 0) { $row = $query->row(); $nm=$row->nm; } echo $nm; } }