Subversion Repositories SmartDukaan

Rev

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

Rev 29707 Rev 29849
Line 73... Line 73...
73
				});
73
				});
74
		}
74
		}
75
 
75
 
76
	});
76
	});
77
 
77
 
-
 
78
	
-
 
79
		$(document).on('click', ".customerofferitemupload", function() {
78
 
80
 
79
	$(document).on('click', ".customerofferitemupload", function() {
81
			var row = $(this).closest("tr");
80
		var id = $(this).data('requestid');
82
			var id = $(this).data('requestid');
81
		console.log("id");
83
			console.log("id");
82
 
-
 
83
		if (confirm('Confirm upload ?')) {
-
 
84
			var fileSelector = $(this)[0];
-
 
85
			if (fileSelector != undefined) {
-
 
86
				var url = `${context}/customerOfferItem/upload?offerId=` + id;
-
 
87
				console.log(url);
-
 
88
				var file = $("#customerofferitem")[0].files[0];
-
 
89
				let fileInput = $(this);
-
 
90
				console.log("file" + file);
-
 
91
				console.log("fileInput" + fileInput);
-
 
92
				doAjaxUploadRequestHandler(
-
 
93
					url,
-
 
94
					'POST',
-
 
95
					file, function(response) {
-
 
96
 
84
 
97
						console.log(response)
-
 
98
						alert("successfully uploaded");
-
 
99
 
85
 
100
					});
-
 
101
 
86
 
-
 
87
			if (confirm('Confirm upload ?')) {
-
 
88
				var fileSelector = $(row).find("td:eq(3) input[type='file']").val()[0];
-
 
89
				if (fileSelector != undefined) {
-
 
90
					var url = `${context}/customerOfferItem/upload?offerId=` + id;
102
			}
91
					console.log(url);
-
 
92
					var file = $("#customerofferitem")[0].files[0];
-
 
93
					let fileInput = $(this);
-
 
94
					console.log("file" + file);
-
 
95
					console.log("fileInput" + fileInput);
-
 
96
					doAjaxUploadRequestHandler(
103
		}
97
						url,
104
	});
98
						'POST',
-
 
99
						file, function(response) {
105
 
100
 
-
 
101
							console.log(response)
-
 
102
							alert("successfully uploaded");
106
 
103
 
-
 
104
						});
107
 
105
 
108
	$(document).on('click', ".upgrade-approved", function() {
-
 
109
		var id = $(this).data('requestid');
106
				}
-
 
107
			}
110
		var row = $(this).closest("tr");
108
		});
111
 
109
 
112
		if (confirm("Are you sure you want Approve r!") == true) {
-
 
113
			doPostAjaxRequestHandler(context + "/approveSamsungUpgradeOffer?id="
-
 
114
				+ id, function(response) {
-
 
115
 
110
 
116
					alert("Successfully Approved");
-
 
117
 
111
 
-
 
112
		$(document).on('click', ".upgrade-approved", function() {
-
 
113
			var id = $(this).data('requestid');
118
					row.html(response);
114
			var row = $(this).closest("tr");
119
 
115
 
-
 
116
			if (confirm("Are you sure you want Approve r!") == true) {
-
 
117
				doPostAjaxRequestHandler(context + "/approveSamsungUpgradeOffer?id="
-
 
118
					+ id, function(response) {
120
 
119
 
121
					return false;
120
						alert("Successfully Approved");
122
				});
-
 
123
		}
-
 
124
 
121
 
125
	});
122
						row.html(response);
126
 
123
 
127
 
124
 
128
	$(document).on('click', ".upgrade-rejected", function() {
125
						return false;
129
		var id = $(this).data('requestid');
126
					});
-
 
127
			}
130
 
128
 
-
 
129
		});
131
 
130
 
132
		if (confirm("Are you sure you want Reject!") == true) {
-
 
133
			doPostAjaxRequestHandler(context + "/rejectSamsungUpgradeOffer?id="
-
 
134
				+ id, function(response) {
-
 
135
					if (response == 'true') {
-
 
136
						alert("Successfully Rejected");
-
 
137
 
131
 
-
 
132
		$(document).on('click', ".upgrade-rejected", function() {
138
						loadWalletRequest("main-content");
133
			var id = $(this).data('requestid');
139
					}
-
 
140
 
134
 
141
					return false;
-
 
142
				});
-
 
143
		}
-
 
144
	});
-
 
145
 
135
 
-
 
136
			if (confirm("Are you sure you want Reject!") == true) {
-
 
137
				doPostAjaxRequestHandler(context + "/rejectSamsungUpgradeOffer?id="
-
 
138
					+ id, function(response) {
-
 
139
						if (response == 'true') {
-
 
140
							alert("Successfully Rejected");
146
 
141
 
-
 
142
							loadWalletRequest("main-content");
147
});
143
						}
148
 
144
 
149
function loadCustomerOffer(domId) {
145
						return false;
-
 
146
					});
-
 
147
			}
-
 
148
		});
150
 
149
 
151
	doGetAjaxRequestHandler(context + "/getCustomerOffer", function(response) {
-
 
152
		$('#' + domId).html(response);
-
 
153
	});
-
 
154
}
-
 
155
 
150
 
156
function loadSamsungUpgradeOffer(domId) {
-
 
157
	doGetAjaxRequestHandler(context + "/getSamsungUpgradeOffer", function(response) {
-
 
158
		$('#' + domId).html(response);
-
 
159
	});
151
	});
160
}
-
 
161
152
 
-
 
153
	function loadCustomerOffer(domId) {
-
 
154
 
-
 
155
		doGetAjaxRequestHandler(context + "/getCustomerOffer", function(response) {
-
 
156
			$('#' + domId).html(response);
-
 
157
		});
-
 
158
	}
-
 
159
 
-
 
160
	function loadSamsungUpgradeOffer(domId) {
-
 
161
		doGetAjaxRequestHandler(context + "/getSamsungUpgradeOffer", function(response) {
-
 
162
			$('#' + domId).html(response);
-
 
163
		});
-
 
164
	}
-
 
165
162
166