/home/nondinda/domains/nondindaengcity.go.th/public_html/WEBBOARD/webboard.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<html>
<head>
    <meta http-equiv=Content-Type content="text/html; charset=windows-874">
    <title>กระทู้</title>
</head>
<body bgcolor="white">
<center><font face="MS Sans Serif">
<p style="margin-top: 0; margin-bottom: 0">
<img border="0" src="Head_webboard.jpg" width="512" height="64"></p><hr>
<p style="margin-top: 0; margin-bottom: 0"><font color="DarkBlue" size=2>เชิญตั้งกระทู้ใหม่หรืออ่านและออกข้อคิดเห็นในกระทู้</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font size="2"><span lang="th">
<font color="#00008B">
ขอให้ใช้เว็บบอร์ดเพื่อการสร้างสรรค์เทศบาลตำบลโนนดินแดงอย่างแท้จริง</font></span></font></p>
<p style="margin-top: 0; margin-bottom: 0"><font size="2"><span lang="th">
<font color="#00008B">เทศบาลตำบลโดนดินแดงขอสงวนสิทธิ์ไม่รับผิดชอบข้อความผิดพลาดใดๆ&nbsp; 
ที่อาจจะเกิดขึ้น</font></span></p>
</center>
<%
    Dim SpamProtect 'Protect Repeated Submit
    If Session("SpamProtect")=Null Then
        Session("SpamProtect")=False
    End If
    set conn=Server.CreateObject("ADODB.Connection")
    str="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.Mappath("WebboardDB.mdb")
    Conn.Open str,"",""
    set RS = Server.CreateObject("ADODB.Recordset")
    sql="Select * From HEAD"
    RS.Open sql, Conn, 1, 3
    NewHeadLine=Request.Form("HeadLine")
    Name=request.Form("Name")
    Email=Request.Form("Email")
    DateTime=Date()
    Message=Request.Form("Message")
    if (NewHeadLine<>"" AND Session("SpamProtect")=False) then
    RS.AddNew
        RS("HeadLine")=NewHeadLine
        RS("Name")=Name
        RS("Email")=Email
        RS("DateTime")=DateTime
        RS("Detail")=Message
    RS.Update
    Session("SpamProtect")=True
    end if
    If not(RS.EOF) Then 
        RS.MoveFirst
    End If
    %>
    <br>
    <hr>
    <%
    Dim icolor
    icolor=1
    While NOT RS.EOF%>
        </font></font>

                  <img src = "bullet.gif">
                <a href="ShowWBDetail.asp?HeadID=<%=RS("HeadID")%>">
                <font face="MS Sans Serif" size="2"><%=RS("HeadLine")%> </font> </a>
                <font face="MS Sans Serif" size="2"> : <%=RS("Name")%></font>
                
                <font face="MS Sans Serif" size="2"> :&nbsp;<%=ShowDate(RS("DateTime"))%>:&nbsp;</font>
                <font face="MS Sans Serif" size="2"><font color="DarkRed"><%=RS("Nread")+1%></font></font>
                <font face="MS Sans Serif" size="2">/&nbsp;<font color="DarkRed"><%=RS("NResponse")+1%></font> 
                </font> 
            
                <br>
    <%Rs.MoveNext
    icolor=icolor+1
    Wend
    %>
    <hr>
</font>
<FORM action="webboard.asp" method="post">
<font face="MS Sans Serif">
<font color="DarkBlue" size=2>ตั้งกระทู้ใหม่</font><font size="2"> </font>
</font>
<table width="90%">
    <tr><td align="right"><font face="MS Sans Serif" size="2"><b>หัวข้อเรื่อง :</b></font></td><td>
        <font face="MS Sans Serif"><input size="45" name="HeadLine" ></font></td></tr>
    <tr><td align="right"><font face="MS Sans Serif" size="2"><b>ชื่อ : </b>
        </font></td><td><font face="MS Sans Serif"><input size="45" name="name" ></font></td></tr>
    <tr><td align="right"><font face="MS Sans Serif" size="2"><b>E-Mail :</b></font></td><td>
        <font face="MS Sans Serif"><input name="Email" size=45></font></td></tr>
    <tr><td align="right" valign="top"><font face="MS Sans Serif" size="2"><b>รายละเอียด :</b></font></td>
        <td><font face="MS Sans Serif">
        <textarea cols="45" rows="6" name="message" style="font-size: 10pt;"></textarea></font></td></tr>
    <tr>
      <td colspan=2 align="middle"><input name="konkiy.pkk@hotmail.com" type="submit" id="konkiy.pkk@hotmail.com" value="ส่งข้อความ">        &nbsp;
      <input type="reset" value="ยกเลิก"></td></tr>
</table>
</FORM>
</center>
<%
RS.Close
Conn.Close
Set RS=Nothing
Set Conn=Nothing
Function ShowDate(D)
    Dim MonthNames
    MonthNames=array ("มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน",    "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม")
    ShowDate=Day(D)&" "&MonthNames(Month(D)-1)&" "&Year(D)
End Function
%>
</body>
</html>