{include file="public/header" /}
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.store_class}</h3>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
  <div class="fixed-empty"></div>
  <form id="store_class_form" method="post">
    <input type="hidden" name="form_submit" value="ok" />
    <input type="hidden" name="sc_id" value="<?php echo $class_array['sc_id'];?>" />
    <table class="ds-default-table">
      <tbody>
        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" class="sc_name">{$Think.lang.store_class_name}:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<?php echo $class_array['sc_name'];?>" name="sc_name" id="sc_name" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>
        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="sc_name">{$Think.lang.store_class_bail}:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<?php echo $class_array['sc_bail'];?>" name="sc_bail" id="sc_bail" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>
        <tr>
          <td colspan="2" class="required"><label for="sc_sort">{$Think.lang.ds_sort}:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<?php echo $class_array['sc_sort'];?>" name="sc_sort" id="sc_sort" class="txt"></td>
          <td class="vatop tips">{$Think.lang.update_sort}</td>
        </tr>
      </tbody>
      <tfoot>
        <tr class="tfoot">
          <td colspan="15"><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span>{$Think.lang.ds_submit}</span></a></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script>
//按钮先执行验证再提交表单
$(function(){$("#submitBtn").click(function(){
    if($("#store_class_form").valid()){
     $("#store_class_form").submit();
	}
	});
});
//
$(document).ready(function(){
	$('#store_class_form').validate({
        errorPlacement: function(error, element){
            error.appendTo(element.parent().parent().prev().find('td:first'));
        },

        rules : {
            sc_name : {
                required : true
            },
            sc_sort : {
                number   : true
            }
        },
        messages : {
            sc_name : {
                required : '{$Think.lang.store_class_name_no_null}'
            },
            sc_sort  : {
                number   : '{$Think.lang.store_class_sort_only_number}'
            }
        }
    });
});
</script>