 |
|
<%@ Language=VBScript %>
<% response.buffer=true %>
<!-- #INCLUDE FILE="../DBSystem/Utility.asp" -->
<%
' Counter Person Start
strConSQL="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=IntranetGeneralUsr;" & "Initial Catalog=MTEC;Data Source=Joobjib"
Set objConSQL=Server.CreateObject("ADODB.Connection")
objConSQL.Open strConSQL
Set RS = Server.CreateObject("ADODB.Recordset")
%>
<html>
<head>
<title>ระบบสารสนเทศใน MTEC </title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<meta name="keywords" content="DB Information System">
</head>
<body bgcolor="#FFFFFF" text="#009999">
<form name="SystemSrch" method="post" action="syssrch.asp">
<p align="center"><font color="#023491" size="4" face="Microsoft Sans Serif"><strong>ระบบสารสนเทศในMTEC </strong></font></p>
<table width="99%" border="0" align="center">
<tr>
<td width="22%"><font face="Microsoft Sans Serif"><strong><font color="#FF0000" size="2">Search By </font></strong></font></td>
<td width="75%"> </td>
</tr>
<tr>
<td><font face="Microsoft Sans Serif"><strong><font color="#023491" size="2">ผู้ดูแล (Owner)</font></strong></font></td>
<td width="75%"><font color="#023491" size="2" face="Microsoft Sans Serif">
<%
Set RSS = Server.CreateObject("ADODB.Recordset")
SQLS = "SELECT DISTINCT TOP 100 PERCENT dbo.Cmp_DBSystem.sect_id, dbo.SECTION.SECT_TH FROM dbo.Cmp_DBSystem INNER JOIN dbo.SECTION ON dbo.Cmp_DBSystem.sect_id = dbo.SECTION.SECT_ID ORDER BY dbo.Cmp_DBSystem.sect_id DESC"
if RSS.state=1 then RSS.Close
RSS.Open SQLS,objConSQL,1,3
if Err.Number <> 0 Then
response.clear
session("Deserror")=Err.description
response.end
end if
if not rss.eof then
str=""
do while rss.eof=false
str=str & "<option value='" & rss("sect_id") & "'"
if cdbl(rss("sect_id"))=cdbl(request("sect_srch")) then str=str & " selected "
str=str & ">" & rss("SECT_TH") &"</option> "
rss.movenext
loop
end if
RSS.Close
%>
<select name="sect_srch">
<%=str%>
</select>
</font></td>
</tr>
<tr>
<td><font face="Microsoft Sans Serif"><strong><font color="#023491" size="2">ชื่อระบบ(Th/En)</font></strong></font></td>
<td><font color="#023491" size="2" face="Microsoft Sans Serif">
<input type="text" name="name" size="51" maxlength="255"value="<%=request("name")%>">
</font></td>
</tr>
<tr>
<td><font face="Microsoft Sans Serif"><strong><font color="#023491" size="2">Admin</font></strong></font></td>
<td><font color="#023491" size="2" face="Microsoft Sans Serif">
<%
Set RSS = Server.CreateObject("ADODB.Recordset")
SQLS = "SELECT DISTINCT TOP 100 PERCENT admin_id, FName_TH, LName_TH FROM Cmp_DBSystem, Person WHERE Cmp_DBSystem.admin_id=Person.person_id ORDER BY Cmp_DBSystem.admin_id"
if RSS.state=1 then RSS.Close
RSS.Open SQLS,objConSQL,1,3
if Err.Number <> 0 Then
response.clear
session("Deserror")=Err.description
response.end
end if
if not rss.eof then
str=""
do while rss.eof=false
str=str & "<option value='" & rss("admin_id") & "'"
if cdbl(rss("admin_id"))=cdbl(request("adminselect")) then str=str & " selected "
str=str & ">" & rss("FName_TH") &"</option>"
rss.movenext
loop
end if
RSS.Close
%>
<select name="adminselect">
<option value="0">ไม่ระบุ</option>
<%=str%>
</select>
</font></td>
</tr>
<tr>
<td><font face="Microsoft Sans Serif"><strong><font color="#023491" size="2">สถานภาพ(Status)</font></strong></font></td>
<td><font color="#023491" size="2" face="Microsoft Sans Serif">
<%
Set RSS = Server.CreateObject("ADODB.Recordset")
SQLS = "SELECT DISTINCT TOP 100 PERCENT dbo.Cmp_DBSystem.status_id, dbo.Cmp_DBSystem_Status.status FROM dbo.Cmp_DBSystem INNER JOIN dbo.Cmp_DBSystem_Status ON dbo.Cmp_DBSystem.status_id = dbo.Cmp_DBSystem_Status.status_id ORDER BY dbo.Cmp_DBSystem.status_id"
if RSS.state=1 then RSS.Close
RSS.Open SQLS,objConSQL,1,3
if Err.Number <> 0 Then
response.clear
session("Deserror")=Err.description
response.end
end if
if not rss.eof then
str=""
do while rss.eof=false
str=str & "<option value='" & rss("status_id") & "'"
if cdbl(rss("status_id"))=cdbl(request("statusselect")) then str=str & " selected "
str=str & ">" & rss("status") &"</option>"
rss.movenext
loop
end if
RSS.Close
%>
<select name="statusselect">
<%=str%>
<option value="0">ไม่ระบุ</option>
</select>
</font></td>
<td width="1%"> </td>
<td width="0%">
<td width="2%" rowspan="3"><font color="#023491" size="2" face="Microsoft Sans Serif">
<%
Set RSS = Server.CreateObject("ADODB.Recordset")
STFromDate=cdbl(SaveThDt(Request("st_date")))
EDToDate=cdbl(SaveThDt(Request("en_date")))+0.9999884
sql="SELECT * FROM dbo.Cmp_DBSystem where end_date between " & STFromDate & " and " & EDToDate & " order by dbo.Cmp_DBSystem.end_date DESC"
if RSS.state=1 then RSS.Close
RSS.Open SQLS,objConSQL,1,3
if Err.Number <> 0 Then
response.clear
session("Deserror")=Err.description
response.end
end if
RSS.Close
%>
</font> </tr>
<tr>
<td><font face="Microsoft Sans Serif"><strong><font color="#023491" size="2">วันที่เริ่มต้น (Start Date) </font></strong></font></td>
<td><font color="#023491" size="2" face="Microsoft Sans Serif">
<input name="st_date" type="text" value="" size="20">
<strong> วันที่เสร็จสิ้น (End Date) </strong>
<input name="en_date" type="text" value="" size="20">
</font>
<font color="#023491" size="2" face="Microsoft Sans Serif"> (dd/mm/yyyy Ex. 31/12/2549)</font> </tr>
<tr>
<td><font size="2"> </font></td>
<td>
</tr>
<td><font size="2"> </font></td>
</tr>
<tr> </tr>
<tr>
<td><div align="center"><font size="2"></font></div></td>
<td><div align="left"> <font color="#0033FF" size="2" face="Microsoft Sans Serif">
<input type="submit" name="Submit" value="ค้นหา">
</font></div></td>
</tr>
</table>
</form>
<div align="center">
<font face="Microsoft Sans Serif">
<%if request("sect_srch")=0 and request("name")="" and request("en_date")="" and request("adminselect")=0 and request("statusselect")=0 then%>
</font></div>
<font face="Microsoft Sans Serif"><font face="AngsanaUPC">
<div align="center">
<font color="#0000FF">
<% end if%>
<%SQL=" SELECT TOP 100 PERCENT dbo.Cmp_DBSystem.sys_name_th, dbo.Cmp_DBSystem.sys_name_en, dbo.Cmp_DBSystem.admin_id, dbo.Cmp_DBSystem.end_date, dbo.Cmp_DBSystem.status_id, dbo.Cmp_DBSystem.start_date, dbo.PERSON.FNAME_TH, dbo.PERSON.LNAME_TH, dbo.Cmp_DBSystem.job_typeid, dbo.Cmp_SystemType.job_type, dbo.Cmp_DBSystem_Status.status, dbo.[SECTION].SECT_TH, dbo.Cmp_DBSystem.sys_id, dbo.Cmp_DBSystem.sect_id, dbo.Cmp_DBSystem_DevTeam.Staff_ID, PERSON_1.FNAME_TH AS staff_name_th FROM dbo.PERSON RIGHT OUTER JOIN dbo.PERSON PERSON_1 RIGHT OUTER JOIN dbo.Cmp_DBSystem_DevTeam ON PERSON_1.PERSON_ID = dbo.Cmp_DBSystem_DevTeam.Staff_ID RIGHT OUTER JOIN dbo.Cmp_SystemType RIGHT OUTER JOIN dbo.Cmp_DBSystem LEFT OUTER JOIN dbo.Cmp_DBSystem_Status ON dbo.Cmp_DBSystem.status_id = dbo.Cmp_DBSystem_Status.status_id ON dbo.Cmp_SystemType.job_typeid = dbo.Cmp_DBSystem.job_typeid LEFT OUTER JOIN dbo.[SECTION] ON dbo.Cmp_DBSystem.sect_id = dbo.[SECTION].SECT_ID ON dbo.Cmp_DBSystem_DevTeam.SyS_ID = dbo.Cmp_DBSystem.sys_id ON dbo.PERSON.PERSON_ID = dbo.Cmp_DBSystem.admin_id WHERE (1 = 1)"
if request("sect_srch")<>0 then
SQL = SQL & " and SECTION.SECT_ID = '" & request("sect_srch")&"'"
end if
if request("name")<>"" then
SQL = SQL & " and sys_name_th like '%" & request("name") & "%'"
end if
if request("en_date")<>"" then
SQL = SQL & " and end_date between " & STFromDate & " and " & EDToDate
end if
if request("adminselect")<>0 then
SQL = SQL & " and Cmp_DBSystem.admin_id=" & request("adminselect")
end if
if request("statusselect")<>0 then
SQL = SQL & " and Cmp_DBSystem.status_id=" & request("statusselect")
end if
SQL = SQL & " ORDER BY dbo.Cmp_DBSystem.start_date DESC, dbo.Cmp_DBSystem.end_date DESC, dbo.Cmp_DBSystem.sys_id "
if RS.state=1 then RS.Close
RS.Open SQL,objConSQL,1,3
if Err.Number <> 0 Then
response.clear
session("Deserror")=Err.description
response.end
end if
%>
</font>
<table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#023491" bgcolor="#023491" >
<tr>
<td>
<tr bordercolor="#333333" bgcolor="#023491">
<td width="25%" height="44"><p align=center><font size="2" face="Microsoft Sans Serif"><strong><font color="#FFFFFF">ชื่อระบบ</font></strong></font></p></td>
<td width="15%"><p align=center><font size="2" face="Microsoft Sans Serif"><strong><font color="#FFFFFF">ผู้ดูแล</font></strong></font></p></td>
<td width="15%"><p align=center><font size="2" face="Microsoft Sans Serif"><strong><font color="#FFFFFF">ประเภทงาน (Job Type)</font></strong></font></p></td>
<td width="15%"><p align=center><font size="2" face="Microsoft Sans Serif"><strong><font color="#FFFFFF">วันที่เริ่มต้น (Start Date)</font></strong></font></p></td>
<td width="15%"><p align=center><font size="2" face="Microsoft Sans Serif"><strong><font color="#FFFFFF">วันที่สิ้นสุด (End Date)</font></strong></font></p></td>
<td width="18%"><p align=center><font size="2" face="Microsoft Sans Serif"><strong><font color="#FFFFFF">Admin</font></strong></font></p></td>
<td width="18%"><p align=center><font size="2" face="Microsoft Sans Serif"><strong><font color="#FFFFFF">สถานภาพ (Status)</font></strong></font></p></td>
<td width="15%"><p align=center><font size="2" face="Microsoft Sans Serif"><strong><font color="#FFFFFF">Staff</font></strong></font></p></td>
</tr>
<%
if not rs.eof then
RS.movefirst
else
%>
<tr>
<td height="28" colspan=8 bgcolor="#FFFFFF"><p align=center><font color="#FF0000" size="2" face="Microsoft Sans Serif"><b>ไม่มีข้อมูล</b></font></p></td>
</tr>
<div align="center"><font color="#0000FF" face="Microsoft Sans Serif">
<%end if%>
<%
sys_staff=0
while not RS.eof
if sys_staff<>rs("sys_id") then
sys_staff=rs("sys_id")
Set RSS2 = Server.CreateObject("ADODB.Recordset")
sql= "SELECT TOP 100 PERCENT dbo.Cmp_DBSystem_DevTeam.Staff_ID, PERSON_1.FNAME_TH AS staff_name_th, PERSON_1.LNAME_TH FROM dbo.PERSON PERSON_1 RIGHT OUTER JOIN dbo.Cmp_DBSystem_DevTeam ON PERSON_1.PERSON_ID = dbo.Cmp_DBSystem_DevTeam.Staff_ID WHERE dbo.Cmp_DBSystem_DevTeam.SyS_ID = "&sys_staff
RSS2.Open SQL,objConSQL,1,3
if Err.Number <> 0 Then
response.clear
session("Deserror")=Err.description
response.end
end if
staff_name=""
do while not rss2.eof
staff_name= staff_name &rss2("staff_name_th")
rss2.movenext
if not rss2.eof then
staff_name= staff_name & "/" & "<br>"
end if
loop
RSS2.close
sysname = trim(rs("sys_name_th") & " " & rs("sys_name_en"))
varsect= trim(rs("SECT_TH"))
vartypename = trim(rs("job_type"))
varstartdate = trim(rs("start_date"))
varenddate = trim(rs("end_date"))
varadmin = trim(rs("FNAME_TH") & " " & rs("LNAME_TH"))
varstatus = trim(rs("status"))
%>
</font></div>
<tr bgcolor="#FFFFFF">
<td width="15%"><p align=center><font color="#023491" size="2" face="Microsoft Sans Serif"> <%=sysname%></font></p></td>
<td width="15%"><p align=center><font color="#023491" size="2" face="Microsoft Sans Serif"> <%=varsect%></font></p></td>
<td width="15%"><p align=center><font color="#023491" size="2" face="Microsoft Sans Serif"> <%=vartypename%></font></p></td>
<td width="15%"><p align=center><font color="#023491" size="2" face="Microsoft Sans Serif"> <%=varstartdate%></font></p></td>
<td width="15%"><p align=center><font color="#023491" size="2" face="Microsoft Sans Serif"> <%=varenddate%></font></p></td>
<td width="10%"><p align=center><font color="#023491" size="2" face="Microsoft Sans Serif"> <%=varadmin%></font></p></td>
<td width="15%"><p align=center><font color="#023491" size="2" face="Microsoft Sans Serif"> <%=varstatus%></font></p></td>
<td width="15%"><p align=center><font color="#023491" size="2" face="Microsoft Sans Serif"> <%=staff_name%></font></p></td>
</tr>
<%
end if
RS.movenext
wend
set rs=nothing
set objConSQL=nothing
%>
</table>
<p><center>
<font face="Microsoft Sans Serif"><b><font size="+1" color="#006699"><br>
<br>
</font><font size="+1" color="#006699"></b></font><b><hr width="80%">
<font face="Microsoft Sans Serif"><br>
</font><font color="#006699" size="+1" face="Microsoft Sans Serif" ><font size="5"><font color="#023491" size="4">สอบถามข้อมูลเพิ่มเติมได้ที่งานที่รับผิดชอบระบบ <br>
หรือ งานระบบสารสนเทศเพื่อการจัดการ เบอร์โทร 4344-6 </font></font></font><font size="4"><font face="Microsoft Sans Serif"></font></b><font color="#023491" size="4" face="Microsoft Sans Serif"></b>
</font>
</center>
<font color="#023491" face="Microsoft Sans Serif">
</p>
</font><font face="Microsoft Sans Serif"><br>
<br>
<br>
</font>
</body>
</html>

Tag : - - - -
|
|
 |
 |
 |
 |
Date :
24 ส.ค. 2550 08:56:51 |
By :
ขอบคุณ |
View :
1801 |
Reply :
6 |
|
 |
 |
 |
 |
|
|
|
 |