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

//

?>


 <form method=post action="<?php echo $jumpv;?>&act=pos">
 <table class="formtab formtabhovertr">
<tr style="background:#B3C0E0">
<td  align="center">排序号</td>
<td>标题</td>
 <td align="center">效果文件</td> 
 
  <td align="center"> cssname</td> 
   <td align="center">样式 </td> 
   <td align="center">textstyle </td> 
<td align="center">修改</td>
<td align="center">删除</td>
<td align="center">状态</td>
<td align="center">锚点</td>
</tr>
<?php

 $sql = "SELECT * from $tablename  where    pid='$pid' order by pos desc,id";
 // echo $sql;
 $rowlist = getall($sql);
if($rowlist=='no') {
  echo '暂无内容<br /><br />';
  
      $homeconfig = TPLCURROOT.'homeconfig.php';
      if(is_file($homeconfig)){
   
       //  echo '<a class="needpopup" href="'.$jumpv.'&file=add_dao"><i class="fa fa-plus-circle"></i> 导入homeconfig</a><br /><br /><br />';
         
      } 

} 
else{
foreach($rowlist as $v){
  // pre($v);
$pidnamehere=$v['pidname'];
$name=$v['name']; $format=$v['format'];
$tid=$v['id'];

 $kv = $v['kv'];
$sta_visi_v=$v['sta_visible']; 
$textstyle=$v['textstyle']; 
 
menu_changesta($sta_visi_v,$jumpv,$tid,'sta');

 $reganchor = $blockid =  '';
$effect=$v['effect']; 

$cssname = $cssstyle = $reganchor =  $dmpadT  = $dmpadB = '';


$arr_cfg=$v['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];
             }
          }
      }



 $jsname = jsdelname($v['name']);




$editlink='<a class=but1   href='.$jumpv.'&file=editcan&tid='.$tid.'><i class="fa fa-pencil-square-o"></i> 页面设置</a> ';

 //$langedit='<a class=but1   href='.$jumpveditcnt.'&file=editlangcnt&pid='.$pidnamehere.'><i class="fa fa-pencil-square-o"></i> 内容管理</a> ';
 
$del_text= " <a href=javascript:del('del','$pidnamehere','$jumpv','$jsname')  class=but2><i class='fa fa-trash-o'></i> 删除</a>";

 // $movelink=' <a class=but3    href='.$jumpv.'&file=move&act=edit&tid='.$tid.'><i class="fa fa-files-o"></i> 复制</a>';
//no move function.

$numsubnode = num_subnode(TABLE_COLUMN,'pid',$pidname2);
if($numsubnode>0)   $del_text ='';

?>
<tr  <?php echo $tr_hide;?>>
 <td align="center">
 <input type="text" name="<?php echo $tid;?>"  value="<?php echo $v['pos'];?>" size="3" />
 </td>

 <td>

 <?php
     echo '<strong>'.$name.'</strong>';
     echo '  &nbsp;<span class="cgray">('.$pidnamehere.')</span>';

 ?>


  </td>
  
<td align="center">

  <?php 
    if($effect<>'') { 
  ?>
  <input style="background:#C2E8FF;padding:2px;height: 22px;line-height: 22px" onclick="this.select();document.execCommand('Copy');" type="text" value="<?php echo  $effect;?>" class="form-control">
<?php 
}
?>
    <?php

     

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

 if(is_file($file222)) {

          if(substr($effect,0,7)=='jthome_') {

           //  $arr22 = explode("/",$effect);
            //  $linkv= 'mod_jttext.php?lang='.LANG.'&pid='.$arr22[0].'&pidfile='.$arr22[1];

          }
          else{
           // $linkv= 'mod_jttext.php?lang='.LANG.'&pid='.$pid.'&pidfile='.$effect;

            }

   
        //  echo ' <a href="'.$linkv.'" target="_blank">编辑内容</a>';
  }
 else {
         echo '<br /><span class="cred">文件不存在</span>';
        }


?>
  </td>
 
<td align="center">
    <?php echo $cssname; ?>
  </td>
 <td align="center">
    <?php echo $cssstyle; ?>
  </td>
   <td align="center">
    <?php 
        if($textstyle<>''){
          echo '......'.substr($textstyle,0,20);
        }
      ?>
  </td>


  <td align="center">
  <?php
  echo $editlink;
  //echo $langedit;
  ?>
  
  </td>
   <td align="center">
    <?php  echo $del_text;  ?>
   </td>
   <td align="center"><?php echo $sta_visible;?></td>
  
 <td align="center">
   <?php
 if($reganchor=='') echo  'region'.$tid;
 else echo $reganchor;
 ?>
 </td>

 </tr>
 <?php
}
}
?>

	</table>
<div style="padding-bottom:22px;text-align:left">
<input class="mysubmit" type="submit" name="Submit" value="排序" />
<p><?php echo $sortid_asc?>
</p>
</div>
</form>
