##include templates\lheader.htm##
{BEGIN grid_block}
<div id="grid_block{$id}">
<table name="maintable" class="data" border="0" cellpadding=3 cellspacing=0 width="100%">
{BEGIN grid_header}
<tr valign="top" class=blackshade {$gridHeader_attrs}>
{BEGIN record_header}
<td class="headerlist_left_gif_P">&nbsp;</td>

##if @TABLE.bEdit##
{BEGIN edit_column}
<td width=50 align="center" class="headerlist"><img src="include/img/icon_edit.gif"></td>
{END edit_column}
##endif##

##if @TABLE.bInlineEdit##
{BEGIN inlineedit_column}
<td width=50 align="center" class="headerlist"><img src="include/img/icon_edit.gif"></td>
{END inlineedit_column}
##endif##

##if @TABLE.bCopy##
{BEGIN copy_column}
<td width=50 align="center" class="headerlist"><img src="include/img/icon_copy.gif"></td>
{END copy_column}
##endif##

##if @TABLE.bView##
{BEGIN view_column}
<td width=50 align="center" class="headerlist"><img src="include/img/icon_view.gif"></td>
{END view_column}
##endif##

##if @TABLE.arrKeyFields.len && (@TABLE.bDelete || @TABLE.bExportTo || @TABLE.bPrinterFriendly || @TABLE.bInlineEdit)##
{BEGIN checkbox_column}
<td width=50 align="center" class="headerlist">
<input type=checkbox {$checkboxheader_attrs}>
</td>
{END checkbox_column}
##endif##

##foreach @BUILDER.tables as @t filter @t.arrMasterTables[strMasterTable==@TABLE.strDataSourceTable].len##
{BEGIN ##@t.strShortTableName##_dtable_column}
<td width=50 class="headerlist">&nbsp;</td>
{END ##@t.strShortTableName##_dtable_column}
##endfor##

##foreach @TABLE.Fields as @f filter bListPage order nListPageOrder##
{BEGIN ##@f.strName g##_fieldheadercolumn}
##if @last##
<td class="headerlist_right2">
##else##
<td class="headerlist">
##endif##
{BEGIN ##@f.strName g##_fieldheader}
##if IsSortable(@f)##
<a class="tablelinks" {$##@f.strName g##_orderlinkattrs}>
##@f.strLabel h##</a>
##else##
##@f.strLabel h##
##endif##
{END ##@f.strName g##_fieldheader}
</td>
{END ##@f.strName g##_fieldheadercolumn}
##endfor##
<td class="headerlist_right_gif_P">&nbsp;</td>
{BEGIN endrecordheader_block}
<td class=body2></td>
{END endrecordheader_block}

{END record_header}
</tr>
{END grid_header}

{BEGIN grid_row}
<tr valign="top" {$rowstyle} {$rowattrs}>
{BEGIN grid_record}

<td>&nbsp;</td>

##if @TABLE.bEdit##
{BEGIN edit_column}
<td align="center" valign=middle class=borderbody>
{BEGIN edit_link}
<a class=tablelinks {$editlink_attrs}>##message EDIT##</a>
{END edit_link}
</td>
{END edit_column}
##endif##

##if @TABLE.bInlineEdit##
{BEGIN inlineedit_column}
<td align="center" valign=middle class=borderbody>
{BEGIN inlineedit_link}
<a class=tablelinks {$inlineeditlink_attrs}>##message INLINE_EDIT##</a>
{END inlineedit_link}
</td>
{END inlineedit_column}
##endif##

##if @TABLE.bCopy##
{BEGIN copy_column}
<td align="center" valign=middle class=borderbody>
{BEGIN copy_link}
<a class=tablelinks {$copylink_attrs}>##message COPY##</a>
{END copy_link}
</td>
{END copy_column}
##endif##

##if @TABLE.bView##
{BEGIN view_column}
<td align="center" valign=middle class=borderbody>
{BEGIN view_link}
<a class=tablelinks {$viewlink_attrs}>##message VIEW##</a>
{END view_link}
</td>
{END view_column}
##endif##

##if @TABLE.arrKeyFields.len && (@TABLE.bDelete || @TABLE.bExportTo || @TABLE.bPrinterFriendly || @TABLE.bInlineEdit)##
{BEGIN checkbox_column}
<td align="center" valign=middle class=borderbody>
{BEGIN checkbox}
<input type=checkbox {$checkbox_attrs}>
{END checkbox}
</td>
{END checkbox_column}
##endif##

##foreach @BUILDER.tables as @t filter @t.arrMasterTables[strMasterTable==@TABLE.strDataSourceTable].len##
{BEGIN ##@t.strShortTableName##_dtable_column}
<td align="center" valign=middle class=borderbody>
{BEGIN ##@t.strShortTableName##_dtable_link}
<a  {$##@t.strShortTableName##_dtablelink_attrs}>##@t.strCaption h####if @t.arrMasterTables[strMasterTable==@TABLE.strDataSourceTable].bDisplayChildCount##{BEGIN ##@t.strShortTableName##_childcount}({$##@t.strShortTableName##_childnumber})
{END ##@t.strShortTableName##_childcount}
##endif##
</a>
{END ##@t.strShortTableName##_dtable_link}
##if @t.arrMasterTables[strMasterTable==@TABLE.strDataSourceTable].nDetailPreview==dpINLINE##
{BEGIN ##@t.strShortTableName##_preview_link}
<a {$##@t.strShortTableName##_previewlink_attrs}>##message PREVIEW##</a>
{END ##@t.strShortTableName##_preview_link}
##endif##
</td>
{END ##@t.strShortTableName##_dtable_column}
##endfor##

##foreach Fields as @f filter bListPage order nListPageOrder##
{BEGIN ##@f.strName g##_fieldcolumn}
<td align=center valign=middle ##if !@last##class=borderbody##endif## {$##@f.strName g##_style}>
{$##@f.strName g##_value}
</td>
{END ##@f.strName g##_fieldcolumn}
##endfor##
<td>&nbsp;</td>
{BEGIN endrecord_block}
<td width=20 class=body2 {$endrecordblock_attrs}>&nbsp;</td>
{END endrecord_block}
{END grid_record}
</tr>
{END grid_row}

##if Fields[strTotalsType].len##
{BEGIN totals_row}
<tr class=blackshade>
{BEGIN totals_record}
<td class=blackshade>&nbsp;</td>

##if @TABLE.bEdit##
{BEGIN edit_column}
<td class=blackshade>&nbsp;</td>
{END edit_column}
##endif##
	
##if @TABLE.bInlineEdit##
{BEGIN inlineedit_column}
<td class=blackshade>&nbsp;</td>
{END inlineedit_column}
##endif##
	
##if @TABLE.bCopy##
{BEGIN copy_column}
<td class=blackshade>&nbsp;</td>
{END copy_column}
##endif##
	
##if @TABLE.bView##
{BEGIN view_column}
<td class=blackshade>&nbsp;</td>
{END view_column}
##endif##
	
##if @TABLE.arrKeyFields.len && (@TABLE.bDelete || @TABLE.bExportTo || @TABLE.bPrinterFriendly || @TABLE.bInlineEdit)##
{BEGIN checkbox_column}
<td class=blackshade>&nbsp;</td>
{END checkbox_column}
##endif##
	
##foreach @BUILDER.tables as @t filter @t.arrMasterTables[strMasterTable==@TABLE.strDataSourceTable].len##
{BEGIN ##@t.strShortTableName##_dtable_column}
<td class=blackshade>&nbsp;</td>
{END ##@t.strShortTableName##_dtable_column}
##endfor##

##foreach Fields as @f filter @f.bListPage order @f.nListPageOrder##
{BEGIN ##@f.strName g##_fieldfootercolumn}
<td class=blackshade>
##if @f.strTotalsType##
	{BEGIN ##@f.strName g##_showtotal}
	##if strTotalsType=="COUNT"##
		##message COUNT##
	##elseif strTotalsType=="TOTAL"##
		##message TOTAL##:
	##elseif strTotalsType=="AVERAGE"##
		##message AVERAGE##:
	##endif##
	{$##@f.strName g##_total}
	{END ##@f.strName g##_showtotal}
##else##
&nbsp;
##endif##
</td>
{END ##@f.strName g##_fieldfootercolumn}
##endfor##
<td class=blackshade>&nbsp;</td>
{BEGIN endrecordtotals_block}
<td class=body2>&nbsp;</td>
{END endrecordtotals_block}
{END totals_record}
</tr>
{END totals_row}
##endif##

{BEGIN grid_footer}
<tr class=blackshade>
{BEGIN record_footer}
    <td class=headerlistdown_left2_P height=15></td>
	##if @TABLE.bEdit##
{BEGIN edit_column}
	<td class=blackshade>&nbsp;</td>
{END edit_column}
	##endif##
	
	##if @TABLE.bInlineEdit##
{BEGIN inlineedit_column}
	<td class=blackshade>&nbsp;</td>
{END inlineedit_column}
	##endif##
	
	##if @TABLE.bCopy##
{BEGIN copy_column}
	<td class=blackshade>&nbsp;</td>
{END copy_column}
	##endif##
	
	##if @TABLE.bView##
{BEGIN view_column}
	<td class=blackshade>&nbsp;</td>
{END view_column}
	##endif##
	

##if @TABLE.arrKeyFields.len && (@TABLE.bDelete || @TABLE.bExportTo || @TABLE.bPrinterFriendly || @TABLE.bInlineEdit)##
{BEGIN checkbox_column}
	<td class=blackshade>&nbsp;</td>
{END checkbox_column}
	##endif##
	
	##foreach @BUILDER.tables as @t filter @t.arrMasterTables[strMasterTable==@TABLE.strDataSourceTable].len##
{BEGIN ##@t.strShortTableName##_dtable_column}
	<td class=blackshade>&nbsp;</td>
{END ##@t.strShortTableName##_dtable_column}
	##endfor##

	##foreach Fields as @f filter @f.bListPage order @f.nListPageOrder##
		<td class=blackshade>&nbsp;</td>
	##endfor##
	<td class=headerlistdown_right2_P height=15>&nbsp;</td>
{BEGIN endrecordfooter_block}
    <td width=20 class=body2>&nbsp;</td>
{END endrecordfooter_block}
{END record_footer}
	</tr>
{END grid_footer}
</table>
</div>
{END grid_block}

##include templates\lfooter.htm##
