| Line 209... |
Line 209... |
| 209 |
var parent = field.parentNode.parentNode.parentNode;
|
209 |
var parent = field.parentNode.parentNode.parentNode;
|
| 210 |
|
210 |
|
| 211 |
var artist = mysqliHtmlDecode(parent.getElementsByTagName("td")[1].innerHTML);
|
211 |
var artist = mysqliHtmlDecode(parent.getElementsByTagName("td")[1].innerHTML);
|
| 212 |
var title = mysqliHtmlDecode(parent.getElementsByTagName("td")[2].innerHTML);
|
212 |
var title = mysqliHtmlDecode(parent.getElementsByTagName("td")[2].innerHTML);
|
| 213 |
var barcode = parent.getElementsByTagName("td")[3].innerHTML.replace(/-/g, '');
|
213 |
var barcode = parent.getElementsByTagName("td")[3].innerHTML.replace(/-/g, '');
|
| - |
|
214 |
var cond = parent.getElementsByTagName("td")[5].innerHTML;
|
| 214 |
var format = parent.getElementsByTagName("td")[5].innerHTML;
|
215 |
var format = parent.getElementsByTagName("td")[6].innerHTML;
|
| 215 |
var price = parent.getElementsByTagName("td")[6].innerHTML;
|
216 |
var price = parent.getElementsByTagName("td")[7].innerHTML;
|
| 216 |
|
217 |
|
| 217 |
document.getElementById("wlMsg").innerHTML = "";
|
218 |
document.getElementById("wlMsg").innerHTML = "";
|
| 218 |
document.getElementById("wlId").value = id;
|
219 |
document.getElementById("wlId").value = id;
|
| 219 |
document.getElementById("wlArtist").value = artist;
|
220 |
document.getElementById("wlArtist").value = artist;
|
| 220 |
document.getElementById("wlTitle").value = title;
|
221 |
document.getElementById("wlTitle").value = title;
|
| 221 |
document.getElementById("wlBarcode").value = barcode;
|
222 |
document.getElementById("wlBarcode").value = barcode;
|
| - |
|
223 |
document.getElementById("wlCond").value = cond;
|
| 222 |
document.getElementById("wlFormat").value = format;
|
224 |
document.getElementById("wlFormat").value = format;
|
| 223 |
document.getElementById("wlPrice").value = price;
|
225 |
document.getElementById("wlPrice").value = price;
|
| 224 |
}
|
226 |
}
|
| 225 |
|
227 |
|
| 226 |
$("#editWishlistModal").modal();
|
228 |
$("#editWishlistModal").modal();
|
| Line 231... |
Line 233... |
| 231 |
var field = document.getElementById("wlIdRow" + id);
|
233 |
var field = document.getElementById("wlIdRow" + id);
|
| 232 |
var parent = field.parentNode;
|
234 |
var parent = field.parentNode;
|
| 233 |
var artist = document.getElementById("wlArtist").value;
|
235 |
var artist = document.getElementById("wlArtist").value;
|
| 234 |
var title = document.getElementById("wlTitle").value;
|
236 |
var title = document.getElementById("wlTitle").value;
|
| 235 |
var barcode = document.getElementById("wlBarcode").value;
|
237 |
var barcode = document.getElementById("wlBarcode").value;
|
| - |
|
238 |
var cond = document.getElementById("wlCond").value;
|
| 236 |
var format = document.getElementById("wlFormat").value;
|
239 |
var format = document.getElementById("wlFormat").value;
|
| 237 |
var price = document.getElementById("wlPrice").value;
|
240 |
var price = document.getElementById("wlPrice").value;
|
| 238 |
|
241 |
|
| 239 |
var xhttp = new XMLHttpRequest();
|
242 |
var xhttp = new XMLHttpRequest();
|
| 240 |
xhttp.onreadystatechange = function() {
|
243 |
xhttp.onreadystatechange = function() {
|
| Line 244... |
Line 247... |
| 244 |
case 0:
|
247 |
case 0:
|
| 245 |
parent.getElementsByTagName("td")[1].innerHTML = artist;
|
248 |
parent.getElementsByTagName("td")[1].innerHTML = artist;
|
| 246 |
parent.getElementsByTagName("td")[2].innerHTML = title;
|
249 |
parent.getElementsByTagName("td")[2].innerHTML = title;
|
| 247 |
parent.getElementsByTagName("td")[3].innerHTML = barcode;
|
250 |
parent.getElementsByTagName("td")[3].innerHTML = barcode;
|
| 248 |
parent.getElementsByTagName("td")[4].innerHTML = barcode; // bugbug Format
|
251 |
parent.getElementsByTagName("td")[4].innerHTML = barcode; // bugbug Format
|
| - |
|
252 |
parent.getElementsByTagName("td")[5].innerHTML = cond;
|
| 249 |
parent.getElementsByTagName("td")[5].innerHTML = format;
|
253 |
parent.getElementsByTagName("td")[6].innerHTML = format;
|
| 250 |
parent.getElementsByTagName("td")[6].innerHTML = price;
|
254 |
parent.getElementsByTagName("td")[7].innerHTML = price;
|
| 251 |
parent.getElementsByTagName("td")[7].innerHTML = '$' + Number(price).toFixed(2); // bugbug Format
|
255 |
parent.getElementsByTagName("td")[8].innerHTML = '$' + Number(price).toFixed(2); // bugbug Format
|
| 252 |
$("#editWishlistModal").modal('hide');
|
256 |
$("#editWishlistModal").modal('hide');
|
| 253 |
break;
|
257 |
break;
|
| 254 |
case 1:
|
258 |
case 1:
|
| 255 |
document.getElementById("wlMsg").innerHTML = "<div class=\"alert alert-danger alert-dismissible mt-0 mb-0\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" + json.msg + "</div>";
|
259 |
document.getElementById("wlMsg").innerHTML = "<div class=\"alert alert-danger alert-dismissible mt-0 mb-0\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" + json.msg + "</div>";
|
| 256 |
editWishlist(id, null)
|
260 |
editWishlist(id, null)
|
| Line 261... |
Line 265... |
| 261 |
}
|
265 |
}
|
| 262 |
}
|
266 |
}
|
| 263 |
};
|
267 |
};
|
| 264 |
xhttp.open("POST", "wishlistDB.php", true);
|
268 |
xhttp.open("POST", "wishlistDB.php", true);
|
| 265 |
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
269 |
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
| 266 |
xhttp.send("function=update&id=" + id + "&artist=" + encodeURIComponent(artist) + "&title=" + encodeURIComponent(title) + "&barcode=" + encodeURIComponent(barcode) + "&format=" + encodeURIComponent(format) + "&price=" + encodeURIComponent(price) + "&sessionTab=" + document.getElementById("sessionTab").value);
|
270 |
xhttp.send("function=update&id=" + id + "&artist=" + encodeURIComponent(artist) + "&title=" + encodeURIComponent(title) + "&barcode=" + encodeURIComponent(barcode) + "&cond=" + encodeURIComponent(cond) + "&format=" + encodeURIComponent(format) + "&price=" + encodeURIComponent(price) + "&sessionTab=" + document.getElementById("sessionTab").value);
|
| 267 |
}
|
271 |
}
|
| 268 |
|
272 |
|
| 269 |
// Pagination
|
273 |
// Pagination
|
| 270 |
function paginationSetup() {
|
274 |
function paginationSetup() {
|
| 271 |
$("[id^=masterModal]").modal("hide");
|
275 |
$("[id^=masterModal]").modal("hide");
|