<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="sql_query"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
	<tr>
  	<td>
  		<script type="text/javascript">
				a_toolbar = new ToolBar();
				a_toolbar.AddButton( new ToolBarButton('query_database', '<inp2:m_phrase label="la_ToolTip_RunSQL" escape="1"/>', function() {
					submit_event('adm','OnSqlQuery');
						}
					) );
			<!--##
				a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
					location.href = '<inp2:m_Link t="sections_list" pass="m" section="in-portal:tools" module="In-Portal" no_amp="1"/>';
						}
					) );
			##-->
				a_toolbar.Render();
			</script>
		</td>
	</tr>
</tbody>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
<inp2:m_RenderElement name="subsection" title="la_prompt_sqlquery_header"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td colspan="3">
	<inp2:m_inc param="tab_index" by="1"/>
	<span class="hint"><img src="img/smicon7.gif" align="absmiddle" height="14" width="14">
		<inp2:m_Phrase label="la_text_db_warning"/>
	</span>
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
	<inp2:m_inc param="tab_index" by="1"/>
  <td valign="top" width="100"><span class="text" ID="prompt_sql_query"><inp2:m_Phrase label="la_prompt_sqlquery"/><br />

</td>
  <td valign="top" width="400"><span class="text">
  <TEXTAREA ValidationType="exists" name="sql" cols="100" rows=10><inp2:m_Get var="sql"/></TEXTAREA>
  </td>
  <td align="left" valign="top"><span class="text">
  <inp2:m_if check="m_Get" var="query_status">
  		<inp2:m_Phrase label="la_SQLRuntime"/>:&nbsp;<inp2:m_Get var="sql_time"/> sec.<br />
  	<inp2:m_if check="m_Get" var="sql_has_affected">
		<br /><inp2:m_Phrase label="la_SQLAffectedRows"/>: <inp2:m_Get var="sql_affected"/>
	</inp2:m_if>
  </inp2:m_if>

  </span></td>
</tr>
</table>

<inp2:m_if check="m_Get" var="query_status">
	<inp2:m_if check="m_Get" var="sql_has_rows">
		<br />
		<table width="100%" cellspacing="0" cellpadding="0" class="bordered">
			<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
				<inp2:m_inc param="tab_index" by="1"/>
			  <td colspan="3">
				<table width="100%" border="0" cellspacing="0" cellpadding="4">
			  	<inp2:m_DefineElement name="sql_column_title">
				<td width="100%" nowrap="nowrap">
					<span class="columntitle_small"><img title="" src="../../admin/images/list_arrow_rt.gif" align="absmiddle" border="0"><inp2:m_param name="value"/></span>
				</td>
			  	</inp2:m_DefineElement>
			  	<inp2:m_DefineElement name="sql_row">
				<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
					<inp2:m_param name="cells"/>
				</tr>
			  	</inp2:m_DefineElement>
			  	<tr class="grid-header-row-0">
			  		<inp2:adm_PrintSqlCols render_as="sql_column_title"/>
			  	</tr>
			  	<inp2:adm_PrintSqlRows render_as="sql_row"/>
			  	</table>
			  </td>
			</tr>
		</table>
	</inp2:m_if>
</inp2:m_if>

<inp2:m_include t="incs/footer"/>