fixed error message on unsuccessful fileupload + list reload
This commit is contained in:
parent
3190217b97
commit
e7508727b6
@ -14,6 +14,7 @@ function init_saimod_sys_files_list(){
|
|||||||
$.getJSON('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=del&cat='+$(this).attr("cat")+'&id='+$(this).attr("id"), function(data){
|
$.getJSON('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=del&cat='+$(this).attr("cat")+'&id='+$(this).attr("id"), function(data){
|
||||||
if(data.status){
|
if(data.status){
|
||||||
alert("ok");
|
alert("ok");
|
||||||
|
system.reload();
|
||||||
} else{
|
} else{
|
||||||
alert("fail");
|
alert("fail");
|
||||||
}
|
}
|
||||||
@ -21,13 +22,18 @@ function init_saimod_sys_files_list(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(".imgrnbtn").click(function(){
|
$(".imgrnbtn").click(function(){
|
||||||
|
if($($(this).attr("textfield")).val() === ''){
|
||||||
|
alert('Name cant be empty!');
|
||||||
|
} else {
|
||||||
$.getJSON('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=rn&cat='+$(this).attr("cat")+'&id='+$(this).attr("id")+'&newid='+$($(this).attr("textfield")).val(), function(data){
|
$.getJSON('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=rn&cat='+$(this).attr("cat")+'&id='+$(this).attr("id")+'&newid='+$($(this).attr("textfield")).val(), function(data){
|
||||||
if(data.status){
|
if(data.status){
|
||||||
alert("ok");
|
alert("ok");
|
||||||
|
system.reload();
|
||||||
} else{
|
} else{
|
||||||
alert("fail");
|
alert("fail");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#datei').change(function(){
|
$('#datei').change(function(){
|
||||||
@ -44,7 +50,14 @@ function init_saimod_sys_files_list(){
|
|||||||
url: './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=upload&cat='+$(this).attr('cat'), //Server script to process data
|
url: './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=upload&cat='+$(this).attr('cat'), //Server script to process data
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
//Ajax events
|
//Ajax events
|
||||||
success: function(){alert('ok');},
|
success: function(data){
|
||||||
|
if(data.status){
|
||||||
|
alert('ok');
|
||||||
|
system.reload();
|
||||||
|
} else {
|
||||||
|
alert(data.result.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
error: function(){alert('fail');},
|
error: function(){alert('fail');},
|
||||||
// Form data
|
// Form data
|
||||||
data: formData,
|
data: formData,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user