<?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;}

$arrcanexcerpt = [];

 $bscnt22 = '';
 if(count($_POST)>1){
         foreach ($_POST as  $k=>$v) {
           if(strtolower($k)=='submit') break;if(strtolower($k)=='inputmust') break;
           if(in_array($k,$arrcanexcerpt))   continue;
           $bscnt22 .= $k.':##'.zbdesp_onlyinsert(trim($v)).'==#==';

         }
     }
      $bscnt22 = substr($bscnt22,0,-5);


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



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

	$sql = "SELECT * from  $tablename  where pidname='header' and pid = 'header' $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 ('header','header','$user2510','','".LANG."','$arr_cfg','')"; 
iquery($ss);
 
  jump($jumpv);

}

$jtimg = $row['jtimg'];$jtimg2 = $row['jtimg2'];$jtimg3 = $row['jtimg3'];$jtimg4 = $row['jtimg4'];

$arr_cfg=zbdesp_imgpath($row['arr_cfg']);   //echo $arr_cfg;
$bscntarr = explode('==#==',$arr_cfg);
     if(count($bscntarr)>1){
          foreach ($bscntarr as   $bsvalue) {
             if(strpos($bsvalue, ':##')){
               $bsvaluearr = explode(':##',$bsvalue);
               $bsccc = $bsvaluearr[0];
               $$bsccc=$bsvaluearr[1];
             }
          }
      }

  
 //$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">



<td colspan="2" class="trbg">图片 </td></tr>

<?php

$pidnamehere = 'header';
 
require_once HERE_ROOT.'mod_jt_region/plugin_region_image.php';
?>

<td colspan="2" class="trbg">内容 </td></tr>

<?php 
 for ($i=1; $i < 7; $i++) { 
   $tit = '内容'.$i.'： (jttext'.$i.')'; 
   $text = 'jttext'.$i;


?>
<tr>
<td  class="tr"><?echo $tit?></td>
 <td >
  <textarea name = "<?php echo $text?>" cols="50" rows="3" style="width:100%"><?php echo $$text?></textarea>
 </td>
</tr>
<?php 
 }
 ?>





<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>
