{*
	/**************************************************************************\
	* Simple Groupware 0.700                                                   *
	* http://www.simple-groupware.de                                           *
	* Copyright (C) 2002-2011 by Thomas Bley                                   *
	* ------------------------------------------------------------------------ *
	*  This program is free software; you can redistribute it and/or           *
	*  modify it under the terms of the GNU General Public License Version 2   *
	*  as published by the Free Software Foundation; only version 2            *
	*  of the License, no later version.                                       *
	*                                                                          *
	*  This program is distributed in the hope that it will be useful,         *
	*  but WITHOUT ANY WARRANTY; without even the implied warranty of          *
	*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
	*  GNU General Public License for more details.                            *
	*                                                                          *
	*  You should have received a copy of the GNU General Public License       *
	*  Version 2 along with this program; if not, write to the Free Software   *
	*  Foundation, Inc., 59 Temple Place - Suite 330, Boston,                  *
	*  MA  02111-1307, USA.                                                    *
	\**************************************************************************/
*}
<html>
<head>
<link media="all" href="images.php?css_style=core&{$smarty.const.CORE_VERSION}" rel="stylesheet" type="text/css" />
<style>
{literal}
body {
  overflow-y:hidden;
}
#codemain {
  position:absolute;
  width:100%;
  top:250px;
  bottom:0px;
  overflow:auto;
  height:expression(document.body.clientHeight-getObj('mainbody').offsetHeight-12);
}
#codemain div {
  padding-left:10px;
  padding-right:10px;
}
.codebox {
  width:69.7%;
  height:200px;
  font-size:13px;
  margin-top:0px;
  margin-bottom:2px;
  float:left;
}
.codebox2 {
  width:100%;
  height:200px;
  font-size:13px;
}
#selectbox {
  width:30%;
  height:200px;
  margin-bottom:2px;
  float:right;
  height:expression('201px');
}
table td {
  font-size:12px;
  padding:2px;
}
{/literal}
</style>
<title>{$title}</title>
{* You are not allowed to remove or alter the copyright. *}
<!-- 
	This website is brought to you by Simple Groupware
	Simple Groupware is an open source Groupware and Web Application Framework created by Thomas Bley and licensed under GNU GPL v2.
	Simple Groupware is copyright 2002-2011 by Thomas Bley.	Extensions and translations are copyright of their respective owners.
	More information and documentation at http://www.simple-groupware.de/
-->
</head>
<body onload="document.forms[0].code.focus();">
<script>
{literal}
function getObj(id) {
  return document.getElementById(id);
}
function set_height(obj,size) {
  if (!obj) return;
  obj.style.height=obj.offsetHeight+size+'px';
}
function change_size(size) {
  set_height(getObj('codebox'),size);
  if (getObj('selectbox')) set_height(getObj('selectbox'),size);
  getObj('codemain').style.top = getObj('codemain').offsetTop + size + "px";
}
{/literal}
</script>
<div id="mainbody">
<center>
<a href="?console=sql" {if $console eq "sql"}class="bold"{/if}>SQL</a> - 
<a href="?console=php" {if $console eq "php"}class="bold"{/if}>PHP</a> - 
<a href="?console=sys" {if $console eq "sys"}class="bold"{/if}>SYS</a>
</center>
<form method="post" action="console.php">
<input type="hidden" name="token" value="{""|modify::get_form_token}">
{if $console eq "sql" && $auto_complete}
  <select size="2" id="selectbox" ondblclick="select_insert(obj('codebox'),obj(this.id));">
  </select>
  <input type="hidden" id="database" value="{$database|escape:"html"}" />
  <textarea name="code" id="codebox" class="codebox">{$code|escape:"html"}</textarea><br>
  <script type="text/javascript" src="ext/lib/json/json.js"></script>
  <script type="text/javascript" src="ext/js/functions_sql.js?{$smarty.const.CORE_VERSION}"></script>
{else}
  <textarea name="code" id="codebox" class="codebox2">{$code|escape:"html"}</textarea><br>
{/if}
<input type="submit" value="{t}Execute{/t}  [ Alt+e ]" accesskey="e">
{if $console eq "sql"}
  <input type="submit" name="full_texts" value="{t}Execute{/t} ({t}Full texts{/t})  [ Alt+f ]" accesskey="f">
{/if}
<input type="button" value="{t}Clear{/t}  [ Alt+c ]" accesskey="c" onclick="getObj('codebox').value=''; getObj('codebox').focus();">
<input type="button" value="+" onclick="change_size(100);" />
<input type="button" value="&ndash;" onclick="change_size(-100);" />
<input type="hidden" name="console" value="{$console}">

<br>
</div>
<div id="codemain"><div>
  {$content}
  {if $console eq "sys"}
    <hr>
	<table style="width:98%;">
	  <tr class="bold"><td style="width:30%;">Command</td><td style="width:35%;">Linux</td><td style="width:35%;">Windows</td></tr>
	  <tr><td>Directory listing</td><td><a href="?console=sys&code=ls -lisa">ls -lisa</a></td><td><a href="?console=sys&code=dir">dir</a></td></tr>
	  <tr><td>Process list</td><td>
	  	<a href="?console=sys&code=ps aux">ps aux</a></td><td><a href="?console=sys&code=wmic process get Caption, ExecutablePath, ProcessId, ThreadCount, WorkingSetSize">wmic process get</a> / <a href="?console=sys&code=tasklist /V">tasklist /V</a><br>
	    <a href="?console=sys&code=wmic service get Caption, ProcessId, StartMode, State">wmic service get</a>
	  </td></tr>
	  <tr><td>Disk info</td><td><a href="?console=sys&code=df -h">df -h</a></td><td><a href="?console=sys&code=wmic logicaldisk get Caption, FileSystem, FreeSpace, Size, VolumeName">wmic logicaldisk get</a></td></tr>
	  <tr><td>Memory info</td><td><a href="?console=sys&code=free">free</a></td><td><a href="?console=sys&code=wmic os get CSName, FreePhysicalMemory, FreeSpaceInPagingFiles, TotalVisibleMemorySize, TotalVirtualMemorySize">wmic os get</a></td></tr>
	</table>
  {/if}
  {if $console eq "sql"}
    <hr>
	<a href="?console=sql&code=select * from ">select * from </a><br/>
	<a href="?console=sql&code=delete from ">delete from </a><br/>
	<a href="?console=sql&code=show full columns from ">show full columns from </a><br/>
	<a href="?console=sql&code=show tables">show tables</a><br/>
	<a href="?console=sql&code=show processlist">show processlist</a>
  {/if}
</div></div>
</form>
</body>
</html>