{include file="adm-header.tpl"}
<div class="content">
{if $error != null}<div class="error">{$error}</div>{/if}
{if $success != null}<div class="success">{$success}</div>{/if}
{if $num != 0}
<form action="administrator.php?mod=payment" method="post">
<table width="100%" border=0 cellspacing="2" cellpadding="2" style="margin-top: 5px;">
<tr class="th_1"><td colspan="9" >Płatności  </td></tr>
        <tr class="td_list_title">
                <td width="2%">lp</td>
                <td width="20%">typ płatności</td>
                <td width="15%">rodzaj płatności</td>
                <td width="10%">identyfikator usługi ( sms )</td>
                <td width="7%">dni</td>
                <td width="7%">cena ( zł )</td>
                <td width="22%">opis</td>
                <td width="7%">opcje</td>
                <td width="5%">kolejność</td>
        </tr>
        {assign var='i' value='0'}
        {foreach from=$p item=P}
        {assign var='i' value=$i+1}
        <tr class="{if $i%2 == 0}td_list_a{else}td_list_b{/if}" onmouseover="style.backgroundColor='#a9a7a7'" onmouseout="style.backgroundColor='#f6f4f4'">
                <td>{$i}</td>
                <td align="left">&nbsp; 
								{if $P.payToo == '1'}abonament ( emisja obiektu )
								{elseif $P.payToo == '2'}abonament ( promowanie obiektu )
								{elseif $P.payToo == '4'}abonament ( wyróżnienie obiektu )
								{else}abonament ( last minute ){/if}
								</td>
                <td align="left">&nbsp; {if $P.payOption == 'sms'}sms premium{else}płatności online{/if}</td>
                <td align="left">&nbsp; {$P.payCodeSms}</td>
                <td>{$P.payDay}</td>
                <td>{$P.payPrice}</td>
                <td align="left">&nbsp;{$P.payDesc|substr:0:40} ...</td>
                <td>
                        <a onclick="location.href='administrator.php?mod=payment&act=edit&id={$P.payId}'" style="cursor: pointer;"><img src="../img/admin-edit.png" border="0" class="img" /></a>
                        <a onclick="javascript:if (confirm('Chcesz usunąć abonament!\n\n Aby potwierdzić, wciśnij [ OK ], aby anulować wciśnij [ Anuluj ]\n')) location.href='administrator.php?mod=payment&act=delete&id={$P.payId}'" style="cursor: pointer;"><img src="../img/admin-delete.png" border="0" class="img" /></a>
                </td>
                <td><input type="hidden" name="payId[]" value="{$P.payId}" /><input type="text" name="paySeq[]" value="{$P.paySeq}" style="width: 30px; text-align: center;"  /></td>
        </tr>
        {/foreach}
        <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td align="center"><input type="hidden" name="changeSeq" value="" /><input type="submit" value="zmień" /></td>
        </tr>
</table>
</form>
{else}
<center>lista jest pusta...</center>
<br />
{/if}
{if isset($edit)}
{foreach from=$ed item=E}
<form action="administrator.php?mod=payment&act=edit&id={$id}" method="post" name="payment">
<table width="100%" cellspacing="2" cellpadding="2" >
<tr class="th_1"><td colspan="2" >
Edycja Płatności ==> {if $P.payToo == '1'}abonament (emisja obiektu)
{elseif $P.payToo == '2'}abonament (promowanie obiektu)
{elseif $P.payToo == '4'}abonament (wyróżnienie obiektu)
{else}abonament (last minute){/if} 

</td></tr>
        <tr>
                <td class="td_1" >Typ płatności</td>
                <td class="td_2">
					<table ><tr>
						<td class="td_3">
<input type="radio" name="type" value="1" {if isset($E.payToo)}{if $E.payToo == '1'}CHECKED{/if}{else}CHECKED{/if} /> 
&nbsp; - &nbsp; abonament (emisja obiektu)
						</td>
                		<td class="td_3">
<input type="radio" name="type" value="2" {if $E.payToo == '2'}CHECKED{/if} /> 
&nbsp; - &nbsp; abonament (promowanie obiektu)
									</td>
                	<td class="td_3">
<input type="radio" name="type" value="4" {if $E.payToo == '4'}CHECKED{/if} />
 &nbsp; - &nbsp; abonament (wyróżnienie obiektu)
									</td>
                	<td class="td_3">
<input type="radio" name="type" value="3" {if $E.payToo == '3'}CHECKED{/if} />
 &nbsp; - &nbsp; abonament (last minute)
									</td>

         			</tr></table>
		 		</td>
		</tr>
        <tr>
                <td class="td_1"  >Rodzaj płatności</td>
                <td class="td_2">
						<table ><tr>
						<td class="td_3"><input type="radio" name="pay" value="sms" onclick="document.payment.idSms.disabled=false;" {if $E.payOption == 'sms'}CHECKED{/if}/> &nbsp; - &nbsp; sms premium</td>
        		        <td class="td_3"><input type="radio" name="pay" value="online" onclick="document.payment.idSms.disabled=true; document.payment.idSms.value='';" {if isset($E.payOption)}{if $E.payOption == 'online'}CHECKED{/if}{else}CHECKED{/if} /> &nbsp; - &nbsp; płatności online</td>
        				</tr></table>
				</td>
		</tr>
        <tr>
                <td class="td_1">Identyfikator usługi ( sms )</td>
                <td class="td_2"><input type="text" name="idSms" value="{$E.payCodeSms}" id="identyfikator" style="width: 400px;" {if $E.payOption != 'sms'}disabled="disabled{/if}" /> &nbsp; <a onmouseover="document.getElementById('help_3').style.display='';" onmouseout="document.getElementById('help_3').style.display='none';" style="cursor: pointer;"><img src="../img/pomoc.png" border="0" class="img" /></a> &nbsp; <span id="help_3" style="display: none; position: absolute;"> np: DTS5</span></td>
        </tr>
        <tr>
                <td class="td_1">Liczba dni</td>
                <td class="td_2"><input type="text" name="day" value="{$E.payDay}" style="width: 60px;" /> </td>
        </tr>
        <tr>
                <td class="td_1">Cena abonamentu</td>
                <td class="td_2"><input type="text" name="price" value="{$E.payPrice}" style="width: 100px;" /> </td>
        </tr>
        <tr>
                <td class="td_1">Skrócony opis</td>
                <td class="td_2"><input type="text" name="desc" value="{$E.payDesc}" style="width: 500px;" /> </td>
        </tr>
        <tr>
                <td class="td_1">Treść ( informacjeo płatności )</td>
                <td class="td_2"><textarea name="txt" rows="" cols="" style="width: 600px; height: 150px;">{$E.payTxt}</textarea> </td>
        </tr>
        <tr>
                <td align="center"><br /><input type="hidden" name="editPay" value="" /><input type="submit" class="submit" value=" Zapisz " /></td>
        </tr>
</table>
</form>
{/foreach}
{else}
<form action="administrator.php?mod=payment" method="post" name="payment">
<table width="100%" cellspacing="2" cellpadding="2" >
<tr class="th_1"><td colspan="2" >Nowe Płatności  </td></tr>
        <tr>
                <td class="td_1" >Typ płatności</td>
                <td class="td_2">
						<table ><tr>
							<td class="td_3">
<input type="radio" name="type" value="1" {if isset($type)}{if $type == '1'}CHECKED{/if}{else}CHECKED{/if} />
 &nbsp; - &nbsp; abonament (emisja obiektu)
							</td>
							<td class="td_3">
<input type="radio" name="type" value="2" {if $type == '2'}CHECKED{/if} />
&nbsp; - &nbsp; abonament (promowanie obiektu)
							</td>
							<td class="td_3">
<input type="radio" name="type" value="4" {if $type == '4'}CHECKED{/if} />
&nbsp; - &nbsp; abonament (wyróżnienie obiektu)
							</td>
							<td class="td_3">
<input type="radio" name="type" value="3" {if $type == '3'}CHECKED{/if} />
 &nbsp; - &nbsp; abonament (last minute)
							</td>
        				</tr></table>
				</td>
		</tr>
		
        <tr>
               <td class="td_1"  >Rodzaj płatności</td>
               <td class="td_2">
			   			<table ><tr>
			   				<td class="td_3"><input type="radio" name="pay" value="sms" onclick="document.payment.idSms.disabled=false;" {if $pay == 'sms'}CHECKED{/if}/> &nbsp; - &nbsp; sms premium</td>
                			<td class="td_3"><input type="radio" name="pay" value="online" onclick="document.payment.idSms.disabled=true;" {if isset($pay)}{if $pay == 'online'}CHECKED{/if}{else}CHECKED{/if} /> &nbsp; - &nbsp; płatności online</td>
        				</tr></table>
				</td>
		</tr>
        <tr>
                <td class="td_1">Identyfikator usługi ( sms )</td>
                <td class="td_2"><input type="text" name="idSms" value="{$idSms}" id="identyfikator" style="width: 400px;" {if $pay != 'sms'}disabled="disabled{/if}" /> &nbsp; <a onmouseover="document.getElementById('help_3').style.display='';" onmouseout="document.getElementById('help_3').style.display='none';" style="cursor: pointer;"><img src="../img/pomoc.png" border="0" class="img" /></a> &nbsp; <span id="help_3" style="display: none; position: absolute;">np: DTS5</span></td>
        </tr>
        <tr>
                <td class="td_1">Liczba dni</td>
                <td class="td_2"><input type="text" name="day" value="{$day}" style="width: 60px;" /> </td>
        </tr>
        <tr>
                <td class="td_1">Cena abonamentu</td>
                <td class="td_2"><input type="text" name="price" value="{$price}" style="width: 100px;" /> </td>
        </tr>
        <tr>
                <td class="td_1">Skrócony opis</td>
                <td class="td_2"><input type="text" name="desc" value="{$desc}" style="width: 500px;" /> </td>
        </tr>
        <tr>
                <td class="td_1">Treść ( informacjeo płatności )</td>
                <td class="td_2"><textarea name="txt" rows="" cols="" style="width: 600px; height: 150px;">{$txt}</textarea> </td>
        </tr>
        <tr>
                <td align="center"><br /><input type="hidden" name="addPay" value="" /><input type="submit" class="submit" value=" Zapisz " /></td>
        </tr>
</table>
</form>
{/if}
</div>
{include file="adm-footer.tpl"}
