diff --git a/README.md b/README.md new file mode 100644 index 0000000..0a9be10 --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# BiblioMxWeb + + + +> Not official and not + +A system to extract data from a [BiblioMx](http://www.micla.org/freeware/bibliomx.html) system and display it on the Internet in a searchable fashion, trough a semi-automatic process + +> **Notice** +> +> The GUI present in this software is in Italian, because of the primary audience of said software +> However, you may freely and easily fix this in your implementation + +## Preamble + +BiblioMx, despite being a pretty common library management software, saves data in custom binary files, and only allows to export data to CSV. + +This is the major limitation that this project tries to address. + +## Components + +### Server + +The server receives a CSV (trough chunking, if necessary) and concerts it into a sqllite database. + +The PHP application provides a Web UI for searching and viewing books, including bibliographical data and availability + +### Agent + +The agent must be set to boot hidden at the start of the computer (functionality not included int the code) + +``biblio.ini`` must be configured with the correct information, under the ``[DATA]`` section: + +| Key | Value | +| ---- | ----- | +|databasePath|The path to the xbb database| +|csvPath|The path to the csv export file| +|serverUrl|The URL to ``up.php``| +|authCode|The authentication code for that server instance| +|significance|The number of action that must be taken before the server shall be synced again| +|verbose|Show verbose output| +|updateUserWait|After prompting the user to update the CSV, how much time (s) to wait before moving on and uploading the file, starts after pressing "OK"| +|chunkSize|Chunk size (rows) for uploading the CSV| + + + +Once the librarian performs a set number of actions, they will be asked to export the database manually to a csv, then the agent will upload it accordingly + +The upload will also trigger the refresh of the sqllite database on the server when ended + diff --git a/server/bookDetail.php b/server/bookDetail.php new file mode 100644 index 0000000..98378ca --- /dev/null +++ b/server/bookDetail.php @@ -0,0 +1,221 @@ +prepare("SELECT * FROM Libri WHERE Titolo=:titolo AND ISBN=:isbn"); + + $stmt->execute([":isbn"=>$ex]);//TODO + } + else{*/ + $stmt = $pdo->prepare("SELECT * FROM Libri WHERE id=:id"); + $stmt->execute([':id' => $id]); + // } + $data = $stmt->fetch(); + $ak=array_keys($data); + for($i=0;$i + + + <?php echo htmlentities($data["Titolo"]); ?> | <?php echo $GLOBALS["place"]; ?> + + + + + + + + + + + +
+ +
+ + + +
+ +
+ +
+ +
+
+

+
+
+ + +

+ + + +

+ + +

ISBN:

+ + +

+ +
+
+
+ + +
+
+ + +
+

Il libro risulta essere in prestito in base agli ultimi dati disponibili

+
+ + +
+

Il libro risulta essere disponibile al prestito in base agli ultimi dati disponibili

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
Genere
Titolo
Autore
Editore
Serie
Lingua
Argomento
ISBN
Note".htmlentities($data["Note2"]); ?>
Posizione
Data
Inventario
Numero di Pagine
Livello Bibliografico
Dewey
Paese di pubblicazione
Luogo editore
Curatore
Tipo
Traduzione
Descrizione
Identificativo
+ +
+ +
+
+
+ + + + + +
+ + + + + +
+ + +
+
+ + + + + + + + + + + + + diff --git a/server/books.png b/server/books.png new file mode 100644 index 0000000..ef1b0cb Binary files /dev/null and b/server/books.png differ diff --git a/server/bookshelf.svg b/server/bookshelf.svg new file mode 100644 index 0000000..ad92d85 --- /dev/null +++ b/server/bookshelf.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/server/common.php b/server/common.php new file mode 100644 index 0000000..f96c69b --- /dev/null +++ b/server/common.php @@ -0,0 +1,38 @@ + + + + Biblioteca | <?php echo $GLOBALS["place"]; ?> + + + + + + + + + + + +
+
+ Biblioteca | + +
+
+ + + +
+ +
+ +
+ +
+
+

Biblioteca online

+

+
+
+ + +

prepare("SELECT COUNT(*) as n FROM Libri"); + $stmt->execute(); + $data = $stmt->fetch(); + + echo "Volumi: " . $data["n"]; + + ?>

+ + +

prepare("SELECT COUNT(DISTINCT Autore) as n FROM Libri"); + $stmt->execute(); + $data = $stmt->fetch(); + + echo "Autori: " . $data["n"]; + + ?>

+ + +

+ +
+
+
+ + +
+
+ + +
+
+
+

+ +

+ +

+ +

+ +

+ +

+
+ +
+

+ +

+ +

+ +

+ +

+ +

+ +
+ +
+ +

+ +

+ +

+ +

+ +

+ +

+ +
+ +
+ +

+ +

+ +

+ +

+ +

+ +

+ +
+ + +
+
+
+ + +
+ + + +
+
+
+ + + + + +
+ + + + + +
+ + +
+
+ + + + + + + + + + + + + diff --git a/server/processCsv.php b/server/processCsv.php new file mode 100644 index 0000000..2f39f8c --- /dev/null +++ b/server/processCsv.php @@ -0,0 +1,47 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $q=$dbh->prepare("DELETE FROM Libri"); + $q->execute(); + $i=0; + foreach($f as $row){ + if($i==0){ + $i++; + continue; + } + $aL=str_getcsv($row); + $statement=$dbh->prepare("INSERT INTO Libri(Genere,Titolo,Autore,Editore,Serie,Lingua,Argomento,Prestito,ISBN,Note1,Note2,Posizione,Data,Inventario,Npag,Lvlbibliogr,Dewey,Paesepubblicaz,Luogoeditore,Curatore,Tipo,Traduzione,Descrizione,Identificativo) VALUES(:Genere,:Titolo,:Autore,:Editore,:Serie,:Lingua,:Argomento,:Prestito,:ISBN,:Note1,:Note2,:Posizione,:Data,:Inventario,:Npag,:Lvlbibliogr,:Dewey,:Paesepubblicaz,:Luogoeditore,:Curatore,:Tipo,:Traduzione,:Descrizione,:Identificativo)"); + $statement->execute([ + ":Genere"=>$aL[0], + ":Titolo"=>$aL[1], + ":Autore"=>$aL[2], + ":Editore"=>$aL[3], + ":Serie"=>$aL[4], + ":Lingua"=>$aL[5], + ":Argomento"=>$aL[6], + ":Prestito"=>$aL[7], + ":ISBN"=>$aL[8], + ":Note1"=>$aL[9], + ":Note2"=>$aL[10], + ":Posizione"=>$aL[11], + ":Data"=>$aL[12], + ":Inventario"=>$aL[13], + ":Npag"=>$aL[14], + ":Lvlbibliogr"=>$aL[15], + ":Dewey"=>$aL[16], + ":Paesepubblicaz"=>$aL[17], + ":Luogoeditore"=>$aL[18], + ":Curatore"=>$aL[19], + ":Tipo"=>$aL[20], + ":Traduzione"=>$aL[21], + ":Descrizione"=>$aL[22], + ":Identificativo"=>$aL[23] + ]); + $i++; + } + $q=$dbh->prepare("VACUUM"); + $q->execute(); + file_put_contents("lastupdate.dat",time()); +} diff --git a/server/results.php b/server/results.php new file mode 100644 index 0000000..5bf5cdc --- /dev/null +++ b/server/results.php @@ -0,0 +1,328 @@ + + + + Biblioteca | <?php echo $GLOBALS["place"]; ?> + + + + + + + + + + + +
+ +
+ + + +
+ +
+ +
+ +
+
+

Biblioteca online

+

+
+
+

Interrogazione completata

+
+
+
+ + +
+
+ + +
+ prepare($query); + $stmt->execute($arrayQ); + $i = 0; + while ($data = $stmt->fetch()) { + $ak = array_keys($data); + for ($i = 0; $i < count($ak); $i++) { + $data[$ak[$i]] = iconv('iso-8859-1', 'UTF-8//IGNORE', $data[$ak[$i]]); + } + ?> +
+ + + + + + + + + + + + + +
Titolo
Autore
ISBN
+
+ " /> + +
+
+ Nessun risultato'; + } + ?> +
+ +
+
+ $val) { + ?> + + +
+
+
+
+

Pagina

+
+
+ +
+ $val) { + ?> + + +
+ +
+
+
+ + + + + +
+
+
+ + + + + +
+ + + + + +
+ + +
+
+ + + + + + + + + + + + + diff --git a/server/up.php b/server/up.php new file mode 100644 index 0000000..b25f459 --- /dev/null +++ b/server/up.php @@ -0,0 +1,41 @@ +