<?php
/*  欢迎使用DM企业建站系统，本系统由www.demososo.com开发。
*/

echo 'no use...';
exit;


require_once '../config_a/common.inc2010.php';
$switchlanglink = 'mod_jt_region/mod_jttext.php?file=edit&pid='.$pid.'&pidfile='.$pidfile;

//mod_jt_region/mod_jttext.php?lang=cn&file=edit&pid=jthome_homepart&pidfile=aboutus

ifhave_lang(LANG);//TEST if have lang,if no ,then jump
$menuactive_block = 'nav-active';


//$jump = BASEURL.'dmpostform.php?type=editjtmbsqlite&pidname='.$pidname.'&pidname2='.$pidname2.'&lang='.LANG;

 //$jumpsidebar = BASEURL.'dmpostform.php?type=editjtmbsqlite&pidname2='.$pidname2.'&lang='.LANG;

 
$title = '编辑文件区块';

$tablename = TABLE_JTTEXT;
$tablename2 =  TABLE_JTTEXT;
//echo $ppid;

 if($act <> "pos") zb_insert($_POST);


$filearr =  array("add","edit","edit_filename","list","add",);
if(!in_array($file,$filearr))   {
  echo 'file is error.';exit;
}

 //like pid=sys&pidname=aboutus
$jumpvinit = '../mod_jt_region/mod_jttext.php?lang='.LANG;
$jumpv = $jumpvinit.'&pidfile='.$pidfile;
$jumpvf = $jumpvinit.'&pidfile='.$pidfile;
 
$jumpinit_pf = $jumpvinit.'&pidname='.$pidname.'&file='.$file;
 
 
 $jumpv2 = '../mod_jt_region/mod_jttext_list.php?lang='.LANG;


//------------------
 


//-----------------------
if($act == "del---00")
{
 

   $sql = "SELECT * from $tablename  where pid='$pidname'  order by id";
    //echo $sql;exit;
   $rowall = getall($sql);
   if($rowall<>'no'){
          foreach ($rowall as $k => $v) {   
                  $blockimg = $v['jtimg'];
                  $blockimg2 = $v['jtimg2'];
                  $blockimg3 = $v['jtimg3'];
                  $blockimg4 = $v['jtimg4'];           
               
                  if($blockimg<>'')   p2030_delimg($blockimg,'y','n');
                  if($blockimg2<>'')  p2030_delimg($blockimg2,'y','n');
                  if($blockimg3<>'')  p2030_delimg($blockimg3,'y','n');
                  if($blockimg4<>'')  p2030_delimg($blockimg4,'y','n'); 

                    $tid = $v['id'];
                   $ss2 = "delete from $tablename  where id='$tid' ";

                    iquery($ss2);

     }  

   }

     
     $ss = "delete from $tablename  where pidname='$pidname'";
    // echo $ss;
       // iquery($ss);
        jump($jumpv); 
}

 

//-----------

 //if($file =='add' || $act =='insert') require_once HERE_ROOT.'mod_common/tpl_header_iframe.php';
//else require_once HERE_ROOT.'mod_common/tpl_header.php';

if($file =='edit_filename') require_once HERE_ROOT.'mod_common/tpl_header_iframe.php';
else require_once HERE_ROOT.'mod_common/tpl_header.php';
  
?>

 <div class="page-title-box">

  <?php 
    if($file <> 'edit_filename'){
  ?>
                    <h4 class="page-title"> 
                    <?php 
                         echo $title;   

                         
                         $arr = explode('/', $pidfile);
                         if(substr($pidfile,0,13)=='jthome_effect'){

                              $jumpv2 = $jumpv2.'&pidfile='.$arr[1].'/';
                         }

                    ?>
                      
                      <a href="<?php echo $jumpv2?>" style="font-size: 18px ">管理列表</a>
                    </h4>
             <?php } 
             ?>      
                    <div class="clearfix"></div>
                 </div>
                  <!--End Page Title-->          
           
           
                  <!--Start row-->
                  <div class="row">
                    <div class="col-md-12">
                       <div class="white-box">

 

        <?php
         
         if($file=='list') $file = 'edit';

     
          require_once HERE_ROOT.'mod_jt_region/tpl_text_'.$file.'.php';

        ?>
 </div> </div> </div>
<?php
 //if($file =='add' || $act =='insert') require_once HERE_ROOT.'mod_common/tpl_footer_iframe.php';
//else require_once HERE_ROOT.'mod_common/tpl_footer.php';

 
if($file =='edit_filename') require_once HERE_ROOT.'mod_common/tpl_footer_iframe.php';
else require_once HERE_ROOT.'mod_common/tpl_footer.php';