<?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');

 
$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

if(is_dir(TPLCURROOT.'tpl/layout/')){
   $filedir = TPLCURROOT.'tpl/layout/page/';
   $filedir_name = HTMLDIR.'/tpl/layout/page/';
}
else{
   $filedir = BLOCKROOT.'tpl/layout/page/';
   $filedir_name = 'DM-block/tpl/layout/page/';
}

//echo $filedir;
if(is_dir($filedir)){
  $filearr = getFile($filedir);
 // $filearr = array_merge($filearr2,$filearr);

}

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



  <?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
  }
  ?>
  
 