<html>
<head>
<meta charset="tis-620">
<title>List Current Employee</title>
<script src="jquery.js" ></script>
<script>
$(document).ready(function(){
// $("#tests").click(function(){
// var mydata=$("#sso1").attr("data-sso"); อmydata ่อานจาก data-sso กลับได้ undefine พอไปใช้ nodelist กับอ่านได้ ค่า no ปรกติ
// var mydata2=$("#sso2").attr("data-sso"); mydata2 อ่านค่าได้ ปกติ
// var xsel=document.getElementsByTagName("select");
//alert(mydata + " " + mydata2 + " " + mydata3 );
var myNodelist = document.getElementsByTagName("select");
// document.getElementById("div2").innerHTML = myNodelist.length;
// var txt="";
for (i = 0; i < myNodelist.length; i++) {
// txt+=myNodelist[i].id +".." + myNodelist[i].getAttribute("data-sso");
if ( myNodelist[i].getAttribute("data-sso")=="no") {
myNodelist[i].options[1].selected="yes"; // no
}else{
// myNodelist[i].value="yes"; //yes
myNodelist[i].options[0].selected="yes";
}
}
// document.getElementById("div2").innerHTML = txt;
// });
});
</script>
</head>
<body >
<button id="tests">test</button>
<div id="div2"></div>
<%
response.Expires=-1
'response.CharSet="tis-620"
dim rs,sql,my%>
<!-- #include virtual="/v1/salary/dbconnect_realpath_grandattendance.asp"-->
<%set rs=Server.CreateObject("ADODB.Recordset")
m_y=request.QueryString("monthy")
dim i,j,xmonth,xyear
i=instr(1,m_y,"/")
xmonth=mid(m_y,1,i-1)
xyear=mid(m_y,i+1)
mname=monthname(xmonth)
Dim showempall
sql="SELECT set_showEmpAll from tblSet"
rs.Open sql,conn
showempall=rs.Fields("set_showEmpAll")
rs.close
If showempall="yes" then
sql="SELECT DISTINCT tbltime.empid as iempid, emp_name, emp_surname,emp_showinsurance FROM tbltime, tblemployee WHERE time_Date Like '%/" & m_y & "' and tbltime.empid=tblemployee.empid;"
Else
sql="SELECT DISTINCT tbltime.empid as iempid, emp_name, emp_surname,emp_showinsurance FROM tbltime, tblemployee WHERE time_Date Like '%/" & m_y & "' and tbltime.empid=tblemployee.empid and tblemployee.emp_showinsurance='yes';"
End If
rs.Open sql,conn
%>
<h4 style={color="#000000";}>ตารางเงินเดือน(ShowSalary)</h4>
<p><% response.Write ("เงินเดือนงวดที่ : " & mname & " " & xyear & " (" & m_y & ")" )%></p>
<table border="1" width="100%" id="employees" >
<caption align="left"></caption>
<tr bgcolor="#b0c4de" name="headtable" id='rowhead'>
<!--#include virtual='v1/salary/headtable_curemp.asp'-->
</tr>
<%
dim m
m=1
dim ibool
ibool=0
%>
<!--#include virtual='v1/salary/coltable.asp'-->
<%do until rs.EOF%>
<%
if ibool=0 then
response.Write ("<tr id='tr" & m & "'>")
ibool=1
else
response.Write ("<tr class='alt' id='tr" & m & "'>")
ibool=0
end if
%>
<form method="post" action="db_edit.asp" target="_blank" ID=Form1>
<% xId=rs.Fields("iempid")
' xM=rs
' xY=%>
<td id="<%="td"&m&"_0"%>" class="wrap" onmouseover="cell_in(<%=m %>,0)" onmouseout="cell_out(<%=m %>,0)"><%Response.Write( xId)%> </td>
<td id="<%="td"&m&"_1"%>" class="wrap" onmouseover="cell_in(<%=m %>,1)" onmouseout="cell_out(<%=m %>,1)"><%Response.Write(m)%><input type="checkbox" name=<%="chk_id_sd"%> id=<%="chk" & m %> value=<%=rs.Fields("iempid")%> title=<%="id=" & rs.Fields("iempid")%>> </td>
<td id="<%="td"&m&"_2"%>" class="wrap" onmouseover="cell_in(<%=m %>,2)" onmouseout="cell_out(<%=m %>,2)"><%Response.Write(rs.Fields("emp_name"))%> </td>
<td id="<%="td"&m&"_3"%>" class="wrap" onmouseover="cell_in(<%=m %>,3)" onmouseout="cell_out(<%=m %>,3)"><%Response.Write(rs.Fields("emp_surname"))%> </td>
<% 'เอา empid และ m y ไปเช็คกับ tblsalarydetail ว่าได้มีการลงข้อมูลแล้วหรือยัง%>
<% 'salary=queryFieldByEmpIdMonthYear()%>
<td >
<select id="sso<%=m%>" data-empid="true" data-sso='<%=rs.Fields("emp_showinsurance")%>' >
<option value="yes">yes</option>
<option value="no">no</option>
</select>
</td>
</form>
</tr>
<% m=m+1 %>
<%rs.MoveNext%>
<%
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</table>
<p>view our homepage : <a href="http://www.grandpestcontrol.com" target="_blank"><strong>www.GrandPestControl.com</strong></a></p>
</body>
<script language="javascript">
document.body.style.cursor="default";
document.getElementById("go").style.cursor="default";
document.getElementById("loading").style.visibility="hidden";
</script>
</html>
ไม่มีความคิดเห็น:
แสดงความคิดเห็น