phpLens
 home  products examples manual  faq support forum  contact news  login store

More Examples:   View Source:   Advanced Filtering

Free Download

This uses a filter template to reformat the search form vertically. The phpLens search form is very flexible. Try the following:

- Search for all product id's greater than 30: >30
- All product id's between 10 to 30: 10 (to) 30
- All product names beginning with V: V

This is a Demo. You can not change anything for security reasons.
Back to Grid     phpLens Settings  Column Settings   Choose   Generate PHP Code   Remove All Settings   ?  
 
Cancel
FieldQUANTITYPERUNIT   Type: string[60]   Change Type
Default Title
Grid Title
Edit Title 2 Fields in Row
New Title 2 Fields in Row
Edit Notes
Use {KEY} to incorporate primary key, and prefix ?EDIT? or ?NEW? to display note only in EDIT or NEW state
Detail Title 2 Fields in Row
Filter Title
Input Dimensions
(suggested size: 48 x 1)
Columns:   Rows:

Power Lens
Lookup Values
Input Type        
     
# check/radio columns
Overlib Text
Search Lookup when editing
Matching above sql with fields
Minimum character length   Search mode   Hide key code
Validation
 X: 0-9 A-Z             x: 0-9 A-Z optional       Z: 0-9 A-Z _            z: 0-9 A-Z _ optional
#: 0-9 9: 0-9 optional +: positive numbers only
&: any character ?: any character optional \: escape character >: to uppercase <: to lowercase =EMAIL: email validation
Validation Error Msg
Default New Value
Prefix value with = to execute PHP code and % for SQL function
Optional Editable ColumnEnabled when Column   has value Enter A^B^C, or * for any non-empty value
Power Edit Lens
Grid TD Attributes   (nowrap, width=30%, align=center etc.)
Cell Color grid^title^input  
Color Reference opens in a new window

Section Break Title
Back color   CSS class

WYSIWYG Editor for fields that accept HTML
Do not convert
Special Chars
This Field supports Double-Byte (eg Chinese, Japanese) and HTML tags
Must FillNo   * Must Fill Columns
Read OnlyNo   - Read Only Columns
Visible in GridYes   Grid Columns
Visible in New RecordYes   * New Record Columns
Visible in Edit RecordYes   * Edit Columns
  Cancel
PHPLens: 4.9.2   Data: 0.02   DB: mysql   adodb: 4.62   Compat: 2   PHP: 5.2.17   OS: Linux
License Type: Enterprise   ID: (Natsoft;John Lim;jlim@natsoft.com)   Valid Till: Never Expires

Notes

This example demonstrates using a template to change the search screen:
 $lens->templateFilter = 'ex311.tpl';

The contents of the template:

{$_FORMBEGIN_}
<table width="100%" border="1">
<tr bgcolor="#333333">
  <td colspan=5 align=right><font color="#FFFFFF">
{$_SUBMIT_}</font> {$_DYNEDIT_} &nbsp; </td>
</tr>
<tr bgcolor="#666666">
  <td><b><font color="#FFFFFF">{$PRODUCTID_T}</font></b></td>
  <td><b><font color="#FFFFFF">{$PRODUCTNAME_T} </font></b></td>
  <td><b><font color="#FFFFFF">{$SUPPLIERID_T}</font></b></td>
  <td><b><font color="#FFFFFF">{$CATEGORYID_T}</font></b></td>
  <td><b><font color="#FFFFFF">{$QUANTITYPERUNIT_T}</font></b></td>
</tr>
<tr>
  <td>{$PRODUCTID}</td>
  <td>{$PRODUCTNAME}</td>
  <td>{$SUPPLIERID}</td>
  <td>{$CATEGORYID}</td>
  <td>{$QUANTITYPERUNIT}
</td>
</tr>
</table>
{$_FORMEND_}

The template consists of the fields ,eg {$PRODUCTID}, and the captions {$PRODUCTID_T}. And we also have the buttons {$_SUBMIT_} and {$_CANCEL_}, though the cancel button has been removed. The {$_DYNEDIT_} tag holds the green "e" editor button. Finally we have the form management tags {$_FORMBEGIN_} and {$_FORMEND_}.

Other features include exporting to Excel [which requires the ob_start() call at the beginning of the page)] and setting the firstState to FILTERVIEW, so the search screen appears on startup.

$lens->exportLens = 'PRODUCTID;PRODUCTNAME;SUPPLIERID;CATEGORYID;QUANTITYPERUNIT';
$lens->firstState = 'FILTERVIEW';
email: contact#phplens.com (change # to @)     telephone (malaysia): 60-3-7947 2888     fax (malaysia): 60-3-7947 2800