<?php
include("../../includes/db.inc.php");
include("../../includes/config.php");
$msql=new SHARP_SQL;
$fsql=new SHARP_SQL;
$msql->query("select * from auto_user where userid='$userid'");
if($msql->next_record()){
$urlname=$msql->f('urlname');
$sitename=$msql->f('sitename');
$ensitename=$msql->f('ensitename');
$name=$msql->f('name');
$email=$msql->f('email');
$tel=$msql->f('tel');
$fax=$msql->f('fax');
$addr=$msql->f('addr');
$zip=$msql->f('zip');
$bannerurl=$msql->f('bannerurl');
$size1=$msql->f('size1');
$size2=$msql->f('size2');
$mainmod=$msql->f('mainmod');
$intro=$msql->f('intro');
$code=$msql->f('code');
$intro=str_replace("\n","<br>",$intro);
}
?>

<HTML>

<HEAD><title><?php echo "$sitename"; ?></title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=big5">
<STYLE>HTML {TEXT-DECORATION: none}



A:link {COLOR: #000000; TEXT-DECORATION: none}
A:hover {COLOR: rgb(0,147,43); TEXT-DECORATION: none}
A:active {COLOR: #000000; TEXT-DECORATION: none}
A:visited {COLOR: #000000; TEXT-DECORATION: none}

EM {FONT-FAMILY: CourierNew; FONT-SIZE: 16pt; FONT-STYLE: normal}



A {FONT-SIZE: 9pt}



TD {FONT-SIZE: 9pt}



P {



FONT-SIZE: 9pt



}



<base href="../../mod/1/"></STYLE>
</HEAD>

<BODY LEFTMARGIN="0" MARGINWIDTH="0" TOPMARGIN="0" MARGINHEIGHT="0" bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<table cellpadding="0" cellspacing="0" border="0" align="center" width="656">
  <tr> 
    <td colspan="6"><img src="../mod/1/images/mod_0.gif" width="776" height="11"></td>
  </tr>
  <tr> 
    <td background="../mod/1/images/topbg.gif"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0" height="61">
        <tr valign="middle"> 
          <td width="26" height="61" align="left"><img src="../mod/1/images/mod_1.gif" width="26" height="61"></td>
          <td align="left" height="60"  background="../mod/1/images/top1.jpg" width="266"> 
            <div style="width: 275; font-size:<?php echo $size1; ?>pt; font-family: 細明體 ; color: white; position: relative; filter: glow(color=black, strength=3)"> 
              <b><?php echo "$sitename"; ?></b> </div>
            <div style="width: 275; font-size:<?php echo $size2; ?>pt; font-family: 細明體 ; color: white; position: relative; filter: glow(color=black, strength=1)"> 
              <b> <?php echo "$ensitename"; ?></b> </div>
          </td>
          <td height="60" width="480"><?php
$bannerfile="../../banner/".$userid.".jpg";
if(file_exists($bannerfile)){
echo "<a href=$bannerurl target=_blank><img border=0 src=$bannerfile width=468 height=60></a>";
}else{
echo "<img border=0 src='images/banner.gif' width=468 height=60>";
}
?></td>
        </tr>
      </table>
    </td>
    <td colspan="5" height="61" background="../mod/1/images/topbg.gif">&nbsp;</td>
  </tr>
  <tr> 
    <td colspan="6"><img src="../mod/1/images/mod_5.gif" width="776" height="14"></td>
  </tr>
</table>
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" align="center" width="776">
  <TR> 
    <TD COLSPAN="6"><IMG SRC="../mod/1/images/mod_6.gif" WIDTH="776" HEIGHT="11"></TD>
  </TR>
  <TR> 
    <TD COLSPAN="2" valign="top" height="8" bgcolor="#C2CE99"> 
      <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#666666">
        <?php
$msql->query("select * from auto_dir where userid='$userid' and parentid=0 order by xuhao");
while($msql->next_record()){
$dirid=$msql->f('dirid');
$ifson=$msql->f('ifson');
$dirname=$msql->f('dirname');
$mod=$msql->f('mod');

?> 
        <tr> 
          <td background="../mod/1/images/leftbg.gif" width="22%" height="17">&nbsp;</td>
          <td width="78%" bgcolor="#FFFFFF" height="17"> <img src="../mod/1/images/dot.gif" width="8" height="14"><?php
if($ifson=='0'){
include("../../includes/dir.php3");

}elseif($ifson=='1'){

		echo "<a href=index.php3?file=index.php3&nowdir=$dirid>$dirname</a>";

}
?></td>
        </tr>
        <?php
if($dirid==$nowdir){
$fsql->query("select * from auto_dir where parentid='$nowdir'");
while($fsql->next_record()){
$dirid=$fsql->f('dirid');
$dirname=$fsql->f('dirname');
$mod=$fsql->f('mod');

?> 
        <tr> 
          <td bgcolor="#C2CE99" width="22%" height="17">&nbsp;</td>
          <td width="78%" bgcolor="#FFFFFF" height="17"> <img src="../mod/1/images/dot.gif" width="8" height="14"> 
            <?php
include("../../includes/dir.php3");

?> </td>
        </tr>
        <?php
}
}
}
?> 
      </table>
      <img src="../mod/1/images/mod_10.gif" width="158" height="88"> 
      <table width="98%" border="0" cellspacing="4" cellpadding="0" align="center">
        <tr> 
          <td width="92%" bgcolor="#CFDBAC" height="22"> 
            <div align="center">首頁連結</div>
          </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <?php
$msql->query("select * from auto_link where userid='$userid'  order by xuhao");
while($msql->next_record()){
$linkname=$msql->f('linkname');
$mod=$msql->f('mod');
$url=$msql->f('url');
$linkid=$msql->f('linkid');
?> 
        <tr> 
          <td> 
            <div align="center"><?php
$linkimg="../../link/".$linkid.".jpg";
if(file_exists($linkimg)){
echo "<a href=$url target=_blank><img src=$linkimg border=0 width=88 ></a>"; 
}else{
echo "<a href=$url target=_blank>$linkname</a>"; 
}

?> </div>
          </td>
        </tr>
        <?php
}
?> 
      </table>
    </TD>
    <TD ROWSPAN="3" width="10" bgcolor="#C2CE99" valign="top">&nbsp;</TD>
    <TD COLSPAN="3" ROWSPAN="3" valign="top"> 
      <table width="100%" border="0" cellspacing="8" cellpadding="0">
        <tr valign="top"> 
          <td height="242" width="420"> 
            <table  border="0" cellspacing="2" cellpadding="1">
              <tr> <?php
$msql->query("select id,title,ms1,ms2 from auto_con where userid='$userid' and iftj='2' limit 0,5");
$kk=0;
while($msql->next_record()){
$id=$msql->f('id');
$title=$msql->f('title');
$ms1=$msql->f('ms1');
$ms2=$msql->f('ms2');
?> 
                <td width="75" valign="top" height="75"> <?php
$imgfile="../../comimg/$id.jpg";
if(!file_exists($imgfile)){
$imgfile="images/noimg.jpg";
}
echo "<a href=index.php3?file=detail.php3&nowdir=$nowdir&id=$id&detail=2><img src=$imgfile  border=0 width=75  height=75></a>"; 
?> </td>
                <?php
}
?> </tr>
            </table>
            <br>
            <table width="100%" border="0" cellspacing="1" cellpadding="1">
              <tr> 
                <td height="224" valign="top" width="49%"> 
                  <table width="100%" border="0" cellspacing="2" cellpadding="1" align="center">
                    <?php
$msql->query("select id,title from auto_con where userid='$userid' and  iftj='1' order by id desc");
while($msql->next_record()){
$id=$msql->f('id');
$title=$msql->f('title');
?> 
                    <tr bgcolor="#F7F7F7"> 
                      <td> <font color="#FFCC33">·</font><?php echo "<font size=3><a href=index.php3?file=detail.php3&nowdir=$nowdir&id=$id>$title</a></font>"; ?> 
                      </td>
                    </tr>
                    <?php
}
?> 
                  </table>
                </td>
                <td height="224" width="51%" valign="top"> 
                  <table width="100%" border="0" cellspacing="2" cellpadding="1" align="center">
                    <?php
$msql->query("select id,title from auto_con where userid='$userid' and  iftj='3' order by id desc");
while($msql->next_record()){
$id=$msql->f('id');
$title=$msql->f('title');
?> 
                    <tr bgcolor="#F7F7F7"> 
                      <td> <font color="#FFCC33">·</font><?php echo "<font size=3><a href=index.php3?file=detail.php3&nowdir=$nowdir&id=$id>$title</a></font>"; ?> 
                      </td>
                    </tr>
                    <?php
}
?> 
                  </table>
                </td>
              </tr>
            </table>
          </td>
          <td height="242" width="1" background="images/line.gif"><img src="images/dot.gif" width="1" height="30"></td>
          <td height="242" width="160"> 
            <table width="100%" border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC">
              <tr valign="top" bgcolor="#FFFFFF"> 
                <td height="201"><?php echo "$intro"; ?> </td>
              </tr>
            </table>
            <br>
            <table width="100%" border="0" cellspacing="2" cellpadding="0">
              <tr> 
                <td width="40" valign="top"> 
                  <div align="right"><font color="#333333"> 地址：</font></div>
                </td>
                <td><font color="#333333"><?php echo "$addr"; ?> </font></td>
              </tr>
              <tr> 
                <td width="40" valign="top"> 
                  <div align="right"><font color="#333333">聯絡：</font></div>
                </td>
                <td><font color="#333333"><?php echo "$name"; ?></font></td>
              </tr>
              <tr> 
                <td width="40" valign="top"> 
                  <div align="right"><font color="#333333">電話：</font></div>
                </td>
                <td><font color="#333333"><?php echo "$tel"; ?> </font></td>
              </tr>
              <tr> 
                <td width="40" valign="top"> 
                  <div align="right"><font color="#333333">傳真：</font></div>
                </td>
                <td><font color="#333333"><?php echo "$fax"; ?></font></td>
              </tr>
              <tr> 
                <td width="40" valign="top"> 
                  <div align="right"><font color="#333333">郵編：</font></div>
                </td>
                <td><font color="#333333"><?php echo "$zip"; ?></font></td>
              </tr>
              <tr> 
                <td width="40" valign="top"> 
                  <div align="right"><font color="#333333">電郵：</font></div>
                </td>
                <td><font color="#333333"><a href="mailto:<?php echo "$email"; ?>"><img src="images/mail.gif" width="16" height="11" border="0"></a></font></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </TD>
  </TR>
  <TR> 
    <TD COLSPAN="2" bgcolor="#C2CE99" valign="top" rowspan="2">
      <div align="center"><font size="2"><br>
        </font> </div>
    </TD>
  </TR>
  <TR> </TR>
  <TR> 
    <TD width="26" height="2"><IMG SRC="../mod/1/images/space.gif" WIDTH="26" HEIGHT="1"></TD>
    <TD width="132" height="2"><IMG SRC="../mod/1/images/space.gif" WIDTH="132" HEIGHT="1"></TD>
    <TD width="10" height="2"><IMG SRC="../mod/1/images/space.gif" WIDTH="10" HEIGHT="1"></TD>
    <TD width="117" height="2"><IMG SRC="../mod/1/images/space.gif" WIDTH="117" HEIGHT="1"></TD>
    <TD width="468" height="2"><IMG SRC="../mod/1/images/space.gif" WIDTH="468" HEIGHT="1"></TD>
    <TD width="23" height="2"><IMG SRC="../mod/1/images/space.gif" WIDTH="23" HEIGHT="1"></TD>
  </TR>
</TABLE>

<br>
<table width="776" border="0" cellspacing="2" cellpadding="0" align="center">
  <tr> 
    <td width="22%" valign="top"> 
      <div align="center"><font size="2"><font color="#330000">訪問人數：<?php 
$countsfile="../../counts/$userid.cc";
if(file_exists($countsfile)){
$fd=fopen($countsfile,"r");
$counts = fread($fd,10);
fclose($fd);
}else{
$counts=1;
}
echo "$counts"; 
$counts=$counts+1;
$fd=fopen($countsfile,"w");
fwrite($fd,$counts,10);
fclose($fd);

?> </font></font></div>
    </td>
    <td width="78%"> 
      <div align="center"><img src="<?php
$logofile="../../logo/".$userid.".jpg";
if(file_exists($logofile)){
echo "$logofile";
}else{
echo "images/mylogo.gif";
}
?>"><font size="2"><font color="#330000"><br>
        </font></font></div>
    </td>
  </tr>
  <tr> 
    <td width="22%" height="20">&nbsp;</td>
    <td width="78%" height="20"> 
      <div align="center"><font color="#333333"><?php echo "$code"; ?></font></div>
    </td>
  </tr>
</table>
<br>
</BODY>

</HTML>
