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

$updatev = 'y';
$langpathv =$domanv ='';   
if($abc3<>''){
      $sql = "SELECT id from ".TABLE_LANG." where langpath='$abc3' and id<>'$tid' order by id desc";
      $num = getnum($sql);             
      if($num>0)   { 
        alert('出错，后缀重复。');
        $updatev = 'n';
      }
      else  $langpathv =" ,langpath='$abc3' ";  
} else  $langpathv =" ,langpath='' ";  

if($abc4<>''){
  $sql = "SELECT id from ".TABLE_LANG." where domain='$abc4' and id<>'$tid' order by id desc";
  $num = getnum($sql);             
  if($num>0)   {
    alert('出错，域名重复。');
    $updatev = 'n';
  }
  else  $domanv =" ,domain='$abc4' ";  
}
else  $domanv =" ,domain='' ";

  if($updatev =='y')    { 

  

$arrcanexcerpt =  array("sitename","name","langpath","domain","procatpid");

$bscnt22 = '';
if(count($_POST)>1){
      foreach ($_POST as  $k=>$v) {
         if(strtolower($k)=='submit') break;if(strtolower($k)=='inputmust') break;
         if(substr($k,0,6)=='trline') break;

        if(in_array($k,$arrcanexcerpt))   continue;

        $bscnt22 .= $k.':##'.htmlentitdm(trim($v)).'==#==';

      }
  }
   $bscnt22 = substr($bscnt22,0,-5);



     $ss = "update ".TABLE_LANG." set  sitename='$abc1',name='$abc2',arr_font='$bscnt22',procatpid='$abc5' $langpathv $domanv  where  pbh='".USERBH."' and id='$tid' limit 1";
       // echo $ss;exit;
       iquery($ss);
           //alert("修改成功");
  }
 jump($jump_back);   

}

else{

 $sql = "SELECT * from ".TABLE_LANG."  where  id='$tid' and pbh='".USERBH."'    order by id limit 1"; 
 
$row = getrow($sql);
//pre($row);
   
    $langpath=$row['langpath']; 
    $domain=$row['domain']; 
   $langhere =  $lang=$row['lang']; 
     $sitenamehere = $sitename=$row['sitename'];   $name=$row['name']; 
     $linkfont = $sitecss = '';

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

    

  
 
    $jump_insert=$jumpv_file.'&act=update&tid='.$tid; 
 
 
?> 


<div class="blocklist fl col-xs-12 col-sm-12  col-md-2">
<h3>请选择</h3>  
    <?php 
       require_once HERE_ROOT.'mod_basic/plugin_textcfg_sidebar.php';
       ?>
</div>

<div class="fl col-xs-12 col-sm-12  col-md-10">

<h2 style="font-size:14px">正在编辑：<?php echo $sitenamehere?> ( <span class="cred"><?php echo $langhere?></span> )</h2>
 

<form  onsubmit="javascript:return checkhere(this)" action="<?php echo $jump_insert;?>" method="post">
  <table class="formtab">
 
  
    
 <tr>
      <td class="tr">网站名称：</td>
      <td>

       <input  type="text"  class="form-control"  name="sitename" value="<?php echo $sitename;?>" /><?php echo $xz_must;?>
        </td>
    </tr>
 <tr>
      <td class="tr">国旗名称：</td>
      <td>

       <input  type="text"  class="form-control"  name="name" value="<?php echo $name;?>" /><?php echo $xz_maybe;?>
        </td>
    </tr>


  <tr>
      <td class="tr">多语言的后缀：
     <?php
      
      if(SITEIDBYDOMAIN=='y') echo '<br/><span style="color:red">(未启用)</span>';

    
     ?> 
      </td>
      <td> <input name="langpath" type="text" value="<?php echo $langpath?>" class="form-control" />
<p class="cgray">
(  
  后缀可以修改， <br />
比如www.yoursite.com/<span class="cred">en</span> 还是 www.yoursite.com/<span class="cred">english</span>
)
</p>
        </td>
    </tr>
 
    <tr>
      <td class="tr">多站点的域名：
      <?php
     
      if(SITEIDBYDOMAIN<>'y') echo '<br/><span style="color:red">(未启用)</span>';

      
     ?>
     </td>
      <td> <input name="domain" type="text" value="<?php echo $domain?>" class="form-control" />
    <p class="cgray">不要带http</p>
        </td>
    </tr>
<!--关联产品主分类标识 no use-->
 <tr style="display: none">
      <td class="tr">关联产品主分类标识： 
     </td>
      <td> <input name="procatpid" type="text" value="<?php echo $procatpid?>" size="35" /> <?php echo $xz_maybe;?>
        <br />

        <?php 
            if($procatpid<>'') echo get_fieldnolang(TABLE_CATE,'name',$procatpid,'pidname');
        ?>
 
        </td>
    </tr>

    <tr>
      <td class="tr">link字体：  
     </td>
      <td> <input name="linkfont" type="text" value="<?php echo $linkfont?>" class="form-control" /> 
        <p class="cgray">比如谷歌字体： https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap</p>
 
        </td>
    </tr>


    <tr>
      <td class="tr">网站css： 
     </td>
      <td> <textarea name="sitecss" cols="110" rows="8"><?php echo $sitecss?></textarea> 
         
    <p style="margin-top:10px">
    <pre>比如：
    body { font-family:font-family:微软雅黑;}

    使用谷歌字体： body{font-family:roboto}

    </pre>
    
    </p>
        <?php 


          //  if($sitefont<>'') echo  '<p style="padding:10px;font-size:16px;font-family:'.$sitefont.'">字体预览： 山不在高，有仙则灵。 font view, welcome you.are you ok? I  am fine , and you?</p> ';
        ?>
 
        </td>
    </tr>


<tr>
      <td class="tr">语言标识：</td>
      <td>  <?php echo $lang?>  (标识不能修改)
        </td>
    </tr>
 
 


<tr>
      <td></td>
      <td>
      <input  class="mysubmit" type="submit" name="Submit" value="提交"></td>
    </tr>
  </table>
</form>
 </div>
 <div class="c"></div>
  
<?php } ?>
 
<script>
function  checkhere(thisForm){
   
  if ($.trim(thisForm.sitename.value)==""){
          alert("请输入网站名称");
          thisForm.sitename.focus();
          return (false);
        }
  
    
}

</script>


