By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,867 Members | 1,981 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,867 IT Pros & Developers. It's quick & easy.

How to stop exceuting the script

syedshaffee
P: 91
this is my web page and i have a script that is executed even if the page is refreshed the asp page:
Expand|Select|Wrap|Line Numbers
  1. <%@ LANGUAGE="VBSCRIPT" %>
  2. <%
  3. ''
  4. '' Contracts Detail
  5. ''
  6. '' Taken from LifeCycle Management and edited for Contracts Management Phase II
  7. ''
  8. '' Updated    20001012 by Vincent Leung
  9. ''        - Added "flexible showing of barcode columns", so that if recordset has
  10. ''          no barcodes at all, then hide column.  --VL
  11.  
  12. %>
  13. <!--#INCLUDE FILE="../include/Constants.asp"-->
  14. <!--#INCLUDE FILE="../include/commoninc_restrict.asp"-->
  15.  
  16. <%
  17. ' get Client Manager details
  18. ' check if already have Client Manager details
  19. ' if Session("rstStaffContact") is nothing then
  20. set Session("rstAsset_edit") = nothing
  21.  
  22.         sql = "SELECT distinct Staff.Staff_Name," & _
  23.                     " Staff.Staff_phone," & _
  24.                     " Staff.Staff_fax," & _
  25.                     " Staff.Staff_cell," & _
  26.                     " Staff.Staff_email" & _
  27.                     " from Staff inner join " & _
  28.                     " Customer_Detail on Staff.Staff_id = Customer_Detail.Customer_Staff_id " & _
  29.                     " where Customer_Detail.Customer_id = " & Session(CUSTOMER_ID)
  30.  
  31.     Set objRIMSConn = Server.CreateObject("ADODB.Connection")
  32.     objRIMSConn.Open RIMS_CONNECT
  33.  
  34.     Set rstStaffContact = Server.CreateObject("ADODB.Recordset")
  35.     rstStaffContact.Open sql, objRIMSConn, adOpenKeyset, adLockOptimistic
  36.  
  37.     Set Session("rstStaffContact") = rstStaffContact        ' Store for fast retrieval later on.
  38. 'end if
  39. ' check if already in contract review session
  40.     if Session("rstContract") is nothing then
  41.         sql = "SELECT DISTINCT Contract_Detail.Contract_no," & _
  42.                 " Contract_Detail.Contract_Commence_Date," & _
  43.                 " Contract_Detail.Contract_Expiry_Date," & _
  44.                 " Contract_Detail.Contract_rental," & _
  45.                 " Contract_Detail.Contract_assetmgmt," & _
  46.                 " Contract_Detail.Contract_term," & _
  47.                 " Contract_Detail.Contract_frequency," & _
  48.                 " Contract_Detail.Contract_disc_date," & _
  49.                 " Contract_Detail.Contract_disc_rec," & _
  50.                 " isNull(Contract_Detail.Contract_asset_value,0)  Contract_asset_value " & _
  51.                 " FROM Contract_Detail" & _
  52.                 " WHERE Contract_Detail.Contract_Customer_id = " & Session(CUSTOMER_ID)
  53.  
  54.         sql = sql & " ORDER BY Contract_Detail.Contract_no"
  55.  
  56.         Set objRIMSConn = Server.CreateObject("ADODB.Connection")
  57.         objRIMSConn.Open RIMS_CONNECT
  58.  
  59.  
  60.         Set rstContract = Server.CreateObject("ADODB.Recordset")
  61.         rstContract.Open sql, objRIMSConn, adOpenKeyset, adLockOptimistic
  62.  
  63.         rstContract.PageSize = CONTRACT_LIST_PAGE_SIZE        ' Number of records to display per page.
  64.         Set Session("rstContract") = rstContract        ' Store for fast retrieval later on.
  65.         Session("ContPage") = 1                                                    ' Start on the first page.
  66.     else
  67.         ' Contract information already exists, retrieve it from the session object.
  68.         Set rstContract = Session("rstContract")
  69.     end if
  70.  
  71. ' check if already have CustomerNotice
  72. ' if Session("CustomerNotice") is nothing then
  73.             sql = "SELECT Customer_Detail.CustomerNotice" & _
  74.                 " from Customer_Detail " & _
  75.                 " where Customer_Detail.Customer_id = " & Session(CUSTOMER_ID)
  76.  
  77.         Set objRIMSConn = Server.CreateObject("ADODB.Connection")
  78.         objRIMSConn.Open RIMS_CONNECT
  79.  
  80.         Set rstCustomerNotice = Server.CreateObject("ADODB.Recordset")
  81.         rstCustomerNotice.Open sql, objRIMSConn, adOpenKeyset, adLockOptimistic
  82.  
  83.         Set Session("CustomerNotice") = rstCustomerNotice("CustomerNotice")        ' Store for fast retrieval later on.
  84. '    end if
  85.  
  86.  
  87.  
  88.     Set objRIMSConn = Server.CreateObject("ADODB.Connection")
  89.     objRIMSConn.Open RIMS_CONNECT
  90.  
  91.  
  92. '    else
  93.         ' Contact information already exists, retrieve it from the session object.
  94. '        Set rstCustContact = Session("rstCustContact")
  95. '    end if
  96.  
  97.     response.write("<!--<br> debug: session-cont-sort-item (before): " & Session("ContSortItem"))
  98.     response.write("<br> debug: req-cont-sort-item (before): " & request("ContSortItem") & "-->")
  99. ' Process any sort requests.
  100.     If not(IsEmpty( Request("ContSortItem") ) or Request("ContSortItem")="")  then
  101.         set Session("rstAsset") = nothing
  102.         Session("ContSortItem") = "<!--<br> Request of session-cont-sort-item: " & Session("ContSortItem") & "-->"
  103.     end if
  104.  
  105.  
  106.  
  107. '' Research disabled for ContractManagement2. And for sake of the Edit Assets page,
  108. '' Following code Disabled and Session("FilterSQL") ALWAYS set to "" --VL20001018
  109.  
  110. Session("FilterSQL") = ""
  111.  
  112.  
  113. ''' Process any research requests
  114. ''    If (Request("Research") <>"") AND (Request("Research") <> Session("FilterSQL")) then
  115. ''            set Session("rstAsset") = nothing
  116. ''        Session("FilterSQL") = Request("Research")
  117. '''        Session("FilterDisplay") = Request("FilterDisplay")
  118. ''    end if
  119.  
  120. ' Process any pagesize requests
  121.     if (Request("pageSize") <> Session("ASSET_LIST_PAGE_SIZE")) and (Request("pageSize") <> "") then
  122.         Session("ASSET_LIST_PAGE_SIZE") = Request("pageSize")
  123.             set Session("rstAsset") = nothing
  124.             ''response.write("<br> debug: session-cont-sort-item: " & Session("ContSortItem"))
  125.     end if
  126.  
  127. ''response.write("<br>session-contract_no: " & session("Contract_no"))
  128. ''response.write("<br>req-contract_no: " & request("Contract_no"))
  129.  
  130. ' Process Contract request
  131.     If not(IsEmpty(Request("Contract_no")) or Request("Contract_no")="" ) then
  132.         Session("Contract_no") = Request("Contract_no")
  133.         LogTransaction "" ,"MLog Contract Viewed : " & Session("Contract_no"),"",""
  134.         ''response.write("<br>Session-Cont_no updated!!!")
  135.         set Session("rstAsset") = nothing
  136.  
  137.     else
  138.  
  139.         if Session("Contract_no") = "" then
  140.             Response.Redirect "contlist_contract2.asp"
  141.         end if
  142.     end if
  143.  
  144. ' Generate sql for search
  145.     if Session("rstAsset") is nothing then
  146.  
  147.         sql = " SELECT isnull(userdatacomment,'NONE') as comment,Asset_Detail.Asset_id, Asset_Detail.Asset_serial_no,Asset_Detail.Asset_id, " &_
  148.               " Asset_Detail.Asset_barcode_no, " &_
  149.               " Asset_Detail.Asset_description, Asset_Type.Asset_type_description, " &_
  150.               " assettypesub.assettypesubdesc, " &_
  151.               " Asset_Detail.Asset_contract_no,Asset_Detail.Asset_Rental,Asset_Detail.Asset_type_id, " &_
  152.               " state.statedesc,Asset_Detail.Asset_purchase_date,Asset_Detail.Asset_PO_no, " &_
  153.               " isnull(Asset_Detail.Asset_purchase_price,0) Asset_purchase_price," &_
  154.               " Supplier_Detail.Supplier_Name, invoice.invoice_date,Invoice.Invoice_no, " &_
  155.               " Customer_User.User_Name,Customer_User.User_code,Cost_Centre.Cost_Centre_Code,Cost_Centre.Cost_Centre_Description, " &_
  156.               " Department.Department_Code, Department.Department_Desc " &_
  157.  
  158.               " FROM Asset_Detail left JOIN user_data on userdataassetid = asset_detail.asset_id " &_
  159.               " inner join Contract_detail ON Asset_Detail.Asset_contract_no = Contract_detail.Contract_no " &_
  160.               " left JOIN Department ON Asset_Detail.Asset_Department_Id = Department.Department_Id " &_
  161.               " left JOIN Customer_User ON Customer_User.User_Id = Asset_Detail.Asset_User_Id " &_
  162.               " left JOIN ( select * from Cost_Centre where Cost_Centre_Active <> 0) Cost_Centre ON " &_
  163.               " Cost_Centre.Cost_Centre_ID = Asset_Detail.Asset_CostCentre_Id " &_
  164.               " LEFT JOIN Invoice ON Asset_Detail.Asset_invoice_id = Invoice.Invoice_id " &_
  165.               " left JOIN state ON asset_detail.asset_TO_stateID=state.stateid " &_
  166.               " LEFT JOIN Asset_Type ON Asset_Detail.Asset_type_id = Asset_Type.Asset_type_id " &_
  167.               " LEFT JOIN AssetTypesub on Asset_detail.asset_subtype=assettypesub.assetTypesubId " &_
  168.               " LEFT JOIN Asset_Category ON Asset_Category.Asset_category_id = Asset_Type.Asset_type_Category_id " &_
  169.               " LEFT JOIN Supplier_Detail ON Invoice.Invoice_supplier_id = Supplier_Detail.Supplier_id " &_
  170.               " WHERE Contract_detail.Contract_customer_id = " & Session(CUSTOMER_ID) & _
  171.               " AND ISNULL(Asset_Detail.Asset_Active,0) <> 0" 
  172.  
  173.  
  174.  
  175.         if Session("FilterSQL") <> "" then
  176.             ' If a filter has been applied, then include the where clause for this.
  177.             sql = sql & " AND " & Session("FilterSQL")
  178.         end if
  179.  
  180.         ' add contract filter
  181.         tmpsql = " Asset_Detail.Asset_contract_no = '" & Session("Contract_no") & "'"
  182.         sql = sql & " and " & tmpsql
  183.         session("filtersql") = session("filtersql") & tmpsql
  184.  
  185.         if IsEmpty(Session("ContSortItem")) OR (Session("ContSortItem") = "") then
  186.             Session("ContSortItem") = "Asset_description desc"
  187.         end if
  188.  
  189.         sql = sql & " ORDER BY " & Session("ContSortItem")
  190.  
  191.         if objRIMSConn is nothing then
  192.             Set objRIMSConn = Server.CreateObject("ADODB.Connection")
  193.             objRIMSConn.Open RIMS_CONNECT
  194.         end if
  195.         'response.write sql
  196. '    response.write sql
  197. '    response.end
  198.  
  199.         Set rstAsset = Server.CreateObject("ADODB.Recordset")
  200.         rstAsset.Open sql, objRIMSConn, adOpenKeyset, adLockOptimistic
  201.         'rstAsset.Open sql, objRimsConn, adOpenKeyset, adLockOptimistic
  202.  
  203.         rstAsset.PageSize = Session("ASSET_LIST_PAGE_SIZE")    ' Number of records to display per page.
  204. '        rstAsset.PageSize = ASSET_LIST_PAGE_SIZE        ' Number of records to display per page.
  205.         Set Session("rstAsset") = rstAsset            ' Store for fast retrieval later on.
  206.         Session("Page") = 1                                                    ' Start on the first page.
  207.     else
  208.         ' Asset information already exists, retrieve it from the session object.
  209.         Set rstAsset = Session("rstAsset")
  210.     end if
  211.  
  212.     ' Determine whether there is no data in the recordset at this stage. Must check for BOF
  213.     ' as well as we could be on the last page of the data, and in this case EOF would be true.
  214.     bolNoData = rstAsset.EOF and rstAsset.BOF
  215.  
  216.     %>
  217.     <!--#INCLUDE FILE="checknulls_contract2.asp"-->
  218.     <%
  219.  
  220.     ' Process any paging move requests.
  221.     Select Case Trim(Request("PagingMove"))
  222.         Case "requery"
  223.             rstAsset.Requery
  224.         Case "prev"
  225.             If Session("Page") > 1 Then
  226.                 Session("Page") = Session("Page") - 1
  227.             End If
  228.         Case "first"
  229.             Session("Page") =  1
  230.         Case "next"
  231.             if Session("Page") < rstAsset.PageCount then
  232.                 Session("Page") = Session("Page") + 1
  233.             end if
  234.         Case "last"
  235.             Session("Page") = rstAsset.PageCount
  236.     End Select
  237.  
  238.     ' what is this? nbs 20/1/00
  239.     on Error resume next
  240.     rstAsset.AbsolutePage = Session("Page")
  241.     on error goto 0
  242.  
  243.  
  244. '    ' Check if there is only 1 asset, if so go straight to the item details page
  245. '    if (rstAsset.RecordCount = 1) then
  246. '        Response.Redirect "item.asp?AssetID=" & rstAsset("Asset_Id")
  247. '    end if
  248.  
  249.     Set rstContract = Session("rstContract")
  250.     on Error resume next
  251.     rstContract.AbsolutePage = 1
  252.     on error goto 0
  253.     TotalAssetValue=0
  254.     Do While Not rstContract.EOF
  255.         if rstContract("Contract_no") = Session("Contract_no") then
  256.             TotalAssetValue = rstContract("Contract_Asset_Value")
  257.             ContractExpiryDate = rstContract("Contract_expiry_date")
  258.             ContractTerm = rstContract("Contract_term")
  259.             ContractStarted = rstContract("Contract_commence_date")
  260.         end if
  261.         rstContract.MoveNext
  262.     Loop
  263.  
  264.     on Error resume next
  265.     rstContract.AbsolutePage = Session("Page")
  266.     on error goto 0
  267.  
  268.  ' calculate total asset value
  269.     on Error resume next
  270.     rstAsset.AbsolutePage = 1
  271.     on error goto 0
  272.  
  273.  
  274.  
  275.     on Error resume next
  276.     rstAsset.AbsolutePage = Session("Page")
  277.     on error goto 0
  278.  
  279. sql = "SELECT ControlValue " & _
  280. " from ControlData where argument = 'GST'"
  281. Set rstVat = Server.CreateObject("ADODB.Recordset")
  282. rstVat.Open sql, objRIMSConn, adOpenKeyset, adLockOptimistic
  283.  
  284.  
  285. %>
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293. <!--<SCRIPT LANGUAGE='JavaScript'>
  294. <!--hide from old browsers
  295.     function order_by(column_order)
  296.         {
  297.         document.sortform.ContSortItem.value=column_order;
  298.         document.sortform.submit()
  299.         }
  300.         function Count_rows(){
  301.         var Value=new Array(200)
  302.         var k =0
  303.         var a=0
  304.         detailsTable = document.getElementsByName('Table_Data');
  305.         detailsRow = detailsTable.getElementsByTagName('td')[rownumber];
  306.  
  307.         value=document.getElementById('Table_Data').getElementsByTagName('td').length;
  308.         document.sortform.submit()
  309.  
  310.  
  311.         count=document.getElementById('Table_Data').rows.length
  312.  
  313.         for(var i=14;i<=document.getElementById('Table_Data').getElementsByTagName('td').length;i++)
  314.         {
  315.           name=detailsRow.getElementsbyTagName("td")[0];
  316.  
  317.  
  318.         }
  319.          document.sortform.submit()
  320.          document.write(""+Value[i]"<br/>");
  321.         }
  322.         function Submit()
  323.         {
  324.  
  325.         document.sortform.submit()
  326.         document.write("hello");
  327.  
  328.         }
  329.  
  330.     /**function research_using(column_clause,equals_clause,display_clause)
  331.         {
  332.         document.sortform.Research.value=column_clause  + "'" + equals_clause + "'";
  333.         document.sortform.FilterDisplay.value=display_clause  + " = " + equals_clause;
  334.         document.sortform.submit()
  335.         }
  336.  
  337.     function research_using_int(column_clause,equals_clause,display_clause,display_value)
  338.         {
  339.         document.sortform.Research.value=column_clause  + equals_clause ;
  340.         document.sortform.FilterDisplay.value=display_clause  + " = " + display_value;
  341.         document.sortform.submit()
  342.         }*/
  343.  
  344.     function first_page()
  345.         {
  346.         document.paging.PagingMove.value="first";
  347.         document.paging.submit()
  348.         }
  349.     function prev_page()
  350.         {
  351.         document.paging.PagingMove.value="prev";
  352.         document.paging.submit()
  353.         }
  354.     function next_page()
  355.         {
  356.         document.paging.PagingMove.value="next";
  357.         document.paging.submit()
  358.         }
  359.     function last_page()
  360.         {
  361.         document.paging.PagingMove.value="last";
  362.         document.paging.submit()
  363.         }
  364.     function refresh_page()
  365.         {
  366.         document.paging.PagingMove.value="requery";
  367.         document.paging.submit()
  368.  
  369.         }
  370.     function displayResult()
  371. {
  372. var namelist = "";
  373. with(document.sortform) {
  374. for(var i = 0; i < same.length; i++){
  375. if(same[i].checked) {
  376. namelist += same[i].value + "\n";
  377. }
  378. }
  379. }
  380. if(namelist == "") {
  381. alert("select names");
  382. } else {
  383. alert (namelist);
  384. }
  385. return false;
  386. }
  387. alert("hi");
  388.  
  389. }
  390.  
  391.  
  392.  
  393.  //end of javascript 
  394. </SCRIPT>-->
  395.  
  396. <!--#INCLUDE FILE="..\include\header.asp"-->
  397.  
  398. <% If Session(ALLOW_LIFECYCLE) then %>
  399. <title>Lifecycle Management Asset Search</title>
  400. <% Else %>
  401. <title>Contract Management Asset Search</title>
  402. <% End if %>
  403. <!--#INCLUDE FILE="..\include\header.asp"-->
  404. <script language="javascript">
  405. function displayResult()
  406. {
  407.  
  408. var namelist = "";
  409.  
  410. with(document.sortform) {
  411. for(var i = 0; i < same.length; i++){
  412. if(same[i].checked) {
  413. namelist += same[i].value + ";";
  414. }
  415. }
  416. }
  417. if(namelist == "") {
  418. alert("select names");
  419. } else {
  420. //alert (namelist);
  421. var myArray = new Array();
  422. myArray= namelist.split(";");
  423. for(var i=0;i<myArray.length-1;i++)
  424. {
  425.  
  426. //alert(myArray[i]);
  427.  
  428. }
  429. }
  430. return false;
  431. }
  432. function checkAll(field)
  433. {
  434. for (i = 0; i < field.length; i++)
  435.     field[i].checked = true ;
  436. }
  437.  
  438. function uncheckAll(field)
  439. {
  440. for (i = 0; i < field.length; i++)
  441.     field[i].checked = false ;
  442. }
  443. function first_page()
  444.         {
  445.         document.paging.PagingMove.value="first";
  446.         document.paging.submit()
  447.         }
  448.     function prev_page()
  449.         {
  450.         document.paging.PagingMove.value="prev";
  451.         document.paging.submit()
  452.         }
  453.     function next_page()
  454.         {
  455.         document.paging.PagingMove.value="next";
  456.         document.paging.submit()
  457.         }
  458.     function last_page()
  459.         {
  460.         document.paging.PagingMove.value="last";
  461.         document.paging.submit()
  462.         }
  463.     function refresh_page()
  464.         {
  465.         document.paging.PagingMove.value="requery";
  466.         document.paging.submit()
  467.  
  468.         }
  469. function Lock()
  470. {
  471. with(document.sortform) {
  472. for(var i = 0; i < same.length; i++){
  473. if(same[i].checked) {
  474. document.sortform.Date.disabled=true;
  475. }
  476. }
  477. }
  478. return false;
  479. }
  480.  
  481. </script>
  482. <!--<script type="text/javascript">
  483.  
  484.  /** $(document).ready(function () {    
  485.     //assigning alternative row style
  486. $("#Table_Data tr:even").addClass("evenrow");
  487. $("#Table_Data tr:odd").addClass("oddrow");
  488.  
  489.  $("#Table_Data tr:#clickME").click(function(){
  490.    $(this).find(':checkbox').attr('checked', ! $(this).find(':checkbox').attr('checked'));    
  491.    if($(this).find(':checkbox').attr('checked'))
  492.         {
  493.         $('#Table_Data td:nth-child(2)').click(function() {
  494.  
  495.     html = $(this).text();
  496.     document.cookie=html;
  497.     var Cook=document.cookie.split(";");
  498.     alert(Cook);
  499.  
  500.  
  501. });
  502.  
  503.  
  504.         }
  505.         else
  506.         {
  507.             $(this).removeClass('highlight');
  508.               $(this).addClass('evenrow');
  509.         }
  510. });
  511. /**$("#Table_Data tr:odd").click(function(){
  512.     $(this).find(':checkbox').attr('checked', !$(this).find(':checkbox').attr('checked'));   
  513.     if($(this).find(':checkbox').attr('checked'))
  514.         {
  515.               $(this).removeClass('oddrow');
  516.               $(this).addClass('highlight');
  517.         }
  518.         else
  519.         {
  520.             $(this).removeClass('highlight');
  521.               $(this).addClass('oddrow');
  522.         }
  523. });
  524. });*/
  525. function Check(){
  526.  
  527. dim falg as int
  528. alert(document.getElementsByName("Che").item(0,0);
  529.  
  530.  
  531. }
  532.  
  533.  
  534.     </script>-->
  535.    <style  type="text/css">
  536.  
  537.   .highlight
  538. {
  539.     background-color:Red;
  540. }
  541. .oddrow    { background-color:#eee; }
  542. .evenrow   { background-color:#fff; }
  543. table.pretty {
  544.   background: whitesmoke;
  545.   border-collapse: collapse;
  546. }
  547. table.pretty th, table.pretty td {
  548.   border: 1px silver solid;
  549.   padding: 0.2em;
  550. }
  551. table.pretty th {
  552.   background: gainsboro;
  553.   text-align: left;
  554. }
  555. table.pretty caption {
  556.   margin-left: inherit;
  557.   margin-right: inherit;
  558. }
  559.  
  560.    </style>
  561.  
  562. <% Session("active_nav")="Contract" %>
  563. <link rel="stylesheet" href="stylemain.css">
  564. <!--#INCLUDE FILE="..\include\body.asp"-->
  565. <TABLE border=0 bordercolor="red" cellPadding=0 cellSpacing=0 width=100% height="135">
  566.   <TBODY> 
  567.   <TR> 
  568.     <TD width="167" vAlign=top><img src="http://bytes.com/images/nav/logo_b.gif" width="166" height="135"><br></TD>
  569.     <TD align=center vAlign=top  height="130" width=100%> 
  570.       <table border=0 bordercolor="blue" cellpadding=0 cellspacing=0 align="center">
  571.         <tbody> 
  572.         <tr> 
  573.           <td bgcolor=silver width=15 height="111">&nbsp;</td>
  574.           <td bgcolor=silver width="51%" valign="top" height="111" align="right"> 
  575.             <table width=100% border="0" bordercolor="orange" cellspacing="0" cellpadding="0">
  576.               <tr> 
  577.                 <td valign="top" align="right"></td>
  578.                 <td bgcolor=silver align=center> <br>
  579.                   <table border=0 cellpadding=0 cellspacing=0 bgcolor=silver>
  580.                     <tbody> 
  581.                     <tr bgcolor=silver> 
  582.  
  583.                       <th align=left nowrap colspan="2"> <font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<b> 
  584.                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Contract No: &nbsp; &nbsp; <%=Session("Contract_no")%>&nbsp; 
  585.                         </b></font> </th>
  586.                     </tr>
  587.                     <tr> 
  588.                       <td align=left nowrap> <font face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
  589.                         Number of assets: &nbsp; </font> </td>
  590.                       <td> <font face="Verdana, Arial, Helvetica, sans-serif" >&nbsp; 
  591.                         <%=rstAsset.RecordCount%> &nbsp; </font> </td>
  592.                     </tr>
  593.                     <tr> 
  594.                       <td align=left> <font face="Verdana, Arial, Helvetica, sans-serif" >&nbsp; 
  595.                         Total asset value: &nbsp; </font> </td>
  596.                       <td> <font face="Verdana, Arial, Helvetica, sans-serif" >&nbsp; 
  597.                         <%
  598.                        if trim(TotalAssetValue) = "" or isnull(TotalAssetValue) then 
  599.                         TotalAssetValue = 0
  600.  
  601.                        end if  
  602.  
  603.                        %>
  604.                         <%=session("CountryCurrency")%>&nbsp;<%=formatnumber(TotalAssetValue)%> 
  605.                         </font> </td>
  606.                     </tr>
  607.                     <tr> 
  608.                       <td align=left> <font face="Verdana, Arial, Helvetica, sans-serif" >&nbsp; 
  609.                         Contract started: &nbsp; </font> </td>
  610.                       <td> <font face="Verdana, Arial, Helvetica, sans-serif" >&nbsp; 
  611.                       <%
  612.                                   if trim(ContractStarted) <> "" then
  613.                                         StartDay = Day(FormatDateTime(ContractStarted,vbShortDate))
  614.                                         if len(StartDay) = 1 then
  615.                                             StartDay = "0" & StartDay
  616.                                         end if
  617.                                         StartMonth = Month(FormatDateTime(ContractStarted,vbShortDate))
  618.                                         if len(StartMonth) = 1 then
  619.                                             StartMonth = "0" & StartMonth
  620.                                         end if
  621.                                         StartYear = Year(FormatDateTime(ContractStarted,vbShortDate))
  622.                                         StartDate = StartDay & "/" & StartMonth & "/" & StartYear
  623.                                 else
  624.                                         startdate = "TBA"
  625.                                 end if
  626.                       %>
  627.  
  628.                         <% if ContractStarted Then %>
  629.                         <%=StartDate%> 
  630.                         <% end if %>
  631.                         &nbsp; </font> </td>
  632.                     </tr>
  633.                     <tr> 
  634.                       <td align=left> <font face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
  635.                         Expiry date: &nbsp; </font> </td>
  636.                       <td> <font face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
  637.                       <%
  638.                                   if trim(ContractExpiryDate) <> "" then
  639.                                         ExpiryDay = Day(FormatDateTime(ContractExpiryDate,vbShortDate))
  640.                                         if len(ExpiryDay) = 1 then
  641.                                             ExpiryDay = "0" & ExpiryDay
  642.                                         end if
  643.                                         ExpiryMonth = Month(FormatDateTime(ContractExpiryDate,vbShortDate))
  644.                                         if len(ExpiryMonth) = 1 then
  645.                                             ExpiryMonth = "0" & ExpiryMonth
  646.                                         end if
  647.                                         ExpiryYear = Year(FormatDateTime(ContractExpiryDate,vbShortDate))
  648.                                         ExpiryDate = ExpiryDay & "/" & ExpiryMonth & "/" & ExpiryYear
  649.                                 else
  650.                                         ExpiryDate = "TBA"
  651.                                 end if
  652.                       %>
  653.                         <% if ContractExpiryDate Then%>
  654.                         <%=ExpiryDate%> 
  655.                         <% end if %>
  656.                         &nbsp; </font> </td>
  657.                     </tr>
  658.                     <tr> 
  659.                       <td align=left> <font face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
  660.                         Term: &nbsp; </font> </td>
  661.                       <td> <font face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
  662.                         <%=ContractTerm%> months &nbsp; </font> </td>
  663.                     </tr>
  664.  
  665.                     <tr> 
  666.                       <td align=left height="2"> <font face="Verdana, Arial, Helvetica, sans-serif" >&nbsp; 
  667.                         Notice: &nbsp; </font> </td>
  668.                       <td height="2"> <font face="Verdana, Arial, Helvetica, sans-serif" >&nbsp; 
  669.                         <%=Session("CustomerNotice")%> days</font> </td>
  670.                     </tr>
  671.                     </tbody> 
  672.                   </table>
  673.                 </td>
  674.                 <td width="3%" valign="top" align="left"></td>
  675.               </tr>
  676.               <tr> 
  677.                 <td colspan="3" align="center"><img src="http://bytes.com/submit/images/transparent.gif" width="200" height="8" border="0"></td>
  678.               </tr>
  679.             </table>
  680.           </td>
  681.           <td bgcolor=silver width="23" valign="top" height="111">&nbsp;</td>
  682.           <td bgcolor=silver width="507" height="109" valign="top"> 
  683.             <table width="100%" border="0" cellspacing="0" cellpadding="0">
  684.               <tr> 
  685.                 <td width="4%" align="right" valign="top"></td>
  686.                 <td width="92%" bgcolor=silver valign="top"> <br>
  687.                   <table border=0 cellpadding=0 cellspacing=0 
  688.                               width="100%" bgcolor=silver class="SmallText">
  689.                     <tr bgcolor=silver align="center"> 
  690.                       <th align=left nowrap width="100%" colspan="2"> <font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>To 
  691.                         Contact Us</b></font> </th>
  692.                     </tr>
  693.                     <tbody> 
  694.                     <tr> 
  695.                       <td width=50> <font face="Verdana, Arial, Helvetica, sans-serif">&nbsp;Name:</font> 
  696.                       </td>
  697.                       <td > <font face="Verdana, Arial, Helvetica, sans-serif"> 
  698.                         <%
  699.                         if rstStaffContact.EOF then
  700.                             name = "TBA"
  701.                         else
  702.                             name = rstStaffContact("Staff_Name")
  703.                             pos = instr(1,rstStaffContact("Staff_Name"),",")
  704.                             if pos <> -1 then
  705.                                 'name = right(rstStaffContact("Staff_Name"),len(rstStaffContact("Staff_Name"))-pos) + " " + left(rstStaffContact("Staff_Name"),pos - 1)                                 
  706.                             end if
  707.                         end if
  708.                         %>
  709.                         <%= name %> </font> </td>
  710.                     </tr>
  711.                     <tr> 
  712.                       <td width=50> <font face="Verdana, Arial, Helvetica, sans-serif">&nbsp;Phone:</font> 
  713.                       </td>
  714.                       <%
  715.                       if rstStaffContact.EOF then
  716.                           staff_phone = "+91 22 6761 6400"
  717.                       else
  718.                           if isnull((rstStaffContact("Staff_phone"))) then
  719.                             staff_phone = "+91 22 6761 6400" 
  720.                           else 
  721.                             staff_phone = rstStaffContact("Staff_phone")
  722.                           end if
  723.                       end if
  724.  
  725.                       %>
  726.                       <td> <font face="Verdana, Arial, Helvetica, sans-serif"><%= staff_phone %></font> 
  727.                       </td>
  728.                     </tr>
  729.                     <tr> 
  730.                       <td width=50> <font face="Verdana, Arial, Helvetica, sans-serif">&nbsp;Fax:</font> 
  731.                       </td>
  732.                       <%
  733.                       if rstStaffContact.EOF then
  734.                         staff_fax = "+91 22 6695 0590"
  735.                       else
  736.                             if isnull((rstStaffContact("Staff_fax"))) then
  737.                             staff_fax = "+91 22 6695 0590" 
  738.                           else 
  739.                             staff_fax = rstStaffContact("Staff_fax")
  740.                            end if
  741.                       end if
  742.  
  743.                       %>
  744.                       <%
  745.                       if rstStaffContact.EOF <> TRUE THEN
  746.                       %>
  747.                       <td> <font face="Verdana, Arial, Helvetica, sans-serif"><%= staff_fax %></font> 
  748.                       </td>
  749.                     </tr>
  750.                     <tr> 
  751.                       <td width=50> <font face="Verdana, Arial, Helvetica, sans-serif">&nbsp;Mobile:</font> 
  752.                       </td>
  753.                       <td> <font face="Verdana, Arial, Helvetica, sans-serif"><%= rstStaffContact("Staff_cell") %></font> 
  754.                       </td>
  755.                     </tr>
  756.                     <tr> 
  757.                       <td width=50> <font face="Verdana, Arial, Helvetica, sans-serif">&nbsp;Email:</font> 
  758.                       </td>
  759.                       <td> <a href="mailto:<%= rstStaffContact("staff_email")%>"><b><font face="Verdana, Arial, Helvetica, sans-serif"  color="Navy"><%= rstStaffContact("Staff_email")%></font></b></a> 
  760.                       </td>
  761.                     </tr>
  762.                     <tr> 
  763.                       <td width=50> 
  764.                         <p><font face="Verdana, Arial, Helvetica, sans-serif"></font></p>
  765.                       </td>
  766.                       <td> 
  767.                         <p><font face="Verdana, Arial, Helvetica, sans-serif"></font></p>
  768.                       <%
  769.                       END IF
  770.                       %>
  771.  
  772.        </td>
  773.                     </tr>
  774.                     </tbody> 
  775.                   </table>
  776.                 </td>
  777.                 <td width="4%" valign="top" align="left"></td>
  778.               </tr>
  779.             </table>
  780.           </td>
  781.         </tr>
  782.         <tr valign="top"> 
  783.           <form name="paging" action="../contract/Asset_Returned_result.asp" method="POST">
  784.             <input type="hidden" name="PagingMove">
  785.           </form>
  786.           <td bgcolor=white colspan="4" align="right" > 
  787.             <table bgcolor="#EFEFEF" cellpadding="0" cellspacing="0" align="right" width="518">
  788.               <tr> 
  789.                 <td height="20"> 
  790.                   <div align="right"><a href="Assetlst_Returned.asp"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#2C85B1">Home</font></b></font></a> 
  791.                     | <a href="javascript:window.print()"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#2C85B1">Print</font></b></font></a> 
  792.                     <% If not bolNoData Then %>
  793.                     | <a href="javascript:first_page();"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#2C85B1">First</font></b></font></a> 
  794.                     | <a href="javascript:prev_page();"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#2C85B1">Previous</font></b></font></a> 
  795.                     | <a href="javascript:next_page()"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#2C85B1">Next</font></b></font></a> 
  796.                     | <a href="javascript:last_page()"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#2C85B1">Last</font></b></font></a> 
  797.                     <% End If %>
  798.                     | <a href="contlist_contract2.asp" <%'onClick="javascript:changeHeader()%>><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#2C85B1">Contract 
  799.                     Summary</font></b></font></a> | <b><a href="http://bytes.com/submit/Structure/edit_assets.asp"><b><font color="#2C85B1" face="Verdana, Arial, Helvetica, sans-serif" size="1">Edit 
  800.                     Assets</font></b></a></b> | <a href="javascript:refresh_page()"><b><font color="#2C85B1" face="Verdana, Arial, Helvetica, sans-serif" size="1">Refresh</font></b></a></div>
  801.                 </td>
  802.               </tr>
  803.             </table>
  804.         </tr>
  805.         </tbody> 
  806.       </table>
  807.     </TD>
  808.   </TR>
  809.   </TBODY> 
  810. </TABLE>
  811.  
  812.  
  813. <table width="100%" border="0" cellspacing="0" cellpadding="0" height=82%>
  814.   <tr> 
  815.     <td width="165" valign="top" height=100%> 
  816.       <table width="166" background="../../images/nav/new_b.jpg" border="0" cellspacing="0" cellpadding="0" height=100%>
  817.         <tr> 
  818.           <td width="166" height="100%"valign=top> 
  819.             <!-- navbar begin -->
  820.             <!-- left navigation -->
  821.             <!--#INCLUDE FILE="../include/inc_menu.asp"-->
  822.           </td>
  823.         </tr>
  824.       </table>
  825.     </td>
  826.     <td colspan="2" valign="top"> 
  827.       <p>&nbsp; <br>
  828.         &nbsp;&nbsp;&nbsp;
  829.         <form name="sortform" ACTION="Asset_Returned_result.asp" METHOD="POST" ID="Form1"> 
  830.         <input type="hidden" name="ContSortItem" value = "">
  831.         <!--input  type="hidden" name="Research" value = ""-->
  832.         <input  type="hidden" name="FilterDisplay" value = "">
  833.  
  834.  
  835. <%cmboBox=request.Form("cboCustomerID") %>
  836. <%
  837. if cmboBox<>"" then 
  838. Session("EotAction")=cmboBox 
  839. 'Response.Write("<p>"& Session("EotAction")&"</p>")
  840. end if
  841. %>
  842. //The Insert script starts from here
  843. \*<% 
  844. dim i
  845. dim checkboxValue
  846. dim TextBoxValue
  847.  
  848. dim Count
  849. dim Count1
  850. dim postion
  851. dim postion1
  852. position=0
  853. postion1=0
  854. i=0
  855. Checkbox1= Request.Form("same")
  856. strdate=Request.Form("Date")
  857. a=Split(strdate ,",")
  858. b=Split(Checkbox1,",") 
  859. if strdate<>"" and Checkbox1<>"" then
  860. TextBoxValue=UBound(a)
  861. checkboxValue=UBound(b)
  862. 'Response.Write(TextBoxValue)
  863. if TextBoxValue  > checkboxValue then
  864. for i=0 to  checkboxValue
  865. objRIMSConn.Execute "Insert into Eot_returned (Asset_id,Date) values ("+ b(i) +", '" + a(i)+ "');"
  866. next
  867.  
  868.     else
  869.     for i=0 to TextBoxValue
  870.     objRIMSConn.Execute "Insert into Eot_returned (Asset_id,Date) values ("+ b(i) +", '" + a(i) +"');"
  871. next
  872. end if
  873.  
  874.     Response.Write("<script language='javascript' type='text/javascript'> alert('The value hass been Inserted'); </script>")
  875.      else
  876.     Response.Write("<script language='javascript' type='text/javascript'> alert('Do you want to return any asset'); </script>")
  877. end if
  878. %>*/
  879.  
  880.         <%if bolNoData then%>
  881.       </p>
  882.  
  883.   <table width=80%>
  884.           <tr> 
  885.             <td> 
  886.               <div align="center"><br>
  887.                 <b> Sorry, there are no assets to display for this contract. </b> 
  888.               </div>
  889.             </td>
  890.             <%else %>
  891.             <table CELLPADDING="2" CELLSPACING="1" BORDER="0">
  892.               <tr> 
  893.                 <td> <font face="Arial" size="3" color="#808080"><strong>Assets under this contract</strong></font> </td>
  894.                 <td nowrap VALIGN="left" ALIGN="left"> <nobr>Page <%=Session("Page") %> 
  895.                   of <%=rstAsset.PageCount%></nobr>, rows per page = 
  896.                   <SELECT NAME="pageSize" onChange='javascript:document.sortform.submit();'>
  897.                     <OPTION VALUE="10" <% if rstAsset.PageSize = 10 then %>selected<% end if %> >10 
  898.                     <OPTION VALUE="20" <% if rstAsset.PageSize = 20 then %>selected<% end if %> >20 
  899.                     <OPTION VALUE="30" <% if rstAsset.PageSize = 30 then %>selected<% end if %> >30 
  900.                     <OPTION VALUE="40" <% if rstAsset.PageSize = 40 then %>selected<% end if %> >40 
  901.                     <OPTION VALUE="50" <% if rstAsset.PageSize = 50 then %>selected<% end if %> >50 
  902.                     <OPTION VALUE="60" <% if rstAsset.PageSize = 60 then %>selected<% end if %> >60 
  903.                     <OPTION VALUE="9999" <% if rstAsset.PageSize = 9999 then %>selected<% end if %> >no 
  904.                     limit 
  905.  
  906.                   </SELECT><a href="Assetlst_Returned.asp" ><img src="http://bytes.com/submit/images/button/button_small_search.gif" alt="Back to the search page" border="0" valign="middle" width="62" height="15" align="absmiddle"></a>
  907.  
  908.                 </td>
  909.                 <td>
  910.                     <input id="Hidden1" type="hidden" />
  911.                   </td>
  912.  
  913.                 <br />
  914.  
  915.              <%
  916.         sql = "SELECT EOTAction_ID,EOTActionName FROM EOTAction " & _
  917.             "WHERE EOTAction.EOTAction_ID In (4,5,3)ORDER BY EOTAction.EOTActionName"
  918.     %>
  919.  
  920.                 <td>
  921.                <b><span>Action to be taken </span></b><select name="cboCustomerID" id="cboCustomerID" style="width:250" size="1" onchange="displayResult()">
  922.         <option></option>
  923.     <%
  924.             Set rstCust = Server.CreateObject("ADODB.Recordset")
  925.             rstCust.Open sql, objRIMSConn, adOpenForwardOnly
  926.             Do Until rstCust.EOF
  927.                 'Response.Write( "<option value=" & Chr(34) & rstCust("EOTAction_ID") & Chr(34) )
  928.                 'Response.Write( ">" & rstCust("EOTActionName") & "</option>" & vbCrLf )
  929.  
  930.  
  931.  
  932.     %>
  933.     <option value="<%= rstCust("EOTActionName")%>"><%=rstCust("EOTActionName")%>
  934.                                  </option>
  935.  
  936.     <%rstCust.MoveNext
  937.             Loop %>
  938.      </select></td>
  939.               </tr>
  940.  
  941.  
  942.                         <!--#INCLUDE FILE="rpt_header.asp"-->
  943.             </table>
  944.             <br>
  945.             <table CELLPADDING="2" CELLSPACING="1" WIDTH="100%" BORDER="0" id="Table_Data">
  946.               <tr> 
  947.               <td><input type="button" name="CheckAll" value="Check All" onclick="checkAll(document.sortform.same)"/></td>
  948.                   <td><input type="button" name="UnCheckAll" value="Uncheck All"onclick="uncheckAll(document.sortform.same)"/></td>
  949.                   <td><input type="button" name="UnCheckAll" value="Submit"onclick='javascript:document.sortform.submit();'/></td>
  950.                   <tr>
  951.               <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> 
  952.                   <br>
  953.                  <b>Select</b> </td>
  954.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4">  
  955.                 <b>Asset_id</b> </td>
  956.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("invoice.invoice_date asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by Invoice in ascending order" align="middle" border="0"></a> 
  957.                   <a href='javascript:order_by("invoice.invoice_date desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by Invoice in descending order" align="middle" border="0" ></a> 
  958.                   <br>
  959.                   <b>Invoice no.</b> </td>
  960.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("invoice.invoice_date asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by Invoice in ascending order" align="middle" border="0"></a> 
  961.                   <a href='javascript:order_by("invoice.invoice_date desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by Invoice in descending order" align="middle" border="0" ></a> 
  962.                   <br>
  963.                   <b>Invoice Date</b> </td>
  964.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("Supplier_Detail.Supplier_Name asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by Supplier in ascending order" align="middle" border="0"></a> 
  965.                   <a href='javascript:order_by("Supplier_Detail.Supplier_Name desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by Supplier in descending order" align="middle" border="0" ></a> 
  966.                   <br>
  967.                   <b>Vendor name</b> </td>
  968.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("Asset_type.Asset_type_description asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by Supplier in ascending order" align="middle" border="0"></a> 
  969.                   <a href='javascript:order_by("Asset_type.Asset_type_description desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by Supplier in descending order" align="middle" border="0" ></a> 
  970.                   <br>
  971.                   <b>Asset type</b> </td>
  972.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("assettypesub.assettypesubdesc asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by Type in ascending order" align="middle" border="0" ></a> 
  973.                   <a href='javascript:order_by("assettypesub.assettypesubdesc desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by Type in descending order" align="middle" border="0" ></a> 
  974.                   <br>
  975.                   <b>Asset Sub type</b> </td>
  976.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("Asset_Detail.Asset_Description asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by Description in ascending order" align="middle" border="0"></a> 
  977.                   <a href='javascript:order_by("Asset_Detail.Asset_Description desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by Description in descending order" align="middle" border="0"></a> 
  978.                   <br>
  979.                   <b>Asset Description</b> </td>
  980.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("Asset_Detail.Asset_Serial_no asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by Serial No in ascending order" align="middle" border="0" ></a> 
  981.                   <a href='javascript:order_by("Asset_Detail.Asset_Serial_no desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by Serial No in descending order" align="middle" border="0" ></a> 
  982.                   <br>
  983.                   <b>Serial No.</b> </td>
  984.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("Asset_Detail.Asset_barcode_no asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by Barcode in ascending order" align="middle" border="0" ></a> 
  985.                   <a href='javascript:order_by("Asset_Detail.Asset_barcode_no desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by Barcode in descending order" align="middle" border="0" ></a> 
  986.                   <br>
  987.                   <b>Barcode No.</b> </td>
  988.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("Asset_Detail.Asset_purchase_price asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by Purchase Price in ascending order" align="middle" border="0" ></a> 
  989.                   <a href='javascript:order_by("Asset_Detail.Asset_purchase_price desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by Purchase Price in descending order" align="middle" border="0" ></a> 
  990.                   <br>
  991.                   <b>Asset Value</b> </td>
  992.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("state.statedesc asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by Description in ascending order" align="middle" border="0"></a> 
  993.                   <a href='javascript:order_by("state.statedesc desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by Description in descending order" align="middle" border="0"></a> 
  994.                   <br>
  995.                   <b>State</b> </td>
  996.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("Department.Department_Desc asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by PO number in ascending order" align="middle" border="0"></a> 
  997.                   <a href='javascript:order_by("Department.Department_Desc desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by PO number in descending order" align="middle" border="0" ></a> 
  998.                   <br>
  999.                   <b>Branch Location Name</b> </td>
  1000.                 <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> <a href='javascript:order_by("Cost_Centre.Cost_Centre_Code asc")'><img src="http://bytes.com/submit/images/up_arrow.gif" alt="Click to sort by PO number in ascending order" align="middle" border="0"></a> 
  1001.                   <a href='javascript:order_by("Cost_Centre.Cost_Centre_Code desc")'><img src="http://bytes.com/submit/images/down_arrow.gif" alt="Click to sort by PO number in descending order" align="middle" border="0" ></a> 
  1002.                   <br>
  1003.                  <b>Cost Center</b> </td>
  1004.                  <td ALIGN="center" NOWRAP class="colhead" bgcolor="#B0C5D4"> 
  1005.                   <br>
  1006.                  <b>Date to be returned</b> </td>
  1007.               <%
  1008.     BgColour = BGColourA
  1009.     intRecordsPrinted = 0
  1010.     intRecordNo = ((Session("Page") - 1) * rstAsset.PageSize) + 1
  1011.         Do While Not rstAsset.EOF
  1012.             If intRecordsPrinted = rstAsset.PageSize then        ' Printed all assets in this page.
  1013.                 exit do
  1014.             End If%>
  1015.             <tr>
  1016.             </tr>
  1017.               <tr id="clickME"> 
  1018.                 <td  ALIGN="left" VALIGN="top" bgcolor="<%=BgColour%>" NOWRAP><input id="Checkbox1" name="same" type="checkbox" value="<%=rstAsset("Asset_id")%>" /></td>
  1019.                 <td ALIGN="left" VALIGN="top" bgcolor="<%=BgColour%>" NOWRAP><%=rstAsset("Asset_id") %> </td>
  1020.                 <td  ALIGN="left" VALIGN="top" bgcolor="<%=BgColour%>" NOWRAP><%=rstAsset("invoice_no")%> &nbsp; </td>
  1021.                 <td ALIGN="left" VALIGN="top" bgcolor="<%=BgColour%>"> <%= rstAsset("invoice_date") %> &nbsp;</td>
  1022.                 <td ALIGN="left" VALIGN="top" NOWRAP bgcolor="<%=BgColour%>"><%=rstAsset("Supplier_Name")%> &nbsp;</td>
  1023.                 <td ALIGN="left" VALIGN="top" bgcolor="<%=BgColour%>" NOWRAP><%=rstAsset("Asset_type_description")%> &nbsp;</td>
  1024.                 <td ALIGN="left" VALIGN="top" bgcolor="<%=BgColour%>"> <%= rstAsset("assettypesubdesc") %> &nbsp;</td>
  1025.                 <td ALIGN="left" VALIGN="top" bgcolor="<%=BgColour%>"> <%= rstAsset("Asset_description") %> &nbsp;</td>
  1026.                 <td ALIGN="left" VALIGN="top" NOWRAP bgcolor="<%=BgColour%>"> <%=rstAsset("Asset_Serial_no")%> &nbsp;</td>
  1027.                 <td ALIGN="left" VALIGN="top" NOWRAP bgcolor="<%=BgColour%>"><%=rstAsset("Asset_barcode_no")%> &nbsp;</td>
  1028.                 <td ALIGN="right" VALIGN="top" NOWRAP bgcolor="<%=BgColour%>"> <%=Formatnumber(rstAsset("Asset_purchase_price"))%></td>
  1029.                 <td ALIGN="left" VALIGN="top" bgcolor="<%=BgColour%>"> <%= ucase(rstAsset("statedesc")) %>&nbsp; </td>
  1030.                 <td ALIGN="left" VALIGN="top" bgcolor="<%=BgColour%>"> <%= ucase(rstAsset("Department_Desc")) %>&nbsp; </td> 
  1031.                 <td ALIGN="left" VALIGN="top" NOWRAP bgcolor="<%=BgColour%>"> <%=rstAsset("Cost_Centre_Code")%> &nbsp;</td>
  1032.                 <td ALIGN="left" VALIGN="top" NOWRAP bgcolor="<%=BgColour%>"> <input id="Text1" name="Date" type="text" /></td>
  1033.  
  1034.  
  1035.  
  1036.               <%
  1037.     if BgColour = BGColourA then
  1038.         BgColour = BGColourB
  1039.     else
  1040.         BgColour = BGColourA
  1041.     end if
  1042.     intRecordsPrinted = intRecordsPrinted + 1
  1043.     intRecordNo = intRecordNo + 1
  1044.     rstAsset.MoveNext
  1045.     Loop
  1046. end if%>
  1047.  
  1048.             </table>
  1049.         </table>
  1050.       </form>
  1051.  
  1052.  
  1053.     <td width="29"></td>
  1054.   </tr>
  1055.   <tr> 
  1056.   <td>
  1057.  
  1058.  
  1059.  
  1060.           </form>
  1061.        </td>
  1062.  
  1063.   </tr>
  1064. </table>
  1065. <%
  1066.     'objRIMSConn.Close
  1067.     'Set objRIMSConn = nothing
  1068.  
  1069. %>
  1070. <!-- START OF HOTKEY SCRIPT (HOTKEY = Enter ) -->
  1071. <!--<script language="JavaScript1.2">
  1072. Hide script from old browsers
  1073. var hotkey=13
  1074. var destination="Asset_Returned.asp"
  1075. if (document.layers)
  1076. document.captureEvents(Event.KEYPRESS)
  1077. function backhome(e){
  1078. if (document.layers){
  1079. if (e.which==hotkey)
  1080. window.location=destination
  1081. }
  1082. else if (document.all){
  1083. if (event.keyCode==hotkey)
  1084. window.location=destination
  1085. }
  1086. }
  1087. document.onkeypress=backhome
  1088.  
  1089. // End hiding script from old browsers 
  1090. </script>
  1091.  
  1092. END OF HOTKEY SCRIPT  -->
the script where marked as \**/needs to be executed only when a button is clicked can some one help
Jan 27 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.