<?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 cellpadding="0" cellspacing="0" border="0" align="center" width="656">
  <tr> 
    <td background="images/topbg.gif"> 
      <table width="100%" border="0" cellspacing="3" cellpadding="2" height="74">
        <tr> 
          <td height="54" width="21%"> 
            <div align="center"><img src="<?php
$logofile="../../logo/".$userid.".jpg";
if(file_exists($logofile)){
echo "$logofile";
}else{
echo "images/mylogo.gif";
}
?>"> </div>
          </td>
          <td height="54" width="79%"> 
            <table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
              <tr> 
                <td height="48"> 
                  <div style="width: 500; font-size:<?php echo $size1; ?>pt; font-family: 標楷體; color:#ffffff; filter: shadow(color=#000000,direction=60"> 
                    <b><?php echo "$sitename"; ?></b> </div>
                  <div style="width: 500; font-size:<?php echo $size2; ?>pt; font-family: Arial ; color: #ffffff"> 
                    <b><?php echo "$ensitename"; ?></b> </div>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
    <td colspan="5" height="61" background="images/topbg.gif">&nbsp;</td>
  </tr>
  <tr> 
    <td colspan="6"><img src="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="images/mod_6.gif" WIDTH="776" HEIGHT="11"></TD>
  </TR>
  <TR> 
    <TD COLSPAN="2" valign="top" height="8" bgcolor="#C2CE99"> 
      <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="1" cellpadding="0" bgcolor="#666666">
        <tr align="center"> 
          <td height="22" width="22%" background="images/leftbg.gif">&nbsp;</td>
          <td height="22" width="76%" bgcolor="#FFFFFF"> <?php
if($ifson=='0'){
include("../../includes/dir.php3");
}elseif($ifson=='1'){
		echo "<div id='KB".$mainnum."Parent' class='parent'><a href=# onClick=\"expandIt('KB".$mainnum."'); return false\" >$dirname</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="1" cellpadding="0">
        <tr align="center"> 
          <td height="22" width="22%">&nbsp;</td>
          <td height="22" bgcolor="#FFFFFF"> <?php
include("../../includes/dir.php3");
?> </td>
        </tr>
      </table>
      <?php
}
echo "</div>";
$mainnum++;
}
?> 
      <script language="JavaScript">
if (NS4) {
        firstEl = "KB1Parent";
        firstInd = getIndex(firstEl);
        arrange();
}
</script>
      <img src="images/mod_10.gif" width="158" height="88"> </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="1" cellpadding="0" bgcolor="#717171">
        <tr bgcolor="#FFFFFF" valign="top"> 
          <td> 
            <table width="100%" border="0" cellspacing="18" cellpadding="0">
              <tr valign="top"> 
                <td height="295"> 
                  <table width="90%" border="0" cellspacing="2" cellpadding="4" align="center">
                    <?php
$msql->query("select id,title,ms1,ms2 from auto_con where userid='$userid' and dirid='$kdir'");
$kk=0;
while($msql->next_record()){
$id=$msql->f('id');
$title=$msql->f('title');
$ms1=$msql->f('ms1');
$ms2=$msql->f('ms2');
?> 
                    <tr bgcolor="#EDF0E1"> 
                      <td width="382"><?php echo "<font color=#C2CE99>■</font> <font size=3><a href=index.php3?file=detail.php3&nowdir=$nowdir&id=$id&detail=1>$title</a></font>"; ?> 
                      </td>
                      <td width="165"><?php echo "$ms1"; ?> </td>
                    </tr>
                    <?php
$kk++;
}
if($kk==1){
?> 
                    <script>
window.location='index.php3?file=detail.php3&nowdir=<?php echo "$nowdir"; ?>&id=<?php echo "$id"; ?>&detail=1'
</script>
                    <?php
}
?> 
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      
    </TD>
  </TR>
  <TR> 
    <TD COLSPAN="2" bgcolor="#C2CE99" valign="top" rowspan="2"> 
      <div align="center"><br>
      </div>
    </TD>
  </TR>
  <TR> </TR>
  <TR> 
    <TD width="26" height="2"><IMG SRC="images/space.gif" WIDTH="26" HEIGHT="1"></TD>
    <TD width="132" height="2"><IMG SRC="images/space.gif" WIDTH="132" HEIGHT="1"></TD>
    <TD width="10" height="2"><IMG SRC="images/space.gif" WIDTH="10" HEIGHT="1"></TD>
    <TD width="117" height="2"><IMG SRC="images/space.gif" WIDTH="117" HEIGHT="1"></TD>
    <TD width="468" height="2"><IMG SRC="images/space.gif" WIDTH="468" HEIGHT="1"></TD>
    <TD width="23" height="2"><IMG SRC="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">訪問人數：
        <script src="../../includes/count.php3?userid=<?php echo "$userid"; ?>"></script>
        </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>
</BODY>
</HTML>
