<?php  
foreach ($rowall as $k=>$v) {  
 
$bgcolor=$bgimg='';
$bgrepeat= 'no-repeat';
$bgposi= 'center center';
$bgsize= 'cover';
$bgattach = 'fixed';
$stylev= '';
$titlefg = 'notitle';
$reganchor= $cssname = $dmpadT = $dmpadB ='';
 
$arr_cfg = web_despdecode($v['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];
         }
      }
  }
//pre($bscntarr);


$pidnamehere=$v['pidname'];
$pid=$v['pid'];$tid=$v['id'];
 $effect = $v['effect'];

$cssstyle1 = $cssstyle2 = '';
if($dmpadT<>'') $cssstyle1 = 'padding-top:'.$dmpadT.'px;';
if($dmpadB<>'') $cssstyle2 = 'padding-bottom:'.$dmpadB.'px;';

$cssstyle = $cssstyle1.$cssstyle2.$cssstyle;


if($cssstyle<>'' || $bgcolor<>'' || $bgimg<>''){
 $stylebg = regionbg($bgcolor,$bgimg,$bgrepeat,$bgposi,$bgsize,$bgattach);
 if($cssstyle=='')   $stylev =  'style = "'.$stylebg.'"';
  else $stylev =  'style = "'.$stylebg.' '.$cssstyle.'"';
}
    if($bgimg<>'') $cssname = $cssname.' dmbgimg';

$anchorv = $reganchor==''?'region'.$tid:$reganchor;
//-------------
 ?>


<?php // class  block is for js or hover edit link
$wowtop = '';
$haswow = '';
if($haswow=='y') $wowtop = ' wow fadeInUp'; 

 
  $sql = "SELECT * from  jtregion  where pid='$pidnamehere' $andlangbh order by id limit 1";
 // echo $sql;
  $row = dbgetrow($sql);
  if($row=='no'){
 
        if(MAINLANG==LANG) $row = [];
        else{
                 $sql = "SELECT * from  jtregion  where pid='$pidnamehere' and lang='".MAINLANG."' order by id limit 1";
                  // echo $sql;
                  $row = dbgetrow($sql);
                  if($row=='no') $row = [];



        }
  }
//pre($row);

$v = $row;

  $title = web_despdecode($v['title']);
  $despjj = web_despdecode($v['despjj']); 
   $jtimg = $v['jtimg']; $jtimg1 = $v['jtimg1']; $jtimg2 = $v['jtimg2']; $jtimg3 = $v['jtimg3']; $jtimg4 = $v['jtimg4'];
   $cateid = $v['cateid'];
$blockid = $v['blockid'];
 
$arr_cfg = web_despdecode($v['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];
         }
      }
  }
//pre($bscntarr);



echo '<div id="'.$anchorv.'" class="jtregionbox '.$cssname.$wowtop.'" '.$stylev.'>';
if(dmlogin())  dmeditlink('home',$pidnamehere,'jtregion');  
 
             
              $file = TPLCURROOT.'block/home/'.$effect;
              if(checkfile($file))  require  $file; 

echo '</div>';
 
	//------------------------ 
}


?>