<input type="hidden" name="modelid" value="<?=$modelid?>" />
<input type="hidden" name="formtype" value="<?=$form_type?>" />
<table class="adminlist" cellspacing="0">
	<thead>
	<tr>
    	<th width="5%"><input type="checkbox" name="toggle" value="all" id="toggle" /></th>
    	<th>排序</th>
    	<th>选项卡名称</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($formtab as $tab){?>
    	<tr class="row0">
        	<td><input type="checkbox" name="select_id[]" value="<?=$tab->tabid?>" /></td>
            <td><input type="text" name="orders[]" value="<?=$tab->order?>" class="text" style="width:30px;"/></td>
        	<td><input type="text" name="tabnames[]" value="<?=$tab->name?>" class="text" /><input type="hidden" name="tabids[]" value="<?=$tab->tabid?>"  /></td>
        </tr>
    <?php }?>
    	<tr>
        	<td>新增</td>
            <td><input type="text" name="name[]" value="" class="text"/></td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
    <tfoot>
    	<tr>
        	<td colspan="3"><input type="button" value="删除" onclick="select_control('<?=BASEURI?>model_form/tabdel','请确认是否删除')" class="submit" /><input type="button" value="提交" onclick="submitform('<?=BASEURI?>model_form/tab',true)" class="submit" /></td>
        </tr>
    </tfoot>
</table>
<table class="adminlist" border="0" cellpadding="0" cellspacing="0">
          <thead>
            <tr>
              <th width="2%" class="title">#</th>
              <th class="title">排序</th>
              <th class="title">英文名称</th>
              <th class="title">中文名称</th>
              <th class="title">输入类型</th>
              <th class="title">预设值</th>
              <th class="title">验证类型</th>
              <th class="title">错误提示信息</th>
              <th class="title">选项卡</th>
              <th class="title">操作</th>
            </tr>
          </thead>
          <tbody>
          	<?php if($form_type=="cat"){?>
            <?php foreach($columnform as $input){?>
            <tr class="row0">
              <td><?php  if(isset($a)){echo ++$a;}else{echo $a=1;}?></td>
              <td><input type="text" value="<?=@$input->input_order?>" name="input_order[]" style="width:20px; text-align:center;" class="text"/></td>
              <td><?=$input->column_name?><input type="hidden" name="inputid[]" value="<?=$input->input_id?>" /></td>
              <td><input type="text"  class="text" value="<?=@$input->input_title?>" name="input_title[]" dataType="Comthis" targcolumnid='input_status_<?=$a?>' to='2' operator='Equal' msg="<?=$input->column_name?>中文名称不能为空" style="width:100px;"/></td>
              <td align="center"><select name="input_type[]"  <?php if(@$input->enabled==0){?> disabled="disabled" <?php }?>>
                  <?php foreach($FiledType as $tmpType){?>
                  <option value="<?=$tmpType->column_type?>" <?php if(@$input->input_type==$tmpType->column_type){?> selected="selected" <?php }?>>
                  <?=$tmpType->column_type_des?>
                  <?php }?>
                </select></td>
              <td align="center"><select name="beforehand[]"  <?php if(@$input->enabled==0){?> disabled="disabled" <?php }?>>
                  <option value="">无
                  <?php foreach($beforehand as $tmpType){?>
                  <option value="<?=$tmpType->default_type?>" <?php if(@$input->beforehand==$tmpType->default_type){?> selected="selected" <?php }?>>
                  <?=$tmpType->default_description?>
                  <?php }?>
                </select></td>
              <td align="center"><select name="vlidata[]" id="vlidata<?=$a?>">
                  <option value="">无
                  <?php foreach($valids as $k=>$v){?>
                  <option value="<?=$k?>" <?php if($k==$input->vlidata){?> selected="selected" <?php }?>><?=$v?>
                  <?php }?>
                </select></td>
              <td align="center"><input type="text"  class="text" name="error_msg[]" value="<?=@$input->error_msg?>" style="width:100px;"   dataType="Comthis" targcolumnid='vlidata<?=$a?>' to='' operator='NotEqual' msg="<?=$input->column_name?>错误信息不能为空"/></td>
              <td align="center">
              <select name="tabid[]" >
              	<?php foreach($tabs as $tab){?>
                <option value="<?=$tab->tabid?>" <?php if($input->tabid==$tab->tabid){?> selected="selected" <?php }?>><?=$tab->name?>
                <?php }?>
              </select>
              </td>
              <td>
              <a href="<?=BASEURI?>model_form/edit_input_field/<?=$input->input_id?>/<?=$modelid?>/<?=$form_type?>">编辑</a> 
               <?php if(@$input->enabled==1){?>
              <a href="<?=BASEURI?>model_form/del_input_field/<?=$input->input_id?>/<?=$modelid?>/<?=$form_type?>" <?=IS_DELETE?>>删除</a>
               <?php }else{?>
               删除
               <?php }?>
              </td>
            </tr>
            <?PHP }
			}?>
            <?php if($form_type=="con"){?>
              <thead>
                <tr>
                  <th colspan="10">内容表</th>
                </tr>
              </thead>
             <?php foreach($columnform as $input){ 
			 if($input->tab=="attachment") continue;
			 ?>
            <tr class="row0">
              <td><?php  if(isset($a)){echo ++$a;}else{echo $a=1;}?></td>
              <td><input type="text" value="<?=@$input->input_order?>" name="input_order[]" style="width:20px; text-align:center;" class="text"/></td>
              <td><?=$input->column_name?><input type="hidden" name="inputid[]" value="<?=$input->input_id?>" /></td>
              <td><input type="text"  class="text" value="<?=@$input->input_title?>" name="input_title[]" dataType="Comthis" targcolumnid='input_status_<?=$a?>' to='2' operator='Equal' msg="<?=$input->column_name?>中文名称不能为空" style="width:100px;"/></td>
              <td align="center"><select name="input_type[]" <?php if(@$input->enabled==0){?> disabled="disabled" <?php }?>>
                  <?php foreach($FiledType as $tmpType){?>
                  <option value="<?=$tmpType->column_type?>" <?php if(@$input->input_type==$tmpType->column_type){?> selected="selected" <?php }?>>
                  <?=$tmpType->column_type_des?>
                  <?php }?>
                </select></td>
              <td align="center"><select name="beforehand[]" <?php if(@$input->enabled==0){?> disabled="disabled" <?php }?>>
                  <option value="">无
                  <?php foreach($beforehand as $tmpType){?>
                  <option value="<?=$tmpType->default_type?>" <?php if(@$input->beforehand==$tmpType->default_type){?> selected="selected" <?php }?>>
                  <?=$tmpType->default_description?>
                  <?php }?>
                </select></td>
              <td align="center"><select name="vlidata[]" id="vlidata<?=$a?>">
                  <option value="">无
                  <?php foreach($valids as $k=>$v){?>
                  <option value="<?=$k?>" <?php if($k==$input->vlidata){?> selected="selected" <?php }?>><?=$v?>
                  <?php }?>
                </select></td>
              <td align="center"><input type="text"  class="text" name="error_msg[]" value="<?=@$input->error_msg?>" style="width:100px;"   dataType="Comthis" targcolumnid='vlidata<?=$a?>' to='' operator='NotEqual' msg="<?=$input->column_name?>错误信息不能为空"/></td>
              <td align="center">
              <select name="tabid[]">
              	<?php foreach($tabs as $tab){?>
                <option value="<?=$tab->tabid?>" <?php if($input->tabid==$tab->tabid){?> selected="selected" <?php }?>><?=$tab->name?>
                <?php }?>
              </select>
              </td>
               <td>
              <a href="<?=BASEURI?>model_form/edit_input_field/<?=$input->input_id?>/<?=$modelid?>/<?=$form_type?>">编辑</a> 
               <?php if(@$input->enabled==1){?>
              <a href="<?=BASEURI?>model_form/del_input_field/<?=$input->input_id?>/<?=$modelid?>/<?=$form_type?>" <?=IS_DELETE?>>删除</a>
               <?php }else{?>
               删除
               <?php }?>
              </td>
           </tr>
            <?PHP }
			}?>
            <?php if($form_type=="con"){?>
              <thead>
                <tr>
                  <th colspan="10">附件表</th>
                </tr>
              </thead>
             <?php foreach($columnform as $input){ 
			 if($input->tab=="content") continue;
			 ?>
            <tr class="row0">
              <td><?php  if(isset($a)){echo ++$a;}else{echo $a=1;}?></td>
              <td><input type="text" value="<?=@$input->input_order?>" name="input_order[]" style="width:20px; text-align:center;" class="text"/></td>
              <td><?=$input->column_name?><input type="hidden" name="inputid[]" value="<?=$input->input_id?>" /></td>
              <td><input type="text"  class="text" value="<?=@$input->input_title?>" name="input_title[]" dataType="Comthis" targcolumnid='input_status_<?=$a?>' to='2' operator='Equal' msg="<?=$input->column_name?>中文名称不能为空" style="width:100px;"/></td>
              <td align="center"><select name="input_type[]" <?php if(@$input->enabled==0){?> disabled="disabled" <?php }?>>
                  <?php foreach($FiledType as $tmpType){?>
                  <option value="<?=$tmpType->column_type?>" <?php if(@$input->input_type==$tmpType->column_type){?> selected="selected" <?php }?>>
                  <?=$tmpType->column_type_des?>
                  <?php }?>
                </select></td>
              <td align="center"><select name="beforehand[]" <?php if(@$input->enabled==0){?> disabled="disabled" <?php }?>>
                  <option value="">无
                  <?php foreach($beforehand as $tmpType){?>
                  <option value="<?=$tmpType->default_type?>" <?php if(@$input->beforehand==$tmpType->default_type){?> selected="selected" <?php }?>>
                  <?=$tmpType->default_description?>
                  <?php }?>
                </select></td>
              <td align="center"><select name="vlidata[]" id="vlidata<?=$a?>">
                  <option value="">无
                  <?php foreach($valids as $k=>$v){?>
                  <option value="<?=$k?>" <?php if($k==$input->vlidata){?> selected="selected" <?php }?>><?=$v?>
                  <?php }?>
                </select></td>
              <td align="center"><input type="text"  class="text" name="error_msg[]" value="<?=@$input->error_msg?>" style="width:100px;"   dataType="Comthis" targcolumnid='vlidata<?=$a?>' to='' operator='NotEqual' msg="<?=$input->column_name?>错误信息不能为空"/></td>
              <td align="center">
              <select name="tabid[]">
              	<?php foreach($tabs as $tab){?>
                <option value="<?=$tab->tabid?>" <?php if($input->tabid==$tab->tabid){?> selected="selected" <?php }?>><?=$tab->name?>
                <?php }?>
              </select>
              </td>
              <td>
              <a href="<?=BASEURI?>model_form/edit_input_field/<?=$input->input_id?>/<?=$modelid?>/<?=$form_type?>">编辑</a> 
               <?php if(@$input->enabled==1){?>
              <a href="<?=BASEURI?>model_form/del_input_field/<?=$input->input_id?>/<?=$modelid?>/<?=$form_type?>" <?=IS_DELETE?>>删除</a>
               <?php }else{?>
               删除
               <?php }?>
              </td>
          </tr>
            <?PHP }
			}?>
         </tbody>
          <tfoot>
            <tr>
              <td colspan="9" height="25"><input type="submit" name="sb" value="提交" class="submit" /></td>
            </tr>
          </tfoot>
        </table>