room_parameter = {}; function room_grid(items) { var str = ''; str += ''; if (items) { $.each(items, function(index, item) { str += ''; str += ''; str += ''; }); } str += '
idnameaddressoperate
' + item.name + ''; if (item.photo && item.photo != '') { str += imageBase64(item.photo); } else { str += ' '; } str += ''; str += 'edit '; str += 'delete '; str += 'photo'; str += '
'; $('#content').html(str); } function room_list() { $('#result').html(''); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/room/list', xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(json) { $('#result').html(JSON.stringify(json, null, 4)); if (json.type == 'success') { room_grid(json.data, true); } }); } function room_get_select() { $('#result').html(''); var str = ''; str += ''; str += '
get
'; $('#content').html(str); $('#get').click(function() { room_delete(id); }); } function room_get(id) { $('#result').html(''); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/room/' + id, xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function room_post_select() { $('#result').html(''); var str = ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += '
post
name:
building:
floor:
roomNumber:
capacity:
auditor:
available:
device: