<tpl> if $pclass_array.pc_id != "" </tpl> <tpl> assign var='action' value='update' </tpl> <tpl> else </tpl> <tpl> assign var='action' value='save' </tpl> <tpl> /if </tpl>
<form id="form1" name="form1" method="post" action="pclass.manage.php" style="margin-bottom:20px; ">
<input type="hidden" name="action" value="<tpl> $action </tpl>" />
  <table class="from_table">
    <tr>
      <th width="200" class="th2"><tpl> $langSysPClass </tpl>：</th>
      <td width="480" class="td1"><input name="txtPCName" type="text" class="txtinput" id="txtPCName" value="<tpl> $pclass_array.pc_name </tpl>" />      
		<label style="display:none" for="txtPCName" class="wrong" metaDone="true" generated="true"></label>		</td>
    </tr>
    <tr>
      <th width="200" class="th2"><tpl> $langSysPUpClass </tpl>：</th>
      <td width="480" class="td1"><tpl> $slPCUId </tpl></td>
    </tr>
    <tr>
      <th width="200" class="th2"><tpl> $langSysPCIntro </tpl>：</th>
      <td width="480" class="td1"><textarea name="txtPCIntro" cols="50" class="tarea" rows="8" id="txtPCIntro"><tpl> $pclass_array.pc_intro </tpl></textarea>      </td>
    </tr>
	<tr>
      <th width="200" class="th2"><tpl> $langCSort </tpl>：</th>
      <td width="480" class="td1"><input name="txtSort" type="text" class="txtinput" id="txtSort"  value="<tpl> $pclass_array.pc_sort </tpl>" size="10" />
		  <label style="display:none" for="txtSort" class="wrong" metaDone="true" generated="true"></label>		  </td>
    </tr>
    <tr>
     
    
    </tr><input name="txtPCId" type="hidden" id="txtPCId" value="<tpl> $pclass_array.pc_id </tpl>" />
  </table>
  <div class="table-5-bottom">
  <div class="p-left-2">
	  <ul style="width:300px;"> 
	  <li style="float:left;"><span class="btn_left">
	  <input type="submit" class="btn_submit" name="Submit" value="<tpl> $langSysPCSave </tpl>" />　
	  </span></li>
	  <li style="float:left;"><span  class="btn_left">
		<input id="butt_list" class="btn_submit" type="button" value="<tpl> $langSysPClassReturnToList </tpl>" />
		  </span></li>
		
	  </div>
  </div>
</form>
<script>
$(document).ready(function() {
	hideMessage();		
	
	<tpl> if $list_class_error != '' </tpl>
	//输出后台程序错误信息
	showMessage(<tpl> $list_class_error </tpl>,0);
	<tpl> /if </tpl>
	
	//返回列表
	$("#butt_list").click(function(){
		ShowDiv = "result_content";
		getPageContent("pclass.manage.php?action=ajax_list");
	});	
//编辑
	var options = {
		beforeSubmit:  function(){showLoading(showSaveText);},
		success:       function(msg){
							hideLoading();
							showMessage(msg.message,msg.type);
							if(msg.type == '1'){
								ShowDiv	= 'result_content';
								getPageContent("pclass.manage.php?action=ajax_list");
							}
						},
		type:      'post',
		dataType:  'json'
	};
	
	//对添加表单做的验证定义
	$("#form1").validate({
		errorClass: "wrong",
		rules: {
			txtPCName: {required:true},
			txtSort: {required:true,number:true}
		},
		messages: {
			txtPCName: {required: "<tpl> $langSysPleaseFillInPClass </tpl>"},
			txtSort: {required:"<tpl> $langSysPleaseFillInSort </tpl>",number:"<tpl> $langSysSortIsNumber </tpl>"}
		},
		submitHandler: function() {
			//$('#txtPCName').val(str.replace("+","＋"));
			$('#form1').ajaxSubmit(options);
		}
	});
});
</script>
