{include file="$gentemplates/_header.tpl" js="onLoad=document.f1.searchterm.focus()" pagetitle=$companyoverview}
{include file="$gentemplates/_navi.tpl" pagetitle=$companyoverview}

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr class="formhead">
    <td class="subnav" colspan="3">&nbsp;&nbsp;
      {if $hascreaterights}
      <a href="index.php?mod=contact&amp;obj=company&amp;view=newform&amp;npage={$curr_page}&amp;{$SESSION}" class="new">{$new}</a>
      {/if}
    </td>
  </tr>
  <tr><td class="lines2" height="2" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="2"></td></tr>
  <tr>
    <td>
      <form name="f1" action="index.php" method="POST">
      <input type="hidden" name="op" value="qsearch">
      <input type="hidden" name="{$SESSIONNAME}" value="{$SESSIONID}">
      <input type="hidden" name="mod" value="contact" />
      <input type="hidden" name="obj" value="company" />
      <table border="0" cellpadding="0" cellspacing="0" align="right">
	<tr>
	  <td valign="top">{$at|smarty:nodefaults}</td>
	  <td rowspan="2" class="stand" valign="top">
	    <table border="0">
	      <tr>
		<td class="stand">
		  {if $qsearchon}
		  {$quicksearch}:</td>
		<td class="stand"><input type="text" size="20" name="searchterm">
		  <input type="submit" value="{$hashmap.search}" name="qsearch" class="submit">
		  {else}
		  &nbsp;</td><td>&nbsp;
		  {/if}
		</td>
	      </tr>
	      <tr>
		<td class="stand">{$groupsearch}:</td>
		<td class="stand">
		  <select size="1" name="_group">
		    <option value="*">{$hashmap.all}</option>
		      {html_options options=$groups selected=$actgroup}
		  </select>
		  <input type="submit" value="{$hashmap.search}" name="groupsearch" class="submit">
		</td>
	      </tr>
	    </table>
	  </td>
	</tr>
      </table>
      </form>
    </td>
  </tr>    
</table>

<form name="f2" action="index.php" method="POST" onsubmit="return confirm('{$hashmap.massupdateconfirm}');">
<input type="hidden" name="{$SESSIONNAME}" value="{$SESSIONID}">
<input type="hidden" name="mod" value="contact">
<input type="hidden" name="obj" value="company">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="contenttable">
  {if $show_company_id eq 1}
  <tr>
    <th></th>
    <th>
      <a href="{$columns[0].url}&amp;{$SESSION}">{$hashmap.private}</a>
    </th>
    <th>
      <a href="{$columns[1].url}&amp;{$SESSION}">{$hashmap.company}</a>
    </th>
    <th>
      <a href="{$columns[2].url}&amp;{$SESSION}">{$hashmap.email}</a>
    </th>
    <th>
      <a href="{$columns[3].url}&amp;{$SESSION}">{$hashmap.street}</a>
    </th>
    <th>
      <a href="{$columns[4].url}&amp;{$SESSION}">{$hashmap.zip}</a>
    </th>
    <th>
      <a href="{$columns[5].url}&amp;{$SESSION}">{$hashmap.city}</a>
    </th>
    <th>
      <a href="{$columns[6].url}&amp;{$SESSION}">{$hashmap.url}</a>
    </th>
    <th>
      <a href="{$columns[7].url}&amp;{$SESSION}">{$hashmap.id}</a>
    </th>
  </tr>

  {section name=row loop=$td}
  <script type="text/javascript">
  function pop{$td[row].id}(){literal}{{/literal}
    return overlib('<table width=\'100%\' cellspacing=\'0\' cellpadding=\'3\' border=\'0\'><tr><td>{$td[row].action|smarty:nodefaults}</td></tr></table>', STICKY, CAPTION, '{$td[row].name1|escape}{if $td[row].name2 neq ''}<br />{$td[row].name2|escape}{/if}')
{literal}  }{/literal}
  </script>
  <tr class="normal" onmouseover="this.className='hilite';" onmouseout="this.className='normal';nd();">
    <td><input type="checkbox" name="cids[]" value="{$td[row].id}" /></td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].pimg}</td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].name1}</td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].email}</a></td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].street}</td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].zip}</td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].city}</td>
    <td>{$td[row].url|smarty:nodefaults|mgw_linkalize}</td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].id}</td>
  </tr>
  {/section}
  {else}
  <tr>
    <th></th>
    <th>
      <a href="{$columns[0].url}&amp;{$SESSION}">{$hashmap.private}</a>
    </th>
    <th>
      <a href="{$columns[1].url}&amp;{$SESSION}">{$hashmap.company}</a>
    </th>
    <th>
      <a href="{$columns[2].url}&amp;{$SESSION}">{$hashmap.email}</a>
    </th>
    <th>
      <a href="{$columns[3].url}&amp;{$SESSION}">{$hashmap.street}</a>
    </th>
    <th>
      <a href="{$columns[4].url}&amp;{$SESSION}">{$hashmap.zip}</a>
    </th>
    <th>
      <a href="{$columns[5].url}&amp;{$SESSION}">{$hashmap.city}</a>
    </th>
    <th>
      <a href="{$columns[6].url}&amp;{$SESSION}">{$hashmap.url}</a>
    </th>
  </tr>
  {section name=row loop=$td}
  <script type="text/javascript">
  function pop{$td[row].id}(){literal}{{/literal}
    return overlib('<table width=\'100%\' cellspacing=\'0\' cellpadding=\'3\' border=\'0\'><tr><td>{$td[row].action|smarty:nodefaults}</td></tr></table>', STICKY, CAPTION, '{$td[row].name1|escape}{if $td[row].name2 neq ''}<br />{$td[row].name2|escape}{/if}')
{literal}  }{/literal}
  </script>
  <tr class="normal" onmouseover="this.className='hilite';" onmouseout="this.className='normal';nd();">
    <td><input type="checkbox" name="cids[]" value="{$td[row].id}" /></td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].pimg}</td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].name1}</td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].email}</a></td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].street}</td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].zip}</td>
    <td onmouseover="return pop{$td[row].id}();">{$td[row].city}</td>
    <td>{$td[row].url|smarty:nodefaults|mgw_linkalize}</td>
  </tr>
  {/section}
  {/if}
</table>
	
<table width="50%">
  <tr>
    <td align="right" class="stand">
      {if $_prev} <a href="index.php?mod=contact&amp;obj=company&amp;searchtype={$searchtype}&amp;searchterm={$searchterm}&amp;list={$list}&amp;npage={$ppage}&amp;{$SESSION}">{$prevsym|smarty:nodefaults}</a>{/if}
      {if $_next}&nbsp;&nbsp;&nbsp;<a href="index.php?mod=contact&amp;obj=company&amp;searchtype={$searchtype}&amp;searchterm={$searchterm}&amp;list={$list}&amp;npage={$npage}&amp;{$SESSION}">{$nextsym|smarty:nodefaults}</a>{/if}
    </td>
  </tr>
</table>

{$hashmap.withselected}<br />
<table>
  <tr>
    <td>
      <select size="1" name="action">
	<option value="0">-- {$hashmap.action} --</option>
	<option value="delete">{$hashmap.delete}</option>
	<option value="private">{$hashmap.private}</option>
	<option value="public">{$hashmap.public}</option>
      </select>
    </td>
    <td>
      <select size="1" name="group">
	<option value="0">-- {$hashmap.group} --</option>
	  {html_options options=$groups}
      </select>
    </td>
    </td>
    <td>
      <input type="submit" name="massupdate" value="{$hashmap.ok}!" />
    </td>
  </tr>
</table>
</form>

{include file="$gentemplates/_footer.tpl" aktUser=$username}