Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var getUrl = window.location;
- var url = getUrl .protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[0];
- function swalAlert(type,title,text,footer) {
- swal({
- icon : type,
- title : title,
- text : text,
- footer : footer,
- timer : null
- }).then((value) => {
- tabelData();
- //window.location.assign(url+"employees");
- });
- }
- function simpan() {
- $.ajax({
- data: $('#employeForm').serialize(),
- url: url+"employees/store",
- type: "POST",
- dataType: 'json',
- success: function (response) {
- swalAlert('success','Simpan Data','Data Berhasil Disimpan','Terima Kasih');
- $("#employeForm").trigger('reset');
- },
- error: function (response) {
- swalAlert('error','Simpan Data','Terjadi Kesalahan','Cek Isian Data Anda');
- $("#employeForm").trigger('reset');
- }
- });
- }
- function showTambah() {
- $("#tambahEmploye").modal("show");
- $("#titleEdit").addClass("fade");
- $("#Update").addClass("fade");
- $("#titleEntry").removeClass("fade");
- $("#save").removeClass("fade");
- $("#PasswordArea").removeClass("fade");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement