午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    hta編寫的消費(fèi)記錄程序
    來源:易賢網(wǎng) 閱讀:877 次 日期:2016-06-15 09:49:04
    溫馨提示:易賢網(wǎng)小編為您整理了“hta編寫的消費(fèi)記錄程序”,方便廣大網(wǎng)友查閱!

    將代碼復(fù)制粘貼到一文本文檔中,然后保存,并將該文件后綴名改為:hta,雙擊即可運(yùn)行。

    代碼如下:

    <!--////////程序說明/////////====

    程序名稱:消費(fèi)記錄ver1.1(20070808-20070811).hta

    使用說明:將代碼復(fù)制粘貼到一文本文檔中,然后保存,并將該文件后綴名改為:hta,雙擊即可運(yùn)行。

    作者說明:youxi01,,,版權(quán)沒有,歡迎盜版!!///////////-->

    <!--///////設(shè)置題頭,編碼方式//////-->

    <title>消費(fèi)記錄程序</title>

    <meta http-equiv=content-type content=text/html; charset=gb2312/>

    <!--///////hta標(biāo)志//////-->

    <hta:application

    scroll=no

    caption=yes

    sysmenu=yes/>

    <!--///////控制程序部分//////-->

    <script language=vbscript>

    totalmoney=0 '總消費(fèi)額

    index=-1 '初始化checkbox控件id序號;

    flag=0 '定義文件是否改動的標(biāo)志

    set fso=createobject(scripting.filesystemobject)

    '///////////////////文件載入時,讀取配置文件,定義自身大小、位置////////

    sub window_onload

    if not (fso.fileexists(consume.ini)) then '不存在配置文件則創(chuàng)建;

    fso.createtextfile(consume.ini).close

    end if

    window.resizeto 638,495 '設(shè)置自身大小、位置;

    window.moveto 200,100

    addrow 0,hoho,2007-1-1,星期二 '先添加一個行。自己都搞不明白,反正用來處理bug;

    document.all.nameditem(mytable).rows(1).style.display=none '設(shè)置這行不可見;

    addrow 0,hoho,2007-1-1,星期二 '再添加一個行。自己都搞不明白,反正用來處理bug;

    document.all.nameditem(mytable).rows(2).style.display=none '設(shè)置這行不可見;

    readfile(consume.ini)

    end sub

    '//////////////////讀取文件//////////////////

    function readfile(filename)

    set file=fso.opentextfile(filename,1,1)

    do while file.atendofline<>true '讀文件一直到文件尾部

    str=split(file.readline,#) '按#標(biāo)志分割沒行(總共有四個這種標(biāo)志)

    addrow str(1),str(2),str(3),str(4) '添加五個單元格,內(nèi)容分別為....

    loop

    end function

    '////////////////添加表行,單元格///////////

    function addrow(cnum,ctype,cdate,cday)

    index=index+1 '序號自加1

    set objtable=document.all.nameditem(mytable) '根據(jù)id獲取對象表格

    set newrow = objtable.insertrow() '插入一行

    newrow.classname=row_add '設(shè)置該行的樣式;

    newrow.onmouseover=getref(change_bgcolor)

    newrow.onmouseout=getref(back_bgcolor)

    newrow.onclick=getref(chooseobj)

    var=#&cnum&#&ctype&#&cdate&#&cday

    str=split(var,#)

    str(0)=<input type=checkbox id='delcheck'&index>

    for i=0 to 4

    set newcell=newrow.insertcell() '插入單元格,并設(shè)置單元格的值;

    newcell.innerhtml=str(i)

    next

    totalmoney=totalmoney+clng(cnum) '設(shè)置總消費(fèi)額的值,并定義顯示;

    consume.innerhtml=消費(fèi)總額:&totalmoney&元

    end function

    '///////////////改變對象背景//////////////

    function change_bgcolor()

    me.classname=new_row_add

    end function

    '/////////////返回原來背景色//////////////

    function back_bgcolor()

    me.classname=row_add

    end function

    '////////////選定該行/////////

    function chooseobj()

    if me.cells(0).children(0).checked=true then

    me.cells(0).children(0).checked=false

    else

    me.cells(0).children(0).checked=true

    end if

    end function

    '/////////////////刪除一個單元格///////////////

    function delrow()

    for i=0 to index

    if delcheck(i).checked=true then

    set tag=delcheck(i).parentelement.parentelement '設(shè)置該checkbox所在的行;

    tag.style.display=none '其實(shí),所謂的刪除就是把它設(shè)置為不顯示;

    totalmoney=totalmoney-clng(tag.cells(1).innertext)

    consume.innerhtml=消費(fèi)總額:&totalmoney&元

    tag.cells(1).innertext=0 '消費(fèi)額設(shè)置為0;

    end if

    next

    flag=1 '如果執(zhí)行了刪除操作,則標(biāo)志文件已經(jīng)改動;

    end function

    '////////////////////檢查輸入數(shù)據(jù)是否正確////////////

    function check(value)

    if not (isnumeric(value)) then

    msgbox 請在消費(fèi)金額欄中輸入數(shù)字!,64,特別提示

    elseif value<1 then

    msgbox 你的錢難道越花越多?,64,特別提示

    else

    flag=1

    addrow money.value,cstype.options(cstype.selectedindex).innertext,date,weekdayname(weekday(date))

    csmonth.selectedindex = month(date()) '月份checkbox轉(zhuǎn)到當(dāng)前月份;

    selectchange(monthname(month(date()))) '表格顯示為當(dāng)前月份的數(shù)據(jù);

    end if

    money.select() 'money輸入框選定;

    end function

    '////////////////////////如果月份checkbox變化//////////////

    function selectchange(choose) '78行;

    totalmoney=0

    for i=0 to index

    set tag=delcheck(i).parentelement.parentelement

    mname=monthname(month(tag.cells(3).innertext)) '獲取數(shù)據(jù)的月份;

    if trim(choose)=一年 and tag.cells(1).innertext<>0 then

    tag.style.display=

    totalmoney=totalmoney+clng(tag.cells(1).innertext)

    elseif mname<>trim(choose) or tag.cells(1).innertext=0 then

    tag.style.display=none

    else

    tag.style.display=

    totalmoney=totalmoney+clng(tag.cells(1).innertext)

    end if

    next

    consume.innerhtml=消費(fèi)總額:&totalmoney&元

    end function

    '////////////全選或全不選按鈕控制代碼//////

    function selectall() '96行;

    if mybutton.value=全部選擇 then

    for i=0 to index

    delcheck(i).checked=true

    next

    mybutton.value=全不選擇

    else

    for i=0 to index

    delcheck(i).checked=false

    next

    mybutton.value=全部選擇

    end if

    end function

    '/////////////當(dāng)程序退出時//////////////////

    sub window_onunload()

    if flag=1 then '文件如果已經(jīng)標(biāo)志了改動,則提示是否保存;

    msg=msgbox(提示:你的設(shè)置已經(jīng)更改,是否保存?,vbyesno+vbexclamation,保存提醒)

    if msg=6 then '如果選擇了“是”;

    selectchange(一年) '當(dāng)前表格顯示的數(shù)據(jù)為全年的數(shù)據(jù);

    for i=0 to index

    set tag=delcheck(i).parentelement.parentelement

    if tag.cells(1).innertext<>0 then

    txt=txt&#&tag.cells(1).innertext&#&tag.cells(2).innertext&#

    txt=txt&tag.cells(3).innertext&#&tag.cells(4).innertext & vbcrlf

    end if

    next

    set file=fso.opentextfile(consume.ini,2,1) '覆蓋寫入文件;

    file.write(txt).close

    end if

    end if

    end sub

    </script>

    <!--///////以上為控制代碼,以下為樣式代碼/////////////-->

    <style>

    #all{border:1px solid #000069;width:600px;text-align:center;padding:2px;}

    #header{width:598px;text-align:center;font-family: 隸書;font-size: 24px;

    font-weight: bold;background: #eee;margin:1px;}

    #header1{text-align:center;font-size: 16px;width:595px;padding:2px 2px;}

    #month{float:left;width:20px;margin-left:90px;}

    #consume{float:left;width:200px;color:red}

    #main{width:600px;height:300px;background: #eee;border:1px solid #000069;overflow:auto;}

    #contain{width:600px;height:30px;border:1px solid #000069;}

    .line{border:1px solid #000060; height: 1;width:602px;}

    .line2{border:1px solid white; height: 1;width:600px;}

    .c_button{text-align:center;float:left;width:100px;border:1px solid #ccc;

    background-color:#f3f3f3;font-size:12px;color:#333333;

    padding:5px 2px;margin:2px;line-height:20px;}

    .c_other{text-align:center;float:left;width:136px;

    border:1px solid #ccc;background-color:#f3f3f3;font-size:12px;color:#333333;

    padding:5px 2px;margin:2px;line-height:20px;height:23px; }

    .button {padding:1px;text-align:center;border:0;background-color:#eee;height:23px;cursor:pointer}

    .th{text-align=center;background-color:#006699;font-size:14px;

    font-family: 隸書;color:#f2f3f7;padding:2px;line-height:22px;}

    .row_add{text-align:center;background-color:#ccd2de;height:4px;font-size:12px;line-height:15px;

    padding:2px;}

    .new_row_add{text-align:center;color:red;background-color:#ccd2ad;height:4px; font-size:12px;

    line-height:15px;padding:2px;cursor:hand;}

    </style>

    <!--///////以下為要顯示對象/////////////-->

    <hr class=line>

    <div id=all>

    <div id=header>2007年消費(fèi)一覽表</div>

    <div id=header1>

    <div id=month><select id=csmonth onchange=selectchange(csmonth.options(csmonth.selectedindex).innertext)><option>一年</option><option>一月</option><option>二月</option><option>三月</option><option>四月</option><option>五月</option><option>六月</option><option>七月</option><option>八月</option><option>九月</option><option>十月</option><option>十一月</option><option>十二月</option></select></div>

    <div id=consume>消費(fèi)總額:</div></div>

    <div id=main>

    <table border=0 width=100% id=mytable>

    <tr class=th><th>選定</th><th>消費(fèi)金額</th><th>消費(fèi)類型</th><th>消費(fèi)日期</th><th>消費(fèi)星期</th>

    </table></div>

    <hr class=line2 color=white>

    <div id=contain>

    <div class=c_button><input type=submit value=全部選擇 class=button id=mybutton onclick=selectall></div>

    <div class=c_other>消費(fèi)金額:<input type=text name=money size=5 onmouseover='money.select()'></div>

    <div class=c_other>消費(fèi)類型:<select id=cstype><option>飲食</option><option>娛樂</option><option>其它</option></select></div>

    <div class=c_button><input type=submit value=添加記錄 class=button onclick=check(money.value)></div><div class=c_button><input type=submit value=刪除記錄 class=button onclick=delrow()></div>

    </div></div>

    更多信息請查看腳本欄目
    易賢網(wǎng)手機(jī)網(wǎng)站地址:hta編寫的消費(fèi)記錄程序
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2025國考·省考課程試聽報名

    • 報班類型
    • 姓名
    • 手機(jī)號
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報警專用圖標(biāo)