tailieunhanh - Web Publishing with PHP and FileMaker 9- P12

Web Publishing with PHP and FileMaker 9- P12:On the other hand, it would drive me nuts if you bought this book only to discover that it didn’t address your needs. In the spirit of customer satisfaction, please read the following introduction to get a sense of where I’m coming from, and whether you might get some good use out of this book. | Creating Related Records 155 The rest of the page is pretty humdrum compared to all that. We have to remember to close our table form and PHP tags and then output the HTML template exactly like the last page example. portal_html . table portal_html . form html head title 08_02 title head body table border 1 tr th ID th td php echo id td tr tr th Name th td php echo name td tr tr th Model Number th td php echo model_number td tr tr th Price th td php echo price td tr tr th Created At th td php echo created_at td tr tr th Created By th td php echo created_by td tr table php echo portal_html body html 8 156 CHAPTER 8 Working with Related Data Por tals Altering Related Records Let s modify the web page to allow users to edit or delete related records in the portal by adding two hyperlinks to the third column. See Figure for an example of the page displayed in a browser. FIGURE Users now have navigation to edit or delete pages for related inventory records. The concept here is almost identical to the edit and delete links that we covered in Chapter 7 Altering FileMaker Data. There we added edit and delete links to the product list page. Here we are adding those same links to the portal. Here is the completed code php define FM_HOST define FM_FILE Product Catalog define FM_USER esmith define FM_PASS m4rg0t require_once fm new FileMaker FM_FILE FM_HOST FM_USER FM_PASS record fm- getRecordById Product _GET recid if isset _POST new_portal_row new_row record- newRelatedRecord Inventory new_row- setField Inventory Location _POST location new_row- setField Inventory Quantity _POST quantity result new_row- commit record fm- getRecordById Product _GET recid id record- getField ID Altering Related Records 157 name record- getField Name model_number record- getField Model Number price record- getField Price created_at record- getField Created At created_by record- getField Created By portal_records record- getRelatedSet Inventory portal_html form

TỪ KHÓA LIÊN QUAN