function changetype(yyyymmdd)
yyyy=year(yyyymmdd)
mm=month(yyyymmdd)
dd=day(yyyymmdd)
if len(mm)=1 then
mm=0&mm
end if
if len(dd)=1 then
dd=0&dd
end if
if len(dd&"/"&mm&"/"&yyyy)<8 then
changetype=""
else
changetype=dd&"/"&mm&"/"&yyyy
end if
end function
function closelayer_(whichlayer)
<%for h=1 to m
layer_name="layer_"&h
%>
if whichlayer="<%=layer_name%>" then
if document.all.<%=layer_name%>.style.visibility="hidden" then
document.all.<%=layer_name%>.style.visibility="visible"
else
document.all.<%=layer_name%>.style.visibility="hidden"
end if
end if
<%next%>
end function
<script language=vbscript>
sub checkdate(value)
if (value.value<>"" and not isdate(value.value)) or (len(value.value)<>10 and trim(value.value)<>"") then
msgbox "請輸入正確的日期類型",16,"錯誤!"
value.focus
exit sub
else
if isnumeric(right(value.value,4)) and instr(1,right(value.value,4),".")<1 then
else
if value.value<>"" then
if len(day(value.value))=1 then
dd=0&cstr(day(value.value))
else
dd=cstr(day(value.value))
end if
if len(month(value.value))=1 then
mm=0&cstr(month(value.value))
else
mm=cstr(month(value.value))
end if
yyyy=year(value.value)
select case value.name
case "f_riqi"
form1.f_riqi.value=dd&"/"&mm&"/"&yyyy
case "yq_riqi"
form1.yq_riqi.value=dd&"/"&mm&"/"&yyyy
case "wc_riqi"
form1.wc_riqi.value=dd&"/"&mm&"/"&yyyy
case "dd_riqi"
form1.dd_riqi.value=dd&"/"&mm&"/"&yyyy
end select
end if
end if
end if
end sub
sub checklength(value)
if value.value<>"" and len(value.value)<>7 then
msgbox "模具編號一定為7位!",16,"錯誤!"
value.focus
exit sub
end if
end sub
sub checkempty()
<%if instr(1,rsz("mod_no"),".") > 0 then%>
msgbox "此單為已完成且已改圖之模單,不能更改!",16
exit sub
<%end if%>
if form1.zt.value="完成" then
if trim(form1.wc_riqi.value)="" or trim(form1.wc_number.value)="" then
msgbox "數據輸入不完整(完成日期﹑完成數量)﹐請檢查!",16
exit sub
end if
end if
if trim(form1.f_riqi.value)="" then
msgbox "調整復期不能為空!",16,"錯誤!"
form1.f_riqi.focus
exit sub
end if
if trim(form1.yq_riqi22.value)<>"" then
if trim(form1.yq_riqi2.value)="" then
msgbox "模具要求日期不能為空!",16,"錯誤!"
form1.yq_riqi2.focus
exit sub
end if
end if
form1.method="post"
form1.action="update_info_ok.asp"
form1.submit
end sub
sub checkint(value)
if (trim(value.value)<>"" and instr(value.value,".")>0) or (value.value<>"" and not isnumeric(value.value)) then
msgbox "請輸入整數!",16,"錯誤!"
value.focus
exit sub
end if
end sub
function show_hidden(whichlayer)
if whichlayer="layer1" then
if document.all.layer1.style.visibility="hidden" then
document.all.layer1.style.visibility="visible"
document.all.zt.style.visibility="hidden"
document.all.layer2.style.visibility="hidden"
document.all.client_name.style.visibility="visible"
' form1.client_name.value=""
' form1.client_name.disabled="true"
' form1.bd_no.value=""
' form1.bd_no.disabled="true"
else
document.all.layer1.style.visibility="hidden"
document.all.zt.style.visibility="visible"
' form1.client_name.disabled="false"
' form1.bd_no.disabled="false"
end if
end if
if whichlayer="layer2" then
if document.all.layer2.style.visibility="hidden" then
document.all.layer2.style.visibility="visible"
document.all.layer1.style.visibility="hidden"
document.all.zt.style.visibility="hidden"
document.all.layer3.style.visibility="hidden"
document.all.client_name.style.visibility="hidden"
else
document.all.layer2.style.visibility="hidden"
document.all.layer3.style.visibility="visible"
document.all.zt.style.visibility="visible"
document.all.client_name.style.visibility="visible"
end if
end if
if whichlayer="layer33" then
if document.all.layer33.style.visibility="hidden" then
document.all.layer33.style.visibility="visible"
else
document.all.layer33.style.visibility="hidden"
end if
end if
end function
function check_bd_no()
if trim(form1.bd_no.value)<>"" then
document.all.duobianhao2.style.visibility="hidden"
else
document.all.duobianhao2.style.visibility="visible"
end if
end function
function closelayer(whichlayer)
if whichlayer="layer1" then
document.all.layer1.style.visibility="hidden"
document.all.zt.style.visibility="visible"
' form1.client_name.disabled="false"
' form1.bd_no.disabled="false"
end if
if whichlayer="layer2" then
if document.all.layer2.style.visibility="hidden" then
document.all.layer2.style.visibility="visible"
document.all.zt.style.visibility="hidden"
else
document.all.layer2.style.visibility="hidden"
document.all.zt.style.visibility="visible"
end if
end if
end function
function check_fittings_no()
if instr(form1.fittings_sort.value,"組合")>0 then
document.all.duobianhao.style.visibility="visible"
form1.fittings_no.value=""
form1.fittings_no.disabled="true"
else
document.all.duobianhao.style.visibility="hidden"
form1.fittings_no.disabled="false"
end if
end function
function check_all_empty()
check_all_empty=1&trim(form1.b1.vlue)&trim(form1.b2.vlue)&trim(form1.b3.vlue)&trim(form1.b4.vlue)&trim(form1.b5.vlue)&trim(form1.b6.vlue)&trim(form1.b7.vlue)&trim(form1.b8.vlue)&trim(form1.b9.vlue)&trim(form1.b10.vlue)&trim(form1.b11.vlue)&trim(form1.b12.vlue)&trim(form1.b13.vlue)&trim(form1.b14.vlue)&trim(form1.b15.vlue)
end function
sub getime(value)
yyyy=year(date())
mm="0"&month(date())
dd="0"&day(date())
if value.value=right(dd,2)&"/"&right(mm,2)&"/"&yyyy then
value.value=""
else
value.value= right(dd,2)&"/"&right(mm,2)&"/"&yyyy
end if
end sub
</script>
<%
function changetype(yyyymmdd)
yyyy=year(yyyymmdd)
mmmm=month(yyyymmdd)
dddd=day(yyyymmdd)
if len(mmmm)=1 then
mmmm=0&mmmm
end if
if len(dddd)=1 then
dddd=0&dddd
end if
if len(dddd&"/"&mmmm&"/"&yyyy)<8 then
changetype=""
else
changetype=dddd&"/"&mmmm&"/"&yyyy
end if
end function
function getfirstvalue(str,y)
wei=instr(1,str,"#|#")
lenstr=len(str)
if y>0 and instr(1,str,"#|#")<1 then
y=y+1
redim Preserve a(y)
a(y)=str
exit function
end if
if instr(1,str,"#|#")>0 then
y=y+1
redim Preserve a(y)
getstr=left(str,wei-1)
'getfirstvalue=getstr
a(y)=getstr
nextstr=right(str,lenstr-wei-2)
getfirstvalue=getfirstvalue(nextstr,y)
else
exit function
end if
end function
%>
function show_hidden(whichlayer)
if whichlayer="layer1" then
if document.all.layer1.style.visibility="hidden" then
document.all.layer1.style.visibility="visible"
document.all.zt.style.visibility="hidden"
document.all.layer2.style.visibility="hidden"
document.all.client_name.style.visibility="visible"
' form1.client_name.value=""
' form1.client_name.disabled="true"
' form1.bd_no.value=""
' form1.bd_no.disabled="true"
else
document.all.layer1.style.visibility="hidden"
document.all.zt.style.visibility="visible"
' form1.client_name.disabled="false"
' form1.bd_no.disabled="false"
end if
end if
sub getime(value)
yyyy=year(date())
mm="0"&month(date())
dd="0"&day(date())
if value.value=right(dd,2)&"/"&right(mm,2)&"/"&yyyy then
value.value=""
else
value.value= right(dd,2)&"/"&right(mm,2)&"/"&yyyy
end if
end sub
sub checkdate(value)
if (value.value<>"" and not isdate(value.value)) or (len(value.value)<>10 and trim(value.value)<>"") then
msgbox "請輸入正確的日期類型",16,"錯誤!"
value.focus
exit sub
else
if isnumeric(right(value.value,4)) and instr(1,right(value.value,4),".")<1 then
else
if value.value<>"" then
if len(day(value.value))=1 then
dd=0&cstr(day(value.value))
else
dd=cstr(day(value.value))
end if
if len(month(value.value))=1 then
mm=0&cstr(month(value.value))
else
mm=cstr(month(value.value))
end if
yyyy=year(value.value)
select case value.name
case "f_riqi"
form1.f_riqi.value=dd&"/"&mm&"/"&yyyy
case "yq_riqi"
form1.yq_riqi.value=dd&"/"&mm&"/"&yyyy
case "wc_riqi"
form1.wc_riqi.value=dd&"/"&mm&"/"&yyyy
case "dd_riqi"
form1.dd_riqi.value=dd&"/"&mm&"/"&yyyy
end select
end if
end if
end if
end sub
sub checklength(value)
if value.value<>"" and len(value.value)<>7 then
msgbox "模具編號一定為7位!",16,"錯誤!"
value.focus
exit sub
end if
end sub
onBlur=checkdate(g3) onDblClick=getime(g3)