Subversion Repositories SmartDukaan

Rev

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

Rev 23501 Rev 23569
Line 120... Line 120...
120
});
120
});
121
 
121
 
122
function configureItemsDescriptionDropDown(){
122
function configureItemsDescriptionDropDown(){
123
	$(document).ready(function() {
123
	$(document).ready(function() {
124
        $('#itemsDescription').multiselect({
124
        $('#itemsDescription').multiselect({
125
	        //	includeSelectAllOption: true,
125
	        	//includeSelectAllOption: true,
126
	        	maxHeight: 200,
126
	        	maxHeight: 200,
127
	        	buttonWidth: '280px',
127
	        	buttonWidth: '280px',
128
	        //	numberDisplayed: 1,
128
	        //	numberDisplayed: 1,
129
	        	nonSelectedText: 'Items',
129
	        	nonSelectedText: 'Items',
130
	        	nSelectedText: ' - Items Selected',
130
	        	nSelectedText: ' - Items Selected',
131
	        	enableFiltering: true,
131
	        	enableFiltering: true,
-
 
132
	        	enableCaseInsensitiveFiltering:true,
132
	        	multiple: false
133
	        	multiple: false
133
        });
134
        });
134
    });
135
    });
135
}
136
}
136
 
137
 
137
function loadCreatePrebookingListing(domId){
138
function loadCreatePrebookingListing(domId){
138
	doGetAjaxRequestHandler(context+"/createPrebookingListing", function(response){
139
	doAjaxRequestHandler(context+"/createPrebookingListing", "GET", function(response){
139
		$('#' + domId).html(response);
140
		$('#' + domId).html(response);
140
	});
141
	});
141
}
142
}
142
 
143
 
143
function loadPrebookingListings(domId){
144
function loadPrebookingListings(domId){
144
	doGetAjaxRequestHandler(context+"/getPrebookingListings", function(response){
145
	doAjaxRequestHandler(context+"/getPrebookingListings", "GET", function(response){
145
		$('#' + domId).html(response);
146
		$('#' + domId).html(response);
146
	});
147
	});
147
}
148
}
148
 
149
 
149
function loadCreatePrebookingListings(domId){
150
function loadCreatePrebookingListings(domId){
150
	doGetAjaxRequestHandler(context+"/createPrebookingOrder", function(response){
151
	doAjaxRequestHandler(context+"/createPrebookingOrder", "GET", function(response){
151
		$('#' + domId).html(response);
152
		$('#' + domId).html(response);
152
	});
153
	});
153
}
154
}
154
 
155
 
155
function loadPrebookingOrders(domId){
156
function loadPrebookingOrders(domId){
156
	doGetAjaxRequestHandler(context+"/getPrebookingOrders", function(response){
157
	doAjaxRequestHandler(context+"/getPrebookingOrders", "GET", function(response){
157
		$('#' + domId).html(response);
158
		$('#' + domId).html(response);
158
	});
159
	});
159
}
160
}
160
 
161
 
161
function getPrebookingListingsNextItems(start, end){
162
function getPrebookingListingsNextItems(start, end){
162
	console.log(start);
163
	console.log(start);
163
	console.log(end);
164
	console.log(end);
164
	console.log(+end + +10);
165
	console.log(+end + +10);
165
	console.log(+start + +10);
166
	console.log(+start + +10);
166
	doGetAjaxRequestHandler(context+"/getPaginatedPrebookingListings?offset="+end, function(response){
167
	doAjaxRequestHandler(context+"/getPaginatedPrebookingListings?offset="+end, "GET", function(response){
167
		var size = $("#prebooking-listings-paginated .size").text();
168
		var size = $("#prebooking-listings-paginated .size").text();
168
		if((parseInt(end) + 10) > parseInt(size)){
169
		if((parseInt(end) + 10) > parseInt(size)){
169
			console.log("(end + 10) > size == true");
170
			console.log("(end + 10) > size == true");
170
			$( "#prebooking-listings-paginated .end" ).text(size);
171
			$( "#prebooking-listings-paginated .end" ).text(size);
171
		}else{
172
		}else{
Line 187... Line 188...
187
}
188
}
188
 
189
 
189
 
190
 
190
function getPrebookingListingsPreviousItems(start, end, pre){
191
function getPrebookingListingsPreviousItems(start, end, pre){
191
	
192
	
192
	doGetAjaxRequestHandler(context+"/getPaginatedPrebookingListings/?offset="+pre, function(response){
193
	doAjaxRequestHandler(context+"/getPaginatedPrebookingListings/?offset="+pre, "GET", function(response){
193
		$("#prebooking-listings-paginated .end" ).text(+end - +10);
194
		$("#prebooking-listings-paginated .end" ).text(+end - +10);
194
		$( "#prebooking-listings-paginated .start" ).text(+start - +10);
195
		$( "#prebooking-listings-paginated .start" ).text(+start - +10);
195
		$('#prebooking-listings-table').html(response);
196
		$('#prebooking-listings-table').html(response);
196
		$('#prebooking-listing-details-container').html('');
197
		$('#prebooking-listing-details-container').html('');
197
		$("#prebooking-listings-paginated .next").prop('disabled', false);
198
		$("#prebooking-listings-paginated .next").prop('disabled', false);
Line 207... Line 208...
207
function getPrebookingOrdersNextItems(start, end){
208
function getPrebookingOrdersNextItems(start, end){
208
	console.log(start);
209
	console.log(start);
209
	console.log(end);
210
	console.log(end);
210
	console.log(+end + +10);
211
	console.log(+end + +10);
211
	console.log(+start + +10);
212
	console.log(+start + +10);
212
	doGetAjaxRequestHandler(context+"/getPaginatedPrebookingOrders?offset="+end, function(response){
213
	doAjaxRequestHandler(context+"/getPaginatedPrebookingOrders?offset="+end, "GET", function(response){
213
		var size = $("#prebooking-orders-paginated .size").text();
214
		var size = $("#prebooking-orders-paginated .size").text();
214
		if((parseInt(end) + 10) > parseInt(size)){
215
		if((parseInt(end) + 10) > parseInt(size)){
215
			console.log("(end + 10) > size == true");
216
			console.log("(end + 10) > size == true");
216
			$( "#prebooking-orders-paginated .end" ).text(size);
217
			$( "#prebooking-orders-paginated .end" ).text(size);
217
		}else{
218
		}else{
Line 233... Line 234...
233
}
234
}
234
 
235
 
235
 
236
 
236
function getPrebookingOrdersPreviousItems(start, end, pre){
237
function getPrebookingOrdersPreviousItems(start, end, pre){
237
	
238
	
238
	doGetAjaxRequestHandler(context+"/getPaginatedPrebookingOrders/?offset="+pre, function(response){
239
	doAjaxRequestHandler(context+"/getPaginatedPrebookingOrders/?offset="+pre, "GET", function(response){
239
		$("#prebooking-orders-paginated .end" ).text(+end - +10);
240
		$("#prebooking-orders-paginated .end" ).text(+end - +10);
240
		$( "#prebooking-orders-paginated .start" ).text(+start - +10);
241
		$( "#prebooking-orders-paginated .start" ).text(+start - +10);
241
		$('#prebooking-orders-table').html(response);
242
		$('#prebooking-orders-table').html(response);
242
		$('#prebooking-order-details-container').html('');
243
		$('#prebooking-order-details-container').html('');
243
		$("#prebooking-orders-paginated .next").prop('disabled', false);
244
		$("#prebooking-orders-paginated .next").prop('disabled', false);
Line 248... Line 249...
248
	
249
	
249
	
250
	
250
}
251
}
251
 
252
 
252
function loadItemsDescriptionByBrand(domId, brand){
253
function loadItemsDescriptionByBrand(domId, brand){
253
	doGetAjaxRequestHandler(context+"/getItemsByBrand?brand="+brand, function(response){
254
	doAjaxRequestHandler(context+"/getItemsByBrand?brand="+brand, "GET", function(response){
254
		$('#' + domId).html(response);
255
		$('#' + domId).html(response);
255
		configureItemsDescriptionDropDown();
256
		configureItemsDescriptionDropDown();
256
	});	
257
	});	
257
}
258
}
258
 
259
 
259
function loadPrebookingListingDetails(prebookingListingId, domId){
260
function loadPrebookingListingDetails(prebookingListingId, domId){
260
	doGetAjaxRequestHandler(context+"/getPrebookingListingById?prebookingListingId="+prebookingListingId, function(response){
261
	doAjaxRequestHandler(context+"/getPrebookingListingById?prebookingListingId="+prebookingListingId, "GET", function(response){
261
		$('#' + domId).html(response);
262
		$('#' + domId).html(response);
262
		window.dispatchEvent(new Event('resize'));
263
		window.dispatchEvent(new Event('resize'));
263
	});
264
	});
264
}
265
}
265
 
266
 
266
function activePrebookingListing(prebookingListingId, offset, domId){
267
function activePrebookingListing(prebookingListingId, offset, domId){
267
	doPutAjaxRequestHandler(context+"/activePrebookingListingById?prebookingListingId="+prebookingListingId
268
	doAjaxRequestHandler(context+"/activePrebookingListingById?prebookingListingId="+prebookingListingId
268
	        +"&offset="+offset, function(response){
269
	        +"&offset="+offset, "PUT", function(response){
269
		$('#' + domId).html(response);
270
		$('#' + domId).html(response);
270
		$('#prebooking-listing-details-container').html('');
271
		$('#prebooking-listing-details-container').html('');
271
	});
272
	});
272
	
273
	
273
}
274
}
274
 
275
 
275
function expirePrebookingListing(prebookingListingId, offset, domId){
276
function expirePrebookingListing(prebookingListingId, offset, domId){
276
	doPutAjaxRequestHandler(context+"/expirePrebookingListingById?prebookingListingId="+prebookingListingId
277
	doAjaxRequestHandler(context+"/expirePrebookingListingById?prebookingListingId="+prebookingListingId
277
	        +"&offset="+offset, function(response){
278
	        +"&offset="+offset, "PUT", function(response){
278
		$('#' + domId).html(response);
279
		$('#' + domId).html(response);
279
		$('#prebooking-listing-details-container').html('');
280
		$('#prebooking-listing-details-container').html('');
280
	});
281
	});
281
}
282
}
282
283