Linux puskom-ProLiant-DL385-Gen10 5.4.0-150-generic #167~18.04.1-Ubuntu SMP Wed May 24 00:51:42 UTC 2023 x86_64
/
var
/
www
/
html
/
bkd
/
formproses
/
/var/www/html/bkd/formproses/sql_proses_nilai.php
<? //echo $_POST['jass']; //echo $_POST['jnsdosen']; $txtcatatan=''; $txtsks2_as1=''; $txtcatatan2=''; $txtsks2_as2=''; $cbokode_rekom=''; $cbokode_rekomperbaikan=''; if ( isset($_POST['nippst']) ) {$nippst=$_POST['nippst'];} if ( isset($_POST['txtcatatan']) ) {$txtcatatan=$_POST['txtcatatan'];} if ( isset($_POST['txtcatatan2']) ) {$txtcatatan2=$_POST['txtcatatan2'];} if ( isset($_POST['txtsks2_as1']) ) {$txtsks2_as1=$_POST['txtsks2_as1'];} if ( isset($_POST['txtsks2_as2']) ) {$txtsks2_as2=$_POST['txtsks2_as2'];} if ( isset($_POST['cbokode_rekom']) ) {$cbokode_rekom=$_POST['cbokode_rekom'];} if ( isset($_POST['cbokode_rekom2']) ) {$cbokode_rekom2=$_POST['cbokode_rekom2'];} if ( isset($_POST['cbokode_rekomperbaikan']) ) {$cbokode_rekomperbaikan=$_POST['cbokode_rekomperbaikan'];} //$query = "select * from $tbl where id = '$id'"; if ($_POST['jass']==1) { $query = "update $tbl set catatan = '$txtcatatan', sks2_as1= '$txtsks2_as1', rekomendasi1='$cbokode_rekom' where id = '$id'"; $result= iresult($query, $app['sys_db']); #============================================= $query = "select sum(sks2_as1) as tot_sks2 from $app[tdb]t_pengajaran where nip='$nippst' and thaka='$_SESSION[ses_thaka]' and (rekomendasi1 ='A' or rekomendasi1 ='B')"; $result= iresult($query, $app['sys_db']); while($row=iExec($result)){ $tot_pd2_as1=$row['tot_sks2']; } $query = "select sum(sks2_as1) as tot_sks2 from $app[tdb]t_penelitian where nip='$nippst' and thaka='$_SESSION[ses_thaka]' and (rekomendasi1 ='A' or rekomendasi1 ='B')"; $result= iresult($query, $app['sys_db']); while($row=iExec($result)){ $tot_pl2_as1=$row['tot_sks2']; } $query = "select sum(sks2_as1) as tot_sks2 from $app[tdb]t_pengabdian where nip='$nippst' and thaka='$_SESSION[ses_thaka]' and (rekomendasi1 ='A' or rekomendasi1 ='B')"; $result= iresult($query, $app['sys_db']); while($row=iExec($result)){ $tot_pg2_as1=$row['tot_sks2']; } $query = "select sum(sks2_as1) as tot_sks2 from $app[tdb]t_penunjang where nip='$nippst' and thaka='$_SESSION[ses_thaka]' and (rekomendasi1 ='A' or rekomendasi1 ='B')"; $result= iresult($query, $app['sys_db']); while($row=iExec($result)){ $tot_pk2_as1=$row['tot_sks2']; } if ($tot_pd2_as1 ==''){$tot_pd2_as1=0;} if ($tot_pl2_as1 ==''){$tot_pl2_as1=0;} if ($tot_pg2_as1 ==''){$tot_pg2_as1=0;} if ($tot_pk2_as1 ==''){$tot_pk2_as1=0;} $totsks = $tot_pd2_as1+$tot_pl2_as1+$tot_pg2_as1+$tot_pk2_as1; $totpdpl = $tot_pd2_as1 + $tot_pl2_as1; $jnsdosen='DS'; $query = "select jnsdosen from $app[tdb]m_dosen where nip='$nippst' order by nip"; $result= iresult($query, $app['sys_db']); while($row=iExec($result)){ $jnsdosen=$row['jnsdosen']; } if ( $jnsdosen ==''){$jnsdosen='DS';} $ks1='M'; if ($jnsdosen =='DS' || $jnsdosen =='PR'){ if ($totsks > 16){$ks1='T';} if ($totsks < 12){$ks1='T';} if ($totpdpl < 9){$ks1='T';} if ($tot_pd2_as1 <= 0){$ks1='T';} if ($tot_pl2_as1 <= 0){$ks1='T';} if ($tot_pg2_as1 <= 0){$ks1='T';} if ($tot_pk2_as2 <= 0){$ks2='T';} } if ($jnsdosen =='DT' || $jnsdosen =='PT'){ if ($totsks > 16){$ks1='T';} if ($totsks < 3){$ks1='T';} if ($totpdpl < 3){$ks1='T';} if ($tot_pd2_as1 <= 0){$ks1='T';} } $query = "update $app[tdb]t_nilai set pd1 = '$tot_pd2_as1', pl1 = '$tot_pl2_as1', pg1 = '$tot_pg2_as1', pk1 = '$tot_pk2_as1', ks1 = '$ks1' where nip = '$nippst' and thaka = '$_SESSION[ses_thaka]'"; $result= iresult($query, $app['sys_db']); } elseif ($_POST['jass']==2) { $query = "update $tbl set catatan2 = '$txtcatatan2', sks2_as2= '$txtsks2_as2', rekomendasi2='$cbokode_rekom2' where id = '$id'"; $result= iresult($query, $app['sys_db']); #============================================= $query = "select sum(sks2_as2) as tot_sks2 from $app[tdb]t_pengajaran where nip='$nippst' and thaka='$_SESSION[ses_thaka]' and (rekomendasi2 ='A' or rekomendasi2 ='B')"; $result= iresult($query, $app['sys_db']); while($row=iExec($result)){ $tot_pd2_as2=$row['tot_sks2']; } $query = "select sum(sks2_as2) as tot_sks2 from $app[tdb]t_penelitian where nip='$nippst' and thaka='$_SESSION[ses_thaka]' and (rekomendasi2 ='A' or rekomendasi2 ='B')"; $result= iresult($query, $app['sys_db']); while($row=iExec($result)){ $tot_pl2_as2=$row['tot_sks2']; } $query = "select sum(sks2_as2) as tot_sks2 from $app[tdb]t_pengabdian where nip='$nippst' and thaka='$_SESSION[ses_thaka]' and (rekomendasi2 ='A' or rekomendasi2 ='B')"; $result= iresult($query, $app['sys_db']); while($row=iExec($result)){ $tot_pg2_as2=$row['tot_sks2']; } $query = "select sum(sks2_as2) as tot_sks2 from $app[tdb]t_penunjang where nip='$nippst' and thaka='$_SESSION[ses_thaka]' and (rekomendasi2 ='A' or rekomendasi2 ='B')"; $result= iresult($query, $app['sys_db']); while($row=iExec($result)){ $tot_pk2_as2=$row['tot_sks2']; } if ($tot_pd2_as2 ==''){$tot_pd2_as2=0;} if ($tot_pl2_as2 ==''){$tot_pl2_as2=0;} if ($tot_pg2_as2 ==''){$tot_pg2_as2=0;} if ($tot_pk2_as2 ==''){$tot_pk2_as2=0;} $totsks2 = $tot_pd2_as2+$tot_pl2_as2+$tot_pg2_as2+$tot_pk2_as2; $totpdpl2 = $tot_pd2_as2 + $tot_pl2_as2; $jnsdosen='DS'; $query = "select jnsdosen from $app[tdb]m_dosen where nip='$nippst' order by nip"; $result= iresult($query, $app['sys_db']); while($row=iExec($result)){ $jnsdosen=$row['jnsdosen']; } if ( $jnsdosen ==''){$jnsdosen='DS';} $ks2='M'; if ($jnsdosen =='DS' || $jnsdosen =='PR'){ if ($totsks2 > 16){$ks2='T';} if ($totsks2 < 12){$ks2='T';} if ($totpdpl2 < 9){$ks2='T';} if ($tot_pd2_as2 <= 0){$ks2='T';} if ($tot_pl2_as2 <= 0){$ks2='T';} if ($tot_pg2_as2 <= 0){$ks2='T';} if ($tot_pk2_as2 <= 0){$ks2='T';} } if ($jnsdosen =='DT' || $jnsdosen =='PT'){ if ($totsks2 > 16){$ks2='T';} if ($totsks2 < 3){$ks2='T';} if ($totpdpl2 < 3){$ks2='T';} if ($tot_pd2_as2 <= 0){$ks2='T';} } $query = "update $app[tdb]t_nilai set pd2 = '$tot_pd2_as2', pl2 = '$tot_pl2_as2', pg2 = '$tot_pg2_as2', pk2 = '$tot_pk2_as2', ks2 = '$ks2' where nip = '$nippst' and thaka = '$_SESSION[ses_thaka]'"; $result= iresult($query, $app['sys_db']); } $result= iresult($query, $app['sys_db']); ?>