<?php
include("includes/db.inc.php");
include("includes/config.php");
$msql=new SHARP_SQL;
$fsql=new SHARP_SQL;
if(!isset($AUTOUSERID) || $AUTOUSERID=="" || $AUTOUSERID=="deleted"){
header("Location: log.php3?fm=modweb.php3");
}else{
$userid=$AUTOUSERID;
}
if($step=="2"){
    SetCookie("MOD", "$mod"); 
}
?><HTML><HEAD><TITLE></TITLE>



<META content="text/html; charset=big5" http-equiv=Content-Type>



<STYLE>HTML {TEXT-DECORATION: none}



A:link {COLOR: #000000; TEXT-DECORATION: underline}



A:hover {COLOR: rgb(0,147,43); TEXT-DECORATION: underline}



EM {FONT-FAMILY: CourierNew; FONT-SIZE: 16pt; FONT-STYLE: normal}



A {FONT-SIZE: 9pt}



TD {FONT-SIZE: 9pt}



P {



FONT-SIZE: 9pt



}



.hh input {background-color: #ffffff; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}



</STYLE>



</HEAD>



<BODY aLink=#000000 bgColor=#ffffff leftMargin=0 link=#000000 topMargin=0 vLink=#000000 marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr valign="bottom"> 
    <td height="27"><font color="#000000">■ 選擇網頁佈景</font></td>
  </tr>
  <tr bgcolor="#FF3300"> 
    <td height="1"><img src="images/dot.gif" width="22" height="1"></td>
  </tr>
  <tr valign="top"> 
    <td height="272"> <?php
if($step=="2"){
$msql->query("update auto_user set mod='$mod' where userid='$AUTOUSERID'");
 $msql->query("select exptime,urlname from auto_user where  userid='$AUTOUSERID'");
   if($msql->next_record()){
	$exptime=$msql->f('exptime');
	$urlname=$msql->f('urlname');

	$userid=$AUTOUSERID;
}


$fd=fopen("make.htm","r");
$con = fread($fd,10000);
fclose($fd);
$con=str_replace("&&&userid&&&",$userid,$con);
$con=str_replace("&&&ver_id&&&",time(),$con);
$con=str_replace("&&&mod&&&","$mod",$con);
$con=str_replace("&&&exptime&&&","$exptime",$con);
$fd=fopen("com/$urlname/index.php3","w");
fwrite($fd,$con,10000);
fclose($fd);
  chmod("com/$urlname/index.php3",0755);
?> <br>
      <form method="post" action="goto.php3" target=_blank>
        <div align="center">佈景選擇成功，請按以下按鈕更新網站：<br>
          <br>
          <input type="submit" name="Submit22" value="更新並預覽網站">
          <input type="hidden" name="userid" value="<?php echo "$AUTOUSERID"; ?>">
        </div>
      </form>
      <br>
      <?
exit;
}
?> </td>
  </tr>
</table>
</BODY></HTML>



