Subversion Repositories SmartDukaan

Rev

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

Rev 30605 Rev 30610
Line 20... Line 20...
20
});
20
});
21
 
21
 
22
 
22
 
23
$(document).on('click', ".updateWebOfferDuration", function() {
23
$(document).on('click', ".updateWebOfferDuration", function() {
24
	var webOfferId = $(this).data("id");
24
	var webOfferId = $(this).data("id");
-
 
25
	console.log(webOfferId)
-
 
26
 
-
 
27
	webOfferTitle = $("#web-offer-update-title").val();
-
 
28
	detailedText = $("#detailed-update-text").val();
-
 
29
 
-
 
30
	console.log(webOfferTitle)
-
 
31
 
-
 
32
	if (webOfferTitle === "") {
-
 
33
		alert("Title is required");
-
 
34
		return false;
-
 
35
	}
-
 
36
 
-
 
37
 
-
 
38
	var json = {
-
 
39
		id: webOfferId,
-
 
40
		title: webOfferTitle,
-
 
41
		detailedText: detailedText,
-
 
42
		startDate: getDatesFromPicker('input[name="offerUpdatedateRange"]').startDate,
-
 
43
		endDate: getDatesFromPicker('input[name="offerUpdatedateRange"]').endDate
-
 
44
	}
25
 
45
 
26
	startDate = getDatesFromPicker('input[name="offerUpdatedateRange"]').startDate,
46
	startDate = getDatesFromPicker('input[name="offerUpdatedateRange"]').startDate,
27
		endDate = getDatesFromPicker('input[name="offerUpdatedateRange"]').endDate
47
		endDate = getDatesFromPicker('input[name="offerUpdatedateRange"]').endDate
28
	if (confirm("Are you sure you want to update offer!") == true) {
48
	if (confirm("Are you sure you want to update offer!") == true) {
29
		doPostAjaxRequestHandler(context
-
 
30
			+ "/web-offer-duration/update?id="
-
 
31
			+ webOfferId + "&startDate=" + startDate + "&endDate=" + endDate, function(response) {
-
 
32
				if (response == 'true') {
-
 
33
					alert("update successfully ");
-
 
34
 
49
 
-
 
50
		doPostAjaxRequestWithJsonHandler(context + "/web-offer-duration/update", JSON.stringify(json), function(response) {
35
					$('#main-content').html(response);
51
			$('#main-content').html(response);
36
				}
-
 
37
			});
52
		});
38
 
53
 
39
		return false;
54
		return false;
40
	}
55
	}
41
 
56
 
42
});
57
});
Line 80... Line 95...
80
})
95
})
81
 
96
 
82
function addWebOffer() {
97
function addWebOffer() {
83
	webOfferTitle = $("#web-offer-title").val();
98
	webOfferTitle = $("#web-offer-title").val();
84
	smallText = $("#small-text").val();
99
	smallText = $("#small-text").val();
85
	largeText = $("#large-text").val();
100
	largeText = $("#detailed-text").val();
86
	smallBannerUrl = $("#offer-banner-small").val();
101
	smallBannerUrl = $("#offer-banner-small").val();
87
 
102
 
88
	if (webOfferTitle === "") {
103
	if (webOfferTitle === "") {
89
		alert("Title is required");
104
		alert("Title is required");
90
		return false;
105
		return false;
Line 92... Line 107...
92
 
107
 
93
	var json = {
108
	var json = {
94
		id: 0,
109
		id: 0,
95
		title: webOfferTitle,
110
		title: webOfferTitle,
96
		smallText: smallText,
111
		smallText: smallText,
97
		largeText: largeText,
112
		detailedText: largeText,
98
		smallBannerUrl: smallBannerUrl,
113
		smallBannerUrl: smallBannerUrl,
99
		startDate: getDatesFromPicker('input[name="offerdateRange"]').startDate,
114
		startDate: getDatesFromPicker('input[name="offerdateRange"]').startDate,
100
		endDate: getDatesFromPicker('input[name="offerdateRange"]').endDate
115
		endDate: getDatesFromPicker('input[name="offerdateRange"]').endDate
101
	}
116
	}
102
	if (confirm("Are you sure you want to add the offer!") == true) {
117
	if (confirm("Are you sure you want to add the offer!") == true) {