Subversion Repositories SmartDukaan

Rev

Rev 6679 | Rev 6730 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6679 Rev 6680
Line 17... Line 17...
17
</head>
17
</head>
18
<body>
18
<body>
19
	#parse("../content/reports-common.vm")
19
	#parse("../content/reports-common.vm")
20
	<div>
20
	<div>
21
	<h3>Create New Gift Voucher</h3>
21
	<h3>Create New Gift Voucher</h3>
22
	<form id="new-coupon" style='padding-left:20px;' name="coupon" method="POST">
22
	<form id="new-coupon" style='padding-left:20px;' name="coupon" onsubmit="return validateFields()" method="POST">
23
		<div class='form-div'>
23
		<div class='form-div'>
24
			Type: 
24
			Type: 
25
			<select name="type">
25
			<select name="type">
26
				<option value="27" selected="selected">Gift Voucher</option>
26
				<option value="27" selected="selected">Gift Voucher</option>
27
			</select>			
27
			</select>			
28
		</div>
28
		</div>
29
		<div class='form-div'>
29
		<div class='form-div'>
30
			User Email:
30
			User Email:
31
			<input type="text" name="userEmail"/><span style='font-size:14px;padding-left:5px;color:red;'>Enter * if coupon is not specific to one user</span>
31
			<input type="text" name="userEmail"/><span style='font-size:14px;padding-left:5px;color:red;'>If multiple emails, enter email Ids separated by commas. Enter * if coupon is not specific to any email Id.</span>
32
		</div>
32
		</div>
33
		<div class='form-div'>
33
		<div class='form-div'>
34
			Discount type:
34
			Discount type:
35
			<input type='radio' name='discountType' checked='true' value='absolute'>Absolute</input>
35
			<input type='radio' name='discountType' checked='true' value='absolute'>Absolute</input>
36
			<input type='radio' name='discountType' value='percent'>Percent</input>
36
			<input type='radio' name='discountType' value='percent'>Percent</input>
Line 47... Line 47...
47
				<option value='both'>BOTH</option>
47
				<option value='both'>BOTH</option>
48
			</select>
48
			</select>
49
		</div>
49
		</div>
50
		<div id='clickToShow' class='clickToShow' style='margin-top:20px; margin-bottom:10px;cursor:pointer;'>
50
		<div id='clickToShow' class='clickToShow' style='margin-top:20px; margin-bottom:10px;cursor:pointer;'>
51
    		<img id='optionImage' height='14px' width='14px;' src='images/sideways.png'/>
51
    		<img id='optionImage' height='14px' width='14px;' src='images/sideways.png'/>
52
			<span style='color:blue;text-decoration:underline;' onClick='showOptional()'>
52
			<span style='color:blue;text-decoration:underline;' onclick='showOptional()'>
53
				Optional Parameters
53
				Optional Parameters
54
			</span>
54
			</span>
55
		<div id='optional' style='display:none'>
55
		<div id='optional' style='display:none'>
56
			<div class='form-div'>
56
			<div class='form-div'>
57
				Limit per user:
57
				Limit per user:
Line 105... Line 105...
105
			#set ($arguments = $action.getArguments($coupon))
105
			#set ($arguments = $action.getArguments($coupon))
106
			<tr>
106
			<tr>
107
				<td>$coupon.getCouponCode()</td>
107
				<td>$coupon.getCouponCode()</td>
108
				<td>$arguments.get(0)</td>
108
				<td>$arguments.get(0)</td>
109
				<td>$arguments.get(1)</td>
109
				<td>$arguments.get(1)</td>
110
				<td><form method="DELETE" action="coupon-gvs/$coupon.getCouponCode()"><input type="submit" value="delete" onClick="return confirm('Are you sure?')"/></form></td>
110
				<td><form method="DELETE" action="coupon-gvs/$coupon.getCouponCode()"><input type="submit" value="delete" onclick="return confirm('Are you sure?')"/></form></td>
111
			</tr>
111
			</tr>
112
			#end
112
			#end
113
		</table>
113
		</table>
114
	</div>
114
	</div>
115
</body>
115
</body>
Line 122... Line 122...
122
	} else {
122
	} else {
123
    	document.getElementById('optionImage').src="images/down.png";
123
    	document.getElementById('optionImage').src="images/down.png";
124
    	document.getElementById('optional').style.display='block';
124
    	document.getElementById('optional').style.display='block';
125
	}
125
	}
126
}
126
}
-
 
127
 
-
 
128
function validateFields() {
-
 
129
    var email=document.forms["coupon"]["userEmail"].value;
-
 
130
    if (email==null || email=="")
-
 
131
    {
-
 
132
        alert("Email cannot be empty!");
-
 
133
        return false;
-
 
134
    }
-
 
135
	var discount=document.forms["coupon"]["discount"].value;
-
 
136
	if (discount==null || discount=="")
-
 
137
    {
-
 
138
        alert("Discount cannot be empty!");
-
 
139
        return false;
-
 
140
    }
-
 
141
	return true;
-
 
142
}
127
</script>
143
</script>
128
</html>
144
</html>
129
145