{include file="header.html"}
<script type="text/javascript">
//<!CDATA[
$(function(){
    $('#partner_form').validate({
        errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            $(element).after(error);
        },
        success       : function(label){
            label.addClass('right').text('OK!');
        },
        rules : {
            title : {
                required : true,
                byteRange: ['',100,'{$charset}']
            },
            link  : {
                required : true,
                url      : true
            },
            logo  : {
                accept : 'png|jpe?g|gif'
            },
            sort_order : {
                number   : true
            }
        },
        messages : {
            title : {
                required : '{$lang.title_required}',
                byteRange: '{$lang.title_maxlength_error}'
            },
            link  : {
                required : '{$lang.link_required}',
                url      : '{$lang.link_error}'
            },
            logo  : {
                accept   : '{$lang.logo_accept_error}'
            },
            sort_order  : {
                number   : '{$lang.number_only}'
            }
        }
    });
});
//]]>
</script>
<div id="rightTop">
    <p>{$lang.partner}</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=partner">{$lang.manage}</a></li>
        {if $partner.partner_id}
        <li><a class="btn1" href="index.php?app=partner&amp;act=add">{$lang.add}</a></li>
        {else}
        <li><span>{$lang.add}</span></li>
        {/if}
    </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data" id="partner_form">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    {$lang.title}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput2" id="partner_title" type="text" name="title" value="{$partner.title|escape}" />
                    <label class="field_notice">{$lang.title_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.link}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="partner_link" type="text" name="link" value="{$partner.link|escape}" />
                    <label class="field_notice">{$lang.link_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.logo}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableFile" id="partner_logo" type="file" name="logo" />
                    <label class="field_notice">{$lang.logo_desc}</label>
                </td>
            </tr>
            {if $partner.logo}
            <tr>
                <th class="paddingT15">
                </th>
                <td class="paddingT15 wordSpacing5">
                <img src="{$partner.logo}" class="makesmall" max_width="120" max_height="90" />
                </td>
            </tr>
            {/if}
            <tr>
                <th class="paddingT15">
                    {$lang.sort_order}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="sort_order" id="sort_order" type="text" name="sort_order" value="{$partner.sort_order}" />
                    <label class="field_notice">{$lang.sort_order_desc}</label>
                </td>
            </tr>
        <tr>
            <th></th>
            <td class="ptb20">
                <input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
                <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
            </td>
        </tr>
        </table>
    </form>
</div>
{include file="footer.html"}
