Location: PHPKode > scripts > Yet Another Pager > yet-another-pager/doc.html
<html>
<head>
<link href="doc.css" rel="stylesheet" type="text/css">
</head>

<body>
<p class="NormalText">Yap (Yet Another Pager) version 2.1.0<br>
  20/01/2007
</p>

<h2 class='SectionTitle'><a name=index>Index</a></h2>
<ul>
  <li><a href=doc.html#description>Description</a></li>
  <li><a href=doc.html#moredetail>More details</a></li>
  <li><a href=doc.html#install>Installation</a></li>
  <li><a href=doc.html#migration>Migration from rel. 1.x.x</a></li>
  <li><a href=doc.html#work>How it works</a></li>
  <li><a href=doc.html#func_basic>Public functions, basic</a></li>
  <li><a href=doc.html#conf_db>Configuration parameters: Database access info</a></li>
  <li><a href=doc.html#conf_search>Search parameters</a></li>
  <li><a href=doc.html#conf_table>Table columns</a></li>
  <li><a href=doc.html#conf_edit>Row editing parameters</a></li>
  <li><a href=doc.html#conf_mix>Miscellaneous parameters</a></li>
  <li><a href=doc.html#input_type>Available input types</a></li>
  <li><a href=doc.html#func_adv>Public functions, advanced</a></li>
  <li><a href=doc.html#adv_ex>Advanced function, example</a></li>
  <li><a href=doc.html#c_log>Change Log</a></li>
  <li><a href=doc.html#license>License</a></li>
</ul>
<br>

<h2 class='SectionTitle'><a name=description>Description</a></h2>
 
<p class='NormalText'> Yap (Yet Another Pager) is 'another' pager with features 
  of row editing and interactive search pattern. </p>
  <p class='NormalText'>
    Feature:
 </p>
 
<ul>
<li class="list">two type of view: table view, detail view</li>
 
<li class="list">move forward, backward 1 page, move to the end or to the first 
  page </li>
 
<li class="list">the user may insert its search criteria</li>
 
<li class="list">the user or the script may set the number of row to show</li>
 
<li class="list">simple row editing (add,modify, delete rows)</li>
 
<li class="list">each editing action (add,modify,delete) may be authorized per 
  row basis</li>

<li class="list">database supported: MySql MSSQL Server and ODBC connections. (Note: the ODBC functions
 was tested to connect to Ms Access on Win32 system).</li>
 
<li class="list">the modified data may be validated through custom function before 
  write it to the database</li>
</ul> 
  
<p class='NormalText'> For more information see the Yap page at <a href=//www.andrioli.com/en/yap.html>www.andrioli.com/en/yap.html</a> 
  (<a href=//www.andrioli.com/it/yap.html>www.andrioli.com/it/yap.html</a> italian 
  version). </p>
  
<h2 class='SectionTitle'><a name=moredetail>More details</a></h2>
<ul>
<li class="list">Two type of view: table or detail. The first one shows many row as set by the parameter PageSize (default 15). You may set which 
 columns show. On each row besides the values you may add link to other page that perform operation on the
 selected rows. The class itself manages 3 of the link (detail-> switch into detail mode, modify -> 
 open the form to allow the editing of the current row, delete -> remove the current row). Other links
 to other pages may be added by the user. The detail mode shows all the fields for the selected row. 
</li> 
<li class="list">
 Both view allow the user to move backward, forward one page (15 rows the table view, 1 row the detail mode),
 or to move to the first or the last page.
 </li> 
<li class="list"> Search box. You may choose to allow the user to add its custom 
  filter to the pager in order to reduce the shown rows. You may set which field 
  ask to the user. The user may choose to not fill the search box and then the 
  class will show the all rows returned from the sql statement, or fill one or 
  more field and then the class appends that fields to the 'where' part of the 
  sql statement </li> 
<li class="list"> 
  The module saves its internal status into session vars, so in same session you may leave the page 
  generated by Yap, and then, when you return to it, the module resumes the state as before without require
  you to add any GET/POST parameters; simply call the page URL. This feature is save also if you switch 
  between many scripts that use different parameters to istance Yap, because, inside each script, you may set
  different prefix to apply to name of the session vars.
</li>   
<li class="list"> 
 The 'add row' function allows the user to add many rows to the table. You may enable this
 feature from the configuration parameters. Each time the module receives the POST message to add
 the new row, it looks into its parameters to see if 'add row' function is enabled; if the function is
 not enabled Yap don't executes the function.
</li>   
<li class="list"> The 'modify row' function allows the user to modify the shown 
  rows. You have two level of parameters to enable this feature. The first level 
  is 'system wide', you enable it from the configuration parameters,and, if don't 
  set the second level, you allow the user to modify all rows. The second one 
  allows you to enable or not the feature per row basis, so on each row you may 
  tell to the module to show or not the 'modify' link. This second level requires 
  the first level enabled. As above, each time the module receives the POST message 
  to modify the row, it looks into its parameters to see if 'modify row' function 
  is enabled and, if so, the module checks if the user may modify that row. </li>   
<li class="list"> The pager may show output from query on many tables (select 
  with join), but the modify/delete/add functions work only on one table. </li>
<li class="list">Event driven programming. Since the version 2.0 CYap is event driven. It means
  that each active link fires its own event. You may add your own event and the related handler.
  You may, also, redefine the handler of the default events.</li>   
</ul>
<a href=doc.html#index>Return to index</a>

<h2 class='SectionTitle'><a name=install>Installation</a></h2>
 
<p class='NormalText'>The class requires PHP 4.3.x/4.4.x or PHP 5 </p>

<h2 class='SectionTitle'>Note about PHP 5</h2>
<p class='NormalText'>In order to use this module with PHP 5, you must enable compatibility mode 
  with Zend Engine 1 (PHP 4.x), by setting<br>
  <b>zend.ze1_compatibility_mode = on</b><br>
  in your php.ini
</p>
<a href=doc.html#index>Return to index</a><br>


<h2 class='SectionTitle'><a name=migration>Migration from rel. 1.x.x</a></h2> 
<p class='NormalText'>The new event driven coding has changed the behaviour from the previous release.</p>
<p class='NormalText'>If call Yap 1.x without any POST/GET parameter, it tries to establish if it is the first
                           time the script run. If YAP finds its session data, it resumes the previous status. 
                           If it doesn't find anything, Yap assumes to be the first run. </p>
<p class='NormalText'>Yap 2.x has changed his behaviour. If you run the script without any POST/GET parameter YAP, 
                           always, assumes to be the first run and remove all data (if any) from previous run. 
                           If you want resume the previous status you must use ev=YAP_DRAWCURRENT
                           (i.e. http://mysite/myscript.php?ev=YAP_DRAWCURRENT).</p>
<a href=doc.html#index>Return to index</a><br>


<h2 class='SectionTitle'><a name=work>How it works</a></h2> 
  
<p class='NormalText'> The module has two public method: the constructor and showpage. 
  The constructor asks 5 array containing all the information required by Yap 
  to work.</p>
<p class='NormalText'>Here a quick example how to use Yap. </p>
<p class='NormalText'>&nbsp;</p>
 
 
<p><code style='font-size: 10pt '> <font color="#0000BB">&lt;?php <br />
  </font><font color="#FF8000">/* <br />
  * test1.php <br />
  * Module yap testing program 1 <br />
  * $Header: d:/cvs/classistd/yap/doc.html,v 1.4 2003/11/14 06:50:21 Administrator 
  Exp $ <br />
  */ <br />
  // Include the msgbox class. This class is used to display the searchbox, and 
  the modify/delete </font></code><code style='font-size: 10pt '><font color="#FF8000"><br>// 
  forms<br />
  </font><font color="#007700">include_once(</font><font color="#DD0000">'CYapBox.php'</font><font color="#007700">); 
  <br />
  </font><font color="#FF8000">// the module itself <br />
  </font><font color="#007700">include_once(</font><font color="#DD0000">'CYap.php'</font><font color="#007700">); 
  <br />
  </font><font color="#FF8000">// The session are required, start it <br />
  </font><font color="#0000BB">session_start</font><font color="#007700">(</font><font color="#DD0000">'test'</font><font color="#007700">); 
  <br />
  </font><font color="#FF8000">/* <br />
  * Open the HTML page. The module make the html code to show the contents <br />
  * but not open or close the page. The caller must provide the required code 
  <br />
  * to start and to close the page <br />
  */ <br />
  </font><font color="#007700">echo </font><font color="#DD0000">'&lt;html&gt;&lt;body&gt;'</font><font color="#007700">; 
  <br />
  </font><font color="#FF8000">/* <br />
  * Sql statement to retrieve the data to show. Two statement are required. The 
  first <br />
  * give the row to show, the second one allows to retrieve the number of rows 
  <br />
  * returned by tre previous sql statement. <br />
  * Notice the 'where '. If you don't add condition (i.e 'where id&gt;1'), you 
  must add <br />
  * the 'where' without any other condition (the module append to it the condition 
  <br />
  * that it get from the search box). <br />
  * If you add some conditional statement you must end the statement with 'and' 
  <br />
  * (i.e '... where id&gt;1 and ') to allow to append the required search patterns. 
  <br />
  */ <br />
  </font><font color="#0000BB">$SelectQuery</font><font color="#007700">=</font><font color="#DD0000">'select 
  id, DEvent, errno, text, filename, line from dlog where '</font><font color="#007700">; 
  <br />
  </font><font color="#0000BB">$SelectCount</font><font color="#007700">=</font><font color="#DD0000">'select 
  count(*) from dlog where '</font><font color="#007700">; <br />
  </font><font color="#FF8000">/* <br />
  * Start to prepare the parameters for the module <br />
  */ <br />
  //Db Connection parameters <br />
  </font><font color="#0000BB">$db_info</font><font color="#007700">=array(</font><font color="#DD0000">'servername'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'localhost'</font><font color="#007700">, <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'dbname'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'log'</font><font color="#007700">, <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'user'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'your_user'</font><font color="#007700">, <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'password'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'your_password'</font><font color="#007700">, <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'selectquery'&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#0000BB">$SelectQuery</font><font color="#007700">, <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'selectcount'&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#0000BB">$SelectCount</font><font color="#007700">, <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'orderfield'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'id'</font><font color="#007700">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">/* 
  field to use to order the rows <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 
  it must 'selected' from $SelectQuery <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/ 
  <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'orderdirection' 
  </font><font color="#007700">=&gt; </font><font color="#DD0000">'A'</font><font color="#007700">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">/* 
  order A=upward, D=descending*/ <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'needopendb'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#0000BB">true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">/* 
  should the module open the connection <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 
  to the database? */ <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">); 
  <br />
  </font><font color="#FF8000">// Field to use to perform the search <br />
  </font><font color="#0000BB">$Search_field</font><font color="#007700">=array(array(</font><font color="#DD0000">'description' 
  </font><font color="#007700">=&gt; </font><font color="#DD0000">'Event Date'</font><font color="#007700">, 
  <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'fieldname'&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'DEvent'</font><font color="#007700">, <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'type'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'A'</font><font color="#007700">,&nbsp;&nbsp;</font><font color="#FF8000">/* 
  A=alphabetic, N=Numeric */ <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'size'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#0000BB">14</font><font color="#007700">, <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'useregex'&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#0000BB">1 </font><font color="#007700">),&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">/* 
  use regex to match the field <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 
  contents against the requested <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 
  string */ <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">array(</font><font color="#DD0000">'description' 
  </font><font color="#007700">=&gt; </font><font color="#DD0000">'Error Code'</font><font color="#007700">, 
  <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'fieldname'&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'errno'</font><font color="#007700">, <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'type'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'N'</font><font color="#007700">), <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;); 
  <br />
  </font><font color="#FF8000">// Fields to show for each row <br />
  </font><font color="#0000BB">$Show_field</font><font color="#007700">=array(array(</font><font color="#DD0000">'fieldname' 
  </font><font color="#007700">=&gt; </font><font color="#DD0000">'id'</font><font color="#007700">, 
  <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'header'&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'Id'</font><font color="#007700">), <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(</font><font color="#DD0000">'fieldname' 
  </font><font color="#007700">=&gt; </font><font color="#DD0000">'DEvent'</font><font color="#007700">, 
  <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'header'&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'Event Date'</font><font color="#007700">), <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(</font><font color="#DD0000">'fieldname' 
  </font><font color="#007700">=&gt; </font><font color="#DD0000">'errno'</font><font color="#007700">, 
  <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'header'&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'Error Code'</font><font color="#007700">), <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(</font><font color="#DD0000">'fieldname' 
  </font><font color="#007700">=&gt; </font><font color="#DD0000">'text'</font><font color="#007700">, 
  <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'header'&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; 
  </font><font color="#DD0000">'Description'</font><font color="#007700">), <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;); 
  <br />
  <br />
  </font><font color="#0000BB">$Show_info</font><font color="#007700">=array(</font><font color="#DD0000">'prefix' 
  </font><font color="#007700">=&gt; </font><font color="#DD0000">'tst1'</font><font color="#007700">); 
  <br />
  </font><font color="#FF8000">// I don't setup the detail mode, the add/modify/delete 
  row functions <br />
  </font><font color="#0000BB">$Modify_info</font><font color="#007700">=array(); 
  <br />
  <br />
  </font><font color="#FF8000">// new class istance <br />
  </font><font color="#0000BB">$p</font><font color="#007700">=new </font><font color="#0000BB">CYap</font><font color="#007700">(</font><font color="#0000BB">$Search_field</font><font color="#007700">, 
  </font><font color="#0000BB">$Show_field</font><font color="#007700">, </font><font color="#0000BB">$db_info</font><font color="#007700">, 
  </font><font color="#0000BB">$Show_info</font><font color="#007700">, </font><font color="#0000BB">$Modify_info</font><font color="#007700">); 
  <br />
  </font><font color="#FF8000">// Show it <br />
  </font><font color="#0000BB">$p</font><font color="#007700">-&gt;</font><font color="#0000BB">showpage</font><font color="#007700">(); 
  <br />
  echo </font><font color="#DD0000">'&lt;/body&gt;&lt;/html&gt;'</font><font color="#007700">; 
  <br />
  </font><font color="#FF8000">// That's all folk! <br />
  </font><font color="#0000BB">?&gt;</font></code> </p>
<p class='NormalText'>To run the previous example, create  into your Mysql server a database called 'Log' 
and load into it the provided 'example.sql'. It creates the table DLog and fill it.</p><br>
<a href=doc.html#index>Return to index</a><br>

<h2 class='SectionTitle'>Playing around the events</h2>
<p class='NormalText'>The following example highlights the code required to define the custom events.</p>
<p class='NormalText'>The complete example (not provided) shows the open ticket (one ticket per row). On each ticket
the user must be able to close the ticket and add note to it. Therefore I defined the function OtherFunctionAll that add
the two links on each row. The links fire the two custom events 'YAP_TKCLOSE' and 'YAP_ADDNOTE'. Then I tell to Yap 
which function run on my events (call to function RegisterEvent) and write the two handler 
(functions OnAddNote() and OnCloseTicket() ).
</p>
<br>

<p><code style='font-size: 10pt '>
<font color="#000000">
<font color="#0000BB">&lt;?PHP
<br /></font><font color="#FF8000">// main function 
<br /></font><font color="#007700">...
<br /></font><font color="#0000BB">$Show_info</font><font color="#007700">=array(</font><font color="#DD0000">'cfgfile' </font><font color="#007700">=&gt; </font><font color="#DD0000">'../cfg/itemallticket.cfg'</font><font color="#007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'languagefile' </font><font color="#007700">=&gt; </font><font color="#DD0000">'../include/language.en'</font><font color="#007700">,&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'exit' </font><font color="#007700">=&gt; </font><font color="#0000BB">$_SESSION</font><font color="#007700">[</font><font color="#0000BB">$_SERVER</font><font color="#007700">[</font><font color="#DD0000">'PHP_SELF'</font><font color="#007700">].</font><font color="#DD0000">'returnTo'</font><font color="#007700">],
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// the following parameter tells to CYap to call the function OtheFunctioAll on
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// each row. This function add two custom links to each row.
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'rowcallback' </font><font color="#007700">=&gt; </font><font color="#DD0000">'OtherFunctionAll'</font><font color="#007700">,&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);&nbsp;&nbsp;&nbsp;
<br />
<br />...
<br /></font><font color="#0000BB">$p</font><font color="#007700">=new </font><font color="#0000BB">CPciYap</font><font color="#007700">(array(), array(), </font><font color="#0000BB">$db_info</font><font color="#007700">, </font><font color="#0000BB">$Show_info</font><font color="#007700">,</font><font color="#0000BB">$ModifyInfoCfg</font><font color="#007700">);
<br /></font><font color="#FF8000">/*
<br /> * In this example I defined two custom event 'YAP_TKCLOSE' and 'YAP_ADDNOTE'.
<br /> * Here I set the function to run on events.
<br /> */
<br /></font><font color="#0000BB">$p</font><font color="#007700">-&gt;</font><font color="#0000BB">RegisterEvent</font><font color="#007700">(</font><font color="#DD0000">'YAP_TKCLOSE'</font><font color="#007700">,</font><font color="#DD0000">'OnCloseTicket'</font><font color="#007700">);
<br /></font><font color="#0000BB">$p</font><font color="#007700">-&gt;</font><font color="#0000BB">RegisterEvent</font><font color="#007700">(</font><font color="#DD0000">'YAP_ADDNOTE'</font><font color="#007700">,</font><font color="#DD0000">'OnAddNote'</font><font color="#007700">);
<br /></font><font color="#0000BB">$p</font><font color="#007700">-&gt;</font><font color="#0000BB">showpage</font><font color="#007700">();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />...
<br />
<br />
<br />
<br /></font><font color="#FF8000">/*
<br /> * Here I define the two functions. These function may be global or defined inside
<br /> * CYap.
<br /> */
<br /></font><font color="#007700">function </font><font color="#0000BB">OnAddNote</font><font color="#007700">()
<br />{
<br />...
<br />}
<br />
<br /></font><font color="#FF8000">/*
<br /> * ..and this function handle the event YAP_TKCLOSE
<br /> */
<br /></font><font color="#007700">function </font><font color="#0000BB">OnCloseTicket</font><font color="#007700">()
<br />{
<br />...
<br />}
<br />
<br />
<br />
<br /></font><font color="#FF8000">/**
<br /> * 
<br /> * Function used to add other link to each data row.
<br /> * It adds links to add note, close ticket and show the related device.
<br /> */
<br /></font><font color="#007700">function </font><font color="#0000BB">OtherFunctionAll</font><font color="#007700">(</font><font color="#0000BB">$row</font><font color="#007700">)
<br />{
<br /></font><font color="#FF8000">// This link fires my custom event YAP_ADDNOTE.
<br />// All event name must begin with YAP_
<br /></font><font color="#0000BB">$link</font><font color="#007700">=</font><font color="#0000BB">$_SERVER</font><font color="#007700">[</font><font color="#DD0000">'PHP_SELF'</font><font color="#007700">].</font><font color="#DD0000">'?id='</font><font color="#007700">.</font><font color="#0000BB">$row</font><font color="#007700">[</font><font color="#DD0000">'id'</font><font color="#007700">].</font><font color="#DD0000">'&amp;amp;ev=YAP_ADDNOTE'</font><font color="#007700">;
<br /></font><font color="#0000BB">$text</font><font color="#007700">[</font><font color="#0000BB">0</font><font color="#007700">]=</font><font color="#DD0000">'&lt;a href='</font><font color="#007700">.</font><font color="#0000BB">$link</font><font color="#007700">.</font><font color="#DD0000">' onMouseOver="ToolTip(\'Add comments to this ticket\')" onMouseOut="ToolTip()" &gt;&lt;img src=\'images/postit.gif\' border=0&gt;&lt;/a&gt;'</font><font color="#007700">; 
<br />if(</font><font color="#0000BB">$row</font><font color="#007700">[</font><font color="#DD0000">'DateClose'</font><font color="#007700">]==</font><font color="#DD0000">'2000-01-01'</font><font color="#007700">)&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// and this link fires my custom event YAP_TKCLOSE
<br />&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$link</font><font color="#007700">=</font><font color="#0000BB">$_SERVER</font><font color="#007700">[</font><font color="#DD0000">'PHP_SELF'</font><font color="#007700">].</font><font color="#DD0000">'?id='</font><font color="#007700">.</font><font color="#0000BB">$row</font><font color="#007700">[</font><font color="#DD0000">'id'</font><font color="#007700">].</font><font color="#DD0000">'&amp;amp;ev=YAP_TKCLOSE'</font><font color="#007700">;
<br />&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$text</font><font color="#007700">[</font><font color="#0000BB">1</font><font color="#007700">]=</font><font color="#DD0000">'&lt;a href='</font><font color="#007700">.</font><font color="#0000BB">$link</font><font color="#007700">.</font><font color="#DD0000">' onMouseOver="ToolTip(\'Close the ticket\')" onMouseOut="ToolTip()" &gt;&lt;img src=\'images/tk_close.gif\' border=0&gt;&lt;/a&gt;'</font><font color="#007700">;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;}
<br />return(</font><font color="#0000BB">$text</font><font color="#007700">);
<br />}
<br /></font><font color="#0000BB">?&gt;
<br /></font>
<br /></font>
</code>
</p>
<a href=doc.html#index>Return to index</a><br>

<h2 class='SectionTitle'><a name=func_basic>Public functions, basic</a></h2>

<table  style="border: thin dotted #333333 ">  
  <tr>    
    <td><p class='BoldText'>CYap CYap( [array $search_field = array()], [array $show_field = array()], [array $db_info = array()], [array $show_info = array()], [array $modify_info = array()]  )</p></td>
    <td><p class='NormalText'>Istance the class. It takes 5 parameters. These parameters allow you to configure
         the class. You may omit those parameter and use the configuration file. In that case you must provide the 
         configuration file name.
        </p></td>
  </tr>
  <tr>    
    <td><p class='BoldText'>boolean RegisterEvent( string $EventName, string $Handler  )</p></td>
    <td><p class='NormalText'>Set the handler to custom events or modify the default handler to defined events</p></td>
  </tr>
  <tr>    
    <td><p class='BoldText'>void showpage( [string $ForcedEvent = '']  )</p></td>
    <td><p class='NormalText'>Show the HTML page. The parameter allows you to force the event to process. If it is omitted
         Yap looks for $_REQUEST['ev'], if exists. If it don't find the parameter it assumes to be the first time
         the module run.</p></td>
  </tr>
</table>
<a href=doc.html#index>Return to index</a><br>

<h2 class='SectionTitle'><a name=conf_db>Configuration parameters: Database access info</a></h2>
<p class='NormalText'>The database parameters ('$db_info' in the example) contains the following index</p>

<table>
  <tr>    
	<td><p class='BoldText'>servername</p></td>
    <td><p class='NormalText'>Mysql server</p></td>
  </tr>
    <tr>
	<td><p class='BoldText'>dbname</p></td>
    <td><p class='NormalText'>Database name</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>user</p></td>
    <td><p class='NormalText'>user name</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>password</p></td>
    <td><p class='NormalText'>password</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>selectquery</p></td>
    <td><p class='NormalText'>Query used to retrieve the rows to show. Notice 
        the 'where '. If you don't add condition (i.e 'where id&gt;1'), you must 
        add the 'where' without any other condition (the module append to it the 
        condition that it get from the search box).<br>
        If you add some conditional statement you must end the statement with 
        'and' (i.e '... where id&gt;1 and ') to allow to append the required search 
        patterns.</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>selectcount</p></td>
    <td><p class='NormalText'>Query used to re trievethe number of the rows to 
        show. It has the same rule about the 'where ' statement as 'selectquery'</p>
       <p class='NormalText'>You may omit this parameter since Yap 1.1.0</p>
   </td>
  </tr>
  <tr>
	<td><p class='BoldText'>orderfield</p></td>
    <td><p class='NormalText'>field to use to order the rows it must 'selected' 
        from 'selectquery'</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>orderdirection</p></td>
    <td><p class='NormalText'>order directtion: A=upward, D=descending</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>needopendb</p></td>
    <td><p class='NormalText'>should the module open the connection to the database? 
        (true/false). This parameter is useful if you make some temporary table 
        so you need to open the connection inside the caller script and the module 
        must not open its own connection to the database.(Optional, default: true)</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>db_class</p></td>
    <td><p class='NormalText'>Class to use to connect to the database. Must be a class that
        extends CYapDb. (Optional, default: CYap_Mysql)</p></td>
  </tr>
</table> 
<a href=doc.html#index>Return to index</a><br>

<h2 class='SectionTitle'><a name=conf_search>Search parameters</a></h2>
<p class='NormalText'>Parameters required to build the search box. This parameter 
  is an array of array. Each array contains the information about the field to 
  show into the search box and to use it to build the search pattern. If you set 
  this parameter as an empty array, the search box will be not shown. Each field 
  array cointains the following index</p>
<table> 
  <tr>
    <td><p class='BoldText'>description</p></td>
    <td><p class='NormalText'>1.0.0</p></td>
    <td><p class='NormalText'>field description to use in query form</p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>fieldname</p></td>
    <td><p class='NormalText'>1.0.0</p></td>
    <td><p class='NormalText'>mysql field name. It is case sensitive</p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>type</p></td>
    <td><p class='NormalText'>1.0.0</p></td>
    <td><p class='NormalText'>A=alphabetic, N=Numeric</p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>size</p></td>
    <td><p class='NormalText'>1.0.0</p></td>
    <td><p class='NormalText'>field size for padding. Used for type A</p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>padding</p></td>
    <td><p class='NormalText'>1.0.0</p></td>
    <td><p class='NormalText'>Request the padding for the field (none, left, right)
	          default: none. Ignored if field type = N</p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>paddingchar</p></td>
    <td><p class='NormalText'>1.0.0</p></td>
    <td><p class='NormalText'>character to pad the field. Ignored if field type = N</p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>useregex</p></td>
    <td><p class='NormalText'>1.0.0</p></td>
    <td><p class='NormalText'>use regex to match the field
                              contents against the requested string.
                              It is used for type A field, and if true
                              the module don't pad the field. Values 1=use regex, 0=don't use regex. Optional, default: 0
        </p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>fieldclass</p></td>
    <td><p class='NormalText'>2.1.0</p></td>
    <td><p class='NormalText'>
             Class to use to manage the input box. Available classes are:
             <a href=doc.html#CYap_clsSearchDate>CYap_clsSearchDate</a>,              
             <a href=doc.html#CYap_clsSearchRangeTxt>CYap_clsSearchRangeTxt</a>,
             <a href=doc.html#CYap_clsSearchRegexOpt>CYap_clsSearchRegexOpt</a>,            
             <a href=doc.html#CYap_clsSearchSelectBox>CYap_clsSearchSelectBox</a>, and
             <a href=doc.html#CYap_clsSearchTxt>CYap_clsSearchTxt</a>. Default: CYap_clsSearchTxt
        </p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>viewclass</p></td>
    <td><p class='NormalText'>2.1.0</p></td>
    <td><p class='NormalText'>
             Class to use to write the HTML code for the field object. It keeps away the
             HTML code from the logic of the filter form, so you may customize easily the
             form appearance.
             By default, each field class has it own view. The relationship is:
             <table>
               <tr>
                  <td><a href=doc.html#CYap_clsSearchDate>CYap_clsSearchDate</a></td>
                  <td>CYap_ViewDate</td>
               </tr>
               <tr>
                  <td><a href=doc.html#CYap_clsSearchRangeTxt>CYap_clsSearchRangeTxt</a></td>
                  <td>CYap_ViewTextRange</td>
               </tr>
               <tr>
                  <td><a href=doc.html#CYap_clsSearchRegexOpt>CYap_clsSearchRegexOpt</a></td>
                  <td>CYap_ViewOptRegex</td>
               </tr>
               <tr>
                  <td><a href=doc.html#CYap_clsSearchSelectBox>CYap_clsSearchSelectBox</a></td>
                  <td>CYap_SelectBox</td>
               </tr>
               <tr>
                  <td><a href=doc.html#CYap_clsSearchTxt>CYap_clsSearchTxt</a></td>
                  <td>CYap_ViewTextBox</td>
               </tr>
             </table>
        </p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>optionlist</p></td>
    <td><p class='NormalText'>2.1.0</p></td>
    <td><p class='NormalText'>Used only if fieldclass is set to CYap_clsSearchSelectBox. Array of available option
                              The index is the value returned by the form and used to build the filter condition.
                              The value is the text shown to the user as option.
        </p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>showformat</p></td>
    <td><p class='NormalText'>2.1.0</p></td>
    <td><p class='NormalText'>Used only if fieldclass is set to CYap_clsSearchDate. How the date is shown to the user 
                 and entered by the user. Available formats: d/m/Y, d-m-Y, m/d/Y, and m-d-Y.
        </p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>whereformat</p></td>
    <td><p class='NormalText'>2.1.0</p></td>
    <td><p class='NormalText'>Used only if fieldclass is set to CYap_clsSearchDate. Date format to use to build the 
                              filter to look for. It accepts all formats recognized by PHP date command.                 
        </p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>layoutclass</p></td>
    <td><p class='NormalText'>2.1.0</p></td>
    <td><p class='NormalText'>Class used to place the input box on the form. The avilable classes are</p>
        <table border='0'>
        <tr><td>
               <p class='BoldText'>CYap_clsSearchLayout</p>
            </td>
            <td>
               <p class='NormalText'>(default) One column layout.</p>
            </td>
        </tr>
        <tr><td>
               <p class='BoldText'>CYAP_cls2ColumnLayout</p>
            </td>
            <td>
               <p class='NormalText'>Two column layout.</p>
            </td>
        </tr>
        </table>
    </td>
  </tr>

</table> 
<a href=doc.html#index>Return to index</a><br>

<h2 class='SectionTitle'><a name=conf_table>Table columns</a></h2>
<p class='NormalText'>List of column to show into table view. This parameter is 
  an array of array. Each array contains the information about the fields to show. 
  Each field array cointains the following index</p>
<table> 
  
  <tr>
	<td><p class='BoldText'>fieldname</p></td>
    <td><p class='NormalText'>Name of the field from the select query. Note it 
        is case sensitive: the field name has the same case used into select statement</p></td>
  </tr>
  <tr>
	<td><p class='BoldText'>header</p></td>
    <td><p class='NormalText'>Text used as column title into table view</p></td>
  </tr>
 <tr>
    <td><p class='BoldText'>showdetail</p></td>
    <td><p class='NormalText'>True/False, Should the field be shown in detail mode?</p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>showtable</p></td>    
    <td><p class='NormalText'>True/False, Should the field be shown in table mode? </p></td>
  </tr>
  <tr>
    <td><p class='BoldText'>format</p></td>
    <td><p class='NormalText'>Format to use to show the field's value. </p></td>
  </tr>
</table> 
<a href=doc.html#index>Return to index</a><br>

<h2 class='SectionTitle'><a name=conf_edit>Row editing parameters</a></h2>
<p class='NormalText'>Parameters used by add/modify/delete row functions. The 
  array cointains the following index</p>
<table>
  <tr> 
    <td><p class='BoldText'>showadd</p></td>
    <td><p class='NormalText'>Should the module shows the 'new row' link? Values: 
        true/false. Optional, default: false</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>showmodify</p></td>
    <td><p class='NormalText'>Should the module shows the ' modify row' link into 
        each row? Values: true/false. Optional, default: false</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>showdelete</p></td>
    <td><p class='NormalText'>Should the module shows the delete row' link into 
        each row? Values: true/false. Optional, default: false</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>modifyallow</p></td>
    <td><p class='NormalText'>It specifies the custom function to call to check 
        if the module sholud show the 'new row' link. The 'showadd' key tell to 
        Yap 'ok you check the modyallow function and if it allows you show the 
        'modify row' link. This function allows to enable/disable the modify function 
        per row basis. The custom function must accept 1 parameter (the value 
        of the row key) and it must return true (to show the link) or false. Optional, 
        default:true. </p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>deleteallow</p></td>
    <td><p class='NormalText'>As modifyallow applied to the delete function</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>addallow</p></td>
    <td><p class='NormalText'>As modifyallow applied to the add link</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>table</p></td>
    <td><p class='NormalText'>database table name to apply the editing function 
        (this function don't use the information from selectquery parameter).</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>keyfield</p></td>
    <td><p class='NormalText'>Name of the unique key to use to identify the row</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>fieldtorequest</p></td>
    <td><p class='NormalText'>it contains the name of the field to ask into modify/add row. If empty, 
      all field from the table are requested</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>fieldvalidator</p></td>
    <td><p class='NormalText'>callback to the function to perform the validation 
        for each field filled from the form. If not set, the field is assumed 
        correct. The function has two parameters: an array containing all the requested 
        field (indexed by field name), and the name of the field to check; it 
        must return true (if the value is correct) or false to reject the value.</p></td>
  </tr>  
  <tr> 
    <td><p class='BoldText'>customaddrow</p></td>
    <td><p class='NormalText'>Custom page to call when 'add new row' link is selected.</p></td>
  </tr>  
  <tr> 
    <td><p class='BoldText'>custommodifyrow</p></td>
    <td><p class='NormalText'>Custom page to call when the link 'modify row' is selected.
         Yap pass the id of the requested row to the called page through the post parameter 'id'. 
         </p></td>
  </tr>  
  <tr> 
    <td><p class='BoldText'>customdeleterow</p></td>
    <td><p class='NormalText'>Custom page to call to delete the selected row.

Yap pass the id of the requested row to the called page through the post parameter 'id'. </p></td>
  </tr>  
  <tr> 
    <td><p class='BoldText'>fields</p></td>
    <td><p class='NormalText'>New associative array that contains information about the field to request.</p>
        <p class='NormalText'>The array's indexes are the name of the fields required to be shown.</p>
        <p class='NormalText'>Each field item is another associative array. It has the following indexes: </p>
        <table border=0>
        <tr>
           <td><p class='BoldText'>default</p></td>
           <td><p class='NormalText'> Default value for the field</p></td>
        </tr>
        <tr>
           <td><p class='BoldText'>classname</p></td>
           <td><p class='NormalText'> Each type of input box is created as PHP class. Yap sets its own default class, 
               but you may extend that class and here set your class name.</p></td>
        </tr>
        <tr>
           <td><p class='BoldText'>fieldvalidator</p></td>
           <td><p class='NormalText'> As the above 'fieldvalidator' this parameter set the callback function to perform the validation for each field filled from the form. If one field does not have its callback function, the field is assumed correct. The function has two parameters: an array containing 
                      all the requested field (indexed by field name), and the name of the field to check;
                      it must return true (if the value is correct) or false to reject the value.</p></td>
        </tr>
        <tr>
           <td><p class='BoldText'>custom</p></td>
           <td><p class='NormalText'> Custom information used by the class specified in classname.</p></td>
        </tr>
        </table>
    <p class='NormalText'>
       Note: this parameter give a new way to set
        information about field to request, so it override the old parameters 'fieldvalidator' and 'fieldtorequest'.
    </p></td>
  </tr>  
</table> 
<a href=doc.html#index>Return to index</a><br>

<h2 class='SectionTitle'><a name=conf_mix>Miscellaneous parameters</a></h2>
<p class='NormalText'>Group of unrelated parameters</p>
<table  style="border: thin dotted #333333 ">  
   <tr> 
    <td><p class='BoldText'>rowcallback</p></td>
    <td><p class='NormalText'>Callback function called on each row. It is useful to add custom link 
	to each row. Optional, default no callback</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>onokhref</p></td>
    <td><p class='NormalText'>Page to call if the add/modify action successed 
        (only add o modify mode).</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>onaborthref</p></td>
    <td><p class='NormalText'>Page to call if the add/modify action is aborted 
         (only add o modify mode).</p></td>
  </tr>

  <tr> 
    <td><p class='BoldText'>showdethref</p></td>
    <td><p class='NormalText'>Should the module show the 'detail' link to switch to 'detail view'. 
	Values: true/false. Optional, default: false</p></td>
  </tr>
  <tr> 
    <td><p class='BoldText'>prefix</p></td>
    <td><p class='NormalText'>Prefix to add to the session variables to allow multiple pager istance into the
      same session.Optional default space</p></td>
  </tr> 
  <tr> 
    <td><p class='BoldText'>detailmode</p></td>
    <td><p class='NormalText'>Set the table view (if set to false) or the detail view (if set to true). 
	  Optional, default false.</p></td>
  </tr>   
  <tr> 
    <td><p class='BoldText'>languagefile</p></td>
    <td><p class='NormalText'>Set the file that contains the translated text. 
        Optional, default './language.en'</p></td>
  </tr>   
  <tr> 
    <td><p class='BoldText'>showfirstcallrow</p></td>
    <td><p class='NormalText'>When set to true, it enables yap to show first 15 rows at the first 
            time the page is shown. The default, or when set to false, it shows only the search box.
            </p></td>
  </tr>   
  <tr> 
    <td><p class='BoldText'>showpagenumber</p></td>
    <td><p class='NormalText'>Should the class show the link to pages 1,2,3,.. Optional, default: TRUE
            </p></td>
  </tr>   
  <tr> 
    <td><p class='BoldText'>showmovepage</p></td>
    <td><p class='NormalText'>
         Should the class show the link to the next/previous page? Optional, default: TRUE
            </p></td>
  </tr>   
  <tr> 
    <td><p class='BoldText'>mode</p></td>
    <td><p class='NormalText'>
            Set the mode to start to show the rows. 
            The modes are: DisplayTable (shows the rows as a table, the default),
             DisplayDetail (display the row detail, it starts from the first),
             Add (it starts directly into add new row mode), Modify (it starts directly into add new 
             row mode). Optional, default: DisplayTable
            </p></td>
  </tr>   
  <tr> 
    <td><p class='BoldText'>BoxClass</p></td>
    <td><p class='NormalText'>Class used to draw an message box. Optional, default: CYapBox
            </p></td>
  </tr>   
  <tr> 
    <td><p class='BoldText'>DetailViewClass</p></td>
    <td><p class='NormalText'>Class used to render the row's detail. Optional, default: CYap_DetailView
            </p></td>
  </tr>   
  <tr> 
    <td><p class='BoldText'>TableViewClass</p></td>
    <td><p class='NormalText'>As the previous one, 
              but it is used to render the table Optional, default: CYap_TableView
            </p></td>
  </tr>   
  <tr> 
    <td><p class='BoldText'>SkipPageClass</p></td>
    <td><p class='NormalText'>Module used to display first, 
         previous, next, last page. Optional, default: CYap_MoveToPage
            </p></td>
  </tr> 
  <tr> 
    <td><p class='BoldText'>PageNumberClass</p></td>
    <td><p class='NormalText'>
         Display the number of the pages before and after the current one. 
         Optional, default: CYap_PageNumber
            </p></td>
  </tr> 
  <tr> 
    <td><p class='BoldText'>FormClass</p></td>
    <td><p class='NormalText'>Draw the form to perform the add/modify functions. Optional, default: CYap_Form
            </p></td>
  </tr> 
  <tr> 
    <td><p class='BoldText'>pre_1_0_style</p></td>    
    <td><p class='NormalText'>Compatibility issue. In detail mode, the 1.1.1 allows to set which columns show.
        This way requires that the column to show must be listed in $ShowFieldCfg, otherwise
        the module assumes not to show the column. The previous version, in detail mode,
        it shows all columns regardless the $ShowFieldCfg parameter. 
        Set this variable to false if you want to gain more control on the field to show in detail
        mode, or set to true if you prefer the old behaviour.
        Optional, default: true.</p></td>
  </tr> 
  <tr> 
    <td><p class='BoldText'>outformats</p></td>   
    <td><p class='NormalText'>This parameter allows you to define
        many custom formats to use to show the values.
        It is an array indexed by format name. Each element is
        an array which may contains the following keys:
       </p>
        <table align=left>
          <tr>
           <td><p class='BoldText'>custom</p></td>
           
           <td>
               <p class='NormalText'>
                Formats the output through a custom function. The function must accept one parameter (the 
                value) and return the formatted string
               </p>
           </td>
          </tr>
          <tr>
           <td><p class='BoldText'>printf</p></td>
           
           <td>
               <p class='NormalText'>
                Formats the output according to printf format options. It accepts the same
                format as the PHP function printf. 
               </p>
           </td>
          </tr>
          <tr>
           <td><p class='BoldText'>date</p></td>
           
           <td>
               <p class='NormalText'>
                If the field is a timestamp, it shows the date according to the format. It accepts the same
                format as the PHP function date. 
               </p>
           </td>
          </tr>
          <tr>
           <td><p class='BoldText'>number</p></td>
           <td>
               <p class='TestoSfondoNero'>
                Format the number through the PHP number_format function. Value:
                 decimals,dec_point,thousands_sep
               </p>
           </td>
          </tr>
        </table>
        <p class='NormalText'> 
         Yap comes with some predefined formats. They are:
        </p>
        <ul>
          <li>NUMERIC_IT: numeric number, Italian format x.xxx.xxx</li>
          <li>NUMERIC_EN: numeric number, English format x,xxx,xxx.xx</li>
          <li>MONEY_IT  : monetary Italian format x.xxx.xxx,xx</li>
          <li>MONEY_EN  : monetary English format x,xxx,xxx.xx</li>
          <li>DATE_IN   : convert timestamps into Italian format date day/month/year</li>
          <li>DATE_US   : convert timestamps into US format date month/day/year</li>
        </ul>
        <p class='NormalText'> 
         This parameter is optional.
        </p>   
    </td>
  </tr> 
</table>
<a href=doc.html#index>Return to index</a><br>

<h2 class='SectionTitle'><a name=input_type>Available input types</a></h2>
<table>
<tr>
  <td><p  class='BoldText'><a name=CYap_clsSearchDate>CYap_clsSearchDate</a></p></td>
  <td>
     <p class='NormalText'> 
        Date input box. It shows a text input box and the calendar where pick the required date.
     </p>
     <p class='NormalText'> 
      The class allows to set the date format on the form and the format used to build the where
      statement.
     </p>
     <p class='BoldText'> 
      NOTE: it requires dhtmlgoodies calendar library from <a href=www.dhtmlgoodies.com>www.dhtmlgoodies.com</a>.
     </p>
  </td>              
</tr>
<tr>
  <td><p class='BoldText'><a name=CYap_clsSearchRangeTxt>CYap_clsSearchRangeTxt</a></p></td>
  <td>
     <p class='NormalText'> 
       The class allows the user to insert the minimum and maximum value to look for. The user
       has two box (the min and max value), he may fill both, one, or never fill them. If only one 
       input text is filled, Yap assumes equals the minimum and the maximum value. If it is not
       filled, the filter on the specified field will be not applied.
     </p>
  </td>
</tr>
<tr>
  <td><p class='BoldText'><a name=CYap_clsSearchRegexOpt>CYap_clsSearchRegexOpt</a></p></td>
  <td>
     <p class='NormalText'> 
       The class allows the user to choose whether look for the exact text written in the input text box,
       or use that text as pattern. Of course apply the pattern is slower than look for the exact text.
     </p>
  </td>
</tr>
<tr>
  <td><p class='BoldText'><a name=CYap_clsSearchSelectBox>CYap_clsSearchSelectBox</a></p></td>
  <td>
     <p class='NormalText'> 
       The class show the select box with the available options to choose from.
     </p>
     <p class='NormalText'> 
       The configuration parameters tell to the class which the text show as option and which value
       return for each option.
     </p>
     <p class='NormalText'> 
       The class recognizes two reserved words ALL (return all rows) and NOFILTER (do not apply any filter on this field).
       Both values have the same effect, no condition will be added on the database column set for this class.
     </p>
  </td>
</tr>
<tr>
  <td><p class='BoldText'><a name=CYap_clsSearchTxt>CYap_clsSearchTxt</a></p></td>
  <td>
     <p class='NormalText'> 
       Default input text. It shows the box where the user write the text to look for on the provided database.
     </p>
  </td>
</tr>
</table>
<a href=doc.html#index>Return to index</a><br>


<h2 class='SectionTitle'><a name=func_adv>Public functions, advanced</a></h2>
<a href=doc.html#index>Return to index</a><br>

<h2 class='SectionTitle'><a name=adv_ex>Advanced function, example</a></h2>
<code><font color="#000000">
<font color="#0000BB">&lt;?php
<br /></font>
<font color="#0000BB">$p</font><font color="#007700">=new&nbsp;</font><font color="#0000BB">CYap</font><font color="#007700">(array(),&nbsp;array(),&nbsp;</font><font color="#0000BB">$db_info</font><font color="#007700">,&nbsp;</font><font color="#0000BB">$Show_info</font><font color="#007700">,&nbsp;array());
<br /></font>
<font color="#FF8000">//&nbsp;Get&nbsp;the&nbsp;filter&nbsp;object
<br /></font>
<font color="#0000BB">$FilterObj</font><font color="#007700">=</font><font color="#0000BB">$p</font><font color="#007700">-&gt;</font><font color="#0000BB">GetSearchObject</font><font color="#007700">();
<br /></font><font color="#FF8000">//&nbsp;Form&nbsp;Layout:&nbsp;2&nbsp;column&nbsp;layout
<br /></font><font color="#0000BB">$FilterObj</font><font color="#007700">-&gt;</font><font color="#0000BB">SetLayoutClass</font><font color="#007700">(</font><font color="#DD0000">'CYAP_cls2ColumnLayout'</font><font color="#007700">);
<br /></font><font color="#FF8000">//&nbsp;Add&nbsp;range&nbsp;of&nbsp;text&nbsp;input&nbsp;object;
<br />//&nbsp;Create&nbsp;the&nbsp;field.&nbsp;The&nbsp;index&nbsp;are&nbsp;the&nbsp;same&nbsp;as&nbsp;$SearchFieldCfg
<br /></font><font color="#0000BB">$f1</font><font color="#007700">=new&nbsp;</font><font color="#0000BB">CYap_clsSearchRangeTxt</font><font color="#007700">(array(
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">//&nbsp;Textbox&nbsp;label
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'description'&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#DD0000">'Event&nbsp;Date'</font><font color="#007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">//&nbsp;DataBase&nbsp;field&nbsp;where&nbsp;look&nbsp;for&nbsp;the&nbsp;typed&nbsp;string
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'fieldname'&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#DD0000">'DEvent'</font><font color="#007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">//&nbsp;A=alphabetic,&nbsp;N=Numeric
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'type'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#DD0000">'A'</font><font color="#007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">//&nbsp;Field&nbsp;size.&nbsp;Used&nbsp;to&nbsp;set&nbsp;the&nbsp;textbox&nbsp;size
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'size'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#0000BB">14</font><font color="#007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">/*&nbsp;use&nbsp;regex&nbsp;to&nbsp;match&nbsp;the&nbsp;field
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;contents&nbsp;against&nbsp;the&nbsp;requested
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;string.&nbsp;1=yes,&nbsp;0=no&nbsp;*/
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'useregex'&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#0000BB">0&nbsp;</font><font color="#007700">),</font><font color="#DD0000">'TxtRange'</font><font color="#007700">);
<br /></font><font color="#FF8000">//&nbsp;Add&nbsp;the&nbsp;field&nbsp;to&nbsp;the&nbsp;filter&nbsp;form
<br /></font><font color="#0000BB">$FilterObj</font><font color="#007700">-&gt;</font><font color="#0000BB">AddSearchField</font><font color="#007700">(</font><font color="#0000BB">$f1</font><font color="#007700">,</font><font color="#DD0000">'TxtRange'</font><font color="#007700">);
<br />
<br /></font><font color="#FF8000">//&nbsp;Second&nbsp;input.&nbsp;You&nbsp;may&nbsp;setup&nbsp;the&nbsp;parameters&nbsp;later
<br /></font><font color="#0000BB">$f2</font><font color="#007700">=new&nbsp;</font><font color="#0000BB">CYap_clsSearchRegexOpt</font><font color="#007700">(array(),</font><font color="#DD0000">'TxtRegex'</font><font color="#007700">);
<br /></font><font color="#FF8000">//&nbsp;Parameters&nbsp;setup.&nbsp;You&nbsp;may&nbsp;set&nbsp;one&nbsp;paramneter&nbsp;on&nbsp;each&nbsp;call..
<br /></font><font color="#0000BB">$f2</font><font color="#007700">-&gt;</font><font color="#0000BB">LoadCFg</font><font color="#007700">(array(</font><font color="#DD0000">'description'&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#DD0000">'Event&nbsp;Date'</font><font color="#007700">));
<br /></font><font color="#FF8000">//&nbsp;...&nbsp;or&nbsp;many&nbsp;paramters&nbsp;with&nbsp;one&nbsp;call
<br /></font><font color="#0000BB">$f2</font><font color="#007700">-&gt;</font><font color="#0000BB">LoadCFg</font><font color="#007700">(array(</font><font color="#DD0000">'fieldname'&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#DD0000">'DEvent'</font><font color="#007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">//&nbsp;A=alphabetic,&nbsp;N=Numeric
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'type'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#DD0000">'A'</font><font color="#007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'size'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#0000BB">14</font><font color="#007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'useregex'&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#0000BB">1&nbsp;</font><font color="#007700">));
<br /></font><font color="#FF8000">//&nbsp;Add&nbsp;the&nbsp;field&nbsp;to&nbsp;the&nbsp;filter&nbsp;form
<br /></font><font color="#0000BB">$FilterObj</font><font color="#007700">-&gt;</font><font color="#0000BB">AddSearchField</font><font color="#007700">(</font><font color="#0000BB">$f2</font><font color="#007700">,</font><font color="#DD0000">'TxtRegex'</font><font color="#007700">);
<br />
<br /></font><font color="#FF8000">//third...&nbsp;select&nbsp;input&nbsp;type
<br /></font><font color="#0000BB">$f3</font><font color="#007700">=new&nbsp;</font><font color="#0000BB">CYap_clsSearchSelectBox</font><font color="#007700">(array(&nbsp;</font><font color="#FF8000">//&nbsp;Label
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'description'&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#DD0000">'Error&nbsp;Code'</font><font color="#007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">//&nbsp;DataBase&nbsp;field&nbsp;where&nbsp;look&nbsp;for&nbsp;the&nbsp;typed&nbsp;string
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'fieldname'&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#DD0000">'errno'</font><font color="#007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">//&nbsp;A=alphabetic,&nbsp;N=Numeric
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'type'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt;&nbsp;</font><font color="#DD0000">'N'</font><font color="#007700">),</font><font color="#DD0000">'SelectBox'</font><font color="#007700">);
<br /></font><font color="#FF8000">//&nbsp;Now&nbsp;add&nbsp;the&nbsp;available&nbsp;options&nbsp;to&nbsp;choose&nbsp;from
<br /></font><font color="#0000BB">$f3</font><font color="#007700">-&gt;</font><font color="#0000BB">AddOption</font><font color="#007700">(&nbsp;</font><font color="#DD0000">'OK&nbsp;(0)'</font><font color="#007700">,</font><font color="#DD0000">'0'</font><font color="#007700">);
<br /></font><font color="#0000BB">$f3</font><font color="#007700">-&gt;</font><font color="#0000BB">AddOption</font><font color="#007700">(&nbsp;</font><font color="#DD0000">'Err&nbsp;512'</font><font color="#007700">,</font><font color="#DD0000">'512'</font><font color="#007700">);
<br /></font><font color="#0000BB">$f3</font><font color="#007700">-&gt;</font><font color="#0000BB">AddOption</font><font color="#007700">(&nbsp;</font><font color="#DD0000">'Err&nbsp;1024'</font><font color="#007700">,</font><font color="#DD0000">'1024'</font><font color="#007700">);
<br /></font><font color="#FF8000">//&nbsp;ALL&nbsp;rows&nbsp;option
<br /></font><font color="#0000BB">$f3</font><font color="#007700">-&gt;</font><font color="#0000BB">AddOption</font><font color="#007700">(&nbsp;</font><font color="#DD0000">'No&nbsp;selection'</font><font color="#007700">,</font><font color="#DD0000">'NOFILTER'</font><font color="#007700">);
<br /></font><font color="#FF8000">//&nbsp;Add&nbsp;the&nbsp;field&nbsp;to&nbsp;the&nbsp;filter&nbsp;form
<br /></font><font color="#0000BB">$FilterObj</font><font color="#007700">-&gt;</font><font color="#0000BB">AddSearchField</font><font color="#007700">(</font><font color="#0000BB">$f3</font><font color="#007700">,</font><font color="#DD0000">'SelectBox'</font><font color="#007700">);
<br />
<br /></font><font color="#FF8000">//&nbsp;Finally&nbsp;show&nbsp;the&nbsp;table
<br /></font><font color="#0000BB">$p</font><font color="#007700">-&gt;</font><font color="#0000BB">showpage</font><font color="#007700">();
<br />echo&nbsp;</font><font color="#DD0000">'&lt;/body&gt;&lt;/html&gt;'</font><font color="#007700">;
<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code>
<br>
<a href=doc.html#index>Return to index</a><br>


<h2 class='SectionTitle'><a name=c_log>Change Log</a></h2>
<table border=0>
  <tr>
    <td><p class="NormalText">23/01/2007 ver 2.1.0</p></td>
    <td><p class="NormalText">
        <ul>
        <li>
          Changed the code used to manage the filter form. It uses the MVC method to
          draw the form, parse the input and to build the where statement to filter the rows.
          Now is is more easy to add custom input object, modify the form layout.
        </li>
        <li>
          Added more input object type (date input, range input, select box)
        </li>
        </ul>
    </td>
  </tr>
  <tr>
    <td><p class="NormalText">28/02/2005 ver 2.0.0</p></td>
    <td><p class="NormalText">
        <ul>
        <li>
          PHP 5 support.
        </li>
        <li>
          Event driven coding.
        </li>
        <li>
          Added support to MSSQL Server.
        </li>
        <li>
          New API documentation available at http://www.andrioli.com/en/yapapi/index.html.
        </li>
        </ul>
    </td>
  </tr>
  <tr>
    <td><p class="NormalText">30/09/2004 ver 1.2.0</p></td>
    <td><p class="NormalText">
        <ul>
        <li>
          Move out the database connection logic to classes to extend the support to many
          other database.
        </li>
        <li>
          Added support to ODBC. Note: this module was tested to connect to Ms Access on Win32
          system.
        </li>
        </ul>
    </td>
  </tr>
  <tr>
    <td><p class="NormalText">1/9/2004 ver 1.1.1</p></td>
    <td><p class="NormalText">
        <ul>
         <li>
           Added more control on which fields show in detail mode
          </li>
          <li>
           Added parameters to set the value's output format
          </li>
          <li>
           Many bugs fix
          </li>
          <li>
           Fixed the test programs. In the previous release they haven't
           the correct include statements.
          </li>
        </ul>
    </td>
  </tr>
 <tr>
    <td><p class="NormalText">21/06/2004 ver 1.1.0</p></td>
    <td><p class="NormalText">
        <ul>
        <li>In this release I moved out from the business module the PHP code that builds the user interface. In this way I hope to make easy the design customisation. Each interface object as form, table view, detail view, message box, 
             link to the next/previous page, now are written as single class that you may extend.</li>
        </ul>
    </td>
  </tr>
  <tr>
    <td><p class="NormalText">26/03/2004 ver 1.0.1</p></td>
    <td><p class="NormalText">
        <ul>
        <li>Added new parameter showfirstcallrow, to enable to show first 15 rows at the first 
            time the page is shown. Normally it shows only the search box.</li>
        <li>Fixed column type identification in case of type blob/text/set/enum</li>
        <li>Fixed, you must set the parameter 'table' into the edit feature parameters, also 
            if you don't enable it</li>
        </ul>
    </td>
  </tr>
  <tr>
    <td><p class="NormalText">23/11/2003 ver 1.0</p></td>
    <td><p class="NormalText">First public release</td>
  </tr>
</table>
<a href=doc.html#index>Return to index</a><br>

<h2 class='SectionTitle'><a name=license>License</a></h2>
<p class="NormalText">Yap is licensed under the GNU/LGPL. See license.txt.</p>

<p class="NormalText">That's all. I hope it will be useful.<br>
Darvin<br>
(darvin at andrioli dot com)</p>
</body>
</html>
Return current item: Yet Another Pager