first commit
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
include('../../koneksi.php');
|
||||
$key=$_POST['key'];
|
||||
|
||||
if ($key=='simpan_mprodi') {
|
||||
$id=$_POST['id'];
|
||||
$nama=$_POST['nama'];
|
||||
$cek_satker=pg_query("SELECT id FROM prodi WHERE id='$id'");
|
||||
$row_satker = pg_fetch_row($cek_satker);
|
||||
if ($row_satker[0] > 0) {
|
||||
$upd_satker = pg_query("UPDATE prodi SET
|
||||
nama='$nama'
|
||||
WHERE id='$id'");
|
||||
} else {
|
||||
$ins_satker = pg_query("INSERT into prodi (
|
||||
nama
|
||||
) values(
|
||||
'$nama'
|
||||
)
|
||||
");
|
||||
}
|
||||
} else
|
||||
if ($key=='simpan_mjurusan') {
|
||||
$id=$_POST['id'];
|
||||
$nama=$_POST['nama'];
|
||||
$cek_satker=pg_query("SELECT id FROM jurusan WHERE id='$id'");
|
||||
$row_satker = pg_fetch_row($cek_satker);
|
||||
if ($row_satker[0] > 0) {
|
||||
$upd_satker = pg_query("UPDATE jurusan SET
|
||||
nama='$nama'
|
||||
WHERE id='$id'");
|
||||
} else {
|
||||
$ins_satker = pg_query("INSERT into jurusan (
|
||||
nama
|
||||
) values(
|
||||
'$nama'
|
||||
)
|
||||
");
|
||||
}
|
||||
} else
|
||||
if ($key=='simpan_muniv') {
|
||||
$id=$_POST['id'];
|
||||
$nama=$_POST['nama'];
|
||||
$cek_satker=pg_query("SELECT id FROM univ WHERE id='$id'");
|
||||
$row_satker = pg_fetch_row($cek_satker);
|
||||
if ($row_satker[0] > 0) {
|
||||
$upd_satker = pg_query("UPDATE univ SET
|
||||
nama='$nama'
|
||||
WHERE id='$id'");
|
||||
} else {
|
||||
$ins_satker = pg_query("INSERT into univ (
|
||||
nama
|
||||
) values(
|
||||
'$nama'
|
||||
)
|
||||
");
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,231 @@
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-2">
|
||||
<button type="button" id="btn_baru_mprodi" class="btn btn-danger btn-rounded waves-effect waves-light">
|
||||
<i class="fa fa-plus m-r-5"></i> Prodi
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<div id="tabel_mprodi"></div>
|
||||
|
||||
|
||||
<div id="modal_mprodi" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header no-border">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Add Prodi</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="modal_body_mprodi"></div>
|
||||
<div class="modal-footer no-border">
|
||||
<button type="button" class="btn btn-default waves-effect" data-dismiss="modal" id="keluar_mprodi">Keluar</button>
|
||||
<button type="button" class="btn btn-primary waves-effect waves-light" id="simpan_mprodi">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-2">
|
||||
<button type="button" id="btn_baru_mjurusan" class="btn btn-danger btn-rounded waves-effect waves-light">
|
||||
<i class="fa fa-plus m-r-5"></i> Jurusan
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<div id="tabel_mjurusan"></div>
|
||||
|
||||
|
||||
<div id="modal_mjurusan" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header no-border">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Add Jurusan</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="modal_body_mjurusan"></div>
|
||||
<div class="modal-footer no-border">
|
||||
<button type="button" class="btn btn-default waves-effect" data-dismiss="modal" id="keluar_mjurusan">Keluar</button>
|
||||
<button type="button" class="btn btn-primary waves-effect waves-light" id="simpan_mjurusan">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-2">
|
||||
<button type="button" id="btn_baru_muniv" class="btn btn-danger btn-rounded waves-effect waves-light">
|
||||
<i class="fa fa-plus m-r-5"></i> Universitas
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<div id="tabel_muniv"></div>
|
||||
|
||||
|
||||
<div id="modal_muniv" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header no-border">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Add Universitas</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="modal_body_muniv"></div>
|
||||
<div class="modal-footer no-border">
|
||||
<button type="button" class="btn btn-default waves-effect" data-dismiss="modal" id="keluar_muniv">Keluar</button>
|
||||
<button type="button" class="btn btn-primary waves-effect waves-light" id="simpan_muniv">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$('#coba').click(function(){alert('s');});
|
||||
$('#tabel_mprodi').load("app/master/belajar/tabel_mprodi.php");
|
||||
$('#tabel_mjurusan').load("app/master/belajar/tabel_mjurusan.php");
|
||||
$('#tabel_muniv').load("app/master/belajar/tabel_muniv.php");
|
||||
|
||||
$('#btn_baru_mprodi').click(function(){
|
||||
var id = 0;
|
||||
$('#modal_mprodi').modal('show');
|
||||
$('#modal_body_mprodi').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/modal_mprodi.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_mprodi').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#btn_baru_mjurusan').click(function(){
|
||||
var id = 0;
|
||||
$('#modal_mjurusan').modal('show');
|
||||
$('#modal_body_mjurusan').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/modal_mjurusan.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_mjurusan').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#btn_baru_muniv').click(function(){
|
||||
var id = 0;
|
||||
$('#modal_muniv').modal('show');
|
||||
$('#modal_body_muniv').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/modal_muniv.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_muniv').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#simpan_mprodi').click(function(){
|
||||
var id = $('#jkegiatan_id').val();
|
||||
var nama = $('#jkegiatan_nama').val();
|
||||
var key = 'simpan_mprodi';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/crud.php",
|
||||
data: 'id='+id
|
||||
+'&nama='+nama
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
$('#modal_mprodi').modal('hide');
|
||||
$('body').removeClass('modal-open');
|
||||
$('.modal-backdrop').remove();
|
||||
alert('tersimpan..');
|
||||
$('#tabel_mprodi').load("app/master/belajar/tabel_mprodi.php");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#simpan_mjurusan').click(function(){
|
||||
var id = $('#jpelatihan_id').val();
|
||||
var nama = $('#jpelatihan_nama').val();
|
||||
var key = 'simpan_mjurusan';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/crud.php",
|
||||
data: 'id='+id
|
||||
+'&nama='+nama
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
$('#modal_mjurusan').modal('hide');
|
||||
$('body').removeClass('modal-open');
|
||||
$('.modal-backdrop').remove();
|
||||
alert('tersimpan..');
|
||||
$('#tabel_mjurusan').load("app/master/belajar/tabel_mjurusan.php");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#simpan_muniv').click(function(){
|
||||
var id = $('#jtenaga_id').val();
|
||||
var nama = $('#jtenaga_nama').val();
|
||||
var key = 'simpan_muniv';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/crud.php",
|
||||
data: 'id='+id
|
||||
+'&nama='+nama
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
$('#modal_muniv').modal('hide');
|
||||
$('body').removeClass('modal-open');
|
||||
$('.modal-backdrop').remove();
|
||||
alert('tersimpan..');
|
||||
$('#tabel_muniv').load("app/master/belajar/tabel_muniv.php");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#modal_mprodi").on("hidden.bs.modal", function () {
|
||||
$(this).off('hidden.bs.modal');
|
||||
});
|
||||
|
||||
$("#modal_mjurusan").on("hidden.bs.modal", function () {
|
||||
$(this).off('hidden.bs.modal');
|
||||
});
|
||||
|
||||
$("#modal_muniv").on("hidden.bs.modal", function () {
|
||||
$(this).off('hidden.bs.modal');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include ('../../koneksi.php');
|
||||
$id=$_POST['id'];
|
||||
$data=pg_query("SELECT * FROM jurusan WHERE id='$id'");
|
||||
while($row=pg_fetch_array($data)) {
|
||||
$id=$row['id'];
|
||||
$nama=$row['nama'];
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Jurusan</label>
|
||||
<input type="hidden" value="<?php echo $id; ?>" id="mjurusan_id">
|
||||
<input type="text" class="form-control" value="<?php echo $nama; ?>" id="mjurusan_nama">
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include ('../../koneksi.php');
|
||||
$id=$_POST['id'];
|
||||
$data=pg_query("SELECT * FROM prodi WHERE id='$id'");
|
||||
while($row=pg_fetch_array($data)) {
|
||||
$id=$row['id'];
|
||||
$nama=$row['nama'];
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Prodi</label>
|
||||
<input type="hidden" value="<?php echo $id; ?>" id="mprodi_id">
|
||||
<input type="text" class="form-control" value="<?php echo $nama; ?>" id="mprodi_nama">
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include ('../../koneksi.php');
|
||||
$id=$_POST['id'];
|
||||
$data=pg_query("SELECT * FROM univ WHERE id='$id'");
|
||||
while($row=pg_fetch_array($data)) {
|
||||
$id=$row['id'];
|
||||
$nama=$row['nama'];
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Universitas</label>
|
||||
<input type="hidden" value="<?php echo $id; ?>" id="muniv_id">
|
||||
<input type="text" class="form-control" value="<?php echo $nama; ?>" id="muniv_nama">
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
include('../../koneksi.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">$("#tabel_data_mjurusan").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": true,"info": true,"autoWidth": false});</script>
|
||||
<table id="tabel_data_mjurusan" class="table table-striped table-condensed" cellpadding="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<td width="30px;"><b>ID</b></td>
|
||||
<td><b>Jurusan</b></td>
|
||||
<td align="center" width="30px;"><b>Tools</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$data = pg_query("SELECT * FROM jurusan ORDER BY id DESC");
|
||||
while($row=pg_fetch_array($data)) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="kiri"><b><?php echo $row['id']; ?></b></td>
|
||||
<td><b><?php echo $row['nama']; ?></b></td>
|
||||
<td class="kanan" align="center">
|
||||
<button type="button" name="edit_mjurusan" style="height:22px;" class="btn btn-teal btn-xs edit_mjurusan" id="<?php echo $row['id'];?>" data-content="Edit Data" rel="popover" data-placement="bottom" data-trigger="hover">
|
||||
<i class="fa fa fa-pencil"></i>
|
||||
</button>
|
||||
<!-- <button type="button" name="delete_mjurusan" style="height:22px;"class="btn btn-danger btn-xs delete_mjurusan" id="<?php echo $row['id'];?>" data-content="Hapus" rel="popover" data-placement="bottom" data-trigger="hover">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#tabel_data_mjurusan").on('click','.edit_mjurusan',function(){
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_mjurusan').modal('show');
|
||||
$('#modal_body_mjurusan').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/modal_mjurusan.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_mjurusan').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#tabel_data_mjurusan").on('click','.delete_mjurusan',function(){
|
||||
var x = confirm("Anda yakin ingin menghapus ?");
|
||||
if (x) {
|
||||
var key = "delete_mjurusan";
|
||||
var id = $(this).attr('id');
|
||||
var rowElement = $(this).parent().parent();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
rowElement.fadeOut(500).remove();
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
include('../../koneksi.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">$("#tabel_data_mprodi").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": true,"info": true,"autoWidth": false});</script>
|
||||
<table id="tabel_data_mprodi" class="table table-striped table-condensed" cellpadding="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width:30px"><b>ID</b></td>
|
||||
<td><b>Prodi</b></td>
|
||||
<td align="center" width="30px;"><b>Tools</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$data = pg_query("SELECT * FROM prodi ORDER BY id DESC");
|
||||
while($row=pg_fetch_array($data)) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="kiri"><b><?php echo $row['id']; ?></b></td>
|
||||
<td><b><?php echo $row['nama']; ?></b></td>
|
||||
<td class="kanan" align="center">
|
||||
<button type="button" name="edit_mprodi" style="height:22px;" class="btn btn-teal btn-xs edit_mprodi" id="<?php echo $row['id'];?>" data-content="Edit Data" rel="popover" data-placement="bottom" data-trigger="hover">
|
||||
<i class="fa fa fa-pencil"></i>
|
||||
</button>
|
||||
<!-- <button type="button" name="delete_mprodi" style="height:22px;"class="btn btn-danger btn-xs delete_mprodi" id="<?php echo $row['id'];?>" data-content="Hapus" rel="popover" data-placement="bottom" data-trigger="hover">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#tabel_data_mprodi").on('click','.edit_mprodi',function(){
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_mprodi').modal('show');
|
||||
$('#modal_body_mprodi').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/modal_mprodi.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_mprodi').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#tabel_data_mprodi").on('click','.delete_mprodi',function(){
|
||||
var x = confirm("Anda yakin ingin menghapus ?");
|
||||
if (x) {
|
||||
var key = "delete_mprodi";
|
||||
var id = $(this).attr('id');
|
||||
var rowElement = $(this).parent().parent();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
rowElement.fadeOut(500).remove();
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
include('../../koneksi.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">$("#tabel_data_muniv").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": true,"info": true,"autoWidth": false});</script>
|
||||
<table id="tabel_data_muniv" class="table table-striped table-condensed" cellpadding="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<td width="30px;"><b>ID</b></td>
|
||||
<td><b>Universitas</b></td>
|
||||
<td align="center" width="30px;"><b>Tools</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$data = pg_query("SELECT * FROM univ ORDER BY id DESC");
|
||||
while($row=pg_fetch_array($data)) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="kiri"><b><?php echo $row['id']; ?></b></td>
|
||||
<td><b><?php echo $row['nama']; ?></b></td>
|
||||
<td class="kanan" align="center">
|
||||
<button type="button" name="edit_muniv" style="height:22px;" class="btn btn-teal btn-xs edit_muniv" id="<?php echo $row['id'];?>" data-content="Edit Data" rel="popover" data-placement="bottom" data-trigger="hover">
|
||||
<i class="fa fa fa-pencil"></i>
|
||||
</button>
|
||||
<!-- <button type="button" name="delete_muniv" style="height:22px;"class="btn btn-danger btn-xs delete_muniv" id="<?php echo $row['id'];?>" data-content="Hapus" rel="popover" data-placement="bottom" data-trigger="hover">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#tabel_data_muniv").on('click','.edit_muniv',function(){
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_muniv').modal('show');
|
||||
$('#modal_body_muniv').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/modal_muniv.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_muniv').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#tabel_data_muniv").on('click','.delete_muniv',function(){
|
||||
var x = confirm("Anda yakin ingin menghapus ?");
|
||||
if (x) {
|
||||
var key = "delete_muniv";
|
||||
var id = $(this).attr('id');
|
||||
var rowElement = $(this).parent().parent();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/belajar/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
rowElement.fadeOut(500).remove();
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user