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

More Examples:   View Source:   searchInEditNew

Free Download

This demo allows you to enter complaint records for products you are supporting. You can perform a search in the both the EDIT/NEW record forms for the product the customer is complaining about. Hint: search on R in the "prodname" field below.

  PHPLens
E New Srch
(E) (e)id (e)prodname (e)custname (e)telephone (e)Complaint
1
69225
Tunikoshttp://www.alesandra.lt/drabuziai/sukneles-tunikos/68727144926Great article. Great.
2
69230
Sukneles internetehttp://www.alesandra.lt/drabuziai/sukneles-tunikos/80360942463Hey, thanks for the article. Much obliged.
3
69228
Sukneles internetehttp://www.alesandra.lt/drabuziai/sukneles-tunikos/34104916988Looking forward to reading more. Great blog article.Really looking forward to read more. Really Cool.
4
69231
Tunikoshttp://www.alesandra.lt/drabuziai/sukneles-tunikos/12584411976Appreciate you sharing, great article.Really thank you! Want more.
5
69227
Sukneleshttp://www.alesandra.lt/drabuziai/sukneles-tunikos/64174209406I truly appreciate this article.Much thanks again. Want more.
6
69229
Tunikoshttp://www.alesandra.lt/drabuziai/sukneles-tunikos/19449602787Thanks-a-mundo for the article. Really Cool.
7
69232
Sukneleshttp://www.alesandra.lt/drabuziai/sukneles-tunikos/93988538581Major thanks for the blog.Much thanks again. Much obliged.
8
69233
Sukneles internetehttp://www.alesandra.lt/drabuziai/sukneles-tunikos/29882301408Great, thanks for sharing this blog article.Thanks Again. Fantastic.
9
69234
Sukneles internetehttp://www.alesandra.lt/drabuziai/sukneles-tunikos/13647901354Im grateful for the blog.Really looking forward to read more. Much obliged.
10
69235
Sukneles internetehttp://www.alesandra.lt/drabuziai/sukneles-tunikos/62777892567A big thank you for your blog.Thanks Again. Great.
(E) Edit Record     
(e)productid  
(e)prodname
(e)custname
(e)telephone
(e)address1
(e)address2
(e)Complaint
 
  PHPLens (Page 1)  
E New Srch

Notes

This feature is available since 3.1.

This demo show to create complaint records, retrieving the product id and product name using a search form built into the NEW/EDIT record form. This is particularly useful when we have a 100,000 product table and we don't want to pull every product record in a normal lookup, but allow the user to enter the first few characters of the product name, then we perform a search.

The key property is:

$lens->searchInEditNew = 
"PRODNAME^select concat(productname,' (',productid,')'),productname,productid,productid 
	from products where productname like '{#}%'^prodname^productid^>1";
		

There are two modes for searchInEditNew. The first is when no lookupLens is defined as in this example. The second is discussed in ex920.

The searchInEditNew generates the search field. The key to understanding this is the prodname^productid list above, which defines the fields that receive searched values.

Now look at the SQL SELECT statement. The {#} in the SQL is substituted with what the user entered in the input field.

The SQL statement retrieves 3 fields, the first being what we show the end-user in the popup.

The 2nd is what we store in the prodname, the first field of the list prodname^productid.

The 3rd field of the SQL is stored in productlist, the second field of the list prodname^productid.

Now if 3 items were defined in the above list, say prodname^productid^more3 then the SQL statement would have had 4 fields, the 4th field storing into more3.

The >1 in the property means the field requires at least 1 character before a search can occur.

Lastly, this example has the details being displayed below the grid, using $lens->showRecNo = 5;

email: contact#phplens.com (change # to @)     telephone (malaysia): 60-3-7947 2888     fax (malaysia): 60-3-7947 2800