<script type="text/javascript">
 var ajaxCheckUnique = '{url value=customer,ajaxCheckUnique}';
</script>

<div class="header">{if $objCustomer->GetId()}Edycja reklamy{else}Dodaj reklamę{/if}</div>
    
<form action="{url value=customer,edit}" method="post" id="addCustomer"  enctype="multipart/form-data" onsubmit="return formValidate(setCustomer);">
<input type="hidden" name="id" value="{$objCustomer->GetId()}" />
<br />
<table class="adminTable" align="center" style="width: 550px;" >
	<tr>
		<td class="header" colspan="2">Klient</td>
	</tr>
	<tr>
		<td>Nazwa: </td>
		<td><input class="input" type="text" name="name" id="name" value="{$objCustomer->GetName()}" onchange="javascript: CheckUnique('name', document.getElementById('name').value);" />
		<div id="msg_name"><input type="hidden" name="nameUnique" id="nameUnique" value="true" /></div>
		</td>
	</tr>	
	<tr>
		<td>Opis: </td>
		<td><textarea name="content" id="content" class="textarea"  cols="60" rows="8">{$objCustomer->GetSort()}</textarea></td>
	</tr>
	<tr>
		<td class="header" colspan="2">Baner</td>
	</tr>
	<tr>
		<td valign="top">
				<input type="hidden" name="upload_file" value="true" />
				<input type="hidden" name="MAX_FILE_SIZE" value="800000000" />
					<b>baner</b>:
		</td>
		<td>
				<input class="input" type="file" name="baner" id="banerFile" onchange="javascript: CheckFileType(this);" /><br />
				<div id="fileValidate"></div>
			{if $objCustomer->GetPath()}
				<input type="hidden" name="banerSaved" id="banerSaved" value="{$objCustomer->GetFileName()}" />
				{*Usuń baner <input type="checkbox" value="baner" name="delete">*}
				<br />	
					<div id="customer">
						<embed src="{$objCustomer->GetUrl()}" quality="high" bgcolor="#ffffff" width="200" height="77" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
					</div>
			{else}
				{if $objCustomer->GetFileName()}
				Brak pliku! Prosze wgrać jeszcze raz.
				<input type="hidden" name="baner" id="banerSaved" value="" />
				{else}
				<input type="hidden" name="baner" id="banerSaved" value="{$objCustomer->GetFileName()}" />
				Brak
				{/if}
			{/if}
		</td>
	</tr>
	<tr>
		<td>Url: </td>
		<td><input class="input" type="text" name="url" id="url" value="{$objCustomer->GetRedirectUrl()}" /></td>
	</tr>
	<tr>
		<td>Sort: </td>
		<td><input class="input" type="text" name="sort" id="sort" value="{$objCustomer->GetSort()}" /></td>
	</tr>
	<tr>
<td colspan="2"><button type="submit" value="Zapisz" name="saveCustomer" onclick="setCustomer = 1;">Zapisz</button> | 
		<input type="button" class="button" value=" Anuluj " onclick="javascript:document.location.href='{url value=$controller,index}'" /></td>
	</tr>
</table>
</form>
    
        
        

        
             