[phplib] set_block(): Please Help! From: Kartic Krishnamurthy (kaygee <email protected>)
Date: 07/27/00

Hi List!

I would appreciate any help about this Template set_block() method. First
of all, my understanding is probably fuzzy.

Anyway, here is my question:

I have a master template, like this:
- master.ihtml -
<html>
<head><title>TITLE</title></head>

<body>
<table>
<tr><td><{NAV}
<td>{CONTENTS}</td>
</tr>
</table>
</body>

Then, I have a nav.ihtml template (that is not relevant here and so I am not
showing it). I also have a template that is supposed to replace the
CONTENTS template variable and looks like this.
- book.ihtml -
...
<tr>
<!-- BEGIN info -->
<td>{TITLE}
<td>{CALLNO}
<td>{AUTHOR}
<!-- BEGIN option -->
<td><input type="submit" name="cmd" value="{RENEW}">
<td><input type="submit" name="cmd" value="More Details">
<!-- END option -->
<!-- END info -->
</tr>

What I want is, extract from a DB a list of books for a given member id and
list out the books (title, call no, author) and 2 actions against each row,
of which one action is if the book has been renewed already, the button
{RENEW} should appear as "Reserve" (as in place a hold on it) else, it
should appear as "Renew". Additonally, I want to use the same template
definitions to print a header row ("TITLE", "CALL NO", "AUTHOR", "" , "": no
buttons).

Can this be done in this scheme? If so, how do I do it?! I made an attempt
at it but then ended up getting confused. The example in the docs did not
help me too much in this case.

Thank you,
--Kartic
PS: End product -
+-------------------------------------------------------+
| Title | Call No | Author | |
+-------------------------------------------------------|
|XXXX| XXXX | xxxx z | <Renew> | <More Info> |
|YYYY| YYYY | ee xx | <Reserve> | <More Info> |
+-------------------------------------------------------+

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>