| Line 26... |
Line 26... |
| 26 |
});
|
26 |
});
|
| 27 |
|
27 |
|
| 28 |
$(document).on('click', 'a.mk_offer_detail', function () {
|
28 |
$(document).on('click', 'a.mk_offer_detail', function () {
|
| 29 |
let $offerTr = $(this).closest('tr');
|
29 |
let $offerTr = $(this).closest('tr');
|
| 30 |
let offerId = $offerTr.data('offerid');
|
30 |
let offerId = $offerTr.data('offerid');
|
| 31 |
doGetAjaxRequestHandler(`${context}\getOfferMargins?offerId=${offerId}`, function (data) {
|
31 |
doGetAjaxRequestHandler(`${context}/getOfferMargins?offerId=${offerId}`, function (data) {
|
| 32 |
$('#offerDescription .modal-content').html(data);
|
32 |
$('#offerDescription .modal-content').html(data);
|
| 33 |
$("#offerDescription").modal('show');
|
33 |
$("#offerDescription").modal('show');
|
| 34 |
});
|
34 |
});
|
| 35 |
});
|
35 |
});
|
| 36 |
$(document).on('click', 'a.offer_history', function () {
|
36 |
$(document).on('click', 'a.offer_history', function () {
|
| Line 43... |
Line 43... |
| 43 |
});
|
43 |
});
|
| 44 |
|
44 |
|
| 45 |
$(document).on('click', 'a.process_offer', function () {
|
45 |
$(document).on('click', 'a.process_offer', function () {
|
| 46 |
let $offerTr = $(this).closest('tr');
|
46 |
let $offerTr = $(this).closest('tr');
|
| 47 |
let offerId = $offerTr.data('offerid');
|
47 |
let offerId = $offerTr.data('offerid');
|
| 48 |
$clicked = $(this);
|
48 |
let $clicked = $(this);
|
| 49 |
if (confirm("Are your sure you want to process?")) {
|
49 |
if (confirm("Are your sure you want to process?")) {
|
| 50 |
$clicked.hide();
|
50 |
$clicked.hide();
|
| 51 |
doGetAjaxRequestHandler(`${context}/offer/process/${offerId}`, function () {
|
51 |
doGetAjaxRequestHandler(`${context}/offer/process/${offerId}`, function () {
|
| 52 |
alert("Offer Processed successfully");
|
52 |
alert("Offer Processed successfully");
|
| 53 |
$clicked.show();
|
53 |
$clicked.show();
|
| Line 119... |
Line 119... |
| 119 |
</div>`;
|
119 |
</div>`;
|
| 120 |
$allSlabContainers.html(slabHtml.repeat(15));
|
120 |
$allSlabContainers.html(slabHtml.repeat(15));
|
| 121 |
}
|
121 |
}
|
| 122 |
|
122 |
|
| 123 |
$(document).on('click', 'a.mk_offer_active', function () {
|
123 |
$(document).on('click', 'a.mk_offer_active', function () {
|
| 124 |
$clicked = $(this);
|
124 |
let $clicked = $(this);
|
| 125 |
let offerId = $clicked.closest('tr').data("offerid");
|
125 |
let offerId = $clicked.closest('tr').data("offerid");
|
| 126 |
if (confirm(`Are you sure want to activate ${offerId}?`)) {
|
126 |
if (confirm(`Are you sure want to activate ${offerId}?`)) {
|
| 127 |
doGetAjaxRequestHandler(`${context}/offer/active/${offerId}`, function (response) {
|
127 |
doGetAjaxRequestHandler(`${context}/offer/active/${offerId}`, function (response) {
|
| 128 |
alert("Offer is now active");
|
128 |
alert("Offer is now active");
|
| 129 |
$clicked.closest("li").html(`<a class="mk_offer_inactive" href="javascript:void(0)">Mark Inactive</a>`);
|
129 |
$clicked.closest("li").html(`<a class="mk_offer_inactive" href="javascript:void(0)">Mark Inactive</a>`);
|
| 130 |
});
|
130 |
});
|
| 131 |
}
|
131 |
}
|
| 132 |
});
|
132 |
});
|
| 133 |
$(document).on('click', 'a.mk_offer_inactive', function () {
|
133 |
$(document).on('click', 'a.mk_offer_inactive', function () {
|
| 134 |
$clicked = $(this);
|
134 |
let $clicked = $(this);
|
| 135 |
let offerId = $clicked.closest('tr').data("offerid");
|
135 |
let offerId = $clicked.closest('tr').data("offerid");
|
| 136 |
if (confirm(`Are you sure want to activate ${offerId}?`)) {
|
136 |
if (confirm(`Are you sure want to deactivate ${offerId}?`)) {
|
| 137 |
doGetAjaxRequestHandler(`${context}/offer/active/${offerId}?active=false`, function (response) {
|
137 |
doGetAjaxRequestHandler(`${context}/offer/active/${offerId}?active=false`, function (response) {
|
| 138 |
alert("Offer is now inactive");
|
138 |
alert("Offer is now inactive");
|
| 139 |
$clicked.closest("li").html(`<a class="mk_offer_active" href="javascript:void(0)">Mark Active</a>`);
|
139 |
$clicked.closest("li").html(`<a class="mk_offer_active" href="javascript:void(0)">Mark Active</a>`);
|
| 140 |
});
|
140 |
});
|
| 141 |
}
|
141 |
}
|