<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="StarOffice/5.1 (Win32)">
<META NAME="AUTHOR" CONTENT="Philippe Lewicki">
<META NAME="CREATED" CONTENT="20000522;5545499">
<META NAME="CHANGEDBY" CONTENT="Philippe Lewicki">
<META NAME="CHANGED" CONTENT="20000605;6102779">
<STYLE>
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm; font-size: 10pt }
H1 { margin-bottom: 0.21cm; font-family: "helvetica", sans-serif; font-size: 16pt }
H2 { margin-bottom: 0.21cm; font-family: "helvetica", sans-serif; font-size: 14pt; font-style: italic }
H3 { margin-bottom: 0.21cm; font-family: "helvetica", sans-serif; font-size: 12pt }
TD P { margin-bottom: 0.21cm; font-size: 10pt }
TH P { margin-bottom: 0.21cm; font-size: 10pt; font-style: italic }
-->
</STYLE>
</HEAD>
<BODY>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><BR>
</P>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><FONT FACE="Arial, sans-serif"><FONT SIZE=5>MyDataLib
Documentation<BR></FONT></FONT><BR>
</P>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><FONT FACE="Arial, sans-serif"><FONT SIZE=5>Free
MyDB Project</FONT></FONT></P>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm">Author : Philippe Lewicki</P>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<TABLE WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0>
<COL WIDTH=85*>
<COL WIDTH=85*>
<COL WIDTH=85*>
<THEAD>
<TR VALIGN=TOP>
<TH WIDTH=33%>
<P>Class Mydataconnect</P>
</TH>
<TH WIDTH=33%>
<P>class mydataTable</P>
</TH>
<TH WIDTH=33%>
<P>Class mydataForm</P>
</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN=TOP>
<TD WIDTH=33%>
<P STYLE="margin-bottom: 0cm"><B>Methods :</B></P>
<P>hostname
<BR>login<BR>password<BR>db<BR>table<BR>server<BR>registryTable<BR><BR><B>Proprieties
:<BR></B>start() <BR>query()<BR>fetch()<BR><BR><BR>
</P>
</TD>
<TD WIDTH=33%>
<P><B>Methods<BR><BR></B>cfgBorder<BR>cfgBgcolorOne<BR>cfgBgcolorTwo<BR>cfgMaxRows<BR>cfgOrder<BR>cfgShowBlob<BR><BR>cfgOrderTable<BR>cfgEditRecord<BR>cfgDeleteRecord<BR>cfgLinkTableRecord<BR>cfgAddRecord<BR><BR>cfgConfirmDelete<BR><BR>cfgEditPage<BR>cfgAddPage<BR>cfgDeletePage<BR>cfgLinkTablePage<BR><BR>strShowingRecords<BR>srtTotal<BR>strEdit<BR>strPrevious<BR>strNext<BR>strDelete<BR>strDeleted<BR>strLinkedTable<BR>strPos1<BR>strEnd<BR>strInsertNewRow<BR>strYes<BR>strNo<BR>strDoYouReallyDelete<BR><BR><B>Propriety
:<BR></B>displaytable(object mydataconnect, resultquery)<BR><BR><BR>
</P>
</TD>
<TD WIDTH=33%>
<P><B>Methods
:<BR></B>submitPage<BR>resultpage<BR>readonlyField<BR>labelField<BR><BR>secondary_key<BR><BR>tblBorder<BR>tblWidth<BR>tblCellspacing<BR>tblCellpadding<BR><BR>frmTextareaCols<BR>frmTextareaRows<BR>fromFieldSize<BR>frmSubmitButton<BR><BR><B>Proprieties
:<BR></B>printform(object mydataconnect, string where of the
query)<BR>showform(object mydataconnect, string with the where
sequence of a query)
</P>
</TD>
</TR>
</TBODY>
</TABLE>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm; page-break-before: always"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<H1>mydataconnect</H1>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<H2>Methodes
</H2>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<H3>Connect to the database</H3>
<P STYLE="margin-bottom: 0cm"><FONT SIZE=2><B>hostname</B></FONT> =
"localhost" Name of the host <BR><FONT SIZE=2><B>login</B></FONT>
= "" Login to acces the database <BR><FONT SIZE=2><B>password</B></FONT>
= "" Password to acces the database <BR><BR>
</P>
<H3>Create query in the database</H3>
<P STYLE="margin-bottom: 0cm"><FONT SIZE=2><B>db</B></FONT> =
"databasename" Database Name <BR><FONT SIZE=2><B>table</B></FONT>
= "tablename" Table Name<BR><FONT SIZE=2><B>sql_query</B></FONT>
SQL Query <BR><FONT SIZE=2><B>sql_order </B></FONT> Order of
the query (Order by sequence) <BR><FONT SIZE=2><B>pos </B></FONT> record
position (Limit sequence).<BR>server ="0"<BR><FONT SIZE=2><B>id</B></FONT> connexion
identifier<BR><FONT SIZE=2><B>result</B></FONT> Query result
identifier, for the record set. <BR><FONT SIZE=2><B>insert_id</B></FONT>
After an insert query its the uniq identifier
created.<BR><BR><FONT SIZE=2><B>registryTable</B></FONT> = "registry"
; Name of the registry table.<BR><BR>
</P>
<H2>Proprieties</H2>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<H3>start()
</H3>
<P STYLE="margin-bottom: 0cm">Open a connexion to the database using
the methodes : <FONT SIZE=2><B>hostname</B></FONT>, <FONT SIZE=2><B>login</B></FONT>,
<FONT SIZE=2><B>password</B></FONT>.<BR>Return the connexion
identifier. It's affected to the methode <FONT SIZE=2><B>id</B></FONT>
</P>
<H3>startp()
</H3>
<P STYLE="margin-bottom: 0cm">As start() properties but with a
persitante connection</P>
<H3>query()</H3>
<P STYLE="margin-bottom: 0cm">Execute an SQL query <BR>Uses the
methodes : <FONT SIZE=2><B>id, sql_query, sql_order, sql_pos<BR></B></FONT>return
the result identifier. It affected the methode <FONT SIZE=2><B>result</B></FONT>.<BR>If
the SQL is an insert the new create uniq identifier of the primary
key table is insert in the method :<FONT SIZE=2><B> insert_id</B></FONT>.</P>
<H3>fetch($result)
</H3>
<P STYLE="margin-bottom: 0cm">Recieved the result identifier of a
query. By default it use the result method. <BR>Return the record as
an object. Using the fetch_object function.</P>
<H2>Exemple
</H2>
<P STYLE="margin-bottom: 0cm">Display all the name of the table
client.<BR>$conx= new mydataconnect ;<BR>$conx->table =
"client";<BR>$conx->sql_query = "select * from
client" ;<BR>$conx->sql_order = "order by name"
;<BR>$conx->query() ;<BR> while ($client = $conx->fetch(0))
{<BR> echo $client->nom."<br>" ;<BR> }<BR><BR>
</P>
<P STYLE="margin-bottom: 0cm; page-break-before: always"><BR>
</P>
<H1>mydataForm</H1>
<P STYLE="margin-bottom: 0cm">This classe is use to display Forms.
<BR>It reads the fields of the Table and display the field according
to there type or to the information in the registry.<BR>To record or
update de data you must use it with the record classe.<BR>The form
uses CSS styles for the display. <BR>The column with labels uses the
style class : adformlabel.<BR>The column with the fields uses the
style class : adformfield<BR>The table use the style class :
adformtable.</P>
<H2>Methodes
</H2>
<H3>Methods for the pages link to the form.</H3>
<P STYLE="margin-bottom: 0cm"><FONT SIZE=2><B>submitPage</B></FONT> =
"mdfproceed.php3" : name of the page for the ACTION in the
form. It's in this page that you can use the record classe to manage
the insert and updating. <BR><FONT SIZE=2><B>resultPage</B></FONT> :
name of the page to display after the inserting or
updating.<BR><FONT SIZE=2><B>requiredPage</B></FONT> =
"requiredfield.html" The page to show if one of the
required field is not fill.</P>
<H3>Mehods to directly access the registry bieaviours.</H3>
<P STYLE="margin-bottom: 0cm"><FONT SIZE=2><B>readonly </B></FONT>Field
read only, he wont diplay in the form.<BR><FONT SIZE=2><B>labelfield </B></FONT>Label
of the field <BR><FONT SIZE=2><B>picture </B></FONT> Field with a
file.<BR><FONT SIZE=2><B>listfield</B></FONT> List box with the
values from an other table.<BR><FONT SIZE=2><B>hidefield </B></FONT>Hidden
field<BR><FONT SIZE=2><B>required </B></FONT>Required field<BR><FONT SIZE=2><B>default
</B></FONT>Default value for the field<BR><FONT SIZE=2><B>optiontype</B></FONT>
In table radio button or list box.<BR><FONT SIZE=2><B>emailfield
</B></FONT>Set a field as email.</P>
<H3>Methods for the required fields :</H3>
<P STYLE="margin-bottom: 0cm"><FONT SIZE=2><B>requiredIndicator = "*"</B></FONT>
Char to display to indicate that the field is
required.<BR><FONT SIZE=2><B>requiredLegend</B></FONT> = "(*)
are required" Note to indicate what the required indicator
means.</P>
<H3>Methods to display the tables with the fields :</H3>
<P STYLE="margin-bottom: 0cm"><FONT SIZE=2><B>tblBorder<BR>tblWidth<BR>tblCellspacing<BR>tblCellpadding<BR>frmTextareaCols
<BR>frmTextareaRows<BR>frmFieldSize<BR>frmSubmitButton </B></FONT>:
Text that will be shown in the sybmit button.<BR><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm; page-break-before: always"><BR>
</P>
<H2>Proprieties
</H2>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<H3>printform($dbc, $wherequery)
</H3>
<P STYLE="margin-bottom: 0cm"><BR>This methode display the form using
the mydataconnect object ($dbc). If the wherequery attribut is not
null it select the record. Usind the $wherequery string as a WHERE
statement.</P>
<H3>showrecord($dbc, $wherequery)</H3>
<P STYLE="margin-bottom: 0cm">Works just like printform but only
display the data. <BR>Its usualy used to fast display the content of
a record table.</P>
<H3>Exemple
</H3>
<P STYLE="margin-bottom: 0cm"><?<BR> require("../mydatalib/mydatalib.inc.php3");
<BR> $dbconect = new mydataconnect ; <BR> $dbconect->db =
"boutique";<BR> $dbconect->table =
"client";<BR> $dbconect->start(); <BR> $form1 = new
mydataForm ; <BR> $form1->resultPage = "thank.html";
<BR> $form1->frmSubmitButton =
"Save";<BR> $form1->printform($dbconect, $wherequery);
<BR>?><BR><BR>
</P>
<P STYLE="margin-bottom: 0cm; page-break-before: always"><BR>
</P>
<H1>mydataTable
</H1>
<P STYLE="margin-bottom: 0cm">This class display the result of query
in an html table. <BR><BR>You can add some options like edit, delete,
add and linktables.<BR>The linktables will display the relational
reference associate with the select record.<BR>
</P>
<H2>Methods</H2>
<H3>Methods to configure the display</H3>
<P STYLE="margin-bottom: 0cm"><FONT SIZE=2><B>cfgBorder</B></FONT> =
"0" /* Border of the Table */<BR><FONT SIZE=2><B>cfgBgcolorOne</B></FONT>
= "#CCCCCC" /* Background color of the line 1
*/<BR><FONT SIZE=2><B>cfgBgcolorTwo</B></FONT> = "#DDDDDD" /*
Background color of the line 2 */<BR><FONT SIZE=2><B>cfgMaxRows</B></FONT>
= 30 /* Maximum numbers of rows per page */<BR><FONT SIZE=2><B>cfgOrder</B></FONT>
= "ASC" ; /* Default orders of the query's */<BR><FONT SIZE=2><B>cfgShowBlob</B></FONT>
= true /* Show the content of blob fields (false to hide)
*/<BR><FONT SIZE=2><B>cfgWarpcels</B></FONT> = 0 /* Limite la
longueur des cellules à une valeur fixe. */ <BR><BR>
</P>
<H3>Methods for the registry
</H3>
<P STYLE="margin-bottom: 0cm"><FONT SIZE=2><B>showlist </B></FONT>
To display a list box <BR><FONT SIZE=2><B>labelfield</B></FONT>
The title of the colomn <BR><FONT SIZE=2><B>hidefield</B></FONT>
Hide some field to the display</P>
<H3>Methods for the options</H3>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><FONT SIZE=2><B>cfgOrderTable</B></FONT>
= true Display a link so you can order the column of the
table.<BR>cfgOrder<BR><FONT SIZE=2><B>cfgEditRecord</B></FONT> = true
Display a link to update de record.<BR><FONT SIZE=2><B>cfgDeleteRecord</B></FONT>
= true Display a link to delete the record.<BR><FONT SIZE=2><B>cfgLinkTableRecord</B></FONT>
= true Display a link to the relational linked tables.
<BR><FONT SIZE=2><B>cfgAddRecord</B></FONT> = true Display a link
to add a record.<BR><FONT SIZE=2><B>cfgConfirmDelete </B></FONT>=
"Yes" Display a dialogue box to confirm before deleting a
record.</P>
<H3>Methods for the urls and pages.</H3>
<P STYLE="margin-bottom: 0cm">cfgEditPage = "mydataedit.php3"
URL to the edit page, must contain a form class<BR>cfgAddPage =
"mydataedit.php3" URL to the add page, must contain a
form class<BR>cfgDeletePage = "mydatadelete.php3" URL to
the delete page<BR>cfgLinkTablePage = "mydatalinktable.php3" URL
to the linked tablesl.<BR><BR>
</P>
<H3>Methods with the displayed texts</H3>
<P STYLE="margin-bottom: 0cm">strNoRecords = "Il n'y a aucun
enregistrement"; <BR>strShowingRecords = "Affichage des
enregistrements";<BR>strTotal = "total";<BR>strEdit =
"Modifier";<BR>strPrevious = "Précédent";<BR>strNext =
"Suivant"; <BR>strDelete = "Effacer";<BR>strDeleted =
"L'enregistrement a été effacé";<BR>strLinkedTable
= "Tables Liés"; <BR>strPos1 =
"Début";<BR>strEnd =
"Fin";<BR>strInsertNewRow = "Insérer un nouvel
enregistrement";<BR>strYes = "Oui";<BR>strNo =
"Non";<BR>strDoYouReallyDelete = "Voulez vous vraiment
supprimer l'enregistrement "; <BR><BR>
</P>
<H2>Properties
</H2>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<H3>displaytable ($dbc, $dt_result)
</H3>
<P STYLE="margin-bottom: 0cm">This display the table with
mydataconnect object ($dbc) and result identifier from a database
query.<BR>The table will be displayed according to the information in
the registy table.</P>
<H2>Exemple
</H2>
<P STYLE="margin-bottom: 0cm">To fully work the exemple need this
files : checkdelete.php3; mydatadelete.php3, mydataedit.php3,
mydatalib.inc.php3, mydatalinktable.inc.php3, mydatalinktable.php3,
mydataproced.php3, showdialogdelete.php3<BR><BR>
</P>
<P STYLE="margin-bottom: 0cm"><?php
<BR> require("../mydatalib/mydatalib.inc.php3");<BR> $conx
= new mydataconnect;<BR> $conx->start() ; <BR> $conx->table =
client ; <BR> $table = new mydataTable; <BR> $conx->sql_query =
$sql_query;<BR> $conx->sql_order = $sql_order ; <BR> $conx->pos
= $pos ; <BR> $table->cfgBgcolorOne = "#D0F5C5"
;<BR> $table->cfgBgcolorTwo = "#C7F5E7"
;<BR> $table->cfgShowBlob = true; <BR> $table->cfgLinkTableRecord
= false ; <BR> $result = $table->query($conx) ;
<BR> $table->displaytable($conx, $result) ; <BR>?><BR><BR>
</P>
<P STYLE="margin-bottom: 0cm; page-break-before: always"><BR>
</P>
<H1>Registry
</H1>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<H2>Introduction
</H2>
<P STYLE="margin-bottom: 0cm">The registry is the heart of the mydb
project:<BR>It records all the types, beaviors of the different
fields.<BR>Usualy you dont need to access directly the registry
table. You use the MyDB IDE to set all the parameters of the fields.</P>
<H2>The Regisrty Table
</H2>
<P STYLE="margin-bottom: 0cm">The reigrty has 5 fields:<BR>registryid
: unique identifier of the field.<BR>rtable : Name of the table
<BR>rfield : Name of the field<BR>rtype : field type type<BR>rdata :
extra parameters for the feild types.<BR>All the extra parameters are
separate by semicolon ( ' : ').</P>
<H2>readonly type</H2>
<P STYLE="margin-bottom: 0cm">Its used to hide the field for
modifications.<BR>parameters :<BR> none, just use : 1
</P>
<H2>list type</H2>
<P STYLE="margin-bottom: 0cm">Create a list box with the values of an
other table:<BR><BR>The parameters are separate by " : "
:<BR>use : <table name1>:<Field name1>:<Field
name2>:<Default value><BR>-<table name1> Name of the
other table <BR>- <Field name1> Name of the field with the
value that will be insert <BR>- <Field name2> Name of the field
with the value to display <BR>- <Default value> Value in the
<field name1> format that will be selected by default</P>
<H2>picture type</H2>
<P STYLE="margin-bottom: 0cm">The picture type let you upload files
to the server.<BR>Parameters :<BR><directory name>:[<prefix
of the file name>]<BR> Directory where the files will be uploads (
You must be able to write)<BR> Suffix of the file on the server. By
default it will the name of the file that is uploads.<BR> File
extention . Optionnal <BR>Exemple : <BR>demo/picture:product.jpg<BR>On
the server the file while have the folowing name :<BR>n<primary
index value>product.jpg<BR><BR>If you dont want to use the suffixe
you can just give the directory name :<BR>demo/pricture</P>
<H2>hidefield type:</H2>
<P STYLE="margin-bottom: 0cm">To hide a field from the forms, tables,
reports.<BR>The only parameter is : 1 <BR><BR>
</P>
<H2>showpicture type</H2>
<P STYLE="margin-bottom: 0cm">Display the picture in the field. The
feild must already be a picture type.<BR>The only parameter is : 1</P>
<H2>label type</H2>
<P STYLE="margin-bottom: 0cm">This type is for display a text label
in the forms. By default the name of the file is displayed. <BR>The
parameter is a string with the label.</P>
<H2>Datef type</H2>
<P STYLE="margin-bottom: 0cm">Define the format of the date for the
field.<BR>The date is automaticly converted in a unix timestamp.<BR>The
parameter is the date format
</P>
<H2>optiontype type :</H2>
<P STYLE="margin-bottom: 0cm">To create list box or radio button with
the data inside the table format (usign mysql Enum).<BR>The parameter
is :<BR>radiobutton : to display the enum in a radiobutton<BR>listbox
: to display the enum in a list box.</P>
<H2>language type :</H2>
<P STYLE="margin-bottom: 0cm">Used to tel in witch language is the
content of the field.<BR>The parameter is the language
abbreviation.<BR>There are the sames as the domains names<BR>fr :
Français<BR>uk : english<BR>de : germain...</P>
<H2>currency type:</H2>
<P STYLE="margin-bottom: 0cm">Used to tel in witch currency in the
field.<BR>The parameter is the abbreviation set in the currency
table.</P>
<H2>required type :</H2>
<P STYLE="margin-bottom: 0cm">The field is required and cannot be
empty.<BR>The parameter is 1.</P>
<H2>default type :</H2>
<P STYLE="margin-bottom: 0cm">Its the default value of the field<BR>The
parameter is the default value.</P>
<H2>email type</H2>
<P STYLE="margin-bottom: 0cm"> The content of the field is an email.
A verification is done to find a valid domain name.<BR>The parameter
is one.</P>
<H2>access Type</H2>
<P STYLE="margin-bottom: 0cm">The content of the field is a Login or
a Password. There must be both in the same table. When saving the
record mydatarecord verify that there is only one unique login and
password<BR>Used to create a login and password for identifications
purpose.</P>
</BODY>
</HTML>