<?php
/*
  欢迎使用DM企业建站系统，本系统由www.demososo.com开发。
  
*/

require_once '../config_a/common.inc2010.php';
ifhave_lang(LANG);//TEST if have lang,if no ,then jump

 $menuactive_block = 'nav-active';

  
 if($act <> "pos") zb_insert($_POST);
//
$jumpv='mod_field.php?lang='.LANG.'&pid='.$pid;
$jumpv_file=$jumpv.'&file='.$file;

//----------
if($act == "pos")
{
    dmnodepos($_POST,TABLE_FIELD);


      jump($jumpv);
}
if($act == "sta")
{
   dmnode_sta($v,$tid,TABLE_FIELD);
 
    jump($jumpv);
}


 if($act == "del") 
{ 
ifcandel_field(TABLE_FIELDOPTION,'pid',$pidname,'','出错，有选项不能删除，请先删除它的选项！或者不用删除，直接隐藏这个属性。',$jumpv);
//ifcandel_field($table,$field,$value,$typelike,$back)


ifcandel_field(TABLE_FIELDVALUE,'pid',$pidname,'','出错，有文章用到了这个选项！请先删除用了这个选项的文章！',$jumpv);
//ifcandel_field($table,$field,$value,$typelike,$back)


 ifsuredel_field(TABLE_FIELD,'pidname',$pidname,'',$jumpv);
 //ifsuredel_field($table,$field,$value,$typelike,$back)

}

$title = get_field(TABLE_FIELD,'name',$pid,'pidname'); 
$title2=$title3='';
 //$result = ' - <a target="_blank" href="../mod_comment/mod_comment.php?lang='.LANG.'&catid=formblock&catpid='.$pid.'">结果</a>';

 $editformv = '../mod_form/mod_form.php?lang='.LANG.'&pid=block&type=block&file=addedit&act=edit&pidname='.$pid;
 
 $editformv2 =' -  <a href="'.$editformv.'">修改</a>';


if($act=='list') $title2= '<a style="font-size:18px" href="mod_form.php?lang='.LANG.'">表单区块管理</a> - '.$title.$editformv2;
else $title2 = '表单区块管理 - <a style="font-size:18px" href="'.$jumpv.'">'.$title.'</a>';
if($act=='add') $title3='添加';
if($act=='edit') $title3='修改';


require_once HERE_ROOT.'mod_common/tpl_header.php';
?>

 <div class="page-title-box">
                    <h4 class="page-title">
                    <?php echo $title2?> 
      <span style="font-size:14px"> <?php echo $title3;?></span>

    </h4>
                
                    <div class="clearfix"></div>
                 </div>
                  <!--End Page Title-->          
           
           
                  <!--Start row-->
                  <div class="row">
                    <div class="col-md-12">
                       <div class="white-box">



  <div class="contenttop">

 
 <?php
  if($file=='list'){?>
    <a href='<?php echo $jumpv.'&file=addedit&act=add';?>'><i class="fa fa-plus-circle"></i> 添加字段</a>
<?php
  }
 
  if($file<>'list'){
    ?>
 
  <?php 
  }
?>
</div>


<?php


  require_once HERE_ROOT.'mod_form/tpl_field_'.$file.'.php'; 	 
?>
</div></div></div>
<?php
require_once HERE_ROOT.'mod_common/tpl_footer.php';
?>
 