<?php
/*
	power by JASON.ZHANG  DM建站  www.demososo.com
*/
if(!defined('IN_DEMOSOSO')) {
	exit('this is wrong page,please back to homepage');
}
?>

<?php
 $jumpvback=$jumpv.'&catpid='.$catpid.'&catid='.$catid;
 $jumpvback_insert=$jumpvback.'&act=insert';
 
 

 
if(!ifhaspidname2(TABLE_CATE,$catpid)) {  echo '主类不存在';exit;  }
if(!ifhaspidname2(TABLE_CATE,$catid)) {  echo '父类不存在';exit;  }

	if($act=='insert'){ 
			 
    $pidname = 'node'.$bshou; 
     $sta_noaccess='n';
     if($user_stanoaccess=='y' && $usertype=='normal')  $sta_noaccess='y';
    
    if($catid=='') $catid=$catpid;
	 //also must set pidmulti value when add node
      $ss = "insert into ".TABLE_NODE." (ppid,pid,pidmulti,pidname,pbh,title,lang,arr_can,sta_noaccess,dateedit,pos) values ('$catpid','$catid','$catid','$pidname','$user2510','$abc1','".LANG."','$arr_nodeV','$sta_noaccess','$dateall',5000)";
      //echo $ss;exit;
      iquery($ss);

    
			echo '<p style="padding:100px;text-align:center">添加成功！';

		 
			echo '<br /><a href="'.$jumpvback.'" style="font-size:18px">继续添加</a></p>';
			  
	}

  

else	{
 
  $ppidnamev = get_field(TABLE_CATE,'name',$catpid,'pidname');

  if($catid=='') $pidnamev = '同主类';
  else $pidnamev = get_field(TABLE_CATE,'name',$catid,'pidname');

  

  ?>
<form  onsubmit="javascript:return checkhere(this)" action="<?php  echo $jumpvback_insert;?>" method="post" enctype="multipart/form-data">
<table class="formtab">

<tr>
    <td width="12%" class="tr">主类：</td>
    <td width="88%"> 
            <?php echo $ppidnamev; ?>

     </td>
  </tr>

 

<tr>
    <td width="20%" class="tr">父级：</td>
    <td width="78%"> 
            <?php echo $pidnamev; ?>

     </td>
  </tr>

 

  <tr>
    <td  class="tr">标题：</td>
    <td><input name="name" type="text"  value="" class="form-control" />
     </td>
  </tr>


 
  
 
  <tr>
    <td></td>
    <td> 
  <br /><br />
    <input class="mysubmit" type="submit" name="Submit" value="添加内容"></td>
  </tr>
 </table>
</form>

<script>
function  checkhere(thisForm){
		if (thisForm.name.value==""){
		alert("请输入标题");
		thisForm.name.focus();
		return (false); 
		
}
}
 </script>
 


<?php 
}
?>

 
