Skip to content

Commit

Permalink
modif all
Browse files Browse the repository at this point in the history
  • Loading branch information
surya432 committed Jun 10, 2019
1 parent c6206d2 commit 008d601
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 51 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/BrokenLinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function brokenlinksIndexTables()
$query->from('contents')->select('drama_id')->whereIn('id', function ($query) {
$query->from('brokenlinks')->select('contents_id')->groupBy('contents_id')->get();
})->select('drama_id')->groupBy('drama_id')->get();
})->orderBy('id', 'desc')->get();
})->inRandomOrder()->orderBy('id', 'desc')->get();
return Datatables::of($data)
->addColumn('folderids', function ($data) {
if ($data->folderid !== "") {
Expand Down
16 changes: 12 additions & 4 deletions app/Http/Controllers/GmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,18 @@ public function Post(Request $request)
{
if (!empty($request->input("id"))) {
$gmail = Gmail::find($request->input("id"));
$gmail->email = Input::get("email");
$gmail->token = Input::get("token");
$gmail->apiUrl = Input::get("apiUrl");
$gmail->folderid = Input::get("folderid");
if(!empty($request->input("email"))){
$gmail->email = Input::get("email");
}
if(!empty($request->input("token"))){
$gmail->token = Input::get("token");
}
if(!empty($request->input("apiUrl"))){
$gmail->apiUrl = Input::get("apiUrl");
}
if(!empty($request->input("folderid"))){
$gmail->folderid = Input::get("folderid");
}
$gmail->save();
return response()->json($gmail, 201);
}
Expand Down
18 changes: 10 additions & 8 deletions resources/views/dashboard/allusers.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,16 @@
id: $(this).attr('data-id')
},
success: function(data) {
$(".alert-success").text("Delete User " + fn + " success")
$(".alert-success").show()
/* $(".alert-success").text("Delete User " + fn + " success")
$(".alert-success").show() */
swal("SUCCESS", "Success Save", "success")
$('#modelId').modal('hide');
$("#table-users").DataTable().ajax.reload(null, false);
},
error: function(data) {
$(".alert-danger").text("Delete User " + fn + " failed")
$(".alert-danger").show()
swal("Error!!", "Something Error", "error")
}
});
}
Expand All @@ -136,15 +137,16 @@
url: "{{ route('users.add') }}",
data: $(this).serializeArray(),
success: function(data) {
$(".alert-success").text(data.success)
$(".alert-success").show()
swal("SUCCESS", "Success Save", "success")
$('#modelId').modal('hide');
$("#table-users").DataTable().ajax.reload(null, false);
},
error: function(data) {
$(".alert-danger").text(data.responseJSON.alert)
$(".alert-danger").show()
swal("Error!!", data.responseJSON.alert, "error")
$("#table-users").ajax.reload();
$('#modelId').modal('hide');
Expand Down
16 changes: 8 additions & 8 deletions resources/views/dashboard/drama.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@
url: "{{ route('dramaPost') }}",
data: $(this).serializeArray(),
success: function(data) {
$(".alert-success").fadeIn().html(data).wait(2000).fadeOut('slow');
swal("SUCCESS", data, "success")
$("#table-users").DataTable().ajax.reload(null, false);
$("#formDrama")[0].reset()
$('#modelId').modal('hide');
},
error: function(data) {
$(".alert-success").fadeIn().html(data).wait(2000).fadeOut('slow');
swal("SUCCESS", data, "error")
$("#table-users").DataTable().ajax.reload(null, false);
$("#formDrama")[0].reset()
$('#modelId').modal('hide');
Expand All @@ -155,14 +155,14 @@
id: $(this).attr('data-id')
},
success: function(data) {
$(".alert-success").fadeIn().html('Delete Success').wait(2000).fadeOut(
'slow');
swal("SUCCESS", data, "success")
$("#table-users").DataTable().ajax.reload(null, false);
},
error: function(data) {
$(".alert-success").fadeIn().html('Delete Error').wait(2000).fadeOut(
'slow');
swal("Error", "Error Delete", "error")
$("#table-users").DataTable().ajax.reload(null, false);
}
});
Expand Down Expand Up @@ -215,12 +215,12 @@ function btnSingkron() {
type: "get",
success: function(data) {
$(".alert-success").fadeIn().html('Singkron Success').wait(2000).fadeOut('slow');
swal("SUCCESS", 'Singkron Success', "success")
$("#table-users").DataTable().ajax.reload(null, false);
},
error: function(data) {
$(".alert-success").fadeIn().html('Singkron Error').wait(2000).fadeOut('slow');
swal("error", 'Singkron error', "error")
$("#table-users").DataTable().ajax.reload(null, false);
}
});
Expand Down
22 changes: 10 additions & 12 deletions resources/views/dashboard/dramaEps.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@
url: "{{ route('dramaPost') }}",
data: $(this).serializeArray(),
success: function(data) {
$(".alert-success").fadeIn().html(data).wait(2000).fadeOut('slow');
swal("SUCCESS", data, "success");
$('#modelId2343').modal('hide');
},
error: function(data) {
$(".alert-success").fadeIn().html(data).wait(2000).fadeOut('slow');
swal("error",data, "error");
$('#modelId2343').modal('hide');
}
Expand Down Expand Up @@ -275,14 +275,12 @@
id: $(this).attr('data-id')
},
success: function(data) {
$(".alert-success").fadeIn().html('Create Success').wait(2000).fadeOut(
'slow');
swal("SUCCESS", data, "success");
$("#table-users").DataTable().ajax.reload(null, false);
document.location.reload();
},
error: function(data) {
$(".alert-success").fadeIn().html('Create Error').wait(2000).fadeOut(
'slow');
swal("error", "error", "error");
$("#table-users").DataTable().ajax.reload(null, false);
}
});
Expand All @@ -295,15 +293,15 @@
url: "{{ route('epsPost', $result->id) }}",
data: $(this).serializeArray(),
success: function(data) {
$(".alert-success").fadeIn().html(data).wait(20000).fadeOut('slow');
swal("SUCCESS", data, "success");
$("#table-users").DataTable().ajax.reload(null, false);
$("#formDrama")[0].reset()
$('#modelId').modal('hide');
$(".alert-success").fadeOut(20000);
},
error: function(data) {
$(".alert-success").fadeIn().html(data).wait(20000).fadeOut('slow');
swal("error", "error", "error");
$("#table-users").DataTable().ajax.reload(null, false);
$("#formDrama")[0].reset()
$('#modelId').modal('hide');
Expand Down Expand Up @@ -344,13 +342,13 @@
id: id,
},
success: function(data) {
$(".alert-success").fadeIn().html('Delete User ' + fn + ' success')
.wait(20000).fadeOut('slow');
swal("SUCCESS", fn, "success");
$("#table-users").DataTable().ajax.reload(null, false);
},
error: function(data) {
$(".alert-success").fadeIn().html('Delete User ' + fn + ' Failed').wait(
20000).fadeOut('slow');
swal("error", fn, "error");
$("#table-users").DataTable().ajax.reload(null, false);
}
Expand Down
14 changes: 6 additions & 8 deletions resources/views/dashboard/gmail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,13 @@
url: "{{ route('gmailPost') }}",
data: $(this).serializeArray(),
success: function(data) {
$(".alert-success").text("Update Success")
$(".alert-success").show()
swal("success", "success Update", "success")
$("#table-users").DataTable().ajax.reload(null, false);
$("#formGmail")[0].reset()
},
error: function(data) {
$(".alert-danger").text("Failed Update")
$(".alert-danger").show()
swal("error", "fail Update", "error")
$("#table-users").DataTable().ajax.reload(null, false);
$("#formGmail")[0].reset()
}
Expand All @@ -95,13 +93,13 @@
id: $(this).attr('data-id')
},
success: function(data) {
$(".alert-success").text("Delete User " + fn + " success")
swal("SUCCESS", fn, "success")
$(".alert-success").show();
$("#table-users").DataTable().ajax.reload(null, false);
},
error: function(data) {
$(".alert-danger").text("Delete User " + fn + " failed")
swal("error", fn, "error")
$(".alert-danger").show()
$("#table-users").DataTable().ajax.reload(null, false);
}
Expand All @@ -115,11 +113,11 @@
"pageLength": 10,
"ajax": "{{ route('gmailData') }}",
"order": [
[3, "asc"]
[4, "asc"]
],
columnDefs: [{
type: 'date-euro',
targets: 3
targets: 4
}],
"columns": [{
data: 'id',
Expand Down
16 changes: 8 additions & 8 deletions resources/views/dashboard/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ function btnSingkronToweb(idPost, titlePost) {
url: "{{ route('dramaPost') }}",
data: $(this).serializeArray(),
success: function(data) {
$(".alert-success").fadeIn().html(data).wait(2000).fadeOut('slow');
swal("success", data, "success")
$("#table-users").DataTable().ajax.reload(null, false);
$("#formDrama")[0].reset()
$('#modelId').modal('hide');
},
error: function(data) {
$(".alert-success").fadeIn().html(data).wait(2000).fadeOut('slow');
swal("error", data, "error")
$("#table-users").DataTable().ajax.reload(null, false);
$("#formDrama")[0].reset()
$('#modelId').modal('hide');
Expand All @@ -155,14 +155,14 @@ function btnSingkronToweb(idPost, titlePost) {
id: $(this).attr('data-id')
},
success: function(data) {
$(".alert-success").fadeIn().html('Delete Success').wait(2000).fadeOut(
'slow');
swal("success", data, "success")
$("#table-users").DataTable().ajax.reload(null, false);
},
error: function(data) {
$(".alert-success").fadeIn().html('Delete Error').wait(2000).fadeOut(
'slow');
swal("error", data, "error")
$("#table-users").DataTable().ajax.reload(null, false);
}
});
Expand Down Expand Up @@ -216,12 +216,12 @@ function btnSingkron() {
type: "get",
success: function(data) {
$(".alert-success").fadeIn().html('Singkron Success').wait(2000).fadeOut('slow');
swal("success", "success", "success")
$("#table-users").DataTable().ajax.reload(null, false);
},
error: function(data) {
$(".alert-success").fadeIn().html('Singkron Error').wait(2000).fadeOut('slow');
swal("error", "error", "error")
$("#table-users").DataTable().ajax.reload(null, false);
}
});
Expand Down
3 changes: 3 additions & 0 deletions resources/views/dashboard/setting.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ function getData() {
url: "{{ route('setting.postData') }}",
data: $(this).serializeArray(),
success: function(data) {
swal("success", "success", "success");
$("input[name=id]").val(data.id);
$("input[name=site_name]").val(data.site_name);
$("input[name=folder720p]").val(data.folder720p);
Expand All @@ -165,6 +166,8 @@ function getData() {
$(".alert-success").show()
},
error: function(data) {
swal("error", "error", "error");
$("input[name=id]").val(data.id);
$("input[name=site_name]").val(data.site_name);
$("input[name=folder720p]").val(data.folder720p);
Expand Down
1 change: 1 addition & 0 deletions resources/views/parts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

<link href="{!! asset('theme/vendor/font-awesome/css/font-awesome.min.css') !!}" rel="stylesheet" type="text/css">

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js"></script>


</head>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/viu/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ function getById() {
},
success: function(data) {
$(".alert-success").fadeIn().html("Berhasil Di Dapatkan").wait(20000).fadeOut('slow');
swal("success", "success", "success");
$('#exampleFormControlTextarea1').html(data);
},
error: function(request, status, error) {
$(".alert-danger").fadeIn().html("Gagal Di Dapatkan").wait(20000).fadeOut('slow');
swal("error", "error", "error");
$('#exampleFormControlTextarea1').html("");
alert(request.responseText);
}
Expand Down
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
Route::get('/dramasqq', ['as' => 'dramasqq', 'uses' => 'DramaController@dramas']);

Route::get('/backup/dramasqq', ['as' => 'backup', 'uses' => 'BackupController@index']);
Route::post('/gmail/update', ['as' => 'gmailPostUpdate', 'uses' => 'GmailController@Post']);

Route::group(['middleware' => ['web']], function () {
Route::post('/admin/logout', ['as' => 'logout', 'uses' => 'LoginController@logout']);
Expand Down

0 comments on commit 008d601

Please sign in to comment.