DaDaBIK Documentation

Project name: DaDaBIK (DaDaBIK is a DataBase Interfaces Kreator)
Author: Eugenio Tacchini (eugenio.tacchini@unicatt.it)
Web site: http://www.dadabik.org/
Last release: 4.2 (released February 18, 2007). This documentation is about the 4.2 release, if you need the documentation for a previous release please read the documentation file included in each download package.
License: DaDaBIK is released under the GPL license.
Support: If you need general support for DaDaBIK, please use the support forum and not my e-mail address, I immediately receive via e-mail all the posts. Contact me directly only if you have particular requests, or just to say: "Thank you" :)

Introduction


DaDaBIK is a free PHP application that allows you to easily create a highly customizable front-end for a database in order to search, insert, update and delete records; all you need to do is specifying a few configuration parameters.

Starting from version 4.0 alpha DaDaBIK uses the ADOdb Database Abstraction Library in order to support as many DBMS as possible, at the moment it has been tested on MySQL, PostgreSQL, Oracle and MS SQL Server.

The strength of DaDaBIK lies in its ability to be customized. For each field of a table you can choose:

DaDaBIK also allows you to handle multiple tables. Other features include file uploading, export to CSV, checking for possible duplication during an insert, authentication and authorization restrictions on view/update/delete, e-mail notices, table aliases.

The graphic layout of DaDaBIK is customizable to help you to embed its forms in your own site.

DaDaBIK differs from other applications like PHPMyAdmin since it doesn't enable the complete administration of a database, but rather to easily create a simple and customizable Web application that manages a group of tables by allowing search/insert/update/delete operations. DaDaBIK's target user is not the DB administrator but rather the final user.

DaDaBIK is available in Italian, English, Dutch, German, Spanish, French, Portuguese, Croatian, Polish, Catalan, Estonian, Rumanian, Hungarian, Swedish, Slovak and Finnish.

Requirements


Installation


  1. Copy everything which is contained in the directory program_files in a directory under your Web server
  2. Open the file /include/config.php with a text editor and edit it (specify at least $dbms_type, $host, $db_name, $user, $pass, $site_url, $site_path)
  3. Run the file http://your_host/your_dir/install.php to install DaDaBIK
  4. Open the file http://your_host/your_dir/index.php in your browser and have fun!! You can now start using DaDaBIK.

    You can now insert, search, update, delete the records of the tables contained in the database $db_name. You should have set a primary key for each table managed with DaDaBIK if you want to delete and update records, otherwise DaDaBIK won't show you the corresponding buttons.
    Also the "search similar record" feature during the insert needs a primary key.
    The "insert e-mail notice" feature needs a primary key auto increment field to work.

Please send me the URL of your site (just to be aware of it) if you are using DaDaBIK in a public site.

Please leave the link
Powered by: DaDaBIK
somewhere if you use DaDaBIK; it isn't compulsory but I would really appreciate it.

Upgrade from previous versions


1 - If you want to upgrade from 3.0 beta or 3.0 to 3.1 beta without loosing your configuration you don't need to re-install DaDaBIK:

2 - If you want to upgrade from 3.1 beta to 3.2 beta or 3.2 without loosing your configuration you don't need to re-install DaDaBIK, but note that, since the authentication model has changed a lot from 3.1 beta to 3.2 beta, an automatic procedure to import the old DaDaBIK users is not available, so this information will be lost after the upgrade:

3 - If you want to upgrade from 3.2 beta or 3.2 or 4.0 Alpha or 4.0 Beta or 4.0 Beta 2 to 3.2 or 4.0 Alpha or 4.0 Beta or 4.0 Beta 2 or 4.0 without loosing your configuration you don't need to re-install DaDaBIK:

4 - If you want to upgrade from 3.2 beta or 3.2 or 4.0 Alpha or 4.0 Beta or 4.0 Beta 2 or 4.0 to 4.1 beta or 4.1 release candidate 1 without loosing your configuration you don't need to re-install DaDaBIK:

5 - If you want to upgrade from 4.1 beta or 4.1 release candidate 1 to 4.1 release candidate 2 or 4.1 release candidate 3 or 4.1 or 4.2 beta or 4.2 without loosing your configuration you don't need to re-install DaDaBIK:

As an example, if you want to upgrade from 3.2 to 4.1 release candidate 2 both steps 4 and 5 have to be executed.

Configuration


Introduction
The configuration of DaDaBIK can be managed at two different levels:
  1. Some general configuration parameters can be set from the file /include/config.php, just by opening it with a plain text editor and editing it. The file is self-explanatory. At this level you can, for example, set the database you want to manage with DaDaBIK, or enable/disable some DaDaBIK features
  2. For a more analytic tuning you are supposed to use the administration section http://your_host/your_dir/admin.php. At this level you can choose the table you want to include/exclude and, for each table, create your own DaDaBIK interface, choosing for example the field you want to include/exclude from the forms, the content of each field, the labels....
    Also the administration section is self-explanatory, so in the following paragraph we will explain in detail only the interface configurator, which is the core of the DaDaBIK configuration; you can reach it from the home page of the administration section.

The graphic customization can be done by changing the files /include/header.php and /include/footer.php and by using the CSS files /css/styles_screen.css and /css/styles_print.css, the former is the main one, the latter is used only when you print a page produced by DaDaBIK.
From the files under /include/languages you can customize all the sentences DaDaBIK uses.

Interface configurator
Here is the meaning of all the parameters you can set for each table field:

Authentication


An authorization model is available to prevent unauthorized accesses and to allow users to:

The owner of a record is the user who entered it.

To enable authentication, each table you want to protect must have a field whose field type is set to ID_user; you also have to set $enable_authentication = 1 in /include/config.php. By setting the parameters $enable_delete_authorization, $enable update authorization and $enable_browse_authorization you can then customize your authorization model.

There are two types of users: normal users and administrator users. Administrator users can view and manage users list by using DaDaBIK itself.

DaDaBIK is released with the following default administrator user: DaDaBIK uses by default the table users_tab to store user information, but you can also use your own users table, changing the $users_table_* parameters in /include/config.php. User passwords are md5 encrypted.

Before inserting a new user it is necessary to create the encrypted password by following the "create password" link.

Multiple function views: creating two instances of DaDaBIK


Sometimes it is necessary to have one view for users where they can only view the data and a second view for the database administrators to manage the data being displayed. This will help you set up two instances of DaDaBIK to look at the same database.

  1. Install your first instance of DaDaBIK using the default DaDaBIK table prefixes contained in the /include/config.php file (last two variables in the file).
    http://your_host/your_dir/install.php

    If you want things to look the same in both installations like headers, footers, logos, etc., you can make those changes now so that you only have to make them once; otherwise you can worry about prettying it up later.

  2. Copy your entire DaDaBIK folder into a new folder you wish to use for the second instance: http://your_host/your_dir/ <-- all contents copied to: http://your_host/your_dir/admin-dir-name/

  3. Open /include/config.php from the /your_dir/admin-dir-name/include/ folder and change the table prefix and table list name in this file to something like:
    dadabik_admin_
    and
    dadabik_admin_table_list

    It does not matter what your prefixes are -- just so long as they are different from the first install prefixes.

    Also in /include/config.php, change the $site_url to the correct URL for the admin area so the correct installation is used.

  4. Now, install your second instance of DaDaBIK:
    http://your_host/your_dir/admin-dir-name/install.php

  5. This will create additional tables with your admin prefix for all your original DaDaBIK tables also. You should remove them by going to the admin interface for the second instance you just installed and uninstall those tables.

    For this example, we'll assume you used the following:
    1st install: "dadabik_" table prefix with "dadabik_table_list" table list name
    2nd install: "dadabik_admin_" table prefix with "dadabik_admin_table_list" table list name

    In the admin for the 2nd install (http://your_host/your_dir/admin-dir-name/admin.php), "uninstall" each table you see beginning with "dadabik_".

  6. Now you can manage both instances independent from each other through:
    http://your_host/your_dir/admin.php
    and
    http://your_host/your_dir/admin-dir-name/admin.php

    Beyond this, you can add password protection to your admin area through .htaccess (do a search in the support forums for this or goog it for tons of info) or other methods.

Security


Since the files install.php could be used by malicious users in order to re-install your DaDaBIK installation, it is a good practice to protect it or to delete it if you don't need to re-install DaDaBIK or a single DaDaBIK table.

Coding guidelines


If you want to contribute to the DaDaBIK code you have to follow some coding guidelines; this document: http://www.evolt.org/article/PHP_coding_guidelines/18/60247/ fits most of DaDaBIK coding style rules, in particular follow the sections:

In addition and/or modification to the above document sections, here are other rules:
Other coding rules should be learned looking for the DaDaBIK code. Please contact me if you have any doubts.

FAQs


I am looking for an old version of DaDaBIK, can anybody help me with a link to DaDaBIK 3.0 ??

Old releases of DaDaBik can be found at sourceforge.

I get:
"[06] Error: during database connection.
MySQL server said: Client does not support authentication protocol requested by server; consider upgrading MySQL client".
Why?


It is due to the new authentication protocol introduced with MySQL 4.1.x; here:
http://dev.mysql.com/doc/mysql/en/old-client.html you can find several solutions.

I get [08] Error Message
I get "Error during query execution"


Please open the file include/config.php, look for the variable named $debug_mode. Set it to 1, so that you'll be able to see what the error is. If you still cannot figure it out post the error message in the support forum.

I can't see the edit/delete record icons in the results view

You did not set a primary key in the table, so you are able to see the records but DaDaBik cannot edit/delete them.

I get this message:
"Call to undefined function mysql_server_info......"


The version of PHP you're using is prior to 4.0.5, please comment relative lines in common_start and set the mysql version (variable $mysql_server_version) by hand e.g. 32306 for 3.23.6.
Otherwise ask your sys-admin to upgrade PHP to some more recent version.

I get "your database is empty" error, why?

You first have to set up a database and then you can install DaDaBik.
For more info on what DaDaBik's purpose is please see documentation

Are multiple primary keys supported?

Not yet. Not planned. If you're interested in developing it please contact me (eugenio.tacchini at unicatt.it).

How to set magic_quotes_gpc to On in php.ini?

If you can't access the php.ini file try placing a file called .htaccess in the main folder of your DaDaBIK installation.
The content of this .htaccess file must be:

php_flag magic_quotes_gpc On

further reference for this problem can be found here

Page not showing after Insert/Update.

Open include/config.php and make sure the variable $site_url is set to the the complete path to your DaDaBIK installation.
(E.g http://www.yoursite.com/dadabik_folder/)

How to change graphic layout etc?

The role of the files is self-explicatory
include/header.php
include/footer.php

This takes care of the general styles
css/style.css

These two functions take care of forms and results table styles
change build_form() and build_results_table()


Known bugs and limitations