
{include file="../head.tpl"}
<script language="javascript" src="inc/picker.js"></script>
 <script language="javascript">
  var cp100 = new ColorPicker(); 
 {foreach from=$items item=item}
 var cp{$item->id} = new ColorPicker(); 
{/foreach}
{foreach from=$items item=item}
cp{$item->id}.writeDiv();
{/foreach}
 </script>
 

  
<table width="100%"  border="0" cellspacing="1" cellpadding="5" class="tableborder">
<form method="post" action="poll.php?action=sort">
  <tr>
    <td colspan="6" class="header">{$poll->title}</td>
  </tr>

  <tr>
    <td class="firstrow">&nbsp;</td>
    <td class="firstrow">{$langadmin.title}</td>
    <td class="firstrow"><div align="center">{$langadmin.color}</div></td>
    <td class="firstrow"><div align="center">{$langadmin.position}</div></td>
    <td nowrap class="firstrow"><div align="center">{$langadmin.hits}</div></td>
    <td nowrap class="firstrow">&nbsp;</td>
  </tr>
    {foreach from=$items item=item}
  <tr class="{cycle name="c0" values="c1,c2"}">
    <td width="15" class="tdspacer"><div style="width: 15px; height: 20px; background-color: {$item->color}" /></td>
    <td class="tdspacer"><input size="40" type="text" name="title[{$item->id}]" value="{$item->title}" /></td>
    <td class="tdspacer">
	  <div align="center">
	 <input name="color[{$item->id}]" id="cp{$item->id}" size="20" value="{$item->color}" type="text">
		  <a href="#" onclick="cp{$item->id}.select(document.forms[0].cp{$item->id},'pick{$item->id}');return false;" name="pick{$item->id}" id="pick{$item->id}"><img src="std_img/cpicker.png" alt="" border="0" align="absmiddle"></a>
	    </div></td>
    <td class="tdspacer"><div align="center">
      <input type="text" value="{$item->posi}" name="posi[{$item->id}]" size="5" maxlength="5" />
    </div></td>
    <td width="10%" nowrap class="tdspacer"><div align="center">
      <input name="hits[{$item->id}]" type="text" id="hits[{$item->id}]" value="{$item->hits}" size="5" maxlength="5" />
    </div></td>
    <td width="10%" nowrap><div align="right">
        <input class="button" onclick="if(confirm('{$langadmin.confirmdelpoll}'))  location.href='poll.php?redirid={$smarty.request.id}&amp;action=edit_item&amp;subaction=delete&amp;area={$area}&amp;id={$item->id}';" type="button" value="{$langadmin.menue_navigation_delete}" />
    </div></td>
  </tr>
  {/foreach}
  <tr>
    <td colspan="6" class="firstrow"><input name="redirid" type="hidden" id="redirid" value="{$smarty.request.id}">
      <input name="area" type="hidden" id="area" value="{$smarty.request.area}">
      <input name="id" type="hidden" id="id" value="{$smarty.request.id}">
      <input name="Senden" type="submit" class="button" value="{$langadmin.save}">
      
    </td></tr>
  </form>
  <script language="javascript">
  <!--
  function check(){ldelim}
  if(document.newitem.title.value == ''){ldelim}
  	alert('{$langadmin.jserror_notitle}');
	return false;
	{rdelim}
 {rdelim}
  //-->
  </script>
  <form name="newitem" action="poll.php?action=save_item" method="post" onsubmit="return check();">
<tr class="c1">

<td>&nbsp;</td>
<td class="tdspacer"><input type="text" name="title" size="40" value="" /></td>
<td class="tdspacer"><div align="center">
 
  <script language="javascript">
  var cp111 = new ColorPicker(); 
  cp111.writeDiv();
  </script>
 <input name="color" id="cp111" size="20" value="" type="text">
  <a href="#" onclick="cp100.select(document.forms[1].cp111,'pick111');return false;" name="pick111" id="pick111"><img src="std_img/cpicker.png" alt="" border="0" align="absmiddle"></a></div></td>
<td colspan="3" class="tdspacer">
 <select name="posi" id="posi">
{section name=posi loop=30 step=1}
<option value="{$smarty.section.posi.index+1}" {if $pp == $smarty.section.posi.index+1}selected{/if}>{$smarty.section.posi.index+1}</option>
{/section}
</select>
 </td>
<input type="hidden" name="id" value="{$smarty.request.id}" />
<input type="hidden" name="redirid" value="{$smarty.request.id}" />
<input type="hidden" name="area_id" value="{$area}" />
<input type="hidden" name="item_id" value="-1" />

</tr>
<tr class="c1">
  <td colspan="6" class="firstrow"><input name="Senden" type="submit" class="button" value="{$langadmin.menue_add_poll_item}"></td></tr>
</form>
</table>
{include file="../foot.tpl"}