<?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');
$size1=$msql->f('size1');
$size2=$msql->f('size2');
$intro=$msql->f('intro');
$code=$msql->f('code');
$bannerurl=$msql->f('bannerurl');
$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 cellspacing=0 cellpadding=0 width=778 border=0 align="center">
  <tbody> 
  <tr> 
    <td valign=top height="425" background="images/leftbg.gif"> 
      <table cellspacing=0 cellpadding=0 width=121 border=0>
        <tbody> 
        <tr> 
          <td height=1 rowspan=3><img height=81 src="images/TOP1.gif" 
            width=121></td>
        </tr>
        <tr></tr>
        <tr></tr>
        <tr> 
          <td height=1><img src="images/TOP3.gif"></td>
        </tr>
        <tr> 
          <td height=1><img height=3 src="images/leftbg.gif" 
        width=121></td>
        </tr>
        <tr valign="top"> 
          <td height=2></td>
        </tr>
        </tbody> 
      </table>
      <br>
      <script language="JavaScript">
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;
if (ver4) {
    with (document) {
        write("<STYLE TYPE='text/css'>");
        if (NS4) {
            write(".parent {position:absolute; visibility:visible}");
            write(".child {position:absolute; visibility:visible}");
            write(".regular {position:absolute; visibility:visible}")
        }
        else {
            write(".child {display:none}")
        }
        write("</STYLE>");
    }
}
function getIndex(el) {
    ind = null;
    for (i=0; i<document.layers.length; i++) {
        whichEl = document.layers[i];
        if (whichEl.id == el) {
            ind = i;
            break;
        }
    }
    return ind;
}
function arrange() {
    nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;
    for (i=firstInd+1; i<document.layers.length; i++) {
        whichEl = document.layers[i];
        if (whichEl.visibility != "hide") {
            whichEl.pageY = nextY;
            nextY += whichEl.document.height;
        }
    }
}
function initIt(){
    if (!ver4) return;
    if (NS4) {
        for (i=0; i<document.layers.length; i++) {
            whichEl = document.layers[i];
            if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
       }
        arrange();
    }
    else {
        divColl = document.all.tags("DIV");
        for (i=0; i<divColl.length; i++) {
            whichEl = divColl(i);
            if (whichEl.className == "child") whichEl.style.display = "none";
        }
    }
}
function expandIt(el) {
    if (!ver4) return;
    if (IE4) {
        whichEl = eval(el + "Child");
        if (whichEl.style.display == "none") {
            whichEl.style.display = "block";
        }
        else {
            whichEl.style.display = "none";
        }
    }
    else {
        whichEl = eval("document." + el + "Child");
        if (whichEl.visibility == "hide") {
            whichEl.visibility = "show";
        }
        else {
            whichEl.visibility = "hide";
        }
        arrange();
    }
}
onload = initIt;
</script>
      <?php
$msql->query("select * from auto_dir where userid='$userid' and parentid=0 order by xuhao");
$mainnum=1;
while($msql->next_record()){
$dirid=$msql->f('dirid');
$ifson=$msql->f('ifson');
$dirname=$msql->f('dirname');
$mod=$msql->f('mod');
?> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr align="center"> 
          <td height="22"> <?php
if($ifson=='0'){
include("../../includes/dir1.php3");
}elseif($ifson=='1'){
		echo "<div id='KB".$mainnum."Parent' class='parent'><a href=# onClick=\"expandIt('KB".$mainnum."'); return false\" ><font color=#ffffff>$dirname</font></a></div>";
}
?> </td>
        </tr>
      </table>
      <?php
echo "<div id='KB".$mainnum."Child' class='child'>";
$fsql->query("select * from auto_dir where parentid='$dirid' order by xuhao");
while($fsql->next_record()){
$dirid=$fsql->f('dirid');
$dirname=$fsql->f('dirname');
$mod=$fsql->f('mod');
?> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr align="center" bgcolor="#FF0000"> 
          <td height="22"> <?php
include("../../includes/dir1.php3");
?> </td>
        </tr>
      </table>
      <?php
}
echo "</div>";
$mainnum++;
}
?> 
      <div align="center"><br>
        <script language="JavaScript">
if (NS4) {
        firstEl = "KB1Parent";
        firstInd = getIndex(firstEl);
        arrange();
}
</script>
      </div>
    </td>
    <td valign=top width=722 height="425"> 
      <table cellspacing=0 cellpadding=0 width=657 border=0>
        <tbody> 
        <tr> 
          <td colspan=4 height=20>&nbsp;</td>
        </tr>
        <tr valign="top"> 
          <td colspan="4" height="79"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" height="60">
              <tr> 
                <td width="26" valign="top"><img src="images/TOP2.gif" width="24" height="61"></td>
                <td width="135"> 
                  <div align="center"><img src="<?php
$logofile="../../logo/".$userid.".jpg";
if(file_exists($logofile)){
echo "$logofile";
}else{
echo "images/mylogo.gif";
}
?>"></div>
                </td>
                <td width="496"> 
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td height="32"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="4%" height="31">&nbsp;</td>
                            <td width="96%" height="31"> 
                              <table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
                                <tr> 
                                  <td> <?php
$msql->query("select * from auto_name where userid='$userid'");
if($msql->next_record()){
$cnsize=$msql->f('cnsize');
$ensize=$msql->f('ensize');
$cncolor=$msql->f('cncolor');
$encolor=$msql->f('encolor');
$cnface=$msql->f('cnface');
$enface=$msql->f('enface');

echo "<div style='width: 100%; font-size: ".$cnsize."pt; font-family: ".$cnface."; color:".$cncolor."; filter:dropshadow(color=".$cncolor.",offX=1,offY=0,positive=1)'><b>".$sitename."</b></div>";
echo "<div style='width: 100%; font-size: ".$ensize."pt; font-family: ".$enface."; color:".$encolor."'><img src=../../images/dot.gif width=3>".$ensitename."</div>";


}else{

echo "<div style='width: 100%; font-size:20pt; font-family: 細明體; color:#000000; filter:dropshadow(color=#000000,offX=1,offY=0,positive=1)'><b>".$sitename."</b></div>";
echo "<div style='width: 100%; font-size:12pt; font-family: Arial; color:#cccccc'><img src=../../images/dot.gif width=3>".$ensitename."</div>";
}
?> </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr> 
                      <td><img src="images/TITLE.gif" width="484" height="29"></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr> 
          <td valign=top colspan=4> 
            <table cellspacing=18 cellpadding=0 width="100%" border=0>
              <tbody> 
              <tr valign="top"> 
                <td colspan="2" height=284> 
                  <p align="center"><font size="3"></font></p>
                  <form method=post action=../../sendmail.php3>
                    <table width="87%" cellspacing="0" cellpadding="0" align="center">
                      <tr> 
                        <td height="24" width="29%"> 
                          <div align="right"><font size="2">主題(Subject)：</font></div>
                        </td>
                        <td height="24" width="71%"> 
                          <div align="left"> 
                            <input type="text" name="title" size="40">
                          </div>
                        </td>
                      </tr>
                      <tr> 
                        <td height="82" width="29%" valign="top"> 
                          <div align="right"><font size="2">內容(Message)：</font></div>
                        </td>
                        <td height="82" width="71%" valign="top"> 
                          <div align="left"> 
                            <textarea name="con" cols="38" rows="8"></textarea>
                            <input type="hidden" name="step" value="send">
                            <input type="hidden" name="userid" value="<?php echo "$userid"; ?>">
                            <input type="hidden" name="email" value="<?php echo "$email"; ?>">
                          </div>
                        </td>
                      </tr>
                      <tr> 
                        <td height="5" width="29%"> 
                          <div align="right"><font size="3"><font size="2"><font size="2">電子郵件(E-mail):</font></font></font></div>
                        </td>
                        <td height="5" width="71%"> 
                          <input type="text" name="frommail" size="40">
                        </td>
                      </tr>
                      <tr> 
                        <td height="28" width="29%"> 
                          <div align="right"><font size="2"><font size="2"></font></font></div>
                        </td>
                        <td height="28" width="71%"> 
                          <input type="submit" name="Submit" value="發送">
                        </td>
                      </tr>
                    </table>
                  </form>
                  <p></p>
                  <font color="#000000"></font> </td>
              </tr>
              </tbody> 
            </table>
            <table width="100%" border="0" cellspacing="8" cellpadding="0">
              <tr bgcolor="#000000"> 
                <td colspan="2" height="1"><img src="images/dot.gif" width="10" height="1"></td>
              </tr>
              <tr> 
                <td> 
                  <div align="center"><font size="2"><font color="#330000">訪問人數：
                    <script src="../../includes/count.php3?userid=<?php echo "$userid"; ?>"></script>
                    </font></font></div>
                </td>
                <td width="510" align="center"> <?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>
              <tr> 
                <td>&nbsp;</td>
                <td width="510" align="center"><font color="#333333"><?php echo "$code"; ?> 
                  </font></td>
              </tr>
            </table>
          </td>
        </tr>
        </tbody> 
      </table>
    </td>
  </tr>
  </tbody> 
</table>
</BODY>
</HTML>
