//주민등록번호 체크----------------------------------------
function JuminCheck(jnum_01, jnum_02)
{
check_jumin = false
b_Year = (jnum_02.charAt(0) <= "2") ? "19" : "20"
b_Year += jnum_01.substr(0, 2)
b_Month = jnum_01.substr(2, 2) - 1
b_Date = jnum_01.substr(4, 2)
b_sum = new Date(b_Year, b_Month, b_Date)
if ( b_sum.getYear() % 100 != jnum_01.substr(0, 2) || b_sum.getMonth() != b_Month || b_sum.getDate() != b_Date)
{
return check_jumin
}
total = 0
temp = new Array(13)
for(i=1; i<=6; i++)
temp[i] = jnum_01.charAt(i-1)
for(i=7; i<=13; i++)
temp[i] = jnum_02.charAt(i-7)
for(i=1; i<=12; i++)
{
k = i + 1
if(k >= 10) k = k % 10 + 2
total = total + (temp[i] * k)
}
last_num = (11- (total % 11)) % 10
if(last_num == temp[13])
check_jumin = true
else
check_jumin = false
return check_jumin
}
댓글 없음:
댓글 쓰기