home *** CD-ROM | disk | FTP | other *** search
/ 202.53.64.216 / 202.53.64.216.tar / 202.53.64.216 / janahitha / AdsClientBookings.asp < prev    next >
Text File  |  2004-11-26  |  8KB  |  234 lines

  1. <!-- #include file="AdsOpenConn.asp" -->
  2. <%
  3.     if session("ClientId")="" then Response.Redirect "AdsLogin.asp"
  4.     TblHeadBGColor = "#DDF0DF"
  5.     TblHeadFGColor = "#000000"
  6.     TblBGColor = "#ffffff"
  7.     TblFGColor = "#000000"
  8.  
  9.     if Request.Form.Count =0 then
  10. %>
  11. <html>
  12.     <head>
  13.         <title> Janahitha Ads - Welcome </title>
  14.         <meta name="author" content="Jagadish,Gopi">
  15.         <meta name="author" content="Gopi Tanguturi">        
  16.     </head>
  17.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  18.         <!-- #include file="AdsTop.asp" --> 
  19.         <center>
  20.         <table width=100% cellpadding=0 cellspacing=0 border=0 height=100%>
  21.         <tr>
  22.             <td width=150 align=center valign=top bgcolor="#FFFFFF">
  23.                  <!--#include file="AdsLeft.asp" -->
  24.             </td>
  25.             <td width=630 align=center valign=top bgcolor="#ffffff">
  26.                 <br> <br>
  27.                 <font face=verdana color="#566336"> <b> Give The Dates </b> </font> <br> <br>
  28.                 <form name="clientbookingsform" method=post action="<%=Request.ServerVariables("script_name")%>">
  29.                 <input type=hidden name="selectedids" value="<%=selectedids%>">
  30.                 <table cellpadding=0 cellspacing=0 border=0>
  31.                 <tr> <td bgcolor="#f2D197">
  32.                 <table cellspacing=1 cellpadding=5 border=0>
  33.                 <tr bgcolor="#ffffff">
  34.                     <td> 
  35.                         <font face="verdana" size=2> From Date </font> 
  36.                     </td>
  37.                     <td>
  38.                         <select name="fromdd">
  39.                         <%
  40.                             for i = 1 to 31
  41.                         %>
  42.                             <option value="<%=i%>" <%if i=datepart("d", date) then%>selected<%end if%>> <%=i%>
  43.                         <%
  44.                             next
  45.                         %>
  46.                         </select>
  47.                         <select name="frommm">
  48.                         <%
  49.                             months=split("Mon~Jan~Feb~Mar~Apr~May~Jun~Jul~Aug~Sep~Oct~Nov~Dec", "~")
  50.                             for i = 1 to 12
  51.                         %>
  52.                             <option value="<%=i%>" <%if i=datepart("m", date) then%>selected<%end if%>> <%=months(i)%>
  53.                         <%
  54.                             next
  55.                         %>
  56.                         </select>
  57.                         <select name="fromyyyy">
  58.                         <%
  59.                             for i = 2002 to datepart("yyyy", date)+1
  60.                         %>
  61.                             <option value="<%=i%>" <%if i=datepart("yyyy", date) then%>selected<%end if%>> <%=i%>
  62.                         <%
  63.                             next
  64.                         %>
  65.                         </select>
  66.                     </td>
  67.                 </tr>
  68.                 <tr bgcolor="#ffffff">
  69.                     <td> 
  70.                         <font face="verdana" size=2> To Date </font> 
  71.                     </td>
  72.                     <td> 
  73.                         <select name="todd">
  74.                         <%
  75.                             for i = 1 to 31
  76.                         %>
  77.                             <option value="<%=i%>" <%if i=datepart("d", date) then%>selected<%end if%>> <%=i%>
  78.                         <%
  79.                             next
  80.                         %>
  81.                         </select>
  82.                         <select name="tomm">
  83.                         <%
  84.                             months=split("Mon~Jan~Feb~Mar~Apr~May~Jun~Jul~Aug~Sep~Oct~Nov~Dec", "~")
  85.                             for i = 1 to 12
  86.                         %>
  87.                             <option value="<%=i%>" <%if i=datepart("m", date) then%>selected<%end if%>> <%=months(i)%>
  88.                         <%
  89.                             next
  90.                         %>
  91.                         </select>
  92.                         <select name="toyyyy">
  93.                         <%
  94.                             for i = 2002 to datepart("yyyy", date)+1
  95.                         %>
  96.                             <option value="<%=i%>" <%if i=datepart("yyyy", date) then%>selected<%end if%>> <%=i%>
  97.                         <%
  98.                             next
  99.                         %>
  100.                         </select>
  101.                     </td>
  102.                 </tr>
  103.                 </table>
  104.                 </td> </tr>
  105.                 </table>
  106.                 <br>
  107.                 <input type=submit value=" Show Bookings " id=submit1 name=submit1>
  108.                 </form>
  109.             </td>
  110.         </tr>
  111.         </table>
  112.         </center>
  113.         <!-- #include file="AdsBottom.asp"-->
  114.     </body>
  115. </html>>
  116. <%
  117.     else
  118.         msg = ""
  119.         fromdate = Request.Form("frommm") + "/" + Request.Form("fromdd") + "/" + Request.Form("fromyyyy")
  120.         todate = Request.Form("tomm") + "/" + Request.Form("todd") + "/" + Request.Form("toyyyy")
  121.         'if (not isdate(fromdate)) or (not isdate(todate)) then msg = "<font face=verdana size=2 color=red> <b> Enter Valid Dates <br> <br> Go <a href='javascript:history.back();' style='color:red'>Back</a> </b> </font>"
  122.         set rs = server.CreateObject("adodb.recordset")
  123.         'sql = "select HoardingId, RegDate, FromDate, ToDate, Status from BookingsMaster where ClientId=" + session("ClientId") + " and RegDate>='" + fromdate + "' and RegDate<='" + todate + "'"
  124.         sql = "select HoardingId, RegDate, FromDate, ToDate, Status from BookingsMaster where ClientId=" + session("ClientId")
  125.         if msg="" then
  126.             rs.Open sql, con, 3, 3
  127.             if rs.EOF then msg = "<font face=verdana size=2 color=red> <b> No Bookings Available <br> <br> Go <a href='javascript:history.back();' style='color:red'>Back</a> </b> </font>"
  128.             rs.Close 
  129.         end if
  130.         if msg<>"" then
  131. %>
  132. <html>
  133.     <head>
  134.         <title> Janahitha Ads - Welcome </title>
  135.         <meta name="author" content="Jagadish,Gopi">
  136.     </head>
  137.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  138.         <!-- #include file="AdsTop.asp"-->
  139.         <center>
  140.         <table width=100% cellpadding=0 cellspacing=0 border=0 height=100%>
  141.         <tr>
  142.             <td width=150 align=center valign=top bgcolor="#FFFFFF">
  143.                 <!-- #include file="AdsLeft.asp" -->
  144.             </td>
  145.             <td width=630 align=center valign=top bgcolor="#ffffff">
  146.                 <br> <br>
  147.                 <%=msg%>
  148.             </td>
  149.         </tr>
  150.         </table>
  151.         </center>
  152.         <!--#include file="AdsBottom.asp"-->
  153.     </body>
  154. </html>
  155. <%
  156.             Response.end
  157.         end if
  158. %>
  159. <html>
  160.     <head>
  161.         <title> Janahitha Ads - Welcome </title>
  162.         <meta name="author" content="Jagadish,Gopi">
  163.     </head>
  164.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  165.         <!-- #include file="AdsTop.asp" --> 
  166.         <center>
  167.         <table width=100% cellpadding=0 cellspacing=0 border=0 height=100%>
  168.         <tr>
  169.             <td width=150 align=center valign=top bgcolor="#FFFFFF">
  170.                 <!-- #include file="AdsLeft.asp" -->
  171.             </td>
  172.             <td width=630 align=center valign=top bgcolor="#ffffff">
  173.                 <!--<br> <b> <font face="verdana" size=2 color="#566336"> Bookings between The Dates <%=fromdate%> And <%=todate%> </font> </b> <br> <br>-->
  174.                 <%
  175.                     rs.Open "select clientname from clientmaster where clientid=" & session("ClientId"),con,3,3                    
  176.                 %>
  177.                 <br> <b> <font face="verdana" size=2 color="#566336"> Bookings for <%=rs(0)%>  </font> </b> <br> <br>                
  178.                 <%
  179.                     rs.Close
  180.                 %>
  181.                 <table cellpadding=0 cellspacing=0 border=0>
  182.                 <tr><td bgcolor="#47AF59">
  183.                 <table cellpadding=2 cellspacing=1 border=0 width=500>
  184.                 <tr>
  185.                     <th bgcolor="<%=TblHeadBGColor%>"> <font face=verdana size=2 color="<%=TblHeadFGColor%>"> SNo </font> </th>
  186.                     <!--<th bgcolor="<%=TblHeadBGColor%>"> <font face=verdana size=2 color="<%=TblHeadFGColor%>"> Id </font> </th>-->
  187.                     <th bgcolor="<%=TblHeadBGColor%>"> <font face=verdana size=2 color="<%=TblHeadFGColor%>"> Reg Date </font> </th>
  188.                     <th bgcolor="<%=TblHeadBGColor%>"> <font face=verdana size=2 color="<%=TblHeadFGColor%>"> From Date </font> </th>
  189.                     <th bgcolor="<%=TblHeadBGColor%>"> <font face=verdana size=2 color="<%=TblHeadFGColor%>"> To Date </font> </th>
  190.                     <!--<th bgcolor="<%=TblHeadBGColor%>"> <font face=verdana size=2 color="<%=TblHeadFGColor%>"> Status </font> </th>-->
  191.                 </tr>
  192. <%
  193.         rs.Open sql, con, 3, 3
  194.         sno = 0 
  195.         while not rs.EOF
  196.             sno = sno + 1
  197.             Hoardingid = rs("HoardingId")
  198.             if rs("Status")="N" then
  199.                 status = "Not Confirmed"
  200.             elseif rs("Status") = "C" then
  201.                 status = "Confirmed"
  202.             elseif rs("Status") = "D" then
  203.                 status = "Declined"
  204.             end if
  205. %>
  206.                 <tr>
  207.                     <td bgcolor="<%=TblBGColor%>" align=right> <font face="ms sans serif" size=2 color="<%=TblFGColor%>"> <%=sno%>  </font> </td>
  208.                     <!--<td bgcolor="<%=TblBGColor%>"> <a href="AdsHoardingDetail.asp?HId=<%=Hoardingid%>"><font face="ms sans serif" size=2 color="<%=TblFGColor%>"><%=Hoardingid%></font></a> </td>-->
  209.                     <td bgcolor="<%=TblBGColor%>"> <font face="ms sans serif" size=2 color="<%=TblFGColor%>"> <%=rs("RegDate")%> </font> </td>
  210.                     <td bgcolor="<%=TblBGColor%>"> <font face="ms sans serif" size=2 color="<%=TblFGColor%>"> <%=rs("FromDate")%> </font> </td>
  211.                     <td bgcolor="<%=TblBGColor%>"> <font face="ms sans serif" size=2 color="<%=TblFGColor%>"> <%=rs("ToDate")%> </font> </td>
  212.                     <!--<td bgcolor="<%=TblBGColor%>"> <font face="ms sans serif" size=2 color="<%=TblFGColor%>"> <%=status%> </font> </td>-->
  213.                 </tr>
  214. <%
  215.             rs.MoveNext 
  216.         wend
  217.         rs.Close
  218.         set rs = nothing
  219.     
  220. %>
  221.                 </table>
  222.                 </td> </tr>
  223.                 </table>
  224.             </td>
  225.         </tr>
  226.         </table>
  227.         </center>
  228.         <!-- #include file="AdsBottom.asp" -->
  229.     </body>
  230. </html>
  231. <%
  232.     end if
  233. %>
  234. <!-- #include file="AdsCloseConn.asp" -->