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


 $effect=htmlentitdm($_POST['effect']);
   $textstyle=zbdesp_onlyinsert($_POST['textstyle']);

  $arrcanexcerpt =  array("name",  "effect","blockid","textstyle");  //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);



//usr linkcss,not use linkstyle
 $ss = "update  $tablename set name='$abc1',textstyle='$textstyle',effect='$effect',arr_cfg='$bscnt22' where  id='$tid'";
   //echo $ss;exit;
			iquery($ss);
			$jumpvp = $jumpvf.'&act=edit&tid='.$tid;
		 	 jump($jumpvp);
 }



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

	$sql = "SELECT * from  $tablename  where id='$tid'  order by id limit 1";
$row = getrow($sql);
if($row=='no') {echo 'no record...';exit;}

$name=$row['name'];
$effect=$row['effect'];

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

$titlefg='notitle';

 
$pidnamehere = $row['pidname']; 
 
$cssname = $cssstyle = $reganchor = $bgcolor = $bgimg =  $dmpadT  = $dmpadB = '';

$textstyle=zbdesp_imgpath($row['textstyle']);  
$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.php';
?>

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

<div class="fl col-xs-12 col-sm-12  col-md-10">
 
<form  onsubmit="javascript:return checkhere(this)" action="<?php echo $jumpv_insert;?>" method="post">
   <table class="formtab">
    <tr>
      <td width="20%" class="tr">后台标题：</td>
      <td width="78%"> <input name="name" type="text" value="<?php echo $name?>" class="form-control" />
<?php echo $xz_must;?>
        </td>
    </tr>

      <tr>
      <td class="tr" valign="top">
       <span class="strongtext">效果文件：</span>
      </td>
      <td>
   <input name="effect" type="text" value="<?php echo $effect?>" size="35" />
 
 
    <?php 

      // if(substr($effect,0,6) == 'block/')  $file = TPLCURROOT.$effect.'.php';
      //  else $file = JTHOMEROOT.'jthome_homepart/'.$effect.'.php';

    //$file = TPLCURROOT.'block/'.$pid.'/'.$effect.'.php';
    
 $file222 = dmget_jtfile($effect);
 if(checkfile($file222))
{

}   
 

    // $filedir = TPLCURROOT.'block/home/';
    
    // echo $filedir;
    // echo $effect;
   //  if(is_dir($filedir))  $filearr = getFile($filedir); 
   //  else $filearr =  [];

    //  echo  '<select name="effect">';
   // if(sizeof($filearr2)==0) echo '<option value="nofile">'.$fileposi.' 目录下没有文件</option>';
   // else 
   // select_from_arr2($filearr,$effect,'');
     //select_from_filearr($filedir,$template);
    //select_from_filearr2($filedir,$filedirself,$template);
    //echo '</select>';
 

 ?>
 
</td>
    </tr>


    <tr>
      <td width="20%" class="tr">锚点：</td>
      <td width="78%"> <input name="reganchor" type="text" value="<?php echo $reganchor?>" size="35" />
<?php echo $xz_maybe;?>(主要用于单页面功能)
        </td>
    </tr>
  <tr style="background:#fcf6ee">
      <td class="tr">  <?php echo $text_cssname; ?></td>
      <td>  <input name="cssname" type="text" value="<?php echo $cssname?>" class="inputcss form-control" />
<?php echo $xz_maybe;?>
      </td>
      </tr>
 <tr style="background:#fff">
      <td class="tr">样式 </td>
      <td>
<input name="cssstyle" type="text" value="<?php echo $cssstyle?>"  class="inputcss form-control"  /> <?php echo $xz_maybe;?>
<span class="cgray">试下： margin-top:50px;</span>
  </td>
  </tr>

<tr  style="background:#fff">
      <td  class="tr"> 间距：</td>
      <td >   
       上：  <input name="dmpadT" type="text" value="<?php echo $dmpadT?>"  size="5" /> px &nbsp;&nbsp;
      下：  <input name="dmpadB" type="text" value="<?php echo $dmpadB?>"  size="5" /> px
     

     
        </td>
    </tr> 

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

 <tr>
<td  class="tr">自定义样式：(textstyle)

</td>
 <td >

  <textarea name = "textstyle" cols="50" rows="3" style="width:100%"><?php echo $textstyle?></textarea>
 </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>
