dropdownlist list item name changes on button click.....this is the problem..

  • Thread starter Thread starter love4csharp
  • Start date Start date
L

love4csharp

Guest
hi guys

need help

when i select one option from dropdownlist. it provides me data correctly. for eg. suppose i select aoption A....it works but when i click ok button to display data it names changes.to other B ...it takes other name form dropdownlist..item........this is the main problem.how to solve it.

here is the code. kindly provide solution.

if ques is not clear then plz let me know.

<%@ Page Language="VB" AspCompat="true" Inherits="myPage"%>
<%@ Import namespace="ADODB" %><% RStoTablePre()%>




<%
op= Request.QueryString("op")
D1= Request.QueryString("D1")
fdate= Request.QueryString("fdate")
B_go= Request.QueryString("B_go")
qtype= Request.QueryString("qtype")
On Error Resume Next
Session.LCID = 2057
tdate = Date.Today.ToShortDateString
tdate1 = DateAdd(DateInterval.Day, 1, Date.Today).ToShortDateString


%>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>File Tracker >> File >> Pending Files</title>
<link rel="Stylesheet ../inc/htmlstyle.css" />
<script type="text/javascript" language="javascript" src="../inc/script.js </script>

<script type="text/javascript" language="javascript" src="../inc/sorttable.js </script>
<script type="text/javascript" language="javascript" src="../inc/tableresize.js </script>
<link rel="stylesheet ../inc/calendar.css" />
<script type="text/javascript" language="javascript" src="../inc/calendar.js </script>
<script type="text/javascript" language="javascript
<!--

//-->
</script>
</head>

<body topmargin=0>

<div align="center
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%
<tr>
<td height="41
<font size="5" color="#5ED548 <b>Pending Files</b></font></td>
</tr>
<tr>
<td>
<div align="left
<table border="1" cellpadding="0" style="border-collapse: collapse" width="326" bgcolor="#92DCB9" height="37
<form id="f1" method="GET" action="? <input type=hidden value="reg" name="op
<tr>
<td>
<div align="center
<div align="left
<table border="1" cellpadding="0" style=" border-collapse: collapse" width="364" bgcolor="#92DCB9" height="37" class="qtable" id="table1

<tr>
<td>
<div align="center
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table2
<tr>
<td style="border-style:none; border-width:medium; " width="331
<p align="center
<font >
<select style="font-family:Verdana;font-size:10 px" size="1" name="qtype
<option value="Sent to Other Department But Not Returned Sent to Other Department But Not Returned Yet
</option>
<option value="Came From Other Department But Not Sent Back Came From Other Department But Not Sent Back Yet
</option>
<option value="Creation File For More Than 5 Days Creation File For More Than 5 Days
</option>
<option value="Received File For More Than 3 Days Received File For More Than 3 Days
</option>
<option value="Dispatch File For More Than 3 Days Dispatch File For More Than 3 Days
</option>
</select></font></td>
<td style="border-left-style: none; border-left-width: medium <%
response.write level98
Err.Clear()
Select Case CShort(level98)
Case Is>4

RStoCombo "Select department_code,department_name from departments union select ,All Departments from departments", 1,0, "dept", "", 300, "",dept
Case Else
RStoCombo "Select department_code,department_name from departments where department_code=" & dept98 & "", 1,0, "dept", "", 300, "",dept
End Select

%><input type="submit" value="Go" name="B_go" style="color: #000000; font-family: Microsoft Sans Serif; font-size: 10px; border: 1px solid #808080; background-color: #FED676; background-image: url(../images/bg1.jpg)" ></td>
</tr>
</table>

</td>
</tr>
</table>


</td>
</tr></form>
</table>

</td>
</tr>
<tr>
<td>
&nbsp;</td>
</tr>
<tr>
<td style="border-style: solid; border-width: 1px; margin-left: 10; margin-right: 10 <div align=center>
<%
If B_go = "Go" Then

DBInit()



select case qtype
case "Sent to Other Department But Not Returned"

REGSQL="select "filetrack.aspx?fname=||chg_filename||" ||chg_filename|| as ""File Code"",file_subject as ""Subject"",(select department_name from departments where department_code=t1.dept) as ""Sent to Department"",max(dt) as ""Sent At"" from (select chg_filename,(select department_code from offices where office_code=filetrans.next_office_code) as dept,file_subject,despatch_date_time as dt,1 as xx from filetrans, filemaster where filemaster.department_code = file_department And filemaster.section_code = file_section And file_serial_no = file_serial and filemaster.file_year=filetrans.file_year and file_department=" & dept98 & " and (select department_code from offices where office_code=filetrans.next_office_code)<>" & dept98 & " and (select department_code from offices where office_code=filetrans.office_code)=" & dept98 & " union Select chg_filename,(select department_code from offices where office_code=f1.office_code),file_Subject,to_date(12/02/2001,dd/mm/yyyy),-1 from filetrans f1,filemaster f2 where f1.file_department=f2.department_code and f2.section_code=f1.file_section and f2.file_serial_no = f1.file_serial and f1.file_department=" & dept98 & " and (select department_code from offices where office_code=f1.office_code)<>" & dept98 & " and (select department_code from offices where office_code=f1.next_office_code)=" & dept98 & ") t1 group by chg_filename,dept,file_subject having sum(xx)=1 order by max(dt) desc"

REGSQL = "select "filetrack.aspx?fname=||chg_filename||" ||chg_filename|| as ""File Code"",file_subject as ""Subject"", decode(filetrans.next_office_code, null, (select department_name from departments where department_code=(select department_code from offices where office_code=filetrans.office_code)), (select department_name from departments where department_code=(select department_code from offices where office_code=filetrans.next_office_code))) as ""From Department"" from filetrans, filemaster where filemaster.department_code = file_department And filemaster.section_code = file_section And file_serial_no = file_serial and filemaster.file_year=filetrans.file_year and filetrans.id in (select max(filetrans.id) from filetrans, filemaster where filemaster.department_code = file_department And filemaster.section_code = file_section And file_serial_no = file_serial and filemaster.file_year=filetrans.file_year and filemaster.chg_filename in ( select filemaster.chg_filename from filetrans, filemaster where filemaster.department_code = file_department And filemaster.section_code = file_section And file_serial_no = file_serial and filemaster.file_year=filetrans.file_year and file_department=" & dept98 & " and filetrans.next_office_code in (Select office_code from offices where department_code<>" & dept98 & ") group by filemaster.chg_filename ) group by filemaster.chg_filename ) and ( (select department_code from offices where office_code=filetrans.next_office_code)<>" & dept98 & " or (select department_code from offices where office_code=filetrans.office_code)<>" & dept98 & " and filetrans.next_office_code is null )"



Case "Came From Other Department But Not Sent Back"
REGSQL = "select "filetrack.aspx?fname=||chg_filename||" ||chg_filename|| as ""File Code"",file_subject as ""Subject"",(select department_name from departments where department_code=t1.dept) as ""From Department"",max(dt) as ""Sent At"" from (select chg_filename,(select department_code from offices where office_code=filetrans.office_code) as dept,file_subject,despatch_date_time as dt,1 as xx from filetrans, filemaster where filemaster.department_code = file_department And filemaster.section_code = file_section And file_serial_no = file_serial and filemaster.file_year=filetrans.file_year and file_department<>" & dept98 & " and (select department_code from offices where office_code=filetrans.next_office_code)=" & dept98 & " and (select department_code from offices where office_code=filetrans.office_code)<>" & dept98 & " union Select chg_filename,(select department_code from offices where office_code=f1.next_office_code),file_Subject,to_date(12/02/2001,dd/mm/yyyy),-1 from filetrans f1,filemaster f2 where f1.file_department=f2.department_code and f2.section_code=f1.file_section and f2.file_serial_no = f1.file_serial and f1.file_department<>" & dept98 & " and (select department_code from offices where office_code=f1.office_code)=" & dept98 & " and (select department_code from offices where office_code=f1.next_office_code)<>" & dept98 & ") t1 group by chg_filename,dept,file_subject having sum(xx)=1 order by max(dt) desc"
REGSQL = "select "filetrack.aspx?fname=||chg_filename||" ||chg_filename|| as ""File Code"",file_subject as ""Subject"", (select department_name from departments where department_code=filetrans.file_department) as ""From Department"" from filetrans, filemaster where filemaster.department_code = file_department And filemaster.section_code = file_section And file_serial_no = file_serial and filemaster.file_year=filetrans.file_year and filetrans.id in (select max(filetrans.id) from filetrans, filemaster where filemaster.department_code = file_department And filemaster.section_code = file_section And file_serial_no = file_serial and filemaster.file_year=filetrans.file_year and filemaster.chg_filename in ( select filemaster.chg_filename from filetrans, filemaster where filemaster.department_code = file_department And filemaster.section_code = file_section And file_serial_no = file_serial and filemaster.file_year=filetrans.file_year and file_department<>" & dept98 & " and filetrans.next_office_code in (Select office_code from offices where department_code=" & dept98 & ") group by filemaster.chg_filename ) group by filemaster.chg_filename ) and ( (select department_code from offices where office_code=filetrans.next_office_code)=" & dept98 & " or (select department_code from offices where office_code=filetrans.office_code)=" & dept98 & " and filetrans.next_office_code is null )"


Case "Creation File For More Than 5 Days"

REGSQL = "select "filetrack.aspx?fname=||chg_filename||||" ||chg_filename|| as ""File No"",file_subject as ""File Subject"",CREATION_DATE as ""Creation Date"",(select department_name from departments where department_code=filemaster.department_code and rownum=1) as ""Dept"",(select section_name from sections where section_cd=filemaster.section_code and rownum=1 and dept_cd=filemaster.department_code) as ""Section"" from filemaster where CREATION_DATE between trunc(sysdate-5)+(15/24)and least( trunc(sysdate)+(15/24), sysdate) "
Case "Dispatch File For More Than 3 Days"

REGSQL = "select "filetrack.aspx?fname=||chg_filename||||" ||chg_filename|| as ""File No"",file_subject as ""File Subject"",(select DESPATCH_DATE_TIME from FILETRANS where filemaster.file_serial_no = FILETRANS.file_serial and filemaster.file_year=FILETRANS.file_year and filetrans.DESPATCH_DATE_TIME between trunc(sysdate-6)+(15/24) and least( trunc(sysdate)+(15/24), sysdate) and rownum=1) as ""Dispatch Date"",(select department_name from departments where department_code=filemaster.department_code and rownum=1) as ""Dept"",(select section_name from sections where section_cd=filemaster.section_code and rownum=1 and dept_cd=filemaster.department_code) as ""Section"" from filemaster "
Case "Received File For More Than 3 Days"

REGSQL = "select "filetrack.aspx?fname=||chg_filename||||" ||chg_filename|| as ""File No"",file_subject as ""File Subject"",(select RECEIPT_DATE from FILETRANS where filemaster.file_serial_no = FILETRANS.file_serial and filemaster.file_year=FILETRANS.file_year and filetrans.RECEIPT_DATE between trunc(sysdate-6)+(15/24) and least( trunc(sysdate)+(15/24), sysdate) and rownum=1) as ""Received Date"",(select department_name from departments where department_code=filemaster.department_code and rownum=1) as ""Dept"",(select section_name from sections where section_cd=filemaster.section_code and rownum=1 and dept_cd=filemaster.department_code) as ""Section"" from filemaster "

End Select

Response.Write(REGSQL)
RStoTable(REGSQL, qtype & ";filelist;filelist", "100%;400", 5, 50, -1, "", "")
End If
%>

</td>
</tr>


<tr>
<td>&nbsp;</td>
</tr>
</table>


</body>

</html>


thanks and regard love4csharp

Continue reading...
 
Back
Top