Add SPOTA core PHP application
Add the main admin, dosen, mahasiswa, API, and service code needed to run the core legacy application with configurable upload storage.
This commit is contained in:
54
admin/page/manajemendata/act.data-prodi.php
Normal file
54
admin/page/manajemendata/act.data-prodi.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
session_start();
|
||||
if($_POST){
|
||||
include ("../../../inc/helper.php");
|
||||
include ("../../../inc/konfigurasi.php");
|
||||
include ("../../../inc/db.pdo.class.php");
|
||||
|
||||
$db=new dB($dbsetting);
|
||||
|
||||
switch($_POST['act']){
|
||||
case 'insert':
|
||||
$insert="INSERT INTO tbprodi SET
|
||||
idFak='".$_POST['idFak']."',
|
||||
idJur='".$_POST['idJur']."',
|
||||
nmProdi='".$_POST['nmProdi']."'
|
||||
";
|
||||
//echo $insert;
|
||||
if($db->runQuery($insert)){
|
||||
echo json_encode(array("result"=>true,"msg"=>"Data Program Studi baru berhasil ditambahkan."));
|
||||
}else{
|
||||
echo json_encode(array("result"=>false,"msg"=>"Aksi Gagal DBERROR."));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'update':
|
||||
$id=$_POST['idProdi'];
|
||||
if(ctype_digit($id)){
|
||||
$update="UPDATE tbprodi SET
|
||||
idFak='".$_POST['idFak']."',
|
||||
idJur='".$_POST['idJur']."',
|
||||
nmProdi='".$_POST['nmProdi']."' WHERE idProdi='$id'";
|
||||
//echo $update;
|
||||
if($db->runQuery($update)){
|
||||
echo json_encode(array("result"=>true,"msg"=>"Data Fakultas telah diupdate."));
|
||||
}else{
|
||||
echo json_encode(array("result"=>false,"msg"=>"Aksi update Gagal DBERROR."));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'hapusprodi':
|
||||
$id=$_POST['idProdi'];
|
||||
if(ctype_digit($id)){
|
||||
$hapus="DELETE FROM tbprodi WHERE idProdi='$id'";
|
||||
if($db->runQuery($hapus)){
|
||||
echo json_encode(array("result"=>true,"msg"=>"Data Program Studi telah dihapus."));
|
||||
}else{
|
||||
echo json_encode(array("result"=>false,"msg"=>"Aksi gagal DBERROR."));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user