diff --git a/admin/db/languages/lang_it.php b/admin/db/languages/lang_it.php
new file mode 100644
index 0000000..a55bb36
--- /dev/null
+++ b/admin/db/languages/lang_it.php
@@ -0,0 +1,287 @@
+ "LTR",
+ "date_format" => 'G:i \d\e\l j M, Y \A\.\D\. (T)', // see http://php.net/manual/en/function.date.php for what the letters stand for
+ "ver" => "versione",
+ "for" => "per",
+ "to" => "a",
+ "go" => "Vai",
+ "yes" => "Si",
+ "sql" => "SQL",
+ "csv" => "CSV",
+ "csv_tbl" => "Table that CSV pertains to",
+ "srch" => "Ricerca",
+ "srch_again" => "Nuova ricerca",
+ "login" => "Log In",
+ "logout" => "Logout",
+ "view" => "Vista",
+ "confirm" => "Conferma",
+ "cancel" => "Cancella",
+ "save_as" => "Salva con nome",
+ "options" => "Opzioni",
+ "no_opt" => "Nessuna opzione",
+ "help" => "Help",
+ "installed" => "installato",
+ "not_installed" => "non installato",
+ "done" => "fatto",
+ "insert" => "Inserisci",
+ "export" => "Esporta",
+ "import" => "Importa",
+ "rename" => "Rinomina",
+ "empty" => "Vuoto",
+ "drop" => "Elimina",
+ "tbl" => "Tabella",
+ "chart" => "Chart",
+ "err" => "ERRORE",
+ "act" => "Azione",
+ "rec" => "Records",
+ "col" => "Colonna",
+ "cols" => "Colonna(e)",
+ "rows" => "riga(e)",
+ "edit" => "Modifica",
+ "del" => "Cancella",
+ "add" => "Aggiungi",
+ "backup" => "Backup database file",
+ "before" => "Prima",
+ "after" => "Dopo",
+ "passwd" => "Password",
+ "passwd_incorrect" => "Password errata.",
+ "chk_ext" => "Controlla le estensioni SQLite PHP supportate",
+ "autoincrement" => "Autoincremento",
+ "not_null" => "Not NULL",
+ "attention" => "Attenzione",
+
+ "sqlite_ext" => "Estensione di SQLite",
+ "sqlite_ext_support" => "Sembra che nessuna delle librerie SQLite supportate sono disponibili nella tua installazione di PHP. Potresti non essere in grado di usare %s finchè non ne installi almeno una.",
+ "sqlite_v" => "Versione di SQLite",
+ "sqlite_v_error" => "Sembra che il tuo database è un versione di SQLite %s ma la tua installazione PHP non contiene le estensioni necessarie per gestire questa versione. Per risolvere il problema, cancella il database and consenti a %s di crearlo automaticamente oppure ricrealo manualmente nella versione SQLite %s.",
+ "report_issue" => "Il problema non può essere digniosticato The problem cannot be diagnosticato correttamente. Si prega di inviare un resoconto del problema a",
+ "sqlite_limit" => "A causa delle limitazioni di SQLite, solo i campi nome e tipo di data possono essere modificati.",
+
+ "php_v" => "Versione di PHP",
+
+ "db_dump" => "database dump",
+ "db_f" => "database file",
+ "db_ch" => "Cambia Database",
+ "db_event" => "Database Event",
+ "db_name" => "Nome del database",
+ "db_rename" => "Rinomina il Database",
+ "db_renamed" => "Il Database '%s' è stato rinominato in",
+ "db_del" => "Cancella il Database",
+ "db_path" => "Percorso del database",
+ "db_size" => "Dimensione del database",
+ "db_mod" => "Ultima modifica del database",
+ "db_create" => "Crea un nuovo database",
+ "db_vac" => "Il database, '%s', è stato ridotto.",
+ "db_not_writeable" => "Il database, '%s', non esiste e non può essere creato perchè la directory che lo ospita, '%s', non ha il permesso di scrittura. Il programma non è utilizzabile finchè non modifi i permessi di scrittura.",
+ "db_setup" => "C'è stato un problema con il tuo database, %s. Verrà fatto un tentativo per scoprire cosa succede in modo da consentirti di sistemare il problema più facilemtne",
+ "db_exists" => "Un database, un latro file oppure il nome di una directory '%s' già esiste.",
+
+ "exported" => "Esportato",
+ "struct" => "Struttura",
+ "struct_for" => "struttura per",
+ "on_tbl" => "Sulla tabella",
+ "data_dump" => "Dump dei dati per",
+ "backup_hint" => "Suggerimento: Per eseguire il backup del tuo database, la via più semplice è %s.",
+ "backup_hint_linktext" => "scaricare il file del database",
+ "total_rows" => "un totale di %s righe",
+ "total" => "In Totale",
+ "not_dir" => "La directory che hai specificato per eseguire la scansione del database non esiste oppure non è una directory.",
+ "bad_php_directive" => "sembra che la direttiva PHP, 'register_globals' è abilitata. Questo è male. Hai bisogno di disabilitarla prima di continuare.",
+ "page_gen" => "Pagina generata in %s secondi.",
+ "powered" => "Powered by",
+ "remember" => "Ricordami",
+ "no_db" => "Benvenuto in %s. Sembra che tu abbia scelto di scansionare una directory per gestire i database. Comunque, %s potrebbe non trovare alcun valido database SQLite. Puoi usare la forma sottostante per creare il tuo primo database.",
+ "no_db2" => "La directory che hai specificato non contiene alcun database da gestire, e la directory non è scrivibile. Questo significa che non puoi creare nessun nuovo database usando %s. Rendi la directory scrivibile oppure aggiungi manualmente del databases nella directory.",
+
+ "create" => "Crea",
+ "created" => "è stata creata",
+ "create_tbl" => "Crea una nuova tabella",
+ "create_tbl_db" => "Crea una nuova tabella sul database",
+ "create_trigger" => "Crea un nuovo trigger sulla tabella",
+ "create_index" => "Crea un nuovo indice sulla tabella",
+ "create_index1" => "Crea Indice",
+ "create_view" => "Crea una nuova view sul database",
+
+ "trigger" => "Trigger",
+ "triggers" => "Triggers",
+ "trigger_name" => "Nome del Trigger",
+ "trigger_act" => "Azione del Trigger",
+ "trigger_step" => "Trigger Steps (semicolon terminated)",
+ "when_exp" => "WHEN expression (type expression without 'WHEN')",
+ "index" => "Indice",
+ "indexes" => "Indici",
+ "index_name" => "Nome dell'indice",
+ "name" => "Nome",
+ "unique" => "Unique",
+ "seq_no" => "Seq. No.",
+ "emptied" => "has been emptied",
+ "dropped" => "è stato cancellato",
+ "renamed" => "è stato(a) rinominato(a) in",
+ "altered" => "è stata alterata con successo",
+ "inserted" => "inserita",
+ "deleted" => "cancellata",
+ "affected" => "interessata",
+ "blank_index" => "Il nome dell'indice non deve essere vuoto.",
+ "one_index" => "Devi specificare una colonna indice.",
+ "docu" => "Documentazione",
+ "license" => "Licenza",
+ "proj_site" => "Sito del progetto",
+ "bug_report" => "Questo potrebbe essere un bug che necessita di essere riportato a",
+ "return" => "Return",
+ "browse" => "Browse",
+ "fld" => "Campo",
+ "fld_num" => "Numero di campi",
+ "fields" => "Campi",
+ "type" => "Tipo",
+ "operator" => "Operatore",
+ "val" => "Valore",
+ "update" => "Update",
+ "comments" => "Commmenti",
+
+ "specify_fields" => "Devi specificare il numero di campi della tabella.",
+ "specify_tbl" => "Devi specificare il nome della tabella.",
+ "specify_col" => "Devi specificare una colonna.",
+
+ "tbl_exists" => "Esiste già una tabella con lo stesso nome.",
+ "show" => "Mostra",
+ "show_rows" => "Mostra %s row(s). ",
+ "showing" => "Showing",
+ "showing_rows" => "Mostra righe",
+ "query_time" => "(Query elaborata in %s sec)",
+ "syntax_err" => "C'è un problema con la sintassi della tua query (La query non è stata eseguita)",
+ "run_sql" => "Esegui la(e) query SQL sul database '%s'",
+
+ "ques_empty" => "Sei sicuro di voler svuotare la tabella '%s'?",
+ "ques_drop" => "Sei sicuro di voler eliminare la tabella '%s'?",
+ "ques_drop_view" => "Sei sicuro di voler eliminare la view '%s'?",
+ "ques_del_rows" => "Sei sicuro di voler cancellare la(e) riga(e) %s dalla tabella '%s'?",
+ "ques_del_db" => "Sei sicuro di voler cancellare il database '%s'?",
+ "ques_del_col" => "Sei sicuro di voler cancellare la(e) coonna(e) \"%s\" dalla tabella '%s'?",
+ "ques_del_index" => "Sei sicuro di vole cancellare l'indice '%s'?",
+ "ques_del_trigger" => "Sei sicuro di voler cancellare il trigger '%s'?",
+
+ "export_struct" => "Export with structure",
+ "export_data" => "Export with data",
+ "add_drop" => "Add DROP TABLE",
+ "add_transact" => "Add TRANSACTION",
+ "fld_terminated" => "Fields terminated by",
+ "fld_enclosed" => "Fields enclosed by",
+ "fld_escaped" => "Fields escaped by",
+ "fld_names" => "Nome del campo nella prima riga",
+ "rep_null" => "Sostituisci NULL con",
+ "rem_crlf" => "Rimuovi i caratteri CRLF all'interno dei campi",
+ "put_fld" => "Metti i nomi dei campi nella prima riga",
+ "null_represent" => "NULL represented by",
+ "import_suc" => "Importato con successo.",
+ "import_into" => "Importa dentro",
+ "import_f" => "File da importare",
+ "rename_tbl" => "Rinomina la tabella '%s' in",
+
+ "rows_records" => "riga(e) partendo dal record # ",
+ "rows_aff" => "riga(e) interessate. ",
+
+ "as_a" => "as a",
+ "readonly_tbl" => "'%s' è una view, questo significa che si tratta di un istruzione SELECT trattata come una tabella di sola lettura. Non puoi ne editarla ne inserire nuovi record.",
+ "chk_all" => "Seleziona tutto",
+ "unchk_all" => "Deseleziona tutto",
+ "with_sel" => "Operazione selezionata",
+
+ "no_tbl" => "Nessuna tabella nel database.",
+ "no_chart" => "Se leggi questo, significa che il grafico potrebbe non essere generato. I dati che stai cercando di visualizzare potrebbero essere non appropriati per il grafico.",
+ "no_rows" => "Non ci sono righe nella tabella per il range che hai selezionato.",
+ "no_sel" => "Non hai selezionato nulla.",
+
+ "chart_type" => "Tipo di grafico",
+ "chart_bar" => "Grafico a barre",
+ "chart_pie" => "Grafico a torta",
+ "chart_line" => "Spezzata",
+ "lbl" => "Etichette",
+ "empty_tbl" => "Questa tabella è vuota.",
+ "click" => "Clicca qui",
+ "insert_rows" => "Per inserire righe.",
+ "restart_insert" => "Ricomincia l'inserimento con ",
+ "ignore" => "Ignora",
+ "func" => "Funzione",
+ "new_insert" => "Insierisci come Riga Nuova",
+ "save_ch" => "Salva le Modifiche",
+ "def_val" => "Valore di Default",
+ "prim_key" => "Chiave Primaria",
+ "tbl_end" => "campo(i) alla fine della tabella",
+ "query_used_table" => "Query usata per creare questa tabella",
+ "query_used_view" => "Query usata per creare questa view",
+ "create_index2" => "Crea un indice su",
+ "create_trigger2" => "Crea un nuovo trigger",
+ "new_fld" => "Adding new field(s) to table '%s'",
+ "add_flds" => "Aggiungi il campo",
+ "edit_col" => "Editing column '%s'",
+ "vac" => "Vacuum",
+ "vac_desc" => "Large databases sometimes need to be VACUUMed per ridurre l'impronta sul server. Clicca il bottone sotto per eseguire il VACUUM del database '%s'.",
+ "event" => "Event",
+ "each_row" => "Per ogni riga",
+ "define_index" => "Define index properties",
+ "dup_val" => "Duplica i valori",
+ "allow" => "Consentito",
+ "not_allow" => "Con consentito",
+ "asc" => "Ascendente",
+ "desc" => "Discendente",
+ "warn0" => "Sei stato avvisato.",
+ "warn_passwd" => "Stai usando la password di default, può essere pericoloso. Puoi cambiarla facilmente editando %s.",
+ "warn_dumbass" => "Non hai cambiato dumbass ;-)",
+ "sel_state" => "Seleziona l'istruzione",
+ "delimit" => "Delimitatore",
+ "back_top" => "Torna in cima",
+ "choose_f" => "Scegli il File",
+ "instead" => "Invece di",
+ "define_in_col" => "Definisci index column(s)",
+
+ "delete_only_managed" => "Puoi cancellare solamente i database gestiti da questo strumento!",
+ "rename_only_managed" => "Puoi rinominare solamente i database gestiti da questo strumento!",
+ "db_moved_outside" => "Hai certato di spotare dentro una direcotry dove non può essere gestita anylonger, oppure il controllo è fallito per la mancanza di diritti.",
+ "extension_not_allowed" => "L'estensione che hai fornito non è contenuta nella lista delle estensioni consentire. Per favore usa una delle seguenti estensioni",
+ "add_allowed_extension" => "Puoi aggiungere estensioni per questa lista aggiungendo la tua estensione to \$allowed_extensions nella configurazione.",
+ "directory_not_writable" => "Il file del database è di per se editabile, ma per poterci scrivere, anche la direcotory che lo ospita deve essere aggiornabile. Questo perchè SQLite ha bisogno di inserirvi file temporanei per il locking.",
+ "tbl_inexistent" => "La tabella %s non esiste",
+
+ // errors that can happen when ALTER TABLE fails. You don't necessarily have to translate these.
+ "alter_failed" => "Altering of Table %s failed",
+ "alter_tbl_name_not_replacable" => "could not replace the table name with the temporary one",
+ "alter_no_def" => "nessuna definzione ALTER",
+ "alter_parse_failed" =>"fallito il parsing (controllo) della definzione ALTER",
+ "alter_action_not_recognized" => "l'azione ALTER non è stata riconosciuta",
+ "alter_no_add_col" => "non è stata rilevata nessuna colonna da aggiungere nell'istruzione ALTER",
+ "alter_pattern_mismatch"=>"La sequenza non ha combaciato sulla tua istruzione originale CREATE TABLE",
+ "alter_col_not_recognized" => "non è stata rilevato il nome della nuova o della vecchia colonna",
+ "alter_unknown_operation" => "L'operazione ALTER non è riconosciuta!",
+
+ /* Help documentation */
+ "help_doc" => "Documentazione",
+ "help1" => "SQLite Librerie di Estensioni",
+ "help1_x" => "%s usa Librerie di Estensioni di PHP che consentono di interagire con i database SQLite. Attualmente, %s supporta PDO, SQLite3, e SQLiteDatabase. Sia PDO che SQLite3 trattano la versione 3 di SQLite, mentre SQLiteDatabase tratta con la versione 2. Così, se la tua installazione PHP include più di una libreria di estesione SQLite, PDO e SQLite3 avranno la precedenza nel fare uso della tecnologia migliore. Comunque, se possiedi database che sono nella versione 2 di SQLite, %s forzerà ad usare SQLiteDatabase solamente per quei database. Non tutti i database hanno bisogno di essere della stessa versione. Durante la creazione del database, comunque, l'estenzione verrà utilizzata l'estenzione più avanzata.",
+ "help2" => "Creare un Nuovo Database",
+ "help2_x" => "Quando crei un nuovo database, il nome che inserisci sarà appeso con l'estensione del file appropriata (.db, .db3, .sqlite, etc.) se non la includi tu stesso. Il database verrà creato nella directory che tu specifichi come directory \$directory variable.",
+ "help3" => "Tabelle vs. Viste",
+ "help3_x" => "Sulla pagina del database principale, c'è una lista di tabele e viste. Poichè le view sono di sola lettura, certe operazioni verranno disabilitate. Al posto di queste operazioni disabilitate verranno mostrati spazi vuoti (omissioni) nella righa di comando della vista. Se vuoi cambiare il dato di una vista, devi cancellare la vista e crearne una nuova con l'istruzione SELECT desiderata che interroga altre tabelle esistenti. Per maggiori informazioni, guarda http://en.wikipedia.org/wiki/View_(database)",
+ "help4" => "Scrivere un'istruzione di selezione per una nuova View",
+ "help4_x" => "Quando crei una nuova view, devi scrivere un istruzione SQL SELECT che verrà usata come suo dato. Una view è semplicemente una tabella di sola lettura alla quale si può accedere e porre interrogazioni come una normale tabella , ad eccezione del fatto che non può essere modificata con inserimenti, editing di colonna, or editing di riga. E' usata soltamente per estrapolare dati.",
+ "help5" => "Exportazione della Struttura verso il file SQL",
+ "help5_x" => "Durante il processo di esportazione verso un file SQL, puoi scegliere di includere le istruzioni (query) che consentono di creare tabella e colonne.",
+ "help6" => "Esporta i dati verso il File SQL",
+ "help6_x" => "Durante il processo di esportazione verso un file SQL, puoi scegliere di includere le istruzioni (query) che popolano la tabella(e) with the current records of the table(s).",
+ "help7" => "Aggiungi Drop Table (cancella tabella) al File SQL esportato",
+ "help7_x" => "Durante il processo di esportazione verso un file SQL, puoi scegliere di includere le istruzioni (query) per cancellare (DROP) le tabelle esistenti prima di aggiungerle così che non occorreranno problemi cercando di crearetabelle che già esistono.",
+ "help8" => "Aggiungi Transaction al File SQLto esportato",
+ "help8_x" => "Durante il processo di esportazione verso un file SQL, puoi scegliere di includere le istruzioni (query) around a TRANSACTION so that if an error occurs at any time during the importation process using the exported file, the database can be reverted to its previous state, preventing partially updated data from populating the database.",
+ "help9" => "Aggiungi commenti al File esportato",
+ "help9_x" => "Durante il processo di esportazione verso un file SQL, puoi includere commenti spiegano ogni passo del processo così che umano può comprendere meglio cosa sta succedendo."
+
+ );
+
+
+?>
\ No newline at end of file
diff --git a/admin/db/phpliteadmin.config.php b/admin/db/phpliteadmin.config.php
new file mode 100644
index 0000000..b80e7d5
--- /dev/null
+++ b/admin/db/phpliteadmin.config.php
@@ -0,0 +1,81 @@
+ 'database1.sqlite',
+ 'name'=> 'Database 1'
+ ),
+ array(
+ 'path'=> 'database2.sqlite',
+ 'name'=> 'Database 2'
+ ),
+);
+
+
+/* ---- Interface settings ---- */
+
+// Theme! If you want to change theme, save the CSS file in same folder of phpliteadmin or in folder "themes"
+$theme = 'phpliteadmin.css';
+
+// the default language! If you want to change it, save the language file in same folder of phpliteadmin or in folder "languages"
+// More about localizations (downloads, how to translate etc.): https://bitbucket.org/phpliteadmin/public/wiki/Localization
+$language = 'it';
+
+// set default number of rows. You need to relog after changing the number
+$rowsNum = 30;
+
+// reduce string characters by a number bigger than 10
+$charsNum = 300;
+
+// maximum number of SQL queries to save in the history
+$maxSavedQueries = 10;
+
+/* ---- Custom functions ---- */
+
+//a list of custom functions that can be applied to columns in the databases
+//make sure to define every function below if it is not a core PHP function
+$custom_functions = array(
+ 'md5', 'sha1', 'time', 'strtotime',
+ // add the names of your custom functions to this array
+ /* 'leet_text', */
+);
+
+// define your custom functions here
+/*
+function leet_text($value)
+{
+ return strtr($value, 'eaAsSOl', '344zZ01');
+}
+*/
+
+
+/* ---- Advanced options ---- */
+
+//changing the following variable allows multiple phpLiteAdmin installs to work under the same domain.
+$cookie_name = 'pla3419342';
+
+//whether or not to put the app in debug mode where errors are outputted
+$debug = false;
+
+// the user is allowed to create databases with only these extensions
+$allowed_extensions = array('db','db3','sqlite','sqlite3');
diff --git a/admin/db/phpliteadmin.css b/admin/db/phpliteadmin.css
new file mode 100644
index 0000000..9b08fb3
--- /dev/null
+++ b/admin/db/phpliteadmin.css
@@ -0,0 +1,291 @@
+/*
+phpLiteAdmin Modern Theme
+Created by Petar Koretic on 01/04/2013
+*/
+
+html,body
+{
+ font: 81.25% arial, helvetica, sans-serif;
+}
+/* overall styles for entire page */
+body
+{
+ margin: 0px;
+ padding: 0px;
+ font-size: 1em;
+ color: #000;
+ background:#F5F5FA;
+}
+/* general styles for hyperlink */
+a
+{
+ color: #15c;
+ text-decoration: none;
+ cursor :pointer;
+ text-shadow: 0 1px 1px #FFF;
+}
+a:hover
+{
+ color: #00A;
+}
+/* horizontal rule */
+hr
+{
+ height:1px;
+ border: 0;
+ color: #d2d2d2;
+ background: #d2d2d2;
+ width: 100%;
+}
+/* logo text containing name of project */
+h1
+{
+ margin: 0px;
+ padding: 5px;
+ font-size: 1.85em;
+ text-align: center;
+ margin-bottom: 10px;
+}
+/* version text within the logo */
+h1 #version
+{
+ font-size: 0.65em;
+ color:#FFF;
+ text-shadow: 0 1px 1px #194B7E;
+}
+/* logo text within logo */
+h1 #logo
+{
+ color:#FFF;
+ text-shadow: 0 1px 1px #194B7E;
+}
+/* general header for various views */
+h2
+{
+ margin:0px;
+ padding:0px;
+ font-size:1em;
+ margin-bottom:20px;
+}
+select
+{
+ background: #FFF;
+ border: 1px solid #CCC;
+ height:27px;
+ line-height:27px;
+ vertical-align:middle;
+}
+
+[multiple]
+{
+ height:100%;
+}
+
+
+/* input buttons and areas for entering text */
+textarea
+{
+ background:#FBFBFF;
+ padding:5px;
+ margin:0;
+ outline: none;
+ border:1px solid #FFF;
+ border-color:#D2D2DC #E6E6F0 #E6E6F0 #D2D2DC;
+ -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
+ -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
+ box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
+
+}
+input[type=text],
+input[type=password]
+{
+ background:#FBFBFF;
+ display: inline-block;
+ height: 25px;
+ line-height:25px;
+ margin: 0;
+ padding: 0 8px;
+ vertical-align:middle;
+ border:1px solid #FFF;
+ border-color:#D2D2DC #E6E6F0 #E6E6F0 #D2D2DC;
+ -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
+ -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
+ box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
+}
+/* just input buttons */
+input.btn
+{
+ cursor:pointer;
+ vertical-align:middle;
+ display:inline-block;
+ margin: 0;
+ outline:none;
+ border:1px solid #C8C8C8;
+ border-bottom-color:#B4B4B4;
+ border-right-color:#AAAAAA;
+ height:27px;
+ padding:0 10px;
+}
+input.btn:hover
+{
+ border-color:#D2D2D2;
+}
+
+/* general styles for hyperlink */
+fieldset,.confirm
+{
+ padding:15px;
+ background:#f9f9f9;
+ border: 1px solid #B4B4FA;
+}
+/* outer div that holds everything */
+#container
+{
+ padding:10px;
+}
+/* div of left box with log, list of databases, etc. */
+#leftNav
+{
+ float:left;
+ width:250px;
+ padding:0px;
+ padding-bottom:15px;
+ border:1px solid #B4B4FA;
+ background:#FFF;
+}
+/* div holding the content to the right of the leftNav */
+#content
+{
+ overflow:hidden;
+ padding-left:10px;
+}
+/* div holding the login fields */
+#loginBox
+{
+ width:500px;
+ margin-left:auto;
+ margin-right:auto;
+ margin-top:50px;
+ border:1px solid #B4B4FA;
+ background:#FFF;
+}
+/* div under tabs with tab-specific content */
+#main
+{
+ border:1px solid #B4B4FA;
+ padding:15px;
+ overflow:auto;
+ background:#FFF;
+}
+/* odd-numbered table rows */
+.td1
+{
+ background:#fff;
+ text-align:right;
+ font-size:0.9em;
+ padding-left:10px;
+ padding-right:10px;
+}
+/* even-numbered table rows */
+.td2
+{
+ background:#F9F9F9;
+ text-align:right;
+ font-size:0.9em;
+ padding-left:10px;
+ padding-right:10px;
+}
+/* table column headers */
+.tdheader
+{
+ border:1px solid #B4B4FA;
+ font-weight:bold;
+ font-size:0.9em;
+ padding-left:10px;
+ padding-right:10px;
+}
+/* tab navigation for each table */
+.tab
+{
+ display:block;
+ padding:5px;
+ padding-right:8px;
+ padding-left:8px;
+ border:1px solid #B4B4FA;
+ margin-right:1px;
+ float:left;
+ position:relative;
+ top:1px;
+ padding-bottom:4px;
+ background:#eaeaea;
+}
+/* pressed state of tab */
+.tab_pressed
+{
+ display:block;
+ padding:5px 8px;
+ border:1px solid #B4B4FA;
+ margin-right:1px;
+ float:left;
+ border-bottom-style:none;
+ position:relative;
+ top:1px;
+ background:#FFF;
+ cursor:default;
+}
+/* tooltip styles */
+#tt
+{
+ position:absolute;
+ display:block;
+}
+#tttop
+{
+ display:block;
+ height:5px;
+ margin-left:5px;
+ overflow:hidden
+}
+#ttcont
+{
+ display:block;
+ padding:2px 12px 3px 7px;
+ margin-left:5px;
+ background:#f3cece;
+ color:#333
+}
+#ttbot
+{
+ display:block;
+ height:5px;
+ margin-left:5px;
+ overflow:hidden
+}
+
+h1
+{
+ background: #81a8ce; /* Old browsers */
+ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzgxYThjZSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM1ZTg3YjAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
+ background: linear-gradient(#81a8ce,#5e87b0); /* W3C */
+}
+
+input.btn, .tab, .tdheader
+{
+ background: #fdfdfd; /* Old browsers */
+ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZkZmRmZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZWVlZWUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
+ background: linear-gradient(#fdfdfd,#eeeeee); /* W3C */
+}
+
+table
+{
+ border-collapse: collapse;
+}
+table td
+{
+ border: 1px solid #eee;
+ padding:5px;
+}
+#headerlinks
+{
+ text-align:center; }
+
diff --git a/admin/db/phpliteadmin.php b/admin/db/phpliteadmin.php
new file mode 100644
index 0000000..f275369
--- /dev/null
+++ b/admin/db/phpliteadmin.php
@@ -0,0 +1,6181 @@
+.
+//
+// ////////////////////////////////////////////////////////////////////////
+//
+// Please report any bugs you may encounter to our issue tracker here:
+// https://bitbucket.org/phpliteadmin/public/issues?status=new&status=open
+
+//
+// This is sample configuration file
+//
+// You can configure phpliteadmin in one of 2 ways:
+// 1. Rename phpliteadmin.config.sample.php to phpliteadmin.config.php and change parameters in there.
+// You can set only your custom settings in phpliteadmin.config.php. All other settings will be set to defaults.
+// 2. Change parameters directly in main phpliteadmin.php file
+//
+// Please see https://bitbucket.org/phpliteadmin/public/wiki/Configuration for more details
+file_put_contents("../../apicache/lastDbUpdate",time());
+//password to gain access
+$password = 'admin';
+
+//directory relative to this file to search for databases (if false, manually list databases in the $databases variable)
+$directory = '.';
+
+//whether or not to scan the subdirectories of the above directory infinitely deep
+$subdirectories = false;
+
+//if the above $directory variable is set to false, you must specify the databases manually in an array as the next variable
+//if any of the databases do not exist as they are referenced by their path, they will be created automatically
+$databases = array(
+ array(
+ 'path'=> 'database1.sqlite',
+ 'name'=> 'Database 1'
+ ),
+ array(
+ 'path'=> 'database2.sqlite',
+ 'name'=> 'Database 2'
+ ),
+);
+
+
+/* ---- Interface settings ---- */
+
+// Theme! If you want to change theme, save the CSS file in same folder of phpliteadmin or in folder "themes"
+$theme = 'phpliteadmin.css';
+
+// the default language! If you want to change it, save the language file in same folder of phpliteadmin or in folder "languages"
+// More about localizations (downloads, how to translate etc.): https://bitbucket.org/phpliteadmin/public/wiki/Localization
+$language = 'it';
+
+// set default number of rows. You need to relog after changing the number
+$rowsNum = 30;
+
+// reduce string characters by a number bigger than 10
+$charsNum = 300;
+
+// maximum number of SQL queries to save in the history
+$maxSavedQueries = 10;
+
+/* ---- Custom functions ---- */
+
+//a list of custom functions that can be applied to columns in the databases
+//make sure to define every function below if it is not a core PHP function
+$custom_functions = array(
+ 'md5', 'sha1', 'time', 'strtotime',
+ // add the names of your custom functions to this array
+ /* 'leet_text', */
+);
+
+// define your custom functions here
+/*
+function leet_text($value)
+{
+ return strtr($value, 'eaAsSOl', '344zZ01');
+}
+*/
+
+
+/* ---- Advanced options ---- */
+
+//changing the following variable allows multiple phpLiteAdmin installs to work under the same domain.
+$cookie_name = 'pla3412';
+
+//whether or not to put the app in debug mode where errors are outputted
+$debug = false;
+
+// the user is allowed to create databases with only these extensions
+$allowed_extensions = array('db','db3','sqlite','sqlite3');
+
+
+// English language-texts.
+// Read our wiki on how to translate: https://bitbucket.org/phpliteadmin/public/wiki/Localization
+$lang = array(
+ "direction" => "LTR",
+ "date_format" => 'g:ia \o\n F j, Y (T)', // see http://php.net/manual/en/function.date.php for what the letters stand for
+ "ver" => "version",
+ "for" => "for",
+ "to" => "to",
+ "go" => "Go",
+ "yes" => "Yes",
+ "no" => "No",
+ "sql" => "SQL",
+ "csv" => "CSV",
+ "csv_tbl" => "Table that CSV pertains to",
+ "srch" => "Search",
+ "srch_again" => "Do Another Search",
+ "login" => "Log In",
+ "logout" => "Logout",
+ "view" => "View", // here, the noun SQL view is meant, not the verb "to view"
+ "confirm" => "Confirm",
+ "cancel" => "Cancel",
+ "save_as" => "Save As",
+ "options" => "Options",
+ "no_opt" => "No options",
+ "help" => "Help",
+ "installed" => "installed",
+ "not_installed" => "not installed",
+ "done" => "done",
+ "insert" => "Insert",
+ "export" => "Export",
+ "import" => "Import",
+ "rename" => "Rename",
+ "empty" => "Empty",
+ "drop" => "Drop",
+ "tbl" => "Table",
+ "chart" => "Chart",
+ "err" => "ERROR",
+ "act" => "Action",
+ "rec" => "Records",
+ "col" => "Column",
+ "cols" => "Columns",
+ "rows" => "row(s)",
+ "edit" => "Edit",
+ "del" => "Delete",
+ "add" => "Add",
+ "backup" => "Backup database file",
+ "before" => "Before",
+ "after" => "After",
+ "passwd" => "Password",
+ "passwd_incorrect" => "Incorrect password.",
+ "chk_ext" => "Checking supported SQLite PHP extensions",
+ "autoincrement" => "Autoincrement",
+ "not_null" => "Not NULL",
+ "attention" => "Attention",
+ "none" => "None",
+ "as_defined" => "As defined",
+ "expression" => "Expression",
+ "download" => "Download",
+ "open_in_browser" => "Open in browser",
+
+ "sqlite_ext" => "SQLite extension",
+ "sqlite_ext_support" => "It appears that none of the supported SQLite library extensions are available in your installation of PHP. You may not use %s until you install at least one of them.",
+ "sqlite_v" => "SQLite version",
+ "sqlite_v_error" => "It appears that your database is of SQLite version %s but your installation of PHP does not contain the necessary extensions to handle this version. To fix the problem, either delete the database and allow %s to create it automatically or recreate it manually as SQLite version %s.",
+ "report_issue" => "The problem cannot be diagnosed properly. Please file an issue report at",
+ "sqlite_limit" => "Due to the limitations of SQLite, only the field name and data type can be modified.",
+
+ "php_v" => "PHP version",
+ "new_version" => "There is a new version!",
+
+ "db_dump" => "database dump",
+ "db_f" => "database file",
+ "db_ch" => "Change Database",
+ "db_event" => "Database Event",
+ "db_name" => "Database name",
+ "db_rename" => "Rename Database",
+ "db_renamed" => "Database '%s' has been renamed to",
+ "db_del" => "Delete Database",
+ "db_path" => "Path to database",
+ "db_size" => "Size of database",
+ "db_mod" => "Database last modified",
+ "db_create" => "Create New Database",
+ "db_vac" => "The database, '%s', has been VACUUMed.",
+ "db_not_writeable" => "The database, '%s', does not exist and cannot be created because the containing directory, '%s', is not writable. The application is unusable until you make it writable.",
+ "db_setup" => "There was a problem setting up your database, %s. An attempt will be made to find out what's going on so you can fix the problem more easily",
+ "db_exists" => "A database, other file or directory of the name '%s' already exists.",
+ "db_blank" => "The database name cannot be blank.",
+
+ "exported" => "Exported",
+ "struct" => "Structure",
+ "struct_for" => "structure for",
+ "on_tbl" => "on table",
+ "data_dump" => "Data dump for",
+ "backup_hint" => "Hint: To backup your database, the easiest way is to %s.",
+ "backup_hint_linktext" => "download the database-file",
+ "total_rows" => "a total of %s rows",
+ "total" => "Total",
+ "not_dir" => "The directory you specified to scan for databases does not exist or is not a directory.",
+ "bad_php_directive" => "It appears that the PHP directive, 'register_globals' is enabled. This is bad. You need to disable it before continuing.",
+ "page_gen" => "Page generated in %s seconds.",
+ "powered" => "Powered by",
+ "free_software" => "This is free software.",
+ "please_donate" => "Please donate.",
+ "remember" => "Remember me",
+ "no_db" => "Welcome to %s. It appears that you have selected to scan a directory for databases to manage. However, %s could not find any valid SQLite databases. You may use the form below to create your first database.",
+ "no_db2" => "The directory you specified does not contain any existing databases to manage, and the directory is not writable. This means you can't create any new databases using %s. Either make the directory writable or manually upload databases to the directory.",
+ "dir_not_executable" => "The directory you specified cannot be scanned for databases as %s has no execute permissions on it. On Linux, use 'chmod +x %s' to fix this.",
+
+ "create" => "Create",
+ "created" => "has been created",
+ "create_tbl" => "Create new table",
+ "create_tbl_db" => "Create new table on database",
+ "create_trigger" => "Creating new trigger on table",
+ "create_index" => "Creating new index on table",
+ "create_index1" => "Create Index",
+ "create_view" => "Create new view on database",
+
+ "trigger" => "Trigger",
+ "triggers" => "Triggers",
+ "trigger_name" => "Trigger name",
+ "trigger_act" => "Trigger Action",
+ "trigger_step" => "Trigger Steps (semicolon terminated)",
+ "when_exp" => "WHEN expression (type expression without 'WHEN')",
+ "index" => "Index",
+ "indexes" => "Indexes",
+ "index_name" => "Index name",
+ "name" => "Name",
+ "unique" => "Unique",
+ "seq_no" => "Seq. No.",
+ "emptied" => "has been emptied",
+ "dropped" => "has been dropped",
+ "renamed" => "has been renamed to",
+ "altered" => "has been altered successfully",
+ "inserted" => "inserted",
+ "deleted" => "deleted",
+ "affected" => "affected",
+ "blank_index" => "Index name must not be blank.",
+ "one_index" => "You must specify at least one index column.",
+ "docu" => "Documentation",
+ "license" => "License",
+ "proj_site" => "Project Site",
+ "bug_report" => "This may be a bug that needs to be reported at",
+ "return" => "Return",
+ "browse" => "Browse",
+ "fld" => "Field",
+ "fld_num" => "Number of Fields",
+ "fields" => "Fields",
+ "type" => "Type",
+ "operator" => "Operator",
+ "val" => "Value",
+ "update" => "Update",
+ "comments" => "Comments",
+
+ "specify_fields" => "You must specify the number of table fields.",
+ "specify_tbl" => "You must specify a table name.",
+ "specify_col" => "You must specify a column.",
+
+ "tbl_exists" => "Table of the same name already exists.",
+ "show" => "Show",
+ "show_rows" => "Showing %s row(s). ",
+ "showing" => "Showing",
+ "showing_rows" => "Showing rows",
+ "query_time" => "(Query took %s sec)",
+ "syntax_err" => "There is a problem with the syntax of your query (Query was not executed)",
+ "run_sql" => "Run SQL query/queries on database '%s'",
+ "recent_queries" => "Recent Queries",
+ "full_texts" => "Show full texts",
+ "no_full_texts" => "Shorten long texts",
+
+ "ques_empty" => "Are you sure you want to empty the table '%s'?",
+ "ques_drop" => "Are you sure you want to drop the table '%s'?",
+ "ques_drop_view" => "Are you sure you want to drop the view '%s'?",
+ "ques_del_rows" => "Are you sure you want to delete row(s) %s from table '%s'?",
+ "ques_del_db" => "Are you sure you want to delete the database '%s'?",
+ "ques_column_delete" => "Are you sure you want to delete column(s) %s from table '%s'?",
+ "ques_del_index" => "Are you sure you want to delete index '%s'?",
+ "ques_del_trigger" => "Are you sure you want to delete trigger '%s'?",
+ "ques_primarykey_add" => "Are you sure you want to add a primary key for the column(s) %s in table '%s'?",
+
+ "export_struct" => "Export with structure",
+ "export_data" => "Export with data",
+ "add_drop" => "Add DROP TABLE",
+ "add_transact" => "Add TRANSACTION",
+ "fld_terminated" => "Fields terminated by",
+ "fld_enclosed" => "Fields enclosed by",
+ "fld_escaped" => "Fields escaped by",
+ "fld_names" => "Field names in first row",
+ "rep_null" => "Replace NULL by",
+ "rem_crlf" => "Remove CRLF characters within fields",
+ "put_fld" => "Put field names in first row",
+ "null_represent" => "NULL represented by",
+ "import_suc" => "Import was successful.",
+ "import_into" => "Import into",
+ "import_f" => "File to import",
+ "max_file_size" => "Maximum file size",
+ "rename_tbl" => "Rename table '%s' to",
+
+ "rows_records" => "row(s) starting from record # ",
+ "rows_aff" => "row(s) affected. ",
+
+ "as_a" => "as a",
+ "readonly_tbl" => "'%s' is a view, which means it is a SELECT statement treated as a read-only table. You may not edit or insert records.",
+ "chk_all" => "Check All",
+ "unchk_all" => "Uncheck All",
+ "with_sel" => "With Selected",
+
+ "no_tbl" => "No table in database.",
+ "no_chart" => "If you can read this, it means the chart could not be generated. The data you are trying to view may not be appropriate for a chart.",
+ "no_rows" => "There are no rows in the table for the range you selected.",
+ "no_sel" => "You did not select anything.",
+
+ "chart_type" => "Chart Type",
+ "chart_bar" => "Bar Chart",
+ "chart_pie" => "Pie Chart",
+ "chart_line" => "Line Chart",
+ "lbl" => "Labels",
+ "empty_tbl" => "This table is empty.",
+ "click" => "Click here",
+ "insert_rows" => "to insert rows.",
+ "restart_insert" => "Restart insertion with ",
+ "ignore" => "Ignore",
+ "func" => "Function",
+ "new_insert" => "Insert As New Row",
+ "save_ch" => "Save Changes",
+ "def_val" => "Default Value",
+ "prim_key" => "Primary Key",
+ "tbl_end" => "field(s) at end of table",
+ "query_used_table" => "Query used to create this table",
+ "query_used_view" => "Query used to create this view",
+ "create_index2" => "Create an index on",
+ "create_trigger2" => "Create a new trigger",
+ "new_fld" => "Adding new field(s) to table '%s'",
+ "add_flds" => "Add Fields",
+ "edit_col" => "Editing column '%s'",
+ "vac" => "Vacuum",
+ "vac_desc" => "Large databases sometimes need to be VACUUMed to reduce their footprint on the server. Click the button below to VACUUM the database '%s'.",
+ "vac_on_empty"=>"Rebuild database file to recover unused space (Vacuum)",
+ "event" => "Event",
+ "each_row" => "For Each Row",
+ "define_index" => "Define index properties",
+ "dup_val" => "Duplicate values",
+ "allow" => "Allowed",
+ "not_allow" => "Not Allowed",
+ "asc" => "Ascending",
+ "desc" => "Descending",
+ "warn0" => "You have been warned.",
+ "warn_passwd" => "You are using the default password, which can be dangerous. You can change it easily at the top of %s.",
+ "counting_skipped" => "Counting of records has been skipped for some tables because your database is comparably big and some tables don't have primary keys assigned to them so counting might be slow. Add a primary key to these tables or %sforce counting%s.",
+ "sel_state" => "Select Statement",
+ "delimit" => "Delimiter",
+ "back_top" => "Back to Top",
+ "choose_f" => "Choose File",
+ "instead" => "Instead of",
+ "define_in_col" => "Define index column(s)",
+
+ "delete_only_managed" => "You can only delete databases managed by this tool!",
+ "rename_only_managed" => "You can only rename databases managed by this tool!",
+ "db_moved_outside" => "You either tried to move the database into a directory where it cannot be managed anylonger, or the check if you did this failed because of missing rights.",
+ "extension_not_allowed" => "The extension you provided is not within the list of allowed extensions. Please use one of the following extensions",
+ "add_allowed_extension" => "You can add extensions to this list by adding your extension to \$allowed_extensions in the configuration.",
+ "database_not_writable" => "The database-file is not writable, so its content cannot be changed in any way.",
+ "directory_not_writable" => "The database-file itself is writable, but to write into it, the containing directory needs to be writable as well. This is because SQLite puts temporary files in there for locking.",
+ "tbl_inexistent" => "Table %s does not exist",
+ "col_inexistent" => "Column %s does not exist",
+
+ // errors that can happen when ALTER TABLE fails. You don't necessarily have to translate these.
+ "alter_failed" => "Altering of Table %s failed",
+ "alter_tbl_name_not_replacable" => "could not replace the table name with the temporary one",
+ "alter_no_def" => "no ALTER definition",
+ "alter_parse_failed" =>"failed to parse ALTER definition",
+ "alter_action_not_recognized" => "ALTER action could not be recognized",
+ "alter_no_add_col" => "no column to add detected in ALTER statement",
+ "alter_pattern_mismatch"=>"Pattern did not match on your original CREATE TABLE statement",
+ "alter_col_not_recognized" => "could not recognize new or old column name",
+ "alter_unknown_operation" => "Unknown ALTER operation!",
+
+ /* Help documentation */
+ "help_doc" => "Help Documentation",
+ "help1" => "SQLite Library Extensions",
+ "help1_x" => "%s uses PHP library extensions that allow interaction with SQLite databases. Currently, %s supports PDO, SQLite3, and SQLiteDatabase. Both PDO and SQLite3 deal with version 3 of SQLite, while SQLiteDatabase deals with version 2. So, if your PHP installation includes more than one SQLite library extension, PDO and SQLite3 will take precedence to make use of the better technology. However, if you have existing databases that are of version 2 of SQLite, %s will be forced to use SQLiteDatabase for only those databases. Not all databases need to be of the same version. During the database creation, however, the most advanced extension will be used.",
+ "help2" => "Creating a New Database",
+ "help2_x" => "When you create a new database, the name you entered will be appended with the appropriate file extension (.db, .db3, .sqlite, etc.) if you do not include it yourself. The database will be created in the directory you specified as the \$directory variable.",
+ "help3" => "Tables vs. Views",
+ "help3_x" => "On the main database page, there is a list of tables and views. Since views are read-only, certain operations will be disabled. These disabled operations will be apparent by their omission in the location where they should appear on the row for a view. If you want to change the data for a view, you need to drop that view and create a new view with the appropriate SELECT statement that queries other existing tables. For more information, see http://en.wikipedia.org/wiki/View_(database)",
+ "help4" => "Writing a Select Statement for a New View",
+ "help4_x" => "When you create a new view, you must write an SQL SELECT statement that it will use as its data. A view is simply a read-only table that can be accessed and queried like a regular table, except it cannot be modified through insertion, column editing, or row editing. It is only used for conveniently fetching data.",
+ "help5" => "Export Structure to SQL File",
+ "help5_x" => "During the process for exporting to an SQL file, you may choose to include the queries that create the table and columns.",
+ "help6" => "Export Data to SQL File",
+ "help6_x" => "During the process for exporting to an SQL file, you may choose to include the queries that populate the table(s) with the current records of the table(s).",
+ "help7" => "Add Drop Table to Exported SQL File",
+ "help7_x" => "During the process for exporting to an SQL file, you may choose to include queries to DROP the existing tables before adding them so that problems do not occur when trying to create tables that already exist.",
+ "help8" => "Add Transaction to Exported SQL File",
+ "help8_x" => "During the process for exporting to an SQL file, you may choose to wrap the queries around a TRANSACTION so that if an error occurs at any time during the importation process using the exported file, the database can be reverted to its previous state, preventing partially updated data from populating the database.",
+ "help9" => "Add Comments to Exported SQL File",
+ "help9_x" => "During the process for exporting to an SQL file, you may choose to include comments that explain each step of the process so that a human can better understand what is happening.",
+ "help10" => "Partial Indexes",
+ "help10_x" => "Partial indexes are indexes over a subset of the rows of a table specified by a WHERE clause. Note this requires at least SQLite 3.8.0 and database files with partial indexes won't be readable or writable by older versions. See the SQLite documentation.",
+ "help11" => "Maximum size of file uploads",
+ "help11_x" => "The maximum size of file uploads is determined by three PHP settings: upload_max_filesize, post_max_size and memory_limit. The smallest of these three limits the maximum size for file uploads. To upload larger files, adjust these values in your php.ini file."
+
+);
+
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//there is no reason for the average user to edit anything below this comment
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+//- Initialization
+
+// load optional configuration file
+$config_filename = './phpliteadmin.config.php';
+if (is_readable($config_filename))
+{
+ include_once $config_filename;
+}
+
+//constants 1
+define("PROJECT", "phpLiteAdmin");
+define("VERSION", "1.9.8.2");
+define("FORCETYPE", false); //force the extension that will be used (set to false in almost all circumstances except debugging)
+define("SYSTEMPASSWORD", $password); // Makes things easier.
+define('PROJECT_URL','https://www.phpliteadmin.org/');
+define('DONATE_URL','https://www.phpliteadmin.org/donate/');
+define('VERSION_CHECK_URL','https://www.phpliteadmin.org/current_version.php');
+define('PROJECT_BUGTRACKER_LINK','https://bitbucket.org/phpliteadmin/public/issues?status=new&status=open');
+define('PROJECT_INSTALL_LINK','https://bitbucket.org/phpliteadmin/public/wiki/Installation');
+
+// up here, we don't output anything. debug output might appear here which is catched by ob and thrown later
+ob_start();
+
+// Resource output (css and javascript files)
+// we get out of the main code as soon as possible, without inizializing the session
+if (isset($_GET['resource']))
+{
+ Resources::output($_GET['resource']);
+ exit();
+}
+
+// don't mess with this - required for the login session
+ini_set('session.cookie_httponly', '1');
+session_start();
+
+// version-number added so after updating, old session-data is not used anylonger
+// cookies names cannot contain symbols, except underscores
+define("COOKIENAME", preg_replace('/[^a-zA-Z0-9_]/', '_', $cookie_name . '_' . VERSION) );
+
+$params = new GetParameters();
+
+if($debug==true)
+{
+ ini_set("display_errors", 1);
+ error_reporting(E_STRICT | E_ALL);
+} else
+{
+ @ini_set("display_errors", 0);
+}
+
+// start the timer to record page load time
+$pageTimer = new MicroTimer();
+
+// load language file
+if($language != 'en') {
+ $temp_lang=$lang;
+ if(is_file('languages/lang_'.$language.'.php'))
+ include('languages/lang_'.$language.'.php');
+ elseif(is_file('lang_'.$language.'.php'))
+ include('lang_'.$language.'.php');
+ $lang = array_merge($temp_lang, $lang);
+ unset($temp_lang);
+}
+
+// stripslashes if MAGIC QUOTES is turned on
+// This is only a workaround. Please better turn off magic quotes!
+// This code is from http://php.net/manual/en/security.magicquotes.disabling.php
+if (get_magic_quotes_gpc()) {
+ $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
+ while (list($key, $val) = each($process)) {
+ foreach ($val as $k => $v) {
+ unset($process[$key][$k]);
+ if (is_array($v)) {
+ $process[$key][stripslashes($k)] = $v;
+ $process[] = &$process[$key][stripslashes($k)];
+ } else {
+ $process[$key][stripslashes($k)] = stripslashes($v);
+ }
+ }
+ }
+ unset($process);
+}
+
+
+//data types array
+$sqlite_datatypes = array("INTEGER", "REAL", "TEXT", "BLOB","NUMERIC","BOOLEAN","DATETIME");
+
+//available SQLite functions array (don't add anything here or there will be problems)
+$sqlite_functions = array("abs", "hex", "length", "lower", "ltrim", "random", "round", "rtrim", "trim", "typeof", "upper");
+
+//- Support functions
+
+// for php < 5.6.0
+if(!function_exists('hash_equals'))
+{
+ function hash_equals($str1, $str2)
+ {
+ if(strlen($str1) != strlen($str2))
+ return false;
+ else {
+ $res = $str1 ^ $str2;
+ $ret = 0;
+ for($i = strlen($res) - 1; $i >= 0; $i--)
+ $ret |= ord($res[$i]);
+ return !$ret;
+ }
+ }
+}
+
+//function that allows SQL delimiter to be ignored inside comments or strings
+function explode_sql($delimiter, $sql)
+{
+ $ign = array('"' => '"', "'" => "'", "/*" => "*/", "--" => "\n"); // Ignore sequences.
+ $out = array();
+ $last = 0;
+ $slen = strlen($sql);
+ $dlen = strlen($delimiter);
+ $i = 0;
+ while($i < $slen)
+ {
+ // Split on delimiter
+ if($slen - $i >= $dlen && substr($sql, $i, $dlen) == $delimiter)
+ {
+ array_push($out, substr($sql, $last, $i - $last));
+ $last = $i + $dlen;
+ $i += $dlen;
+ continue;
+ }
+ // Eat comments and string literals
+ foreach($ign as $start => $end)
+ {
+ $ilen = strlen($start);
+ if($slen - $i >= $ilen && substr($sql, $i, $ilen) == $start)
+ {
+ $i+=strlen($start);
+ $elen = strlen($end);
+ while($i < $slen)
+ {
+ if($slen - $i >= $elen && substr($sql, $i, $elen) == $end)
+ {
+ // SQL comment characters can be escaped by doubling the character. This recognizes and skips those.
+ if($start == $end && $slen - $i >= $elen*2 && substr($sql, $i, $elen*2) == $end.$end)
+ {
+ $i += $elen * 2;
+ continue;
+ }
+ else
+ {
+ $i += $elen;
+ continue 3;
+ }
+ }
+ $i++;
+ }
+ continue 2;
+ }
+ }
+ $i++;
+ }
+ if($last < $slen)
+ array_push($out, substr($sql, $last, $slen - $last));
+ return $out;
+}
+
+//function to scan entire directory tree and subdirectories
+function dir_tree($dir)
+{
+ $path = array();
+ $stack = array($dir);
+ while($stack)
+ {
+ $thisdir = array_pop($stack);
+ if($dircont = scandir($thisdir))
+ {
+ $i=0;
+ while(isset($dircont[$i]))
+ {
+ if($dircont[$i] !== '.' && $dircont[$i] !== '..')
+ {
+ $current_file = $thisdir.DIRECTORY_SEPARATOR.$dircont[$i];
+ if(is_file($current_file))
+ {
+ $path[] = $thisdir.DIRECTORY_SEPARATOR.$dircont[$i];
+ }
+ elseif (is_dir($current_file))
+ {
+ $path[] = $thisdir.DIRECTORY_SEPARATOR.$dircont[$i];
+ $stack[] = $current_file;
+ }
+ }
+ $i++;
+ }
+ }
+ }
+ return $path;
+}
+
+//the function echo the help [?] links to the documentation
+function helpLink($name)
+{
+ global $lang;
+ return "[?]";
+}
+
+// function to encode value into HTML just like htmlentities, but with adjusted default settings
+function htmlencode($value, $flags=ENT_QUOTES, $encoding ="UTF-8")
+{
+ return htmlentities($value, $flags, $encoding);
+}
+
+// reduce string chars
+function subString($str)
+{
+ global $charsNum, $params;
+ if($charsNum > 10 && (!isset($params->fulltexts) || !$params->fulltexts) && mb_strlen($str)>$charsNum)
+ {
+ $str = mb_substr($str, 0, $charsNum).'...';
+ }
+ return $str;
+}
+
+// marks searchwords and htmlencodes correctly
+function markSearchWords($input, $field, $search)
+{
+ $output = htmlencode($input);
+ if(isset($search['values'][$field]) && is_array($search['values'][$field]))
+ {
+ // build one regex that matches (all) search words
+ $regex = '/';
+ $vali=0;
+ foreach($search['values'][$field] as $searchValue)
+ {
+ if($search['operators'][$field] =='LIKE' || $search['operators'][$field] == 'LIKE%')
+ $regex .= '(?:'.($searchValue[0]=='%'?'':'^'); // does the searchvalue have to occur at the start?
+ $regex .= preg_quote(trim($searchValue,'%'),'/'); // the search value
+ if($search['operators'][$field] =='LIKE' || $search['operators'][$field] == 'LIKE%')
+ $regex .= (substr($searchValue,-1)=='%'?'':'$').')'; // does the searchvalue have to occur at the end?
+ if($vali++ $betweenPart)
+ {
+ $output .= htmlencode($betweenPart); // part that does not match (might be empty)
+ if(isset($fldFoundParts[0][$index]))
+ $output .= ''.htmlencode($fldFoundParts[0][$index]).''; // the part that matched
+ }
+ }
+ return $output;
+}
+
+// checks the (new) name of a database file
+function checkDbName($name)
+{
+ global $allowed_extensions;
+ $info = pathinfo($name);
+ if(isset($info['extension']) && !in_array($info['extension'], $allowed_extensions))
+ {
+ return false;
+ } else
+ {
+ return (!is_file($name) && !is_dir($name));
+ }
+
+}
+
+// check whether a path is a db managed by this tool
+// requires that $databases is already filled!
+// returns the key of the db if managed, false otherwise.
+function isManagedDB($path)
+{
+ global $databases;
+ foreach($databases as $db_key => $database)
+ {
+ if($path === $database['path'])
+ {
+ // a db we manage. Thats okay.
+ // return the key.
+ return $db_key;
+ }
+ }
+ // not a db we manage!
+ return false;
+}
+
+// from a typename of a colun, get the type of the column's affinty
+// see https://www.sqlite.org/datatype3.html section 2.1 for rules
+function get_type_affinity($type)
+{
+ if (preg_match("/INT/i", $type))
+ return "INTEGER";
+ else if (preg_match("/(?:CHAR|CLOB|TEXT)/i", $type))
+ return "TEXT";
+ else if (preg_match("/BLOB/i", $type) || $type=="")
+ return "NONE";
+ else if (preg_match("/(?:REAL|FLOA|DOUB)/i", $type))
+ return "REAL";
+ else
+ return "NUMERIC";
+}
+
+
+// Returns a file size limit in bytes based on the PHP upload_max_filesize
+// post_max_size and memory_limit. Returns -1 in case of no limit.
+function fileUploadMaxSize()
+{
+ $max1 = parseSize(ini_get('post_max_size'));
+ $max2 = parseSize(ini_get('upload_max_filesize'));
+ $max3 = parseSize(ini_get('memory_limit'));
+ if($max1>0 && ($max1<=$max2 || $max2==0) && ($max1<=$max3 || $max3==-1))
+ return $max1;
+ elseif($max2>0 && ($max2<=$max1 || $max1==0) && ($max2<=$max3 || $max3==-1))
+ return $max2;
+ elseif($max3>-1 && ($max3<=$max1 || $max1==0) && ($max3<=$max2 || $max2==0))
+ return $max3;
+ else
+ return -1; // no limit
+}
+
+// Parses given size string like "12M" into number of bytes
+// based on https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Utility%21Bytes.php/function/Bytes%3A%3AtoInt/8.2.x
+function parseSize($size)
+{
+ // Remove the non-unit characters from the size.
+ $unit = preg_replace('/[^bkmgtpezy]/i', '', $size);
+ // Remove the non-numeric characters from the size.
+ $size = preg_replace('/[^0-9\.]/', '', $size);
+ if ($unit)
+ {
+ // Find the position of the unit in the ordered string which is the power
+ // of magnitude to multiply a kilobyte by.
+ return round($size * pow(1024, stripos('bkmgtpezy', $unit[0])));
+ }
+ else {
+ return round($size);
+ }
+}
+
+
+//- Check user authentication, login and logout
+$auth = new Authorization(); //create authorization object
+
+// check if user has attempted to log out
+if (isset($_GET['logout']))
+ $auth->revoke();
+// check if user has attempted to log in
+else if (isset($_POST['login']) && isset($_POST['password']))
+{
+ $attempt = $auth->attemptGrant($_POST['password'], isset($_POST['remember']));
+ $params->redirect( $attempt ? array():array('failed'=>'1') );
+}
+
+//- Actions on database files and bulk data
+if ($auth->isAuthorized())
+{
+
+ //- Create a new database
+ if(isset($_POST['new_dbname']))
+ {
+ if($_POST['new_dbname']=='')
+ $params->redirect(array('table'=>null), $lang['err'].': '.$lang['db_blank']);
+ else
+ {
+ $str = preg_replace('@[^\w\-.]@u','', $_POST['new_dbname']);
+ $dbname = $str;
+ $dbpath = $str;
+ if(checkDbName($dbname))
+ {
+ $tdata = array();
+ $tdata['name'] = $dbname;
+ $tdata['path'] = $directory.DIRECTORY_SEPARATOR.$dbpath;
+ if(isset($_POST['new_dbtype']))
+ $tdata['type'] = $_POST['new_dbtype'];
+ else
+ $tdata['type'] = 3;
+ $td = new Database($tdata);
+ $td->query("VACUUM");
+ } else
+ {
+ if(is_file($dbname) || is_dir($dbname))
+ $params->redirect(array('view'=>'structure'),$lang['err'].': '.sprintf($lang['db_exists'], htmlencode($dbname)));
+ else
+ $params->redirect(array('view'=>'structure'),$lang['extension_not_allowed'].': '.implode(', ', array_map('htmlencode', $allowed_extensions)).' '.$lang['add_allowed_extension']);
+ }
+ }
+ }
+
+ //- Scan a directory for databases
+ if($directory!==false)
+ {
+ if($directory[strlen($directory)-1]==DIRECTORY_SEPARATOR) //if user has a trailing slash in the directory, remove it
+ $directory = substr($directory, 0, strlen($directory)-1);
+
+ if(is_dir($directory)) //make sure the directory is valid
+ {
+ if($subdirectories===true)
+ $arr = dir_tree($directory);
+ else
+ $arr = scandir($directory);
+ $databases = array();
+ $j = 0;
+ for($i=0; $i $database)
+ {
+ if($database['path'] === $tdata['path'])
+ {
+ $currentDB = $database;
+ $params->database = $database['path'];
+ break;
+ }
+ }
+ }
+ }
+ else //the directory is not valid - display error and exit
+ {
+ echo "