forked from userexec/Sendy-Invoicing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit-brand-addition.html
63 lines (57 loc) · 1.9 KB
/
edit-brand-addition.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!--
SENDY INVOICING - EDIT-BRAND-ADDITION
The contents of this file should be pasted into edit-brand.php. Look for the
section around line 397 that looks like this:
<label class="control-label" for="cost_per_recipient">php echo _('Cost per recipient');</label>
<div class="control-group">
<div class="controls">
<div class="input-prepend input-append">
<span class="add-on">php echo $currency_symbol;</span><input type="text" class="input-xlarge" id="-cost_per_recipient" name="cost_per_recipient" placeholder="Eg. .01" value="php echo get_saved_data('cost_per_recipient');" style="width: 80px;">
</div>
</div>
</div>
The contents of this file should appear immediately AFTER the aforementioned
block of code.
-->
<div class="control-group checkbox" style="margin-top: 1rem;">
<label class="control-label" onclick="toggleInvoicing()">
<input id="invoicing" type="checkbox"> <?php echo _('Charge via invoicing');?>
</label>
</div>
<script>
/*global $*/
// CHECK CURRENT INVOICING SELECTION
function checkInvoicing() {
'use strict';
$.ajax({
url: '<?php echo get_app_info("path")?>/includes/Sendy-Invoicing/check-invoicing.php',
type: 'POST',
cache: false,
data: 'i=<?php echo $_GET["i"];?>',
success: function(result) {
if (result == 1) {
$('#invoicing').prop('checked', true);
} else {
$('#invoicing').prop('checked', false);
}
},
error: function() {
$('#invoicing').prop('checked', false);
}
});
}
checkInvoicing();
// TOGGLE INVOICING IN DATABASE
function toggleInvoicing() {
'use strict';
$.ajax({
url: '<?php echo get_app_info("path")?>/includes/Sendy-Invoicing/toggle-invoicing.php',
type: 'POST',
cache: false,
data: 'i=<?php echo $_GET["i"];?>',
success: function() {
checkInvoicing();
}
});
}
</script>