-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdonate.php
116 lines (107 loc) · 3.63 KB
/
donate.php
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php require_once("config.php") ?>
<style>
#uni_modal .modal-content>.modal-footer{
display:none !important;
}
#uni_modal .modal-content>.modal-body{
padding:unset !important;
}
</style>
<div class="container-fluid py-2 px-3">
<p>Your donation will be much appreciated and can help others. Thank you!</p>
<!-- <div class="form-group">
<input type="text" step="2" min="0" id="amount" class="form-control form-control-lg text-right">
<center><small>Enter Orphan Name Here</small></center>
</div> -->
<center><div class="form-group col-md-4">
<select id="inputState" class="form-control">
<option selected> </option>
<option>Sakshi Kalambale</option>
<option>Ram Sharan</option>
<option>Ashish Rathi</option>
<option>Hanif Sheikh</option>
<option>Jyoti Ghosh</option>
<option>Bharti Puri</option>
</select>
<small>Select Orphan</small>
</div></center>
<div class="form-group">
<input type="number" step="2" min="0" id="amount" class="form-control form-control-lg text-right">
<center><small>Enter Donation Amount Here</small></center>
</div>
<div class="form-group">
<!-- <center><span id="paypal-button"></span><br> -->
<button type="button" class="btn btn-secondary" id="pay">Pay</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</center>
</div>
<script>
// function payment_online(){
// $('[name="payment_method"]').val("Online Payment")
// $('[name="paid"]').val(1)
// $('#place_order').submit()
// }
$(function(){
// paypal.Button.render({
// env: 'sandbox', // change for production if app is live,
// //app's client id's
// client: {
// sandbox: 'AdDNu0ZwC3bqzdjiiQlmQ4BRJsOarwyMVD_L4YQPrQm4ASuBg4bV5ZoH-uveg8K_l9JLCmipuiKt4fxn',
// //production: 'AaBHKJFEej4V6yaArjzSx9cuf-UYesQYKqynQVCdBlKuZKawDDzFyuQdidPOBSGEhWaNQnnvfzuFB9SM'
// },
$('#pay').click(function(){
donation_success()
})
})
// commit: true, // Show a 'Pay Now' button
// style: {
// color: 'blue',
// size: 'small'
// },
// payment: function(data, actions) {
// return actions.payment.create({
// payment: {
// transactions: [
// {
// //total purchase
// amount: {
// total: $('#amount').val(),
// currency: 'PHP'
// }
// }
// ]
// }
// });
// },
// onAuthorize: function(data, actions) {
// return actions.payment.execute().then(function(payment) {
// // //sweetalert for successful transaction
// // swal('Thank you!', 'Paypal purchase successful.', 'success');
// });
// },
// }, '#paypal-button');
// })
function donation_success(){
start_loader()
$.ajax({
url:"classes/Master.php?f=save_donation",
method:'POST',
data:{amount:$('#amount').val()},
dataType:'json',
error:err=>{
console.log(err)
alert_toast("Process Was successfull but failed to record the amount into the database")
end_loader();
},success:function(resp){
if(resp.status == 'success'){
location.reload()
}else{
console.log(resp)
alert_toast("Process Was successfull but failed to record the amount into the database")
}
end_loader();
}
})
}
</script>