<?php
/*
	power by JASON.ZHANG  DM建站  www.demososo.com
*/
if(!defined('IN_DEMOSOSO')) {
	exit('this is wrong page,please back to homepage');
}


 if($act=='update'){


//pre($_POST);
 
 
   if(@$_POST['inputmust']=='') {echo $inputmusterror.$backlist;exit;}

  $bscnt22 = '';
  if(count($_POST)>1){
          foreach ($_POST as  $k=>$v) {
            if(strtolower($k)=='submit') break;if(strtolower($k)=='inputmust') break;
            $bscnt22 .= $k.':##'.htmlentitdm(trim($v)).'==#==';
             
          }
      }
       $bscnt22 = substr($bscnt22,0,-5);
 

     $ss = "update ".TABLE_PAGE." set arr_can='$bscnt22'  where id='$tid' $andlangbh limit 1";

	 // echo $ss;exit;
	 	iquery($ss);
  
	jump($jumpv_back);
 }
 else
 {

  $detail_albumid = $detail_videoid =$detail_musicid =$downloadtitle =$downloadurl =$linkmoretitle =$linkmore ='';
 
  $sql = "SELECT arr_can,pidname from ".TABLE_PAGE."  where  id='$tid' $andlangbh   order by id limit 1";
$row = getrow($sql);
 
 

$arr_can=$row['arr_can'];

  $pidname =$row['pidname'];
  $alias= alias($pidname,'page');

 $bannerfile = $bannerimg = $bannertitle = '';

$pagebz1 = $pagebz2 = $pagebz3 = $pagebz4 = $pagebz5 = $pagebz6 = '';

$bscntarr = explode('==#==',$arr_can); 
//pre($bscntarr);

     if(count($bscntarr)>1){
          foreach ($bscntarr as   $bsvalue) {
             if(strpos($bsvalue, ':##')){
               $bsvaluearr = explode(':##',$bsvalue);
               $bsccc = $bsvaluearr[0];
               $$bsccc=$bsvaluearr[1];
             }
          }
      }
    
?>
  <form  action="<?php echo $jumpv_file; ?>&act=update" method="post" enctype="multipart/form-data">

<div style="background:#e2e2e2;padding:10px;font-size:16px;font-weight:bold">其他参数：</div> 
 
  <table class="formtab" >
 
 
 <tr>
    <td class="tr" width="20%">模板文件：
    
    </td>
    <td >
      <?php
$dir = tpllayoutdir().'page/';

if(!is_dir($dir)){
  $filearr = [];
  $filedir_name = tpllayoutdir_name().'page/ 不存在。';
}else{
   $filearr = getFile($dir);
   $filedir_name = tpllayoutdir_name().'page/';
}

//pre($filearr);
 //------------

if($alias=='index') {
     echo '首页的模板文件为 tpl_index.php';
}else{


if($mbfile=='') echo '<p style="color:red">请选择模板文件</p>';
 echo  '<select name="mbfile">';
 //if($sysblockfolder=='mobi') echo '<option value="usepc">使用pc端选择</option>';

  // $selectjcgg = $template == 'jcgg'?' selected= "selected" ':'';
  // if($typepagetemplate<>'common')  echo ' <option '.$selectjcgg.'  value="jcgg">继承公共布局的选择</option>';


echo '<option value="">请选择</option>';

  foreach ($filearr as $v){
           if($mbfile==$v) $select=' selected '; else $select='';

           if($v<>'tpl_index.php')   echo '<option '.$select.'value="'.$v.'">'.$v.'</option>' ;

    }


//  select_from_arr2($filearr,$template,'');
 //echo '<option value="hide">隐藏hide</option>';
 echo '</select>';

}


 ?>
 <p class="cgray">文件目录：   <?php echo $filedir_name;?></p>   
 <div class="c20"> </div>
 
      </td>
  </tr>


<?php 
  require_once HERE_ROOT.'mod_page/plugin_page_banner.php';
?>

 


    <tr>
    <td class="tr" width="20%">资料下载的链接：
    <br />
    <?php echo $xz_maybe;?>
    </td>
    <td >
    字样：
    <input name="downloadtitle" type="text"  value="<?php echo $downloadtitle;?>" size="35" />
    <br /> 
    链接：
    <input name="downloadurl" type="text"  value="<?php echo $downloadurl;?>" class="form-control" /> 
  
  
    <br /><?php echo $text_outlink;?>
      </td>
  </tr>
   
 
  <tr>
    <td class="tr" width="20%">查看全文的链接：
    <br />
    <?php echo $xz_maybe;?>
    </td>
    <td >
    字样：
    <input name="linkmoretitle" type="text"  value="<?php echo $linkmoretitle;?>" size="35" /> 
    <br /> 
    链接：
    <input name="linkmore" type="text"  value="<?php echo $linkmore;?>" class="form-control" /> 
  
  
    <br /><?php echo $text_outlink;?>
      </td>
  </tr>

 <tr>
   <td width="12%" class="tr">备注：</td>
   <td width="88%"> 
                备注1：<input name="pagebz1" type="text"   value="<?php echo $pagebz1; ?>" size="30"  />(pagebz1)
                <?php echo $xz_maybe; ?> 
                   <div class="c5"> </div>
                 备注2：<input name="pagebz2" type="text"   value="<?php echo $pagebz2; ?>" size="30"  /><?php echo $xz_maybe; ?> 
                     <div class="c5"> </div>
                 备注3：<input name="pagebz3" type="text"   value="<?php echo $pagebz3; ?>" size="30"  /><?php echo $xz_maybe; ?> 

            </td>
        </tr>
 
  <?php 
//require_once HERE_ROOT.'mod_page/plugin_page_inc_can.php';
?>


</table>


    

  

<div class="c tc"> 
 
 <input class="mysubmit"     type="submit" name="Submit" value="提交" /> 
     
<?php echo $inputmust;?>
 </div>

 </form>
<?php
  }
  ?>
  
 