Pagination Classic Asp, And Button Changed To Hyperlinks
I've created buttons that have been edited with css to look like hyperlinks so I can use form post instead of using querystring. I've made it so that when a button is clicked it cr
Solution 1:
all you got wrong is the place where you set your session ...
move
alphaCheck = request.form("checkBox")
if alphaCheck <>""then
session("checkBox_"&alphaCheck) = "checked"else
session("checkBox_"&alphaCheck) = ""endif
...
<inputtype="checkbox" name="checkBox" value="<%=alphaB %>" <%=session("checkbox_"&alphaB ) %>/>
before the checkbox creation
what happen is that on the first time your session is not initialized once you hit the page
Solution 2:
<!--#include file="session_check.asp"--><!--#include file="connection.asp"-->
<%
' Last updated by Arun Sharma
' last updation pourpos mintain the paging of POP closed calls
' last updated on 6th sep. 2007`enter code here`
%>
<%
if session("type1")=0 and session("type2") =0 then
response.redirect "Default.asp"
end if
%>
<htmlxmlns:v="urn:schemas-microsoft-com:vml"xmlns:o="urn:schemas-microsoft-com:office:office"xmlns="http://www.w3.org/TR/REC-html40"><head><metahttp-equiv="Content-Language"content="en-us"><metaname="GENERATOR"content="Microsoft FrontPage 5.0"><metaname="ProgId"content="FrontPage.Editor.Document"><metahttp-equiv="Content-Type"content="text/html; charset=windows-1252"><title>view</title></head><body>
<%
If session("type") ="sa" Then
%>
<p><!--#include file="header_sa.asp"--></p>
<%
else
%><p><!--#include file="header_a.asp"--></p><%
End If
%>
<!--
<table width="100%" style="border-left-width: 0; border-top-width: 0; border-bottom-width: 0">
<tr>
<td width="24%" bgcolor="#FFFFFF" style="border-top:medium none #111111; border-bottom:medium none #111111; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium" height="25">
<center> <img border="0" height=90 width=312 src="images/tulipconnect12.jpg"> </center> </td>
</tr>
</table>
<table width="100%" style="border-collapse: collapse" bordercolor="#FFCC99" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" style="border-style: solid; border-width: 1" align="center" bordercolor="#FFFFFF" bgcolor="#F37D7D">
<b><font color="#FFFFFF"> </font>
<font color="#006699" face="Verdana" size="2">
<a style="color: #FFFFFF" href="view_list.asp">Home</a></font></b></td>
<td width="20%" bgcolor="#F37D7D" style="border-style: solid; border-width: 1" align="center" bordercolor="#FFFFFF">
<p align="center"><b> <font face="Verdana" size="2" color="#FFFFFF"> View-Calls</font></b></td>
<td width="20%" style="border-style: solid; border-width: 1" align="center" bordercolor="#FFFFFF" bgcolor="#F37D7D">
<b><font color="#FFFFFF">
</font>
<font face="Verdana" color="#FF6600">
<a href="changepassword.asp"><font size="2" color="#FFFFFF">Change</font></a></font><font face="Verdana"><font size="2"><a style="color: #FFFFFF" href="changepassword.asp">
Password</a></font><font color="#FF6600"><a href="changepassword.asp"><font size="2" color="#FFFFFF">
</font> </a>
</font></font></b></td>
<td width="20%" bgcolor="#F37D7D" style="border-style: solid; border-width: 1" align="center" bordercolor="#FFFFFF">
<p align="center">
<b>
<font color="#FFFFFF"> <font face="Verdana" size="2"> <a href="down.ASP">
<font color="#FFFFFF">Downtime Report</font></a></font></font></b></td>
<td width="20%" bgcolor="#F37D7D" style="border-style: solid; border-width: 1" align="center" bordercolor="#FFFFFF">
<p align="center">
<b>
<font color="#FFFFFF"> <font face="Verdana" size="2"> <a href="LOGOUT.ASP">
<font color="#FFFFFF">Logout</font></a></font></font></b></td>
</tr>
</table>
-->
<%
if session("type1") =1 then
end if
%>
<center><fontcolor="#F37D7D"face="Georgia, Times New Roman, Times, serif"size="4"> </font><fontcolor="#FF3300"face="Georgia, Times New Roman, Times, serif"size="3"><b>Circuit Closed Calls</b></font></center>
<%
dim name
pno=request.querystring("page")
name= request.form("engineer")
if pno="" then
pno=0
end if
' set con =server.createobject("ADODB.CONNECTION")
set rs=server.createobject("ADODB.RECORDSET")
' con.open "Provider=SQLOLEDB; Data Source = database.tulipconnect.com\CALLMANAGER1; Initial Catalog = support; User Id = app; Password=App_access_2009"
sql="select Fault_Ticket_Num,Organisation,Link_Location,Fault_Detail,dDate,tTime,cldate,Assigned_To from Call_Login where Call_Status <> 'OPEN' and region='"&session("region")&"' order by dDate desc"
rs.open sql,con
%>
<tableheight="90%"align="center"><tr><tdvalign="top"><tablewidth="95%"height="70"align="center"cellpadding="0"cellspacing="0"bordercolor="#FFCC99"style="border-collapse: collapse"><trbordercolor="FF3333"bgcolor="FF3333"><tdwidth="6%"height="56"align="center"style="border-style: solid; border-width: 1"><b><fontface="Verdana"color="#FFFFFF"size="2">Call history</font></b></td><tdwidth="13%"height="56"align="center"style="border-style: solid; border-width: 1"><fontcolor="#FFFFFF"face="Verdana"size="2"><b>Fault Ticket Number</b></font></td><tdwidth="9%"height="56"align="center"style="border-style: solid; border-width: 1"><b><fontcolor="#ffffff"face="Verdana"size="2">Organization</font></b></td><tdwidth="8%"height="56"align="center"style="border-style: solid; border-width: 1" ><b><fontcolor="#FFFFFF"face="Verdana"size="2"> Location</font></b></td><tdwidth="25%"height="56"align="center"style="border-style: solid; border-width: 1"><b><fontcolor="#ffffff"face="Verdana"size="2">Fault Details </font></b></td><tdwidth="10%"height="56"align="center"style="border-style: solid; border-width: 1" ><b><fontface="Verdana"color="#FFFFFF"size="2">Call Status</font></b></td><tdwidth="8%"height="56"align="center"style="border-style: solid; border-width: 1" ><b><fontface="Verdana"color="#FFFFFF"size="2">Assigned To</font></b></td><tdwidth="10%"height="56"align="center"style="border-style: solid; border-width: 1" ><b><fontcolor="#FFFFFF"face="Verdana"size="2">Opening Date</font></b></td><tdwidth="10%"height="56"align="center"style="border-style: solid; border-width: 1" ><b><fontcolor="#FFFFFF"face="Verdana"size="2">Closing Date</font></b></td></tr>
<%
If rs.eof Then
response.write("No call for this user")
response.End
End if
rs.move(10*pno)
rno=0
while not rs.eof and rno<10
rno=rno+1
%>
<tr><tdwidth="6%"style="border-style: solid; border-width: 1"bordercolor="#F37D7D"bgcolor="#F9EFF6"height="15"><center><ahref=fault_history.asp?reportid=<%=rs("Fault_Ticket_Num")%>&assignto=<%=rs("Assigned_To")%>> <imgborder="0"src="images/right_arrow.gif"width="13"height="13"></a></center></td><tdwidth="12%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="#F37D7D"height="15"><fontcolor="blue"face="verdana"size=2><%=rs("Fault_Ticket_Num")%></font></td><tdwidth="9%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="#F37D7D"height="15"><fontcolor="blue"face="verdana"size=2><%=rs("Organisation")%></font></td><tdwidth="8%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="#F37D7D"height="15"><fontcolor="blue"face="verdana"size=2><%=rs("Link_Location")%></font></td><tdwidth="25%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="#F37D7D"height="15"><fontcolor="blue"face="verdana"size=2><%=rs("Fault_Detail")%></font><fontcolor="blue"face="verdana"></font></td><tdwidth="10%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="#F37D7D"height="15"><fontcolor="blue"face="verdana"size=2>
<% response.write("Call Closed")%>
</font><fontcolor="blue"face="verdana"></font> </td><tdwidth="8%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="#F37D7D"height="15"> <fontcolor="blue"face="verdana"size=2><%=rs("Assigned_To")%></font><fontcolor="blue"face="verdana"></font></td><tdwidth="10%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="#F37D7D"height="15"><fontcolor="blue"face="verdana"size=2><%=rs("dDate")%></font></td><tdwidth="10%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="#F37D7D"height="15"><fontcolor="blue"face="verdana"size=2><%=rs("clDate")%></font></td></tr>
<% rs.movenext
wend
%>
<tr><tdwidth="20%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="white"height="15"colspan="7"><palign="left"><astyle="color: #663399; font-family:verdana; font-size:12px"href="view_close.asp?D1=<%=oth%>&page=<%response.write(0)%>">First</a><fontcolor="#F37D7D">
<% if pno>0 then
%>
</font> <astyle="color: #663399; font-family:verdana; font-size:12px"href="view_close.asp?D1=<%=oth%>&page=<%response.write(pno-1)%>">Previous</a><fontcolor="#F37D7D">
<% end if %>
<%
if rno=10 Then
pno=pno+1
%>
</font> <astyle="color:#663399; font-family:verdana; font-size:12px"href="view_close.asp?D1=<%=oth%>&page=<%response.write(pno)%>">Next</a><fontcolor="#F37D7D">
<% end if%>
</font></p></td><tdwidth="20%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="white"height="15"colspan="2"><p><ahref="view_open_excel.asp"><fontcolor="black"size="2">MOVE TO EXCEL</font></a></p></td></tr></table></form>
<%
pno1=request.querystring("page1")
%>
<center><p><fontcolor="#F37D7D"face="Georgia, Times New Roman, Times, serif"size="4"> </font><fontcolor="#FF3300"face="Georgia, Times New Roman, Times, serif"size="3"><b>POP Closed Call</b></font></p></center>
<%
Set rs_pop =server.CreateObject("adodb.recordset")
sql_pop_calls="Select distinct(location_b),call_status,fault_detail,ddate,cldate from call_login where pop_call='Y' and call_status='CLOSE' group by location_b,circuit_id,fault_detail,ddate,call_status,cldate"
'response.write(sql_pop_calls)
rs_pop.open sql_pop_calls ,con %>
<tablewidth="95%"height="70"border="1"align="center"cellpadding="2"cellspacing="0"bordercolor="#FF3300"bgcolor="#FFF0F4"style="border-collapse: collapse"><trbgcolor="FF3333"><tdwidth="5%"height="40"bordercolor="#EED5D5"style="border-style: none; border-width: 1"><b><fontface="Verdana"color="#FFFFFF"size="2">S.NO.</font></b></td><tdwidth="10%"height="40"bordercolor="#EED5D5"style="border-style: none; border-width: 1"><b><fontface="Verdana"color="#FFFFFF"size="2">POP Name</font></b></td><tdwidth="19%"height="40"align="left"bordercolor="#EED5D5"style="border-style: none; border-width: 1"><fontcolor="#FFFFFF"face="Verdana"size="2"><b>Fault Details</b></font></td><tdwidth="15%"height="40"align="left"bordercolor="#EED5D5"style="border-style: none; border-width: 1"><b><fontcolor="#FFFFFF"face="Verdana"size="2">Opening Date</font></b></td><tdwidth="15%"height="40"align="left"bordercolor="#EED5D5"style="border-style: none; border-width: 1"><b><fontcolor="#FFFFFF"face="Verdana"size="2">Closing Date</font></b></td><tdwidth="13%"height="40"align="left"bordercolor="#EED5D5"style="border-style: none; border-width:1" ><b><fontcolor="#FFFFFF"face="Verdana"size="2">No. of Affected Circuits</font></b></td></tr>
<%
if pno1="" then
pno1=1
end if
if pno1=1 then
sno=0
else
sno=(pno1-1)*10
end if
rs_pop.move(10*pno1)
rno=0
'sno=0
if not rs_pop.eof then
do while not rs_pop.eof and rno<10
rno=rno+1
sno=sno+1
%>
<tr><tdalign="center"><fontcolor="blue"face="Verdana, Arial, Helvetica, sans-serif"size="2">
<%=sno%></font></td><td><fontcolor="blue"face="Verdana, Arial, Helvetica, sans-serif"size="2"><%=rs_pop("location_b")%></font></td><td><fontcolor="blue"face="Verdana, Arial, Helvetica, sans-serif"size="2"><%=rs_pop("fault_detail")%></font></td><td><fontcolor="blue"face="Verdana, Arial, Helvetica, sans-serif"size="2"><%=rs_pop("ddate")%><%'=rs_pop("ddate")%></font></td><td><fontcolor="blue"face="Verdana, Arial, Helvetica, sans-serif"size="2"><%=rs_pop("cldate")%><%'=rs_pop("ddate")%></font></td><td>
<%
set rs_count_fault=server.CreateObject("adodb.recordset")
sql_count_fault="select count(circuit_id) as no_of_faults from call_login where ddate='"&rs_pop("ddate")&"' and pop_call='Y' and call_status='CLOSE' and location_b='"&rs_pop("location_b")&"' group by location_b "
'response.Write(sql_count_fault)
rs_count_fault.open sql_count_fault,con
if not rs_count_fault.eof then %>
<ahref="#"onClick="javascript:imgB('pop_call_effected_cir_list.asp?pop_name=<%=rs_pop("location_b")%>&call_status=<%=rs_pop("call_status")%>&d_date=<%=rs_pop("ddate")%>')" title="View Affected Circuits">
<fontcolor="blue"face="Verdana, Arial, Helvetica, sans-serif"size="2"><%=rs_count_fault("no_of_faults")%></font></a>
<%
end if
%> </td></tr>
<% rs_pop.movenext
loop
else
%>
<tr><tdcolspan="6"><fontcolor="#000099"face="Verdana, Arial, Helvetica, sans-serif"size="1"><b>No Open Calls </b></font></td></tr>
<%
end if
%>
<tr><tdwidth="20%"style="border-style: solid; border-width: 1"align="center"bgcolor="#F9EFF6"bordercolor="white"height="15"colspan="7"><palign="left"><astyle="color: #663399; font-family:verdana; font-size:12px"href="view_close.asp?page1=<%response.write(1)%>">First</a><fontcolor="#F37D7D">
<% if pno1>1 then
%>
</font> <astyle="color: #663399; font-family:verdana; font-size:12px"href="view_close.asp?page1=<%response.write(pno1-1)%>">Previous</a><fontcolor="#F37D7D">
<% end if %>
<%
if rno=10 Then
pno1=pno1+1
%>
</font> <astyle="color: #663399; font-family:verdana; font-size:12px"href="view_close.asp?page1=<%response.write(pno1)%>">Next</a><fontcolor="#F37D7D">
<% end if%></font></p></td></tr></table><br></td></tr></table><!--#include file="footer.asp"--><script>functionimgB(useridVal)
{
urlImg=useridVal;
nwin1 = window.open(urlImg,"imgB","toolbar=no,directories=no, scrollbars=1, resizable=1,menubar=no,location=no,maximize=yes,width=450,height=230");
}
functionboxes()
{
if(f1.C2.checked==true)
{
for(i=0;i<f1.C1.length;i++)
document.f1.C1[i].checked=true
}
if(f1.C2.checked==false)
{
for(i=0;i<f1.C1.length;i++)
document.f1.C1[i].checked=false
}
}
functionDelete()
{
if(confirm("Are you sure"))
returntrueelsereturnfalse
}
</script></font></p></body></html>
Post a Comment for "Pagination Classic Asp, And Button Changed To Hyperlinks"