<?php
/*
  欢迎使用DM企业建站系统，本系统由www.demososo.com开发。
*/
if(!defined('IN_DEMOSOSO')) {
  exit('this is wrong page,please back to homepage');
}


?>


 <div class="contenttop">            
   <a href="<?php echo $jumpv?>&file=add&act=add"><i class="fa fa-plus-circle"></i> 添加模板</a>
 </div>

 
 <div style="background: #bbdbfb;height: 35px;margin:15px 0;padding:5px">
 <span style="color:red">正在启用的模板：</span>
 </div>
 <ul class="stylegrid gridimghover">

<?php 

$sql = "SELECT * from ".TABLE_STYLE." where $noandlangbh and pidname='$curstyle' and pid='0' order by pos desc,pidname desc,id desc limit 1";
   //echo $sql;
$row = getrow($sql);
 if($row=='no') echo $norr2;
else{

   $kv=$row['kv'];
   $title=$row['title']; 
   $pidnamecur=$row['pidname'];
    $htmldir=$row['htmldir']; 
    $style_blockid=$row['style_blockid']; 
    
    $mbhome=$mbhomemob='';
$bscntarr = explode('==#==',$style_blockid);

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



$kv = '<img src='.get_img($kv, '', '').' alt="" width="200" height="200" />';


  $edit = '<a  class="but1"   href="'.$jumpv.'&pidname='.$pidnamecur.'&file=edit_can&act=edit">修改</a>';
 
?>

<li style="height: auto;width:96%">
<div class="img fl col-md-3">
 <?php
echo '<a href="'.BASEURLPATH.'"  target="_blank">'.$kv.'<br />预览模板</a>';



?>
</div>

<div class="img fl tl col-md-9">

<h3 style="font-size:16px;font-weight:bold"><?php echo $title;?></h3>
<div class="cgray" style="padding:5px 0"><?php echo $pidnamecur;?></div>
<div  style="padding:5px 0;line-height:22px">
 模板目录: <strong class="cblue">DMYI-template/<?php echo $htmldir;
 
 if(!is_dir(TPLCURROOT)) {
   echo '<p class="cred">模板目录不存在。 </p>';
 }
 
 ?></strong>
 
  </div>
 

<div class="edit"  style="height:30px">
 <?php 
  echo $edit;  
 echo  ' <a  class="but1"   href="'.$jumpv.'&pidname='.$pidnamecur.'&file=edit_newcssfile&act=edit">修改样式css</a>';
  ?>
   
     
</div>
 
 <div class="daoregion">
   
   <?php 
      if(is_dir(TPLCURROOT.'block/home')){
         echo  '<a href="mod_style_daoregion.php?lang='.LANG.'">把block/home里的文件 导入到 页面区域</a>';
      }

   ?>
 </div>
 

</div> 

</li>


<?php
}


?>
 
 
 </ul>
 
<div class="c"> </div>
 <div style="background: #bbdbfb;height: 35px;margin:15px 0;padding:5px">其他模板：</div>
<?php
$sql = "SELECT * from ".TABLE_STYLE." where $noandlangbh and pidname<>'$curstyle' and pid='0' order by pos desc,id desc";
   //echo $sql;
$rowlist = getall($sql);
 if($rowlist=='no') echo $norr2;
else{
?>
<form method=post action="<?php echo $jumpv;?>&act=pos">
<ul class="mblist gridimghover">

<?php

foreach($rowlist as $vcat){
   $tid=$vcat['id']; $title=$vcat['title']; 
   $pidnamecur=$vcat['pidname']; $style_blockid=$vcat['style_blockid']; 
    $htmldir=$vcat['htmldir'];  
// if($pidname==$pidnamecur) $curclass=' style="color:#fff;background:red;padding:3px;" ';
// else $curclass=' ';
$mbhome=$mbhomemob='';
$bscntarr = explode('==#==',$style_blockid);

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


   $edit = ' &nbsp; &nbsp; <a  class="but1" target="_blank"  href="'.$jumpv.'&pidname='.$pidnamecur.'&file=edit_can&act=edit">修改</a>';


$js_back = $jumpv.'&pidname='.$pidnamecur;
$activatestyle = "<a href=javascript:confirmaction('activatestyle','nodel','$js_back','确定启用这个模板？这会直接影响前台效果！')  class=but2>启用模板</a>";


$kv=$vcat['kv'];
 //$imgsmall2 = p2030_imgyt($kv, 'y', 'n');
$kv = '<img src='.get_img($kv, '', '').' alt="" width="200" height="200" />';


 ?>
<li> 

<p class="title fb"><?php echo $title;?></p>
 

<?php 
  echo $kv;
?>
 <p> 模板目录: <strong class="cblue"><?php echo $htmldir;?></strong></p>

<p><?php echo $pidnamecur;?></p>
<div style="height:30px">
<?php  
 echo $activatestyle; 
 // echo $edit; //no edit when not currrent
  ?>
  </div>


  <div style="height:30px">
排序号：<input type="text" name="<?php echo $tid;?>"  value="<?php echo $vcat['pos'];?>" size="5" />
</div>

 
 
</li>
<?php 
} 
?>
 </ul>
 <div class="c"></div>
<div class="tc" style="padding-bottom:22px"><input class="mysubmit" type="submit" name="Submit" value="排序" />
<br />
<?php echo $sortid_desc?></div>
</form>
<?php }?>

 


</div>
<div class="c"></div>

