[eluser]jedd[/eluser]
In contrast, I really don't like jumping in and out of PHP within my HTML - I think it is harder to read.
There's some simple stuff you could do. For example, rather than this:
[quote author="Sinclair" date="1263779653"]
Code:
// original code
if ($primVezHrl == '0') {
echo "<br />";
echo " <span class=\"style4\">$row->n_cidade</span><br /><br />";
echo "<table><tr>";
}
else {
echo "<hr size=\"1\" noshade /> <span class=\"style4\">$row->n_cidade</span><br /><br />";
echo "<table><tr>";
}
[/quote]
... I'd pull the table/tr out (it's common) and combine the first two lines in the first block - which means you get the construct down to 4 lines for the if/else (you can forego the { } ).
For neatness, I also like to scatter \n's throughout my compound echo statements, so that the final HTML reads more easily - it fits my overly-neat preferences, but actually has some genuine benefit when you try to match up missing tags later by looking through your page-source.
Similarly your code like this:
Code:
echo " </tr>
<tr>
<td height=\"15\"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>";
$i = 0;
I'd definitely not do one big echo - instead (if it's outside an if block) I'd drop to HTML, but if it's part of a PHP conditional then I'd at least do a simple loop in there to dump out 8 lots of "<td> </td>\n" lines.
I think there's quite a few examples of code - check the Tutorials page in the wiki - and there's a few pages that list demonstration sites (Bamboo Invoice is the main one, but more recently the music one that I can never remember the name of. Check the [url="/wiki/Applications_Using_Code_Igniter/"]Applications Using Code Igniter[/url] page in the wik for a few more hints.
EDIT: Unravel the music - that's the other big one. A huge site, though not sure how instructive it should be given the authors' resistance to writing comments in their code.