![]() |
![]() |
![]() |
![]() |
![]() ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() ![]() |
供应求购 | 免费商铺 | 商业资讯 | 库存二手 | 黄页大全 | 生活贴吧 | 房屋租售 | 招聘求职 | 婚恋交友 | 自助广告 |
ASP酒店预订怎么根据日期来显示不同的价格? | ||
发布时间:2010/11/13 14:52:40 发布人:网络游民 点击:326 | ||
下订单的时候,有可能连续在9月25日到10月5日每天都要买10个..怎么根据这个不同日期来获取这次订单的最终价格呢? 越详细越好,我不是很明白,请各位不吝赐教.谢谢了. |
||
![]() |
#1楼回复: re:ASP酒店预订怎么根据日期来显示不同的价格? | 网络游民 [2010/11/13 14:53:07] | |
源码: <% dim conn,connstr,time1,time2,time3,sql,price on error resume next Connstr="DRIVER=Microsoft Access Driver (*.mdb);DBQ="+server.mappath("data.mdb") '连接数据库,根据实际情况修改,如果有coon.asp的话,include一下,这段可以删去 Set Conn=Server.CreateObject("ADODB.Connection") conn.Open connstr If Err Then err.Clear Set Conn = Nothing Response.Write "数据库连接出错,请检查连接字串。" Response.End End If '定义日期 time1=cdate("2007-10-1 0:0:0") '10月1日 time2=cdate("2007-10-8 0:0:0") '10月7日 time3=cdate("2007-10-16 0:0:0") '10月15日 price=0 '价格 sql="select num,datenow from table1" 'sql查询 num是订货数量 datenow 是订货时间 table1是表名 可根据自己实际情况修改 set rs=conn.execute(sql) do while not rs.eof datenow=rs("datenow") num=rs("num") if datenow<time1 or datenow>time3 then price=price+num*100 end if if datenow>time1 and datenow<time2 then price=price+num*150 end if if datenow>time2 and datenow<time3 then price=price+num*120 end if rs.movenext loop response.write price '输出总价 %> 经过测试可用~~~ |
页次:1/1 每页10 总记录数1 | 分页:
1
|
![]() |
![]() |
※ | 发布回复 | ↓请遵循123发布网同城生活贴吧/论坛发帖规则;↓寻一夜情、包养、招嫖类信息的一律全部删除,并报公安备案↓ | |
|
![]() |
![]() |
网站首页 | 关于我们 | 广告业务 | 关于VIP | 免责声明 | 联系我们 | 设为首页 | 加入收藏 | 意见反馈 | 网站建设 |
123发布网 版权所有 www.123fbw.com 联系电话:18331151646 QQ:1016964448
CopyRight © 2007-2016 All Right Reserved 联系站长 津ICP备10002728号 统计: |