
<script language="javascript" src="js/jupload.js" type="text/javascript"></script>
<script type="text/javascript"> 
{include file="$incpath/other/validate_js.tpl"}
<!-- //
function ajaxFileUpload(updir,divid,resize)
{ldelim}
	$("#loading_" + divid)
	.ajaxStart(function(){ldelim}
		$(this).show();
		document.getElementById('buttonUpload_' + divid).value = '{#Global_Wait#}';
		document.getElementById('buttonUpload_' + divid).disabled = true;
		
	{rdelim})
	.ajaxComplete(function(){ldelim}
		$(this).hide();
		document.getElementById('buttonUpload_' + divid).value = '{#Global_Upload#}';
		document.getElementById('buttonUpload_' + divid).disabled = false;
	{rdelim});

	$.ajaxFileUpload
	(
		{ldelim}
			url:'index.php?do=partners&sub=iconupload' + updir + '&divid=' + divid + '&resize=' + resize,
			secureuri:false,
			fileElementId:'fileToUpload_' + divid,
			dataType: 'json',
			success: function (data, status)
			{ldelim}
				if(typeof(data.error) != 'undefined')
				{ldelim}
					if(data.error != '')
					{ldelim}
						document.getElementById('UpInf_' + divid).innerHTML  = data.error;
					}else
					{ldelim}
						document.getElementById('UpInf_' + divid).innerHTML = data.msg;
						document.getElementById('newFile_' + divid).value =  data.html;
						
					{rdelim}
				{rdelim}
			{rdelim},
			error: function (data, status, e)
			{ldelim}
				document.getElementById('UpInf_' + divid).innerHTML = e;
			{rdelim}
		{rdelim})
	return false;
{rdelim}



$().ready(function(){ldelim}
	$("#new").validate({ldelim}
	rules:
		{ldelim}
				PartnerName: {ldelim}required: true{rdelim},
				PartnerUrl: {ldelim}maxLength: 255, url:true, required:true{rdelim}
		{rdelim}, 
	messages: 
		{ldelim}
		{rdelim},
	submitHandler: function(){ldelim}document.forms['new'].submit();{rdelim}
});
});
// -->
</script>


<div class="header">{#Partners#}</div>


<div class="subheaders">{#Partners_Inf#}</div>
<form method="post" action="" name="kform">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
 
  
    <tr class="headers">
      <td width="100" class="headers">{#Global_Img#}</td>
      <td width="100" class="headers">{#Partners_url#}</td>
      <td width="100" class="headers">{#Global_Name#}</td>
      <td width="50" align="center" class="headers">{#Global_Hits#}</td>
      <td width="50" align="center" class="headers">{#Global_Position#}</td>
      <td width="90" align="center" class="headers">{#Global_Active#}</td>
      <td width="50" class="headers">{#Global_Actions#}</td>
      <td class="headers"><label></label></td>
    </tr>
    
   {foreach from=$partners item=g}
  {assign var=count value=$count+1}
    <tr class="{cycle name=$cna values='second,first'}">
  <td>
  {if $g->Bild!=''}
    <img src="../{$g->Bild}" />
    {/if}
    </td>
    <td><input class="input" type="text" name="PartnerUrl[{$g->Id}]" value="{$g->PartnerUrl}" /></td>
    <td>
     <input class="input" style="width:100px"  type="text" name="PartnerName[{$g->Id}]" value="{$g->PartnerName}" />    </td>
    <td align="center"><input class="input" style="width:30px" type="text" name="Hits[{$g->Id}]" value="{$g->Hits}" /></td>
    <td align="center"><input class="input" style="width:30px" type="text" name="Position[{$g->Id}]" value="{$g->Position}" /></td>
    <td align="center" nowrap="nowrap">
    
    <label><input type="radio" name="Aktiv[{$g->Id}]" value="1" {if $g->Aktiv==1} checked="checked"{/if}/>{#Yes#}</label>
    <label><input type="radio" name="Aktiv[{$g->Id}]" value="0" {if $g->Aktiv==0} checked="checked"{/if}/>{#No#}</label> 
    
    </td>
    <td>
    <a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Edit} href="javascript:void(0);" onclick="popup('index.php?do=partners&amp;sub=edit&amp;id={$g->Id}&noframes=1','edit',600,400,1);"><img src="{$imgpath}/edit.png" alt="" border="0" /></a>
    <a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Global_Delete} onclick="return confirm('{#Partners_delC#}')" href="index.php?do=partners&amp;sub=del&amp;id={$g->Id}"><img src="{$imgpath}/delete.png" alt="" border="0" /></a>    </td>
    <td><label></label></td>
    </tr>
   {/foreach}
</table>
<input type="hidden" name="save" value="1" />
<input type="submit" class="button big" value="{#Save#}" />

</form>

{if $Navi}
<br />
<div class="navi_div">
{$Navi}
</div>
{/if}

<br />
<fieldset>
<legend>{#Partners_new#}</legend>
<form method="post" action="" name="new" id="new">
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr>
      <td width="100">{#Global_Img#}</td>
      <td>
       <div id="UpInf_1"></div><div id="loading_1" align="center"  style="display:none;"><img style="margin-bottom:15px" src="{$imgpath}/loading.gif" alt="" /></div>
       <input id="fileToUpload_1" type="file" size="20" name="fileToUpload_1" class="input" />
       <input type="button" class="button" id="buttonUpload_1" onclick="return ajaxFileUpload('','1','200');" value="{#Global_Upload#}" />
       <input type="hidden" name="newImg_1" id="newFile_1" />
       <!-- Uploadform -->      
       </td>
    </tr>
    <tr>
      <td>{#Global_Name#}</td>
      <td><input class="input" style="width:300px"  type="text" name="PartnerName" value="" /></td>
    </tr>
    <tr>
      <td>{#Partners_url#}</td>
      <td><input class="input" style="width:300px" type="text" name="PartnerUrl" value="" /></td>
    </tr>
    <tr>
      <td>{#Global_Position#}</td>
      <td><input class="input" style="width:30px" type="text" name="Position" value="1" /></td>
    </tr>
  </table>
<input type="hidden" name="new" value="1" />
<input type="submit" class="button" value="{#Save#}" />
</form>
</fieldset>


