<?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=reg_4.php3");

}else{

$userid=$AUTOUSERID;

}

if($step=="new"){

$msql->query("select dirid from auto_dir where userid='$userid'");

if($msql->next_record()){

$ifnew="no";

}

if($ifnew!="no"){

$msql->query("insert into auto_dir values(0,'$userid','0','0','$c1','1','0')");

$msql->query("insert into auto_dir values(0,'$userid','0','0','$c2','2','1')");

$msql->query("insert into auto_dir values(0,'$userid','0','0','$c3','3','2')");

$msql->query("insert into auto_dir values(0,'$userid','0','0','$c4','4','3')");



/////////發信

$subject="網站開通通知";

$message="$NAME 您好！

您的網頁設計DIY已經開通了！

網站名稱： $SITENAME

網址： ".$baseurl."com/$URLNAME



現在您的網站已經開設了以下欄目：



$c1

$c2

$c3

$c4



您可以登錄網站管理系統，預覽您的網站。

通過網站系統管理網站欄目和內容。



您的網站試用期為".$testdays."天，請抓緊測試維護。



聯絡方法和付款方法請參照網上的介紹



如果您在操作中有什麼困難，歡迎向我們詢問。

我們願為您提供最好的服務！



-------------------------------------------------------------------

".$owner." 

".$ownerurl." 



";

$from=$owneremail;

mail($EMAIL,$subject,$message,"From: $from\nReply-To: $from\nX-Mailer: PHP/".phpversion());

///////



}

}

?><HTML><HEAD><TITLE>網頁設計DIY系統 新建網站導覽</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}
.bb input {background-color: #E8E0DB; 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=#666666 leftMargin=0 link=#000000 topMargin=0 vLink=#000000 marginwidth="0" marginheight="0">
<div align="center"> 
  <table width="776" border="0" cellspacing="0" cellpadding="0" align="center" height="80" bgcolor="#FFFFFF">
    <tr> 
      <td height="75" width="249"> 
        <div align="center"><img src="images/logo.gif"></div>
      </td>
      <td height="75" width="527"> 
        <div align="center"><a href=http://www.sina.com.cn target=_blank><img src=images/1.gif width=468 height=60 border=0></a> </div>
      </td>
    </tr>
  </table>
  <table width="776" border="0" cellspacing="0" cellpadding="0" align="center" height="16">
    <tr> 
      <td><a href="index.html"><img src="images/new_1.gif" width="776" height="26" border="0"></a></td>
    </tr>
  </table>
  <table width="776" border="0" cellspacing="0" cellpadding="0" align="center" height="16">
    <tr bgcolor="#FFFFFF"> 
      <td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="776" height="89">
          <param name=movie value="images/auto.swf">
          <param name=quality value=high>
          <embed src="images/auto.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="776" height="89">
          </embed> 
        </object></td>
    </tr>
  </table>
  <table width="776" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr> 
      <td height="2"><img src="images/new_3.gif" width="776" height="2"></td>
    </tr>
  </table>
  <table width="776" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
    <tr> 
      <td valign="top" width="170"> 
        <table width="170" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td height="23"> 
              <table width="100%" border="0" cellspacing="1" cellpadding="0" height="23" background="images/new_bg.gif">
                <tr> 
                  <td><img src="images/dot.gif" width="10" height="10"><img src="images/news_4.gif" width="9" height="9">　用 
                    戶 登 錄 </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr valign="top"> 
            <td height="129"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <form method="post" action="main.php3">
                <tr> 
                  <td align="center"> 
                    <table width="90%" border="0" cellspacing="0" cellpadding="0" >
                      <tr> 
                        <td width="58" height="11"><img src="image/spacer.gif" width="1" height="1"></td>
                        <td height="11" width="105"><img src="image/spacer.gif" width="1" height="1"></td>
                      </tr>
                      <tr> 
                        <td width="58" height="25" align="center">用戶名</td>
                        <td height="25" class="hh" width="105"> 
                          <input type="text" name="user" size="12" maxlength="20">
                        </td>
                      </tr>
                      <tr> 
                        <td width="58" height="25" align="center">密　碼</td>
                        <td height="25" class="hh" width="105"> 
                          <input type="password" name="password" size="12" maxlength="20">
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
                <tr align="center"> 
                  <td height="38"> 
                    <table width="89%" border="0" cellspacing="0" cellpadding="0" height="25">
                      <tr> 
                        <td height="8" colspan="2" valign="top" align="center">&nbsp;</td>
                      </tr>
                      <tr> 
                        <td height="25" width="48%" align="center" valign="top"><a href="reg.php3" ><img src="images/new_zc.gif" border="0" vspace="1" width="66" height="20"></a></td>
                        <td height="25" align="center" width="52%"> 
                          <div align="left"> 
                            <input type="image" border="0" name="Submit" src="images/new_dl.gif" width="66" height="20" >
                          </div>
                        </td>
                      </tr>
                      <tr> 
                        <td height="25" colspan="2"> 
                          <div align="center"><img src="images/mails.gif" width="14" height="13"> 
                            <a href="lostpassword.php3"><font color="#336600">忘記密碼?請按這裡</font></a></div>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </form>
            </table></td>
          </tr>
          <tr> 
            <td  background="images/new_bg.gif" height="23"> 
              <table width="100%" border="0" cellspacing="1" cellpadding="0" height="23" background="images/new_bg.gif">
                <tr> 
                  <td><img src="images/dot.gif" width="10" height="10"><img src="images/news_4.gif" width="9" height="9">　申 
                    請 步 驟</td>
                </tr>
              </table>
            </td>
          </tr>
          <tr valign="top" align="right"> 
            <td height="225"> 
              <table width="96%" border="0" cellspacing="1" cellpadding="1">
                <tr> 
                  <td height="22"><font color="#000000">第一步 → 註冊協議</font></td>
                </tr>
                <tr> 
                  <td height="22"><font color="#000000"> 第二步 → 選擇網頁佈景 </font></td>
                </tr>
                <tr> 
                  <td height="22"><font color="#000000">第三步 → 填寫基本資料 </font></td>
                </tr>
                <tr> 
                  <td height="22"><font color="#000000">第四步 → 設定網站欄目名稱</font></td>
                </tr>
                <tr> 
                  <td height="22"><font color="#000000">第五步 → 完成，登錄管理</font></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
      <td width="3" valign="top" background="images/new_bg2.gif"><img src="images/dot.gif" width="4" height="10"></td>
      <td valign="top"> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0" height="23">
          <tr> 
            <td> 
              <table width="100%" border="0" cellspacing="1" cellpadding="0" height="23" background="images/new_bg.gif">
                <tr> 
                  <td><img src="images/dot.gif" width="10" height="10"><img src="images/news_4.gif" width="9" height="9">　網 
                    站 申 請 向 導</td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
        <table width="97%" border="0" cellspacing="8" cellpadding="0">
          <tr valign="top"> 
            <td height="370"> 
        <br>

        <?php

//////////////////////新增主目錄

if($step=="newmain"){



if($dirname==""){

sendback("對不起，您沒有填寫新增主欄目的名稱！");

}

$msql->query("insert into auto_dir values(0,'$AUTOUSERID','0','0','$dirname','$mxuhao','$mod')");



}

//////////////////////新增二級目錄

if($step=="newsc"){

if($maintype!='2' && $maintype!='1'){

sendback("對不起，只有文字型和圖文型的主欄目才能建立二級欄目！建議查看幫助!");

}

if($dirname==""){

sendback("對不起，您沒有填寫新增二級欄目的名稱！");

}

$msql->query("select id from auto_con where dirid='$parentid'");

		if($msql->next_record()){

			sendback("對不起，主欄目下已有內容，請移動或刪除主欄目下的內容後才能建立二級欄目");

		}

$msql->query("insert into auto_dir values(0,'$AUTOUSERID','$parentid','0','$dirname','$scxuhao','$sctype')");

$msql->query("update auto_dir set ifson='1' where dirid='$parentid'");

}



//////////////////////修改二級目錄

if($step=="modsc"){

	if($cc=="刪"){

		$msql->query("select id from auto_con where dirid='$scdirid'");

		if($msql->next_record()){

			sendback("對不起，該欄目下有內容，不能刪除。請移動或刪除此欄目下的內容");

		}

		$msql->query("delete from auto_dir where dirid='$scdirid' and userid='$AUTOUSERID'");

		$msql->query("select dirid from auto_dir where parentid='$parentid' and userid='$AUTOUSERID'");

		if($msql->next_record()){

		}else{

		$fsql->query("update auto_dir set ifson='0' where dirid='$parentid' and userid='$AUTOUSERID'");

		}

}elseif($cc=="↓"){

$msql->query("update auto_dir set xuhao=xuhao+1 where dirid='$scdirid' and userid='$AUTOUSERID'");

}elseif($cc=="↑"){

$msql->query("update auto_dir set xuhao=xuhao-1 where dirid='$scdirid' and userid='$AUTOUSERID'");

}else{

		if($dirname==""){

			sendback("對不起，二級欄目的名稱必須填寫！");

		}

		$msql->query("update auto_dir set dirname='$dirname',mod='$sctype' where dirid='$scdirid' and userid='$AUTOUSERID'");

	}

}

//////////////////////修改主目錄

if($step=="modmain"){

if($cc=="刪"){

		$msql->query("select id from auto_con where dirid='$dirid'");

		if($msql->next_record()){

			sendback("對不起，該主欄目下有內容，不能刪除。請移動或刪除此欄目下的內容");

		}

		$msql->query("select dirid from auto_dir where parentid='$dirid'");

		if($msql->next_record()){

			sendback("對不起，該主欄目下有二級欄目，不能刪除。請先刪除二級欄目");

		}

		if($oldmaintype=="0" || $oldmaintype=="3" ){

			sendback("對不起，不能刪除主頁或聯絡表單");

		}

		$msql->query("delete from auto_dir where dirid='$dirid' and userid='$AUTOUSERID'");



}elseif($cc=="↓"){

$msql->query("update auto_dir set xuhao=xuhao+1 where dirid='$dirid' and userid='$AUTOUSERID'");

}elseif($cc=="↑"){

$msql->query("update auto_dir set xuhao=xuhao-1 where dirid='$dirid' and userid='$AUTOUSERID'");

}else{

	if($dirname==""){

		sendback("對不起，主欄目的名稱必須填寫！");

	}

	if($oldmaintype=='0' && $oldmaintype!=$maintype){

		sendback("對不起，主頁型欄目只能修改名稱，不能修改類型，否則你的網站就沒有主頁了！");

	}

	if($oldmaintype=='3' && $oldmaintype!=$maintype){

		sendback("對不起，聯絡表單欄目只能修改名稱，不能修改類型，否則你的網站就沒有聯絡表單功能了！");

	}

	if($oldmaintype!='0' && $maintype=='0'){

		sendback("對不起，你已經有主頁型的主欄目了，網站不需要兩個主頁");

	}

	if($oldmaintype!='3' && $maintype=='3'){

		sendback("對不起，你已經有聯絡表單欄目了，不需要兩個聯絡表單欄目");

	}

	$msql->query("update auto_dir set dirname='$dirname',mod='$maintype' where dirid='$dirid' and userid='$AUTOUSERID'");

	}



}

?> <?php

if($step=="new"){

?> 

              <table width="585" border="1" cellspacing="1" cellpadding="0" align="center" bgcolor="#FFFFFF" bordercolor="#333333">
                <tr bgcolor="#FFCC66"> 

            <td height="48"> 

              <div align="center"><font color="#FF0000"><b><font size="3"> 恭喜！您的網頁設計DIY已經申請成功！</font></b></font> 

              </div>

            </td>

          </tr>

          <tr> 

            <td height="285"> 

              <div align="center"> 

                <table width="56%" border="0" cellspacing="2" cellpadding="0">

                  <tr> 

                    <td height="20"><font color="#000000">請使用以下用戶名和密碼登錄到網站管理系統</font><font color="#0000FF"></font></td>

                  </tr>

                  <tr> 

                    <td height="20"><font color="#0000FF"><font color="#000000">用戶名稱：<?php echo "$user"; ?> 

                      </font></font><font color="#000000"></font></td>

                  </tr>

                  <tr> 

                    <td height="20"><font color="#000000"> 管理密碼： <?php echo "$password"; ?> 

                      </font></td>

                  </tr>

                </table>

                <div align="center"> 

                  <p><br>

                    <font color="#0000FF">登錄後，您就可以立即查看和管理您的網站了！</font></p>

                  <table width="100%" border="0" cellspacing="4" cellpadding="2">

                    <tr> 

                      <td><font color="#000000">·預覽網站 - 每次維護網站後，通過〞更新和預覽網站〞按鈕，可看到更新後的網站</font></td>

                    </tr>

                    <tr> 

                      <td><font color="#000000">·名稱管理 - 修改網站名稱及其文字尺寸、顏色、字體等 </font></td>

                    </tr>

                    <tr> 

                      <td><font color="#000000">·網頁佈景 - 隨時選擇更換你喜歡的網頁設計佈景 </font></td>

                    </tr>

                    <tr> 

                      <td><font color="#000000">·欄目管理 - 增加，刪除或修改網站欄目名稱；開設二級欄目；指定欄目類型和排列順序 

                        </font></td>

                    </tr>

                    <tr> 

                      <td><font color="#000000">·內容管理 - 上傳網站中各欄目的內容和圖片。</font></td>

                    </tr>

                    <tr> 

                      <td><font color="#000000">·首頁排版 - 可以設定首頁不同的排版方式，將重要內容推薦到首頁</font></td>

                    </tr>

                    <tr> 

                      <td><font color="#000000">·連結管理 - 和其他網站做文字或圖片連結 </font></td>

                    </tr>

                    <tr> 

                      <td><font color="#000000">·雙語設置 - 把分別建立的中、英文版網站連結在一起 </font></td>

                    </tr>

                    <tr> 

                      <td><font color="#000000">·其他項目 - 包括上傳企業標誌，上傳首頁形象圖片、計數器管理、廣告圖片管理</font></td>

                    </tr>

                    <tr> 

                      <td><font color="#000000">·留言板管理 - 創建和管理網站留言板</font></td>

                    </tr>

                    <tr> 

                      <td height="11"><font color="#000000">·網址申請 - 可以為網站申請國際或國內網址 

                        </font></td>

                    </tr>

                  </table>

                  <div align="left"><br>

                  </div>

                </div>

              </div>

            </td>

          </tr>

          <tr> 

            <td height="32"> 

              <div align="center"><a href="index.html"><b><font size="3" color="#FF3333">登錄網站管理系統</font></b></a></div>

            </td>

          </tr>

        </table>

        <?php

exit;

}

?> <br>

            </table></table></div>