Subversion Repositories SmartDukaan

Rev

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