Subversion Repositories cheapmusic

Rev

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

Rev 128 Rev 130
Line 228... Line 228...
228
}
228
}
229
 
229
 
230
function deleteWishlist(id, field, title, artist) {
230
function deleteWishlist(id, field, title, artist) {
231
	$(field).tooltip('hide');
231
	$(field).tooltip('hide');
232
	if (confirm('Remove ' + title + ' by ' + artist + ' from wishlist?')) {
232
	if (confirm('Remove ' + title + ' by ' + artist + ' from wishlist?')) {
233
		var parent = field.parentNode.parentNode.parentNode;
-
 
234
		var xhttp = new XMLHttpRequest();
233
		var xhttp = new XMLHttpRequest();
235
		xhttp.open("POST", "wishlistDB.php", true);
234
		xhttp.open("POST", "wishlistDB.php", true);
236
		xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
235
		xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
237
		xhttp.send("function=delete&id=" + id + "&sessionTab=" + document.getElementById("sessionTab").value + "&nonce=" + document.getElementById("nonce").value);
236
		xhttp.send("function=delete&id=" + id + "&sessionTab=" + document.getElementById("sessionTab").value + "&nonce=" + document.getElementById("nonce").value);
238
		parent.parentNode.removeChild(parent);
237
		field.closest("tr").remove();
239
	}
238
	}
240
}
239
}
241
 
240
 
242
function editWishlist(id, field) {
241
function editWishlist(id, field) {
243
	if (field !== null) {
242
	if (field !== null) {
244
		$(field).tooltip('hide');
243
		$(field).tooltip('hide');
245
		var parent = field.parentNode.parentNode.parentNode;
244
		var parent = field.closest("tr");
246
 
245
 
247
		var artist = mysqliHtmlDecode(parent.getElementsByTagName("td")[1].innerHTML);
246
		var artist = mysqliHtmlDecode(parent.getElementsByTagName("td")[1].innerHTML);
248
		var title = mysqliHtmlDecode(parent.getElementsByTagName("td")[2].innerHTML);
247
		var title = mysqliHtmlDecode(parent.getElementsByTagName("td")[2].innerHTML);
249
		var barcode = parent.getElementsByTagName("td")[3].innerHTML.replace(/-/g, '');
248
		var barcode = parent.getElementsByTagName("td")[3].innerHTML.replace(/-/g, '');
250
		var cond = parent.getElementsByTagName("td")[5].innerHTML;
249
		var cond = parent.getElementsByTagName("td")[5].innerHTML;
Line 268... Line 267...
268
}
267
}
269
 
268
 
270
function saveEditedWishlist() {
269
function saveEditedWishlist() {
271
	var id = document.getElementById("wlId").value;
270
	var id = document.getElementById("wlId").value;
272
	var field = document.getElementById("wlIdRow" + id);
271
	var field = document.getElementById("wlIdRow" + id);
273
	var parent = field.parentNode;
272
	var parent = field.closest("tr");
274
	var artist = document.getElementById("wlArtist").value;
273
	var artist = document.getElementById("wlArtist").value;
275
	var title = document.getElementById("wlTitle").value;
274
	var title = document.getElementById("wlTitle").value;
276
	var barcode = document.getElementById("wlBarcode").value;
275
	var barcode = document.getElementById("wlBarcode").value;
277
	var cond = document.getElementById("wlCond").value;
276
	var cond = document.getElementById("wlCond").value;
278
	var format = document.getElementById("wlFormat").value;
277
	var format = document.getElementById("wlFormat").value;