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

//

?>
<?php 

     require_once HERE_ROOT.'mod_jt_region/tpl_text_searchinput.php';



  $pidfile = @htmlentitdm($_GET['pidfile']);
 

   $v = @trim($pidfile); //not secruity。
 
  $v=str_replace("<script","<-nojsscript->",$v);
  $v=str_replace("</script>","<-/nojsscript->",$v);
 
  $v = addslashes($v);  //stripslashes
 $pidfile = $v;


  //$keyV="   pid like '%{$pid}%' and " ;
 
   if($pidfile=='')  $keyV="  " ;
   else  $keyV="   and   pidfile like '%{$pidfile}%' " ;
 
//lang = '".JTTEXTLANG."'
 $sql = "SELECT * from $tablename  where  $noandlangbh $keyV   order by id desc";
 $total = getnum($sql);
  //   echo $sql;
 $rowlist = getall($sql);

 ?>
<div class="jtsearchlink"> 
<?php 
  if($pidfile<>'') {
?>

  关键字:     <span class="cblue"> <?php echo $pidfile?> </span>
<?php } ?>
 
       <div class="blocknav" style="padding-top:15px">


      搜索： 

      <?php 
       $jtblockarr = dmgetDir(BLOCKROOT.'jthome/jthome_effect/');
     //  pre($jtblockarr);

       ?>

<?php 
     
    $exarr = ['jtblock_zother','','oldbak---','z','zstatic','vendor'];
     foreach($jtblockarr as $v){
     
        if(in_array($v,$exarr)) continue;

     // if($v=='jtblock_zother' || $v=='') continue;

        if(is_file(BLOCKROOT.'jthome/'.$v.'/vv_noblock.php')) continue;
        if(is_file(BLOCKROOT.'jteffect/'.$v.'/vv_noblock.php')) continue;

       
       $stylev = '';

       $pidfile2 = substr($pidfile, 0,-1);
   
       $curv = $pidfile2==$v?' active':''; 

      // $num = numrecords(TABLE_JTTEXT,$v,'pidfile');

       $vvv = $v.'/';

        $sql = "select id from ".TABLE_JTTEXT." where pidfile like '%$vvv%' $andlangbh order by id";
        //echo $sql;
        $num = getnum($sql);

      
      $numv = $num==0?'':' <span class="num">('.$num.')</span>';

     $v2 = $v;
    //pre($arr_blockfolder);
    foreach($arr_blockfolder as $kk=>$vv){
        if($v == $kk) $v2= $vv;
    }




    $vlink = ' href="'.$jumpv.'&pidfile='.$v.'/"';
    //$vlink = ' target = "_blank" href = "http://dream.demososo.com/site6/dmlink-blockview-'.$v.'-1.html"';

       echo '<a class="'.$curv.'" '.$vlink.$stylev.' >'.$v2.$numv.'</a>  ';
}
?>

   </div> 
</div>
<style>
.jtsearchlink .w2{display: inline-block;margin-left:20px;}
.jtsearchlink .w2 a{display: inline-block;margin:2px 6px;padding:2px 6px;}
</style>
 <div style="padding:10px 0;color:#666"> 

  </div>
<?php
if($pidfile<>''){
      //  $linkview =  'dmlink-blockview-'.$ppid.'-1.html';
      $url = 'adminfrom.php?to=preview_all_jttext&tov='.$pidfile.'='.$langpath;
       // $url =  BASEURL.'adminfrom.php?to='.BASEURLPATH.$linkview;

      //  if(substr($ppid,0,7)=='jthome_')   {  }
      // else
         echo ' <a class="but4" target="_blank" href="'.BASEURL.$url.'">预览</a> &nbsp;&nbsp;';
  }   
     ?>


 <table class="formtab formtabhovertr"> 
<tr style="background:#B3C0E0">
 <td>pidname</td>
  <td align="left">后台标题</td> 
 <td align="left">文件 pidfile</td> 
 <td align="left">预览</td> 
 
 
 
<td align="center">修改</td>
<td align="center">删除</td>
 
</tr>
<?php

if($rowlist=='no') {
  echo '暂无内容<br /><br />';
  
    

} 
else{
foreach($rowlist as $v){
  // pre($v);
$pidnamehere=$v['pidname'];
$pidhere=$v['pid'];
$pidfile=$v['pidfile'];
 $name=$v['name'];

$editlink='<a class="but1" target="_blank"  href="'.$jumpv2.'&file=edit&pidfile='.$pidfile.'"><i class="fa fa-pencil-square-o"></i> 修改内容</a> ';

$editfile=' &nbsp; <a class="needpopup"  href="'.$jumpv2.'&pidname='.$pidnamehere.'&file=edit_filename"> 修改文件名</a> ';
 
 $jumpvdel = $jumpv.'&pidfile='.$pidfile;
$del_text= " <a href=javascript:del('del','$pidnamehere','$jumpvdel','')  class=but2><i class='fa fa-trash-o'></i> 删除</a>";



 //$file222 = dmget_jtfile($pidhere,$pidfile);
if(strpos('aa'.$pidfile,'/block/')>1){
    //if mb effect,only cur mb file will show.
   // $file222 = TEMPLATEROOT.$pidfile.'.php';
   // if(!is_file($file222))  continue;
  //echo $pidfile.'<br>'.HTMLDIR.'/ <BR>';
  //echo strpos($pidfile,HTMLDIR.'/');
  if(strpos('aa'.$pidfile,HTMLDIR.'/')==0 ) {
    $total = $total - 1;
    continue;
  }
}

 
?>
<tr>
 
   <td style="color:#999">  <?php  echo $pidnamehere;    ?>  </td>

    <td>  <?php  echo $name;    ?>  </td>

  
   <td>
 <?php
     echo '<span style="font-size:16px">'.$pidfile.'</span>';  
     echo $editfile;


   $file222 = dmget_jtfile($pidfile);
 
  if(!is_file($file222)) { echo  '<br /><span class="cred">文件不存在</span>';}
     

 ?>
 
  </td>
 
   <td class="tc">  <?php  echo  adm_previewlink($pidfile);  ?> </td>
   <td class="tc">  <?php  echo $editlink;   ?> </td>
  <td class="tc">  <?php  echo $del_text;   ?> </td>

 </tr>
 <?php
}
}
?>

	</table>
  