[SMARTY] Adding title on foreach
Louie Miranda <[email protected]>
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <[email protected]> |
I have a sql select (select * from Questions order by Group_Name) from a db
which has 2 fields, namely title and questions and i have outputted it thru
smarty. But, i want to add the title like this
Accounting:
Vendors Account Version | Y/N | Ratings
Business Management
User friendly (GUI)
But, i dont know how to do it im smarty.
Question Y / N Ratings Accounting | Vendors Accounting version YESNO 1234
5
Accounting | Interface to other programs - Vendor Programming YESNO 12345
Accounting | Interface to other programs - RPC Programming YESNO 12345
Accounting | User Friendly YESNO 12345
Business Management | User friendly (GUI) YESNO 12345
Business Management | Allow RPC to access data to create custom reports
YESNO 12345
Business Management | Export Excel YESNO 12345
Business Management | Export MS products YESNO 12345
Business Management | Layout/readability of static reports YESNO 12345
Here's my code.
<table width=100% cellspacing=0 cellpadding=0 border=0>
>
> <tr class="title">
> <td>Question</td>
> <td>Y / N</td>
> <td>Ratings</td>
> </tr>
>
> {foreach from=$data item="entry"}
>
> <tr>
> <td>{$entry.1|escape} | {$entry.2|escape}</td>
>
> {if $entry.3 eq "Yes"}
> <td colspan=2><input type="text" name=""></td>
> {else}
> <td>
> <select>
> <option>YES</option>
> <option>NO</option>
> </select>
> </td>
> <td>
> <select>
> <option>1</option>
> <option>2</option>
> <option>3</option>
> <option>4</option>
> <option>5</option>
> </select>
> </td>
>
> {/if}
>
> </tr>
> <tr>
> <td height=1 bgcolor=#000000 colspan=3></td>
> </tr>
> {foreachelse}
> <tr>
> <td>No records</td>
> </tr>
> {/foreach}
>
> </table>
>
How can i filter this on smarty? Please help! I desperatly need this to
work.
--
Louie Miranda ([email protected])
http://www.axishift.com
//JSM-W