{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}
<table width="100%" cellspacing="2" cellpadding="2" style="margin-top: 5px;">
<tr class="th_1"><td colspan="4" >Strony  </td></tr>
        <tr class="td_list_title">
                <td width="3%">lp</td>
                <td width="10%">tytuł</td>
                <td width="25%">adres</td>
                <td width="8%">opcje</td>
        </tr>
        {assign var='i' value='0'}
        {foreach from=$pages 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; {$P.pagesTitle}</td>
                <td align="left">&nbsp; <a href="{$adress}{$P.pagesId},{nopl str=$P.pagesTitle}.html" target="_blank">{$adress}{$P.pagesId},{nopl str=$P.pagesTitle}.html</a></td>
                <td>
                        <a onclick="location.href='administrator.php?mod=pages&act=edit&id={$P.pagesId}'" style="cursor: pointer;"><img src="../img/admin-edit.png" border="0" class="img" /></a>
                        <a onclick="javascript:if (confirm('Chcesz usunąć podstronę!\n\n Aby potwierdzić, wciśnij [ OK ], aby anulować wciśnij [ Anuluj ]\n')) location.href='administrator.php?mod=pages&act=delete&id={$P.pagesId}'" style="cursor: pointer;"><img src="../img/admin-delete.png" border="0" class="img" /></a>
                </td>
        </tr>
        {/foreach}
</table>
{else}
<center>lista jest pusta...</center>
{/if}
<br />
{if isset($edit)}
{foreach from=$ed item=E}
<form action="administrator.php?mod=pages&act=edit&id={$id}" method="post">
<table width="100%" cellspacing="2" cellpadding="2" >
<tr class="th_1"><td colspan="2" >Edycja strony : {$E.pagesTitle} </td></tr>
        <tr>
                <td class="td_1">Tytuł podstrony</td>
                <td class="td_2"><input type="text" name="title" value="{$E.pagesTitle}" style="width: 400px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Treść podstrony</td>
                <td class="td_2"><textarea id="editor3" name="txt" rows="" cols="" style="width: 700px; height: 250px;">{$E.pagesTxt}</textarea>
{literal}
<script type="text/javascript" src="ckeditor/edytor/edytor3.js"></script>
{/literal}
								</td>
        </tr>
        <tr>
                <td><br /><input type="hidden" name="pagesEd" value="" /><input type="submit" class="submit" value="Zapisz zmiany" /></td>
        </tr>
</table>
</form>
{/foreach}
{else}
<form action="administrator.php?mod=pages" method="post">
<table width="100%" cellspacing="2" cellpadding="2" >
<tr class="th_1"><td colspan="2" >Nowa strona  </td></tr>
        <tr>
                <td class="td_1">Tytuł podstrony</td>
                <td class="td_2"><input type="text" name="title" value="{$title}" style="width: 400px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Treść podstrony</td>
                <td class="td_2"><textarea id="editor4" name="txt" rows="" cols="" style="width: 700px; height: 250px;">{$txt}</textarea>
{literal}
<script type="text/javascript" src="ckeditor/edytor/edytor4.js"></script>
{/literal}
								</td>
        </tr>
        <tr>
                <td><br /><input type="hidden" name="pagesAdd" value="" /><input type="submit" class="submit" value="Zapisz" /></td>
        </tr>
</table>
</form>
{/if}
<br />
<form action="administrator.php?mod=pages" method="post">
<table width="100%" cellspacing="2" cellpadding="2" >
<tr class="th_1"><td colspan="2" >Edycja stron głównych </td></tr>
        <tr>
                <td class="td_1">Powitanie ( główna )</td>
                <td class="td_2"><textarea id="editor5" name="powitanie" rows="" cols="" style="width: 700px; height: 250px;">{$powitanie}</textarea>
{literal}
<script type="text/javascript" src="ckeditor/edytor/edytor5.js"></script>
{/literal}
								</td>
        </tr>
                <tr>
                <td class="td_1">Regulamin</td>
                <td class="td_2"><textarea id="editor6" name="regulamin" rows="" cols="" style="width: 700px; height: 250px;">{$regulamin}</textarea>
{literal}
<script type="text/javascript" src="ckeditor/edytor/edytor6.js"></script>
{/literal}
								</td>
        </tr>
        <tr>
                <td class="td_1">O nas</td>
                <td class="td_2"><textarea id="editor7" name="onas" rows="" cols="" style="width: 700px; height: 250px;">{$onas}</textarea>
{literal}
<script type="text/javascript" src="ckeditor/edytor/edytor7.js"></script>
{/literal}
								</td>
        </tr>
        <tr>
                <td class="td_1">Reklama</td>
                <td class="td_2"><textarea id="editor8" name="oferta" rows="" cols="" style="width: 700px; height: 250px;">{$Reklama}</textarea>
{literal}
<script type="text/javascript" src="ckeditor/edytor/edytor8.js"></script>
{/literal}
								</td>
        </tr>
        <tr>
                <td><br /><input type="hidden" name="pagesEdit" value="" /><input type="submit" class="submit" value=" Zapisz zmiany " /></td>
        </tr>
</table>
</form>
</div>
{include file="adm-footer.tpl"}
