##include templates\lheader.htm##

{BEGIN grid_block}
<div id="grid_block{$id}">
<table name="maintable" class="data" align="center" width="100%" border="0" cellpadding=3 cellspacing=0>
{BEGIN grid_header}
<tr class="blackshade" valign="top" {$gridHeader_attrs}>
{BEGIN record_header}

##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=100 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}
<td class="headerlist">
{BEGIN ##@f.strName g##_fieldheader}
##if IsSortable(@f)##
<a class="tablelinks" 
{$##@f.strName g##_orderlinkattrs}>
##strLabel h##</a>
##else##
##strLabel h##
##endif##
{END ##@f.strName g##_fieldheader}
</td>
{END ##@f.strName g##_fieldheadercolumn}
##endfor##
{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}

##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 valign=middle class=borderbody align=center {$##@f.strName g##_style}>
{$##@f.strName g##_value}
</td>
{END ##@f.strName g##_fieldcolumn}
##endfor##

{BEGIN endrecord_block}
<td class="body2" {$endrecordblock_attrs}></td>
{END endrecord_block}
{END grid_record}
</tr>
{END grid_row}
	
##if Fields[strTotalsType].len##
{BEGIN totals_row}
<tr class="blackshade">
{BEGIN totals_record}

##if @TABLE.bEdit##
{BEGIN edit_column}
<td width=50 align="center" class="blackshade">&nbsp;</td>
{END edit_column}
##endif##

##if @TABLE.bInlineEdit##
{BEGIN inlineedit_column}
<td width=100 align="center" class="blackshade">&nbsp;</td>
{END inlineedit_column}
##endif##

##if @TABLE.bCopy##
{BEGIN copy_column}
<td width=50 align="center" class="blackshade">&nbsp;</td>
{END copy_column}
##endif##

##if @TABLE.bView##
{BEGIN view_column}
<td width=50 align="center" class="blackshade">&nbsp;</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="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 width=50 class="blackshade">&nbsp;</td>
{END ##@t.strShortTableName##_dtable_column}
##endfor##

##foreach Fields as @f filter bListPage order nListPageOrder##
{BEGIN ##@f.strName g##_fieldfootercolumn}
<td valign=middle align=center 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##

{BEGIN endrecordtotals_block}
<td class="body2"></td>
{END endrecordtotals_block}
{END totals_record}
</tr>
{END totals_row}
##endif##
</table> 

</div>
{END grid_block}
 


##include templates\lfooter.htm##
