Assign coupons

This commit is contained in:
dev-chiefworks
2022-06-02 21:05:53 -04:00
parent d3e28d2aad
commit 51f2b550bc
3 changed files with 143 additions and 22 deletions
+22 -22
View File
@@ -49,11 +49,14 @@
<th scope="row">Coupon Range</th>
<td><input type="number" class="form-control" id="from_coupon" aria-describedby="emailHelp" value="1000" placeholder="Amount From"></td>
<td><input type="number" class="form-control" id="to_coupon" aria-describedby="emailHelp" value="10000" placeholder="Amount To"></td>
<td><button type="submit" class="btn btn-primary">Submit</button></td>
<td><button type="submit" onclick="findCoupon(0)" class="btn btn-primary">Submit</button></td>
</tr>
</tbody>
</table>
</div>
<div id="coupon_sec">
</div>
</div>
@@ -113,42 +116,39 @@
<!-- /main content -->
<script type="text/javascript">
<!--
function resendLink(link_id) {
if (confirm("Are you sure you want to resend this link?")) {
// do something
} else {
return false;
}
$('#btu' + link_id).html('Processing...');
$('#acc' + link_id).prop('disabled', true);
function findCoupon(coupon_id) {
var from_coupon = $('#from_coupon').val();
var to_coupon = $('#to_coupon').val();
$.ajax({
url: "/bkouser/resend_pending?link_id=" + link_id
url: "/bkosmember/listcoupon?from_coupon=" + from_coupon + "&to_coupon=" +to_coupon
}).done(function (data) {
$('#btu' + link_id).html(data);
document.offer_individual.rec_email.value = '';
$('#acc' + link_id).prop('disabled', false);
$('#coupon_sec').html(data);
// document.offer_individual.rec_email.value = '';
// $('#acc' + link_id).prop('disabled', false);
});
return false;
}
function assignCoupon(coupon_id) {
function deleteLink(link_id) {
if (confirm("Are you sure you want to delete this link?")) {
if (confirm("Are you sure you want to assign this coupon ?")) {
// do something
} else {
return false;
}
$('#dtu' + link_id).html('Processing...');
$('#del' + link_id).prop('disabled', true);
$.ajax({
url: "/bkouser/delete_pending?link_id=" + link_id
url: "/bkosmember/assigncoupon?coupon_id=" + coupon_id
}).done(function (data) {
$('#dtu' + link_id).html(data);
document.offer_individual.rec_email.value = '';
$('#del' + link_id).prop('disabled', false);
$('#c_sec'+coupon_id).html(data);
// document.offer_individual.rec_email.value = '';
// $('#acc' + link_id).prop('disabled', false);
});
return false;
}
// -->
</script>