{include file="header.html"}
<script type="text/javascript">
$(function(){
    $('#cycleimg_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
            },
            link    :{
                url     : true
            },
            img  : {
                accept  : 'gif|jpe?g|png'
            },
            sort_order:{
               number   : true
            }
        },
        messages : {
            title : {
                required : '{$lang.title_empty}'
            },
            link    : {
                required : '{$lang.link_empty}',
                url     : '{$lang.link_limit}'
            },
            img     : {
                accept  : '{$lang.limit_img}'
            },
            sort_order  : {
                number   : '{$lang.number_only}'
            }
        }
    });
});
</script>
<div id="rightTop">
    <p>{$lang.cycleimg}</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=cycleimg">{$lang.manage}</a></li>
        {if $cycleimg.cycleimg_id}
        <li><a class="btn1" href="index.php?app=cycleimg&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="cycleimg_form">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    {$lang.title}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput2" id="title" type="text" name="title" value="{$cycleimg.title|escape}" />
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.link}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="link" type="text" name="link" value="{$cycleimg.link}" />
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.logo}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableFile"  id="img" type="file" name="img" />
                    <span class="field_notice">{$lang.limit_img}</span>
                </td>
            </tr>
            {if $cycleimg.img}
            <tr>
                <th class="paddingT15">
                </th>
                <td class="paddingT15 wordSpacing5">
                <img src="{$cycleimg.img}" 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="{$cycleimg.sort_order}" />
                </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"}
