<?php
/*
	欢迎使用DM建站系统，网址：www.demososo.com
*/
if(!defined('IN_DEMOSOSO')) {
	exit('this is wrong page,please back to homepage');
}


if($act=='update'){

if(@$_POST['inputmust']=='') {echo $inputmusterror.$backlist;exit;}


 //$despcontent = zbdesp_onlyinsert($_POST['despcontent']);

 //$despjj=zbdespadd2($abc2);
 //gpc_add

 $menutext = $_POST['menutext'];

 $menutext=str_replace("'","d#y#h#",$menutext);
 $menutext=str_replace("..","d#..y#..h#..",$menutext);
 $menutext=str_replace("/","d/y/h/",$menutext); 

 //$menutext=zbdesp_onlyinsert($v);
 
//usr linkcss,not use linkstyle
 $ss = "update  $tablename set menutext='$menutext'  where  pid='menu' $andlangbh";
  //echo $ss;
  //exit;
   iquery($ss); 
  jump($jumpv);
 }



else
 {
	$jumpv_insert = $jumpv.'&act=update&pid='.$pid;

	$sql = "SELECT * from  $tablename  where pidname='jtmenu' and pid = 'menu' $andlangbh order by id limit 1";
$row = getrow($sql);
if($row=='no') {

	$arr_cfg = 'reganchor:##==#==cssname:##==#==cssstyle:##==#==dmpadT:##==#==dmpadB:##==#==bgcolor:##==#==bgimg:##==#==bgposi:##center center==#==bgattach:##fixed==#==bgrepeat:##no-repeat==#==bgsize:##cover==#==testimg:##n==#==listbtn:##==#==sta_width_cnt:##y==#==jttext1:##==#==jttext2:##==#==jttext3:##==#==jttext4:##==#==jttext5:##==#==jttext6:##==#==linktitle:##==#==linkurl:##';

$ss = "insert into $tablename (pid,pidname,pbh,name,lang,arr_cfg,menutext) values ('menu','jtmenu','$user2510','','".LANG."','$arr_cfg','')"; 
iquery($ss);
 
  jump($jumpv);

}

$menutext  = $row['menutext'];
   $menutext=str_replace("d#y#h#","'",$menutext);
  $menutext=str_replace("d#..y#..h#..","..",$menutext);
  $menutext=str_replace("d/y/h/","/",$menutext); 
 
 //$menutext = zbdesp_imgpath($v); 
 

?> 
<div class="col-xs-12 col-sm-12  col-md-12">
<?php
//require_once HERE_ROOT.'mod_jt_region/plugin_region_rgmenutab.php';
?>

<form  onsubmit="javascript:return checkhere(this)" action="<?php echo $jumpv_insert;?>" method="post">
  <table class="formtab">

<tr>
      <td  class="tr" width="200">菜单内容：</td>
      <td >   
        <textarea name="menutext" class="form-control" rows="30" style="font-size: 14px"><?php echo $menutext?></textarea>

     <p class="cred">建议把内容复制到本地编辑器修改，然后再复制过来。 <br />
     格式验证：  www.bejson.com/jsonviewernew </p>
        </td>
    </tr> 




<tr>
      <td></td>
      <td>
      <input  class="mysubmit" type="submit" name="Submit" value="提交"></td>
    </tr>
  </table>

    <?php echo $inputmust;?>

</form>
 </div><!--end right-->
 <div class="c"></div>
<?php
}
?>

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





   // return;

}


</script>
