Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Web Publishing with PHP and FileMaker 9- P15: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. | 200 CHAPTER 10 Repurposing a FileMaker Layout on the Web Then I use the getFoundCount method of the result object to determine how many records were found found result- getFoundSetCount I compose the message next. Note that if the user has not performed a search criteria will contain an empty string and the message is therefore slightly different if criteria page_content. p Displaying . found . record s of . total . total p else page_content. p Your search for . criteria . returned . found . record s of . total . total p Store the array of record objects in the records variable using the getRecords method of the result object records result- getRecords Start compiling the table for output page_content. table border 1 page_content. tr page_content. th nbsp th Loop through the array of field objects to draw the header row remembering to include the criteria and sort values in the header links foreach fields as field field_name field- getName page_content. th a href . this_page . criteria . criteria . sort . field_name . . field_name . a th Close the header row page_content. tr I can now start looping through the record objects foreach records as record First I open up a row and build the View link exactly as we ve seen in earlier examples page_content. tr page_content. td a href product.php recid . record- getRecordId . View a td List View 201 For every record in the found set I m going to loop through the array of field objects that I pulled out of the layout object to access the field data foreach fields as field Grab the name and type of field field_name field- getName field_data_type field- getResult Notice that I m checking the field type and using the get_image.php page to create img tags for container fields. All other fields are just output normally. if field_data_type container field_val img src get_image.php path .urlencode record- getField field_name . else field_val record- getField field_name This line adds the table data cell to the current row .