Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update import.php #193

Open
wants to merge 1 commit into
base: dev-8.5
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions admin/modules/bibliography/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
$authors = trim($field[15]);
$subjects = trim($field[16]);
$items = trim($field[17]);
$price = $field[18];
// sql insert string
$sql_str = "INSERT IGNORE INTO biblio (title, gmd_id, edition,
isbn_issn, publisher_id, publish_year,
Expand Down Expand Up @@ -197,11 +198,13 @@
}
// items
if (!empty($items)) {
$item_sql = 'INSERT IGNORE INTO item (biblio_id, item_code) VALUES ';
$item_sql = 'INSERT IGNORE INTO item (biblio_id, item_code, price) VALUES ';
$item_array = explode('><', $items);
foreach ($item_array as $item) {
$item = trim(str_replace(array('>', '<'), '', $item));
$item_sql .= " ($biblio_id, '$item'),";
$price = $price;
$item_sql .= " ($biblio_id, '$item', $price),";
}
// remove last comma
$item_sql = substr_replace($item_sql, '', -1);
Expand Down Expand Up @@ -285,4 +288,4 @@
let fileName = $(this).val().replace(/\\/g, '/').replace(/.*\//, '');
$(this).parent('.custom-file').find('.custom-file-label').text(fileName);
});
</script>
</script>