Subversion Repositories SmartDukaan

Rev

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

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