query='select c.name as container, l.name as name, l.id from locations as l inner join containers as c on l.container_id = c.id order by container, name;'
query='select c.name as container, l.name as name, l.id, c.id as container_id from locations as l inner join containers as c on l.container_id = c.id order by container, name;'
@ -30,7 +29,7 @@ function saveLocation(locationID) {
}
vardata=newFormData();
data.append('map',map_v);
data.append('container',container_v);
data.append('name',name_v)
$.ajax({
@ -54,7 +53,65 @@ function saveLocation(locationID) {
});
}
functiondeleteLocation(locationID){
if(locationID<0)
alert('Congratulations! You found the secret UI bug easter egg! This button should not be here, yet I left it specifically because I wanted an easter egg and not because of any other reasons! Good for you!')
return;
if(!confirm('Delete the selected location? If there are parts there, this will leave a mess in the database and Marek will be very sad.'))
return;
$.ajax({
url:rootURL+'deleteLocation/'+locationID,
type:'GET',
cache:false,
contentType:false,
processData:false,
success:function(){
alert("location removed.");
overlay_out();
location.reload();
},
fail:function(){
console.log('An error occurred while deleting the entry');
<h1>ELAB Part Search Engine - LOCATION EDITOR</h1>
<p>Looking for a place to store your obsolete ICs discontinued years ago? Just toss them anywhere and mark that location here!</p>
<tableid="results">
<h1>LOCATION EDITOR</h1>
<p>Looking for a place to store your obsolete ICs discontinued years ago? Just toss them anywhere and mark that location here!<ahref=".">back to parts</a></p>