You are on page 1of 5

<html> <head> <title>IE Editing</title> <SCRIPT LANGUAGE="JavaScript"> function getcell(x,y,z){ if (x == 'd'){ if (confirm("Are you sure you want to delete

lotowner "+z+"?")) { document.operation.info.value=x+'|'+y; document.operation.submit(); } } if (x == 'e'){ if (document.getElementById('lotowner_'+y).value==""){ alert("Please enter a new lotowner value in the field.") ; document.getElementById('lotowner_'+y).focus(); return false; } if (document.getElementById('lotowner_'+y).value=="0"){ alert("Zero quantity is not allowed for lotowner quantit y"); document.getElementById('lotowner_'+y).focus(); return false; } 'if (!/^((\d+(\.\d*)?)|((\d*\.)?\d+))$/.test(document.getElementById('lotowner_' +y).value))'{ 'alert("Only numbers are allowed for lotowner quantity") ; 'document.getElementById('lotowner_'+y).focus(); 'return false; '} if (confirm("Are you sure you want to edit lotowner from "+z+" to "+document.get ElementById('lotowner_'+y).value+"?")) { document.operation.info.value=x+'|'+y+'|'+document.getElementById('lotowner_'+y) .value; document.operation.submit(); } } if (x == 'a'){ if (document.operation.newlotowner.value == ""){ alert("Please enter a new lotowner value in the field."); document.operation.newlotowner.focus(); return false; } if (document.operation.newlotowner.value=="0"){ alert("Zero quantity is not allowed for lotowner"); ddocument.operation.newlotowner.focus(); return false; } if (!/^((\d+(\.\d*)?)|((\d*\.)?\d+))$/.test(document.operation.newlotowner.value )){ alert("Only numbers are allowed for lotowner quantity"); document.operation.newlotowner.focus(); return false; }

if (confirm("Are you sure you want to add new lotowner "+document.operation.newl otowner.value+"?")) { var newid = Number(y); newid = newid + 1; document.operation.info.value=x+'|'+newid+'|'+document.operation.newlotowner.val ue; document.operation.submit(); } } } </SCRIPT> <style type="text/css"> .report { font: normal 10pt arial; font-size: 10pt; } </style> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!--#include file="include/sessions.asp" --> <!--#include file="include/menu.asp" --> <table border=0 width=100% cellspacing=0 cellpadding=3 background="images/BG.jpg "> <tr><td><b><font face="Arial" color="#FFFFFF">IE Editing - lotowner</font></b> </table> <div align="center"> <br> <form style="margin-top:0; margin-bottom:0" method="post" name="operation" act ion="ie_editing_lotowner.asp"> <p align="center"> <input name=info style=visibility:hidden><br> <font face="Arial" size="2"> Below is the lotowner settings available.&nbsp;<br> </font><font face="Arial" size="1"><font color="#663300"> To edit the value, enter new value in the textbox and click the <img border="0 " src="images/edit.gif"> icon.&nbsp;<br> To delete, click on the&nbsp; <img border="0" src="images/delete.gif"> icon.<b r> To add new lotowner setting, click on the 'Add New lotowner' button.</font><br > <br> </font> <center> <table border="1" width="60%" style="border-collapse: collapse" class=report c ellspacing="0" cellpadding="3"> <tr> <td bgcolor="#FFFF99"> <p align="center"><b>EDIT</b></p> </td> <td width=22% bgcolor="#FFFF99"> <p align="center"><b>LOTOWNER</b></p> </td> <td bgcolor="#FFFF99"><b>LAST UPDATE BY</b></td> <td bgcolor="#FFFF99"><b>UPDATE DATE</b></td> <td bgcolor="#FFFF99">

<p align="center"><b>DELETE</b></p> </td> </tr> <% dim maxid set cn = server.CreateObject("ADODB.CONNECTION") cn.open Session("IE_conn") 'response.write Session("IE_conn") 'response.end myoperation = request("info") if myoperation <> "" then myoperation2 = split(myoperation,"|") operation = myoperation2(0) detail = myoperation2(1) end if call info() loaddt = YEAR(Date()) & _ Pd(Month(date()),2) & _ Pd(DAY(date()),2) if operation = "d" then cn.execute("delete from SIL_WSMS_CONSTANT where title = 'lotowner' and v alue= " & detail) %> <script languange="javascript"> document.operation.submit(); </script> <% end if if operation = "e" then newvalue= myoperation2(2) set rsct = cn.execute("select title lotowner from SIL_WSMS_CONSTANT wher e title = " & newvalue ) if NOT rsct.Eof then %> <script languange="javascript"> alert("lotowner <%=cdbl(newvalue)%> is already exist!"); </script> <% else cn.execute("update SIL_WSMS_CONSTANT SET value = " & newvalue & ", updat eby = '" & session("name") & "', updatedate = '" & loaddt & "' where title= 'lot owner' and value = '" & detail & "'") %> <script languange="javascript"> document.operation.submit(); </script> <% end if rsct.close set rsct=nothing end if if operation = "a" then newvalue= myoperation2(2) set rsct = cn.execute("select value lotowner from SIL_WSMS_CONSTANT wher e title ='lotowner' " ) if NOT rsct.Eof then %>

<script languange="javascript"> alert("lotowner <%=cdbl(newvalue)%> is already exist!"); </script> <% else cn.execute("insert into SIL_WSMS_CONSTANT values ('" & lotowner & "'," & newvalue & ",'" & session("name") & "','" & loaddt & "')") %> <script languange="javascript"> document.operation.submit(); </script> <% end if rsct.close set rsct=nothing end if sub info() set rsfb = server.CreateObject("ADODB.RECORDSET") sql = "select title,value lotowner,updateby,updatedate from SIL_WSMS_CONSTANT wh ere title='lotowner' order by title" set rsct = cn.execute(sql) 'maxid = clng(rsct("ID")) While Not rsct.Eof response.write "<tr><td align=center><img border=0 src=images/edit.gif a lt=Save onmouseover=this.style.cursor='hand' onmouseout=this.style.cursor='defau lt' onclick=getcell('e',1,'" & rsct("lotowner") & "');>" response.write "<td align=center><input id=lotowner_" & " value=" & rsc t("lotowner") & " size=20 style=text-align:centre>" response.write "<td>" & rsct("updateby") response.write "<td>" & rsct("updatedate") response.write "<td align=center><img border=0 src=images/delete.gif alt =Delete onmouseover=this.style.cursor='hand' onmouseout=this.style.cursor='defau lt' onclick=getcell('d',1,'" & rsct("lotowner") & "');>" 'response.write ">>" & maxid rsct.MoveNext Wend rsct.Close Set rsct = Nothing end sub response.end %> </table> <br><br> <span id='addnew' style='display:inline'> <input type=button value="Add New LotOwner" onmouseover="this.style.cursor='ha nd'" onmouseout="this.style.cursor='default'" onclick="document.getElementById(' newlotowner').style.display='inline';document.operation.newlotowner.focus();docu ment.getElementById('addnew').style.display='none';"> </span> <span id='newlotowner' style='display:none'> <input name=newlotowner id=newlotowner size=10> <input type=button value="Add" onmouseover="this.style.cursor='hand'" onmouseout ="this.style.cursor='default'" onclick="getcell('a',1);">

<input type=button value="Cancel" onmouseover="this.style.cursor='hand'" onmouse out="this.style.cursor='default'" onclick="document.getElementById('newlotowner' ).style.display='none';document.getElementById('addnew').style.display='inline'; "> </span> </form> </center> </div>> <% '----------------Function pd(n, totalDigits) if totalDigits > len(n) then pd = String(totalDigits-len(n),"0") & n else pd = n end if End Function %> </body> </html>

You might also like