function edit() { foreach ($this->post_arr as $value) { $edit_book = new library_book_edit($value); $status = $edit_book->check_parameter(); if ($status != 'OK') { $this->err[$value['id']] = $edit_book->err; } else { $status = $edit_book->updata(); if ($status == 'OK') { $this->status[$value['id']] = 'OK'; } else { array_push($this->err[$value['id']], $status); } } } }
} else { $status = $new_book->book_inster(); if ($status != 'OK') { print_err_notice($status); } print_successful_notice("成功发布图书 " . $_POST['bkn'], 'library-publish.php?status=OK&id=' . $new_book->get_post_id()); } library_category_up_all(); break; case 'edit': $edit_book = new library_book_edit($_POST); $status = $edit_book->check_parameter(); if ($status != 'OK') { print_err_arr_notice($status, $edit_book->err); } else { $status = $edit_book->updata(); if ($status == 'OK') { print_successful_notice("成功修改图书 " . $_POST['name'] . " 信息", 'library-edit.php?status=OK&id=' . $_POST['id']); } else { print_err_arr_notice($status); } } library_category_up_all(); break; case 'lent': if (isset($_POST['id']) && isset($_POST['user'])) { $book_lent = new library_lent($_POST['id'], $_POST['user']); $status = $book_lent->check(); if ($status != 'OK') { print_err_notice($status); } else {