⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 autoinit.asp

📁 通用考勤系统
💻 ASP
字号:
<%

    myyear=Year(now())   '''获取本月天数
 mymonth=Month(now())
  if mymonth=1 then
   myday=31
elseif mymonth=2  then
   if (year(now()) mod 400)<>0 then
  myday=28
    else
  myday=29
    end if
elseif mymonth=3  then
  myday=31
elseif mymonth=4  then
  myday=30
elseif mymonth=5  then
  myday=31
elseif mymonth=6  then
  myday=30
elseif mymonth=7  then
  myday=31
elseif mymonth=8  then
  myday=31
elseif mymonth=9  then
  myday=30
elseif mymonth=10  then
  myday=31
elseif mymonth=11  then
  myday=30
elseif mymonth=12  then
  myday=31
end if




sub zxnocomornoqd
sqlinit2="select * from ct_sql  where (todayqd=0 and todayqdsuc=1 and noshenhe=1)"            
initrs.open sqlinit2,cn,3,3
 do while not initrs.eof
    autoqd=initrs("auto")
      ptype=initrs("type")
        tu0=initrs("todayusefulworktime")
   if autoqd=0 then
     tsql="select * from type where type="&ptype
        rsa.open tsql,cn,1,1
         syssetpay0=rsa("monthpay")
         worktime0=rsa("worktime")
         dfttime0=rsa("settime")
        rsa.close
   elseif autoqd<>0 then
       sql2="select * from qdsetall where id="&autoqd
       rsa.open sql2,cn,1,1 
         worktime0=rsa("worktime")  
         dfttime0=rsa("settime")  
       rsa.close

       sql3="select monthpay from type where type="&ptype
        rsa.open sql3,cn,1,1
          syssetpay0=rsa("monthpay")    ''该组月固定工资
        rsa.close
  end if

  if tu0<dfttime0 then
    tu0=dfttime0
  end if
 daypay=round((syssetpay0/myday),2)   
 daypay=round(((daypay/systime0)*tu0),2)
 initrs("yestodaypay")=(initrs("yestodaypay")+daypay)
 initrs("monthpay")=((initrs("monthpay")+daypay))                 
 initrs("payall")=((initrs("payall")+daypay))
 initrs.update
 initrs.movenext
loop
initrs.close

  'response.write "1 初始化昨天已正常注销 但是没有完成签到,或者没有签到的人员<br>"
end sub

sub com
   sqlinit="select * from ct_sql where (todayqd=2 and todayqdsuc=1 and noshenhe=1)"            
   initrs.open sqlinit,cn,3,3
    do while not initrs.eof
      yestodaypay_com=initrs("yestodaypay")
      initrs("monthpay")=(initrs("monthpay")+yestodaypay_com)                 
      initrs("payall")=(initrs("payall")+yestodaypay_com)
    initrs.update
  initrs.movenext
loop
 initrs.close

'response.write "2 初始化昨天已完成签到人员<br>"
end sub

sub nozx

sqlinit3="select * from ct_sql  where (todayqd=1 and todayqdsuc=1 and noshenhe=1)"             
initrs.open sqlinit3,cn,3,3
 do while not initrs.eof
       lt=initrs("lattertime")               
        autoqd=initrs("auto")
         ptypee=initrs("type")
          tu1=initrs("todayusefulworktime")
     if autoqd=0 then
      tsql="select * from type where type="&ptypee
        rsa.open tsql,cn,1,1
        syssetpay1=rsa("monthpay")
        systime1=rsa("worktime")
        dfttime1=rsa("settime")
       rsa.close
     elseif autoqd<>0 then
       sql2="select * from qdsetall where id="&autoqd
       rsa.open sql2,cn,1,1    
        systime1=rsa("worktime")          ''获得该组签到时间、次数、未结算时间
        dfttime1=rsa("settime")         
     rsa.close

    sql3="select monthpay from type where type="&ptypee
     rsa.open sql3,cn,1,1
      syssetpay1=rsa("monthpay")    ''该组月固定工资
     rsa.close
     end if 
    if tu1<dfttime1 then
     if (systime1-lt)<dfttime1  then             
       tu1=(systime1-lt)
      else
       tu1=dfttime1
     end if
   end if
daypay=round((syssetpay1/myday),1)                          
daypay=round(((daypay/systime1)*tu1),2)
initrs("monthworktime")=int(initrs("monthworktime")+tu1)
initrs("allworktime")=int(initrs("allworktime")+tu1)
initrs("yestodaypay")=(initrs("yestodaypay")+daypay)
initrs("monthpay")=((initrs("monthpay")+daypay))                 
initrs("payall")=((initrs("payall")+daypay))
initrs.update
initrs.movenext
loop
 initrs.close

'response.write "3 处理未注销人员 [带有惩罚性质]<br>"
 end sub       

sub allinit
  sqlinita="select * from ct_sql where noshenhe=1"         '''''清除员工签到状态     
  rsa.open sqlinita,cn,3,3
do while not rsa.eof
 rsa("todayqd")=0
 rsa("todayqdsuc")=0
 rsa("todayinitdate")=date()
 rsa("lastpay")=0 
 rsa("todayqdontime")=empty 
 rsa("todaylatter")=0
 rsa("lattertime")=0                  
 rsa("mustqdok")=0
 rsa("todaypay")=0 
 rsa("todayqdip")=empty
 rsa("todayqdtimes")=0
 rsa("todayworktime")=0
 rsa("todayallworktime")=0
 rsa("todayusefulworktime")=0 
 rsa("todaylatterrc")=0 
 rsa("thismustqdtime")=empty
 rsa("nextmustzxtime")=empty
rsa.update  
rsa.movenext
loop
rsa.close
  sqlinitb="select todayinitdate from ct_adminboss"            '''''清除管理员签到状态
  rsb.open sqlinitb,cn,3,3
    do while not rsb.eof
     rsb("todayinitdate")=date()
   rsb.update  
 rsb.movenext
loop
rsb.close
  sqlinitd="select * from webset "
   rsb.open sqlinitd,cn,3,3
    rsb("initday")=1
    rsb.update
   rsb.close
'response.write "4 初始化员工、管理员<br>"
  
 end sub  
 
 sub minit
 sqlinit2="select * from ct_sql "
   mrs.open sqlinit2,cn,3,3
   do while not mrs.eof
    
   mrs("monthpay")=0                  
   mrs("monthworktime")=0
   
   mrs("monthqdnum")=0
   mrs("monthqdpaiming")=0
   mrs("monthqdpmtime")=empty
   
   mrs("monthlattertime")=0
   mrs("monthlatterpaiming")=0
   mrs("monthlatterpmtime")=empty

   mrs("monthfen")=0
   mrs("monthfenpmtime")=empty
   mrs("monthfenpaiming")=0
   
   mrs("monthqdrc")=empty
   mrs("monthlatterqdrc")=empty

   

   mrs.update
   mrs.movenext
   loop
   mrs.close
   set mrs=nothing
  
  sqlinitm="select * from webset "
   rsa.open sqlinitm,cn,3,3
  rsa("initmonth")=1
  rsa.update
  rsa.close
 set rsa=nothing
 'response.write "5 月初始化成功<br>"
 end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -