ma39isy

Untitled

Nov 6th, 2025
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.19 KB | None | 0 0
  1. <?php
  2. if($_GET['act']=='student.note.list.save') {
  3.          $dTables = new DataTables($academicConfig);
  4.          if($_SESSION['groupid']==9 || $_SESSION['groupid']==5){
  5.          //check is it there?
  6.          $checkQuery=$dTables->ExecuteQuery("select * from studentactivity where studentid='".StrToDB($_GET['studentId'])."' and schoolYear='".StrToDB($_GET['schoolYear'])."' and semester='".StrToDB($_GET['semester'])."' ");
  7.          $checkData=$dTables->FetchArray($checkQuery);
  8.          
  9.          
  10.             if($checkData['STUDENTID']){
  11.              $query="update studentactivity set COMMENTOFLECTURER='".@str_replace('\'','\'\'',$_POST['note'])."', COMMENTOFPARENTS='".StrToDB($_POST['note_parent'])."' where studentid='".StrToDB($_GET['studentId'])."' and schoolYear='".StrToDB($_GET['schoolYear'])."' and semester='".StrToDB($_GET['semester'])."' ";
  12.            
  13.             $dTables->ExecuteQuery($query);
  14.              }else{
  15.                 $newData=array(
  16.                   "STUDENTID"=>"'".StrToDB($_GET['studentId'])."'",
  17.                   "SCHOOLYEAR"=>"'".StrToDB($_GET['schoolYear'])."'",
  18.                   "SEMESTER"=>"'".StrToDB($_GET['semester'])."'",
  19.                   "COMMENTOFLECTURER"=>"'".@str_replace('\'','\'\'',$_POST['note'])."'",
  20.                   "COMMENTOFPARENTS"=>"'".StrToDB($_POST['note_parent'])."'",
  21.                   "APPROVALBYPRODI"=>"'TIDAK'",
  22.                 );
  23.                 $dTables->Insert("STUDENTACTIVITY",$newData);
  24.              
  25.              }
  26.          }
  27.    
  28.    
  29.     }else if($_GET['act']=='student.note.list.approve') {
  30.          $dTables = new DataTables($academicConfig);
  31.          
  32.          
  33.          
  34.          if($_SESSION['groupid']==9){
  35.              $query="update studentactivity set APPROVALBYPRODI='YA', PRODIAPPROVEMENTDATE=SYSDATE where studentid='".intval($_GET['studentId'])."' and schoolYear='".StrToDB($_GET['schoolYear'])."' and semester='".intval($_GET['semester'])."' ";
  36.              
  37.             $dTables->ExecuteQuery($query);
  38.          }
  39.    
  40.    
  41.    
  42.     }else if($_GET['act']=='student.note.list.un.approve') {
  43.          $dTables = new DataTables($academicConfig);
  44.          if($_SESSION['groupid']==9){
  45.              $query="update studentactivity set APPROVALBYPRODI='TIDAK', PRODIAPPROVEMENTDATE=NULL where studentid='".intval($_GET['studentId'])."' and schoolYear='".StrToDB($_GET['schoolYear'])."' and semester='".intval($_GET['semester'])."' ";
  46.              
  47.             $dTables->ExecuteQuery($query);
  48.          }
  49.    
  50.    
  51.    
  52.     }
  53. ?>
Advertisement
Add Comment
Please, Sign In to add comment