File Manager
Back to List
|
Up to Parent Directory
| Current Directory: ~/research
Editing: research/frm_addnews.asp
Full path: C:\ict\ICT\research\frm_addnews.asp
Permissions: rwx
Write test: File appears not directly writable
Current process identity: IIS APPPOOL\DefaultAppPool
<!--#include file="ConnDB.asp"--> <!--#include file="Function.asp"--> <!--#include file="iFunc.inc"--> <html> <head> <meta http-equiv="Content-Language" content="th"> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <title>������СԨ���� ���</title> <link rel="stylesheet" type="text/css" href="style_sheet/news_event.css"> <% if session("username") = Empty then %> <SCRIPT LANGUAGE="JavaScript"> <!-- alert("Permission denied...!!!"); history.back(); //--> </SCRIPT> <% response.end else %> <% Dim monly(12) '�纪����� ������㹡���ʴ�� Select monly(0) = "���Ҥ�" monly(1) = "����Ҿѹ��" monly(2) = "�չҤ�" monly(3) = "����¹" monly(4) = "����Ҥ�" monly(5) = "�Զع�¹" monly(6) = "�á�Ҥ�" monly(7) = "�ԧ�Ҥ�" monly(8) = "�ѹ��¹" monly(9) = "���Ҥ�" monly(10) = "��Ȩԡ�¹" monly(11) = "�ѹ�Ҥ�" %> <SCRIPT LANGUAGE="JavaScript"> <!-- function OpenDialog(xfile,w1,h1) { y8 = window.showModalDialog(xfile,"","dialogHeight: " + h1 + "px; dialogWidth: " + w1 + "px; dialogTop: px; dialogLeft: px; center: Yes; help: No; edge: Raised; resizable: No; status: No; scroll : No"); return(y8); } //--> </SCRIPT> <script language="JavaScript"> <!-- function Check() { var news_topic = document.frm.news_topic.value; var y_email = document.frm.y_email.value; var y_name = document.frm.y_name.value; var tel = document.frm.tel.value; var ref_url = document.frm.ref_url.value; //˹��§ҹ if (document.FORM1.fac_id.value=="-") { alert("�ô�к�... ˹��§ҹ"); document.FORM1.fac_id.focus(); return false; } //���������� if (document.frm.type_id.value=="0") { alert("�ô���͡... ����������"); document.frm.type_id.focus(); return false; } //��Ǣ�͢��� if (news_topic.length <=9) { alert("�ô�к�... ��Ǣ�͢��� ���ҧ���� 10 ����ѡ��"); document.frm.news_topic.focus(); return false; } //tel if ( tel != "") { if (tel.length <= 3) { alert("�ô�к�... �����Ţ���Ѿ�� ���ҧ���� 4 ����ѡ��"); document.frm.tel.focus(); return false; } } //ref_url if ( ref_url != "") { if ((ref_url.length <= 8) || (ref_url.indexOf('.') == -1)) { alert("������ҧ�� http://www.swu.ac.th"); document.frm.ref_url.focus(); return false; } } //���ͼ���觢��� if (y_name.length <=1) { alert("�ô�к�... ���ͼ���觢��� ���ҧ���� 2 ����ѡ��"); document.frm.y_name.focus(); return false; } //E-mail ����觢��� if ((y_email.length <= 5) || (y_email.indexOf('@') == -1) || (y_email.indexOf('.') == -1)) { alert("�ô�к�... E-mail ����觢��� �� suwimon@swu.ac.th"); document.frm.y_email.focus(); return false; } else return true; } //--> </script> </head> <% fac_id = request("fac_id") '���ʤ�� major_id = request("major_id") '�����Ҥ %> <body topmargin="0" leftmargin="0"> <BR> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1"> <tr> <td width="100%" class="title_head" background="images/dot_gray.gif"> <span lang="en-us">�觢�����СԨ��������</span></td> </tr> <tr> <td width="100%" background="images/dot_nevy.gif"> <img border="0" src="images/tr.gif" width="1" height="1"></td> </tr> </table> <BR> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2"> <% set rs = server.CreateObject ("ADODB.Recordset") ' ************************* Faculty info ***************************** strSQL ="select dept_id, dept_l_name " &_ " from c_in_dept_info " &_ " where mod(dept_id,100)=0 ORDER BY dept_id" rs.Open strSQL,conn rs.MoveFirst %> <FORM action="add_news.asp" id=FORM1 method=get name=FORM1> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="100%"> <table border="0" width="100%"cellspacing="0" cellpadding="0"> <TR> <td width="20%" class="normal">���/ʶҺѹ<font color="#FF0000">*</font></td> <TD width="80%" class="normal"> <SELECT id=select1 name="fac_id" onChange="javascript:window.document.FORM1.submit();"> <OPTION value="-">-- SELECT --</OPTION> <OPTION value="10000" <%if fac_id = "10000" then response.write "selected"%>>����Է�������չ��Թ�����ò</OPTION> <%do while not rs.EOF rs_fac_id = rs("dept_id") rs_dept_l_name = rs("dept_l_name")%> <OPTION <% if cStr(fac_id) = cStr(rs_fac_id) then %>selected <%end if%>value="<%=trim(rs_fac_id)%>"><%=rs_dept_l_name%></OPTION> <%rs.MoveNext%> <%loop%> </SELECT> </TD> </TR> </table> <!-- ***************** MAJOR or DEPT ******************--> <table border="0" width="100%"cellspacing="0" cellpadding="0"> <TR> <td width="20%" class="normal">�Ҥ�Ԫ�<font color="#FF0000">*</font></td> <TD width="80%" class="normal"><SELECT id=select2 name="major_id" onChange="javascript:window.document.FORM1.submit();"> <OPTION value="-"> -- SELECT --</OPTION> <%if fac_id = "10000" then%> <OPTION value="10000" <% if major_id="10000" then response.write "selected"%>> ����Է�������չ��Թ�����ò</OPTION> <%else if fac_id = "20000" then%> <% else %> <%if fac_id <> "" then 'Major info set rsDept = server.CreateObject ("ADODB.Recordset") strSQLDept = " select dept_id , dept_l_name " &_ " from c_in_dept_info " &_ " where dept_id - mod(dept_id,100) = to_number('"& fac_id &"') " rsDept.Open strSQLDept, conn rsDept.MoveFirst do while not rsDept.EOF rs_major_id = rsDept("dept_id") rs_dept_l_name = rsDept("dept_l_name") %> <OPTION <% if cStr(major_id) = cStr(rs_major_id) then %>selected <%end if%>value="<%=trim(rs_major_id)%>"><%=rs_dept_l_name%></OPTION> <%rsDept.MoveNext%> <%loop%> <%rsDept.close()%> <% end if %> <% end if %> <% end if %> </SELECT> </TD> </TR> </TABLE> </FORM> <form name="frm" method="POST" enctype="multipart/form-data" action="addnews.asp" onSubmit="return Check();"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="25%" class="normal">����������/�Ԩ����<font color="#FF0000">*</font></td> <td width="75%" class="normal"> <SELECT id=select3 name="type_id"> <OPTION value="0">-- SELECT --</OPTION> <% set rsty = server.CreateObject ("ADODB.Recordset") strSql = "select * from nw_type where flag='1' ORDER BY type_id" rsty.Open strSql,conn while not rsty.EOF rs_type_id = rsty("type_id") rs_type_name= rsty("type_name") %> <OPTION <% if cStr(type_id) = cStr(rs_type_id) then %>selected <%end if%>value="<%=trim(rs_type_id)%>"><%=rs_type_name%></OPTION> <% rsty.MoveNext wend rsty.Close %> </select> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="25%" class="normal">��Ǣ�͢���<font color="#FF0000">*</font></td> <td width="75%"class="normal"><input type="text" name="news_topic" size="50" maxlength="150"class = "input"></td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="25%" valign="top" class="normal">File �͡���Ṻ(�����)</td> <td width="75%" class="normal"><input type="file" name="files" size="30" class = "input"></td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="25%" class="normal">URL ���ʹ���������´������� </td> <td width="30%" class="normal"><input type="text" name="ref_url" size="20" maxlength="100" class= "input"></td> <td width="20%" class="normal">�������Ѿ��Դ���</td> <td width="25%" class="normal"><input type="text" name="tel" size="10" maxlength="10" class = "input"></td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="25%" class="normal">���ͼ���觢���<font color="#FF0000">*</font></td> <td width="30%" class="normal"><input type="text" name="y_name" size="20" maxlength="100" class="input"></td> <td width="20%" class="normal">E-mail ����觢���<font color="#FF0000">*</font></td> <td width="25%" class="normal"><input type="text" name="y_email" size="15" maxlength="100" class="input"></td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="25%" class="normal">�ѹ�������С�Ȣ���<font color="#FF0000">*</font></td> <td width="75%" class="normal"> �ѹ���<SELECT size="1" name="dd1" CLASS="input"> <% for i = 1 to 31 response.write "<OPTION VALUE=" & i If Trim(Request("dd1"))="" Then if i = Cint(day(now)) then Response.write " selected" end if Else If cint(Request("dd1"))=i Then Response.write " selected" End If End If Response.write ">" & i next %> </SELECT>��<SELECT size="1" name="mm1" CLASS="input"> <% for i = 1 to 12 Response.write "<OPTION VALUE=" & i If Trim(Request("mm1"))="" Then if i = Cint(month(now)) then Response.write " selected" end if Else If cint(Request("mm1"))=i Then Response.write " selected" End If End If Response.write ">" & monly(i-1) next %> </SELECT>��<SELECT size="1" name="yy1" CLASS="input"> <% for i = 2004 to 2007 Response.write "<OPTION VALUE=" & i If Trim(Request("yy1"))="" Then if i = Cint(year(now)) then Response.write " selected" end if Else If cint(Request("yy1"))=i Then Response.write " selected" End If End If Response.write ">" & i + 543 next %> </SELECT><b> �֧<br> </b>�ѹ���<SELECT size="1" name="dd2" CLASS="input"> <% for i = 1 to 31 response.write "<OPTION VALUE=" & i If Trim(Request("dd2"))="" Then if i = Cint(day(now)) then Response.write " selected" end if Else If cint(Request("dd2"))=i Then Response.write " selected" End If End If Response.write ">" & i next %></SELECT>��<SELECT size="1" name="mm2" CLASS="input"> <% for i = 1 to 12 Response.write "<OPTION VALUE=" & i If Trim(Request("mm2"))="" Then if i = Cint(month(now)) then Response.write " selected" end if Else If cint(Request("mm2"))=i Then Response.write " selected" End If End If Response.write ">" & monly(i-1) next %> </SELECT>��<SELECT size="1" name="yy2" CLASS="input"> <% for i = 2004 to 2007 Response.write "<OPTION VALUE=" & i If Trim(Request("yy2"))="" Then if i = Cint(year(now)) then Response.write " selected" end if Else If cint(Request("yy2"))=i Then Response.write " selected" End If End If Response.write ">" & i + 543 next %></SELECT> </td> </tr> </table> <br> <table border="0" width="100%" cellpadding="0"> <tr> <td width="100%"> <p align="center"> <input type="hidden" value="<%=fac_id%>" name="fac_id"> <input type="hidden" value="<%=major_id%>" name="major_id"> <input type="submit" value="Next >>" name="submit" class="submit"> <input type="reset" value="Reset" name="reset" class = "submit"></p> </td> </tr> </table> </td> </tr> </table> </form> </table> <% end if %> <%'*************************EDIT************************************%> <BR> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%" id="AutoNumber1"> <tr> <td width="100%" class="title_head" background="images/dot_gray.gif" align="center">��䢢��Ƿ���͡����ѵ�</td> </tr> <tr> <td width="100%" background="images/dot_nevy.gif"> <img border="0" src="images/tr.gif" width="1" height="1"></td> </tr> </table> <BR> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2"> <table width="90%" cellspacing="0" cellpadding="0" class="m_table" border="1" bordercolor="#FFFFFF"> <tr class="m_body2"> <td width="70%" class="normal"><p align="center">��Ǣ�͢���</td> <td width="20%" class="normal"><p align="center">�ѹ�������Ъ�����ѹ��</td> <td width="10%" class="normal"><p align="center">Action</td> </tr> <% set rs=server.createobject("adodb.recordset") strsql=" select * from nw_events where approve_flag = 1 and username = '"&session("username")&"' order by post_datetime desc " rs.open strSQL, Conn Do while not rs.eof news_topic=rs("news_topic") y_name=rs("y_name") news_id=rs("news_id") begin_pr = rs("begin_pr") '�ѹ������������ʴ����� begDay=right("0" & day(rs("begin_pr")),2) begMonth=right("0" & month(rs("begin_pr")),2) begYear=year(rs("begin_pr"))+543 begDate = begYear&begMonth&begDay '�ѹ�������ش����ʴ����� endDay=right("0" & day(rs("end_pr")),2) endMonth=right("0" & month(rs("end_pr")),2) endYear=year(rs("end_pr"))+543 endDate = endYear&endMonth&endDay if len(news_topic)>80 then news_topic = left(news_topic,80) & "..." end if %> <% response.write "<tr class=m_body1><td width=50% class=normal> " &""&news_topic&"</td>" response.write "<td width=20% class=normal> " & day(rs("begin_pr")) & " " & thMonS(month(rs("begin_pr"))-1) & " " & right(year(rs("begin_pr"))+543,2)&"</td>" response.write "<td width=30% class=normal align=center> " &"<a href=' preview_news.asp?news_id="&news_id&"' class=normal>Edit</a></td></tr>" rs.movenext loop rs.Close Set rs=Nothing Conn.Close SET Conn=Nothing %> </table> <br> </body> </html>