<?php
/*	欢迎使用DM企业建站系统，本系统由www.demososo.com开发。
*/
require_once '../config_a/common.inc2010.php';
$switchlanglink = 'mod_jt_region/mod_region.php?pid=home';


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;

echo 'no use.........';
exit;

ifhave_sqlite();

$title = '复制到其他语言';

$tablename = 'jtregion';

//echo $ppid;

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

 
 

$jumpv='../mod_jt_region/mod_copyregion.php?lang='.LANG;
 
 
//------------------
 
 


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

 //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';

  require_once HERE_ROOT.'mod_common/tpl_header_iframe.php';
 
 if($act=='add'){
  
  $sourcelang = $abc1;
  if($sourcelang==''){
  	 alert('请选择语言');
  	 jump($jumpv);
  }else{


 $sqlsub = "SELECT * from ".TABLE_BLOCK."  where pidname='$pidname' $andlangbh order by id limit 1";
                //echo $sqlsub;exit;
              $v = getrow($sqlsub);
              if($v=='no')  { echo 'no block id by pidname'; exit; }
              else{
                  $arrkey = array_keys($v); 
               //   pre($arrkey);

                      $sqlkey = $sqlvalue= '';

                       foreach ($arrkey as $key => $value) {
                          // echo $value.'<br />';
                           //echo $v[$value].'<br />';

                          //echo htmlspecialchars($v[$value]).'<br />';

                           $sqlkey .= ','.$value;

                           //$vv = htmlspecialchars($v[$value]); //phpmyadmin need it
                           $vv =$v[$value];
                            $vv=str_replace("'","",$vv);
                            $vv=str_replace("\'","",$vv);

                             //echo $vv.'<br />';


                            if(!is_int($v[$value])) {
                               if($value=='name')  $vv  = '[复制区块]'.$vv; 
                               else if($value=='lang')  $vv  =  $sourcelang; 
                               else if($value=='pidname')  $vv  =  'vblock' . $bshou;; 
                                $vv = "'".$vv."'";
                            }

                           if($key<>0){                            
                               $sqlvalue .= ','.$vv;                 
                           } 
                          
                

                       }
                  $daokey = substr($sqlkey,4);
                  $daovalue = substr($sqlvalue,1); 

              }


$insert_sql= "insert into ".TABLE_BLOCK." ($daokey) values ($daovalue);";
//echo $insert_sql; exit;
 //iquery($insert_sql); 
 echo '<p style="padding:100px 0 5px 0;text-align:center;font-size:16px;">复制区块完成。</p>';
 echo '<p style="padding:10px 100px;text-align:center;font-size:16px;">复制语言为：'.$abc1.'</p>';

}
}
else{

?>

 <div class="page-title-box">
    <h4 class="page-title"> 复制到其他语言</h4>
   
    <div class="clearfix"></div>
 </div>
  <!--End Page Title-->          


  <!--Start row-->
<div class="row">
<div class="col-md-12">
   <div class="white-box">

 

        <?php

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

         
 //echo $pidname;

$arrlang = [];
 $sql = "SELECT * from ".TABLE_LANG." where pbh='".USERBH."' and  sta_visible='y' and lang<>'".LANG."' order by pos desc,id";
$arrlang = getall($sql);

$jumpvinsert = $jumpv.'&act=add';
//pre($arrlang);
   ?>
<form  action="<?php echo $jumpvinsert; ?>" method="post" enctype="multipart/form-data">
  
   复制 静态模板首页 到：

   <select name="copytolang">
   	 <option value="">请选择语言</option>
    <?php 

      foreach($arrlang as $v){ 
    ?>
   
    <option  value="<?php echo $v['lang']?>"><?php echo $v['lang']?> ( <?php echo $v['name']?> )</option>
   <?php 
 }

 ?>
   

  </select>
  <p>
   <input  class="mysubmit mysubmitbig" type="submit" name="Submit" value="提交" />

 </p>
</form>

 
 </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';

 
  require_once HERE_ROOT.'mod_common/tpl_footer_iframe.php';
 