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

 $despjj=zbdesp_onlyinsert($_POST['despjj']);
  $title=zbdesp_onlyinsert($_POST['title']);
 $blockid=htmlentitdm($_POST['blockid']); 
  $cateid=htmlentitdm($_POST['cateid']);
 
  $arrcanexcerpt =  array("despjj","title","cateid", "blockid");  //move top line

 $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);

echo $act2;

//usr linkcss,not use linkstyle
 $ss = "update  $tablename2 set  blockid='$blockid',cateid='$cateid',despjj='$despjj',title='$title',arr_cfg='$bscnt22' where   pid='$pidname' $andlangbh";
   // echo $ss;exit;
		 	iquery($ss);
			$jumpvp = $jumpvf.'&pidname='.$pidname;
     // echo $jumpvp;
		  jump($jumpvp);
 }



else
 {
	$jumpv_insert = $jumpvf.'&act=update&pidname='.$pidname;

	$sql = "SELECT * from  $tablename2  where pid='$pidname' $andlangbh order by id limit 1";
 // echo $sql;
$row = getrow($sql);
 
// pre($row);
if($row=='no') {

 
    
        // echo 'no record...,first add content in main lang.';
        echo '还没有相关 语言的内容，请<a href="'.$jumpv.'&file=addlangcnt&pidname='.$pidname.'">添加内容</a>';
         exit;
 

}

$name=$row['name'];


$bgcolor=$bgimg=$cssstyle='';
$bgrepeat= 'no-repeat';
$bgposi= 'center center';
$bgsize= 'cover';
$bgattach = '';
$reganchor = $dmpadT = $dmpadB ='';

$titlefg='notitle';

 
$pidnamehere = $row['pidname']; 

$cateid = $row['cateid'];
$effect = $row['effect'];
$blockid = $row['blockid'];
$jtimg = $row['jtimg'];$jtimg2 = $row['jtimg2'];$jtimg3 = $row['jtimg3'];$jtimg4 = $row['jtimg4'];

$linktitle = $linkurl = $listbtn =  $jtetext1 =  $jtetext2 =  $jtetext3 =  $jtetext4 =  $jtetext5 =  $jtetext6 =  '';
$testimg = 'n';
 $title = zbdesp_imgpath($row['title']); 

$despjj=zbdesp_imgpath($row['despjj']);

$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];
             }
          }
      }
 

?>

<?php
 // require_once HERE_ROOT.'mod_jt_region/tpl_region_inc_edittab.php';
  ?>


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

</div><!--end left-->

<div class="fl col-xs-12 col-sm-12  col-md-10">
<?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
 
require_once HERE_ROOT.'mod_jt_region/plugin_region_image.php';
?>

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

<?php
 
require_once HERE_ROOT.'mod_jt_region/plugin_region_editcnt.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>
