$('#fileupload').change(function(event) {
    var fileName = $('#fileupload').val().replace(/C:\\fakepath\\/i, '');
    $('#img_admin_add').attr('src', '/img/books/' + fileName);
    console.log(fileName);
});


$('#save_new_book').click(function() {
    var ii = '#admin_add_book_input_';
    var newBook = {
        title: $(ii + 'title').val(),
        author: $(ii + 'author').val(),
        description:$(ii + 'description').val(),
        year:$(ii + 'year').val(),
        cover:$('#img_admin_add').src,
        pages:$(ii + 'title').val(),
        date: $.now()
    };

    $.post('//ff', newBook, function() {
        console.log('the book was successfully added');
    });
});
@@ -1,24 +1,39 @@
 $('#
-file
+admin_add_book_img_
 upload').change(
@@ -73,20 +73,35 @@
 e = $('#
-file
+admin_add_book_img_
 upload')
@@ -143,28 +143,24 @@
 ');%0A    $('#
-img_
 admin_add').
@@ -156,16 +156,25 @@
 dmin_add
+_book_img
 ').attr(
@@ -518,20 +518,16 @@
 ver:$('#
-img_
 admin_ad
@@ -527,16 +527,25 @@
 dmin_add
+_book_img
 ').src,%0A

change id of elements i n admin_add_book