Subversion Repositories SmartDukaan

Rev

Rev 35982 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35982 Rev 37765
Line 10... Line 10...
10
  );
10
  );
11
 
11
 
12
} );
12
} );
13
 
13
 
14
function closeStore(fofoId, storeCode) {
14
function closeStore(fofoId, storeCode) {
15
    var inputCode = prompt("This will PERMANENTLY close the store. This action cannot be undone.\n\nTo confirm, type the store code: " + storeCode);
-
 
16
    if (inputCode === null) return;
-
 
17
    if (inputCode.trim() === "") {
-
 
18
        alert("Store code is required to confirm closure.");
-
 
19
        return;
-
 
20
    }
-
 
21
    if (inputCode.trim() !== storeCode) {
-
 
22
        alert("Store code does not match. Closure cancelled.");
-
 
23
        return;
-
 
24
    }
-
 
25
    $.ajax({
-
 
26
        url: contextPath + '/closeStore',
-
 
27
        type: 'POST',
-
 
28
        data: { fofoId: fofoId, storeCode: inputCode },
15
    openStoreClosureModal(fofoId, storeCode, function() {
29
        success: function(response) {
-
 
30
            alert("Store closed permanently.");
16
        inactiveStoreInfo("main-content");
31
            location.reload();
-
 
32
        },
-
 
33
        error: function(xhr) {
-
 
34
            alert("Error closing store: " + (xhr.responseText || "Unknown error"));
-
 
35
        }
-
 
36
    });
17
    });
37
}
18
}
38
</script>
19
</script>
39
<section class="wrapper">
20
<section class="wrapper">
40
	<div class="row">
21
	<div class="row">