Location: PHPKode > projects > MyDB > docs/webide_uk.html
<!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="20000604;2525053">
	<META NAME="CHANGEDBY" CONTENT="Philippe Lewicki">
	<META NAME="CHANGED" CONTENT="20000605;6194232">
	<STYLE>
	<!--
		@page { margin: 2cm }
		P { margin-bottom: 0.21cm; font-size: 10pt }
		H2 { margin-bottom: 0.21cm; font-family: "Arial", sans-serif; font-size: 14pt; font-style: italic }
		H3 { margin-bottom: 0.21cm; font-family: "Arial", sans-serif }
	-->
	</STYLE>
</HEAD>
<BODY>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><FONT SIZE=4 STYLE="font-size: 16pt">Free
MyDB Project</FONT></P>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><BR>
</P>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><FONT SIZE=4 STYLE="font-size: 16pt">MyDB
WebIDE Documentation</FONT></P>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm">Author : Philippe Lewicki</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<H2>Introduction</H2>
<P STYLE="margin-bottom: 0cm">The MyDB WebIDE will help you create
your tables, setup your queries and built your report.</P>
<H2>Table Builder</H2>
<P STYLE="margin-bottom: 0cm">Its where you can create, delete and
parameter the tables of your databases. 
</P>
<H2>Query Builder</H2>
<P STYLE="margin-bottom: 0cm">Its where you create the queries or
selections on your database.<BR><BR>To create a query :<BR>1- Call
the query builder.(click on &#147;create a SQL query&#148;).<BR>2-
Select your fields, the condition, and the boolean op&eacute;rators.
Then do the query.<BR>3- The selection is done you can then save it.
Provide a name and click on &#147;Save&#148;.<BR>4- The name of your
selection will appear on the left menu. You just have to click on it
to execute the query.<BR><BR>For dynamical display you can insert
global variable in your query. The global variable name must be
between [ ].like this : [&lt;global varial name&gt;].<BR>To test your
query with the global variable. Just call the global variable window.
In the left input put the variable name on the right the value.</P>
<H2>Report Builder</H2>
<P STYLE="margin-bottom: 0cm">A report is compose of a &#147;Query&#148;,
and a &#147;Header&#148;, &#147;row&#148; and &#147;footer&#148;
where you insert your html. In the &#147;row&#148; area you can
insert the fields of your table.<BR>The &#147;row&#148; will be
repeat for each record from your query.<BR><BR>You can limit the
number of rows by filling the field : number of row. <BR><BR>For the
ReportTable you can use the field &#147;Number of record per row&#148;
to display multiple records in one row. And you can insert a
navigation barr inserting the [datanavbar] in your footer.<BR><BR>To
display a standard field use : <BR>[fieldname], exemple :
[firstname]<BR>To display one of the multiple record in the same row
:<BR>[fieldname:recordnumber], exemple for 3 record per rows :
[firstname:0], [firstname:1], [firstname:2].<BR>Use an external
function use : [function name:parameter1:parameter2:] exemple :
[noreg:firstname:]</P>
<H2>The default external function</H2>
<P>The function are external function to add somme functionnalities
to your report. You can create your own function</P>
<H3>norreg  
</H3>
<P STYLE="margin-bottom: 0cm">use [noreg:field name:]<BR>With the
noreg function the content of the field will be directly display
without executing the registry.</P>
<H3>sub</H3>
<P STYLE="margin-bottom: 0cm">This function execut an other
report.<BR>Use [sub:reportnumber:globarvar1:globalvar2:]<BR>The
global vars are facultatives. <BR>Exemple : [sub:2:category:]</P>
<H3>globalvar</H3>
<P STYLE="margin-bottom: 0cm">Use [globalvar:globarvar name:]<BR>This
function display the value of a global var from your php script.</P>
<H3>Setglobal</H3>
<P STYLE="margin-bottom: 0cm">Use [setglobal:fieldname:]<BR>Set the
value of a field name as global in your php script</P>
<H2>How to create your own external functions 
</H2>
<P STYLE="margin-bottom: 0cm">The Report API is realy simple.<BR>To
be compatible with the report API your function must have the
folowing format :<BR>stringvaluetodisplay functionname (array
parameters, array row, object mydataconnect)<BR>parameters are the
parameters taken from the report function call.<BR>Row its an array
with the value from the table indexed on the fieldname<BR>mydataconnect
is a connexion object. You can use it to create queries to the
database. (cf mydatalib documentation for more information on using
mydataconnect)<BR><BR>
</P>
<P STYLE="margin-bottom: 0cm">As an exemple we are going to create a
function that multiply that calculate the taxe for a field :<BR>use :
[addtaxes:fieldname:taxecoef:]<BR>Create this php function :<BR>function
addtaxes($parameter, $row, $dbc) {<BR>    $returnvalue =
$row[$parameter[1]] * $parameter[2];<BR>  <FONT FACE="Times New Roman, serif">
 $returnvalue =  </FONT><CODE><FONT FACE="Times New Roman, serif">number_format</FONT></CODE><FONT FACE="Times New Roman, serif">($returnvalue,
2, &quot;.&quot;, &quot; &quot;);<BR></FONT>    return $returnvalue
;<BR>}<BR>include this function in the php script where you call your
report.<BR>Then in your Report you can call your function
:<BR>[addtaxes:price:1.14:]<BR><BR>Thats all.</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
</BODY>
</HTML>
Return current item: MyDB