Subversion Repositories SmartDukaan

Rev

Rev 23809 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21101 kshitij.so 1
<html>
2
<head>
3
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
4
<style>
5
actionMessage{
6
	paddding:0px;
7
}
8
.actionError{
9
	padding:0px;
10
}
22057 amit.gupta 11
table, th, td {
12
    border: 1px solid black;
13
}
21101 kshitij.so 14
</style>
15
</head>
16
<body>
23809 amit.gupta 17
#set($wallet = $action.getUserWallet())
18
#set($user = $action.getUser())
21101 kshitij.so 19
<a href="/Support/reports">Back</a>
20
<a href="/Support/logout">Logout</a>
23809 amit.gupta 21
<h2>Credit User Wallet - $user.getName()</h2>
21101 kshitij.so 22
<div style="color:blue;">
23
	#sactionmessage()
24
</div>
25
<div style="color:red;">
26
	#sactionerror()
27
</div>
28
<form action="/Support/user-wallet-credit!getWallet" method="POST">
29
	<label for="email">Email:</label>
30
    <input name="email" />
31
	<button type="submit" style="margin:5px;">Submit</button>
32
</form>
33
<hr/>
34
#if($wallet.getAmount())
35
    <div>
36
    	<label for="email">Current Wallet Amount ($user.getEmail()):</label>
37
		$wallet.getAmount()
38
    </div>
39
	<form id="wallet-topup">
40
	<label for="amount">Amount:</label>
41
    <input id="amount" name="amount" />
23809 amit.gupta 42
	<input id="email" name="email" type="hidden" value="$user.getEmail()"/>
43
	<label for="cashback">CashBack:</label>
21363 kshitij.so 44
	<select name="cashback">
45
		<option value="0">0%</option>
46
		<option value="1">1%</option>
47
	</select>
23809 amit.gupta 48
	<label for="transactionType">Transaction Type</label>
49
	<select name="transactionType">
23812 amit.gupta 50
		<option value="ADVANCE_AMOUNT">Advance</option>
23809 amit.gupta 51
		<option value="ADVANCE_REVERSAL">Advance Reversal</option>
52
	</select>
22044 amit.gupta 53
	<label for="description">Short Description:</label>
22060 amit.gupta 54
	<input id="shortDescription" name="description" />
21101 kshitij.so 55
	<button type="submit" style="margin:5px;">Submit</button>
56
	</form>
22044 amit.gupta 57
	<hr>
58
	<h4>Last 20 Transactions</h4>
22057 amit.gupta 59
	<table style="border-collapse:collapse;">
22044 amit.gupta 60
		<tr>
61
			<th>Id</th>
62
			<th>Amount</th>
63
			<th>Refundable</th>
64
			<th>Reference Number</th>
65
			<th>Reference Type</th>
66
			<th>Created</th>
67
			<th>Short Description</th>
68
		</tr>
69
		#foreach($walletTr in $action.getUserWalletHistory())
70
		<tr>
71
			<td>$walletTr.getId()</td>
72
			<td>$walletTr.getAmount()</td>
73
			<td>$walletTr.getRefundableAmount()</td>
74
			<td>$walletTr.getReferenceNumber()</td>
75
			<td>$walletTr.getReferenceType()</td>
22055 amit.gupta 76
			<td>$action.getDate($walletTr.getTimestamp())</td>
22052 amit.gupta 77
			<td>$walletTr.getDescription()</td>
22044 amit.gupta 78
		</tr>
79
		#end
80
	</table>
81
 
21101 kshitij.so 82
#end
83
</body>
84
<script type="text/javascript">
85
$("#wallet-topup").live('submit', function(){
86
	var amt = $('#amount').val();
87
	var email = $('#email').val();
88
	if (amt==isNaN(amt) || amt==null || amt==""){
89
		alert("Empty amount.");
90
		return false;
91
	}
92
	if(!confirm("Adding amount "+amt+" to "+email)){
93
		return false;
94
	}
95
	var data = $(this).serialize();
96
    jQuery.ajax({
97
        url: "/Support/user-wallet-credit!creditWallet",
98
        type: 'POST',
99
        data: data,
100
        async: false,
101
        success: function (data) {
102
			$('#wallet-topup')[0].reset();
103
			alert(data);
104
		},
105
		error : function() {
106
		 	alert("OOPS!!!Failed to do changes.Try Again.");
107
			$('#wallet-topup')[0].reset();
108
		 },
109
        cache: false,
110
        contentType: "application/x-www-form-urlencoded",
111
        processData: false
112
    });
113
	location.reload();
114
    return false;
115
	});
116
</script>
117
 
118
</html>