投票系统
来源:互联网 发布:进出口海关数据 编辑:程序博客网 时间:2024/05/01 20:41
一个小小的投票系统,首先创建四张数据库的表,user用户表,vms_vote投票表,vms_voteitem投票选项表,vms_ joinvote用户投票表
各个表字段如下
各个界面如下
主界面主要用到iframe
<script> <!-- 编写脚本 --> function ifmresize(){ var ifm= document.getElementById("contentframe"); ifm.height=document.documentElement.clientHeight; } window.onresize=function(){ ifmresize(); }</script> <div class="col-md-10"> <iframe width="100%" id="contentframe" name="contentframe" onload="ifmresize()" frameborder="0" scrolling="auto" src="listjoinvotes.jsp"> </iframe> </div>
界面基本是一样的结构,有些界面加入了模态框,界面遍历部分代码如下,
<table class="table table-hover"> <thead> <tr> <th> 选项编号 </th> <th> 选项名称 </th> <th> 投票人数 </th> </tr> </thead> <% VoteItemDAO voteItemDAO = new VoteItemDAO(); List<VoteItem> voteItemList = voteItemDAO.getVoteItemResult(votes.getVoteid()); for(VoteItem voteItem : voteItemList) { %> <tr> <td> <%=voteItem.getItemid()+1 %> </td> <td> <%=voteItem.getName() %> </td> <td> <%=voteItem.getVotecount() %> </td> </tr> <% } %> </table>
因为数据库的时间字段是时间戳格式,在界面获取的是String类型,而且使用的日期选择器格式也是mm/dd/yy的,所以在装换的时候,就使用了private SimpleDateFormat simpleDateFormatTemp = new SimpleDateFormat("MM/dd/yyyy");
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
来对日期进行转换.
做完后,感觉就是对数据库的增改查,还有业务逻辑的思考,虽然不是很难,但是代码写的很多重复的,也很乱.所以就不继续粘贴代码了,
基本的投票发起投票和进行投票的功能都实现了,不过还没实现进行多选的投票,还有数据库查询后分页的功能没有实现,以后再看看能不能继续完善,
0 0
- 投票系统投票界面
- 投票系统
- 投票系统
- 投票系统
- 投票系统饼状图
- 明星投票系统
- 投票系统防刷票
- 在线投票系统
- 自动投票系统
- php--简单投票系统
- php投票系统
- PHP 投票系统
- 【C#】投票系统
- 网站投票系统!
- 投票系统设计
- 39 练习:投票系统
- Java+Servlet投票系统
- java投票系统
- LeetCode-226. Invert Binary Tree
- vim快速入门使用
- 喷水装置(一)题目及解法
- Android多线程之AsycnTask
- 关于android开发环境搭建常见问题
- 投票系统
- POJ 1004 Financial Management 水题 求平均数
- NodeJS基础:readline模块的使用
- 第一篇
- JavaScript中的对象的创建
- spring中的设计模式(三)
- Codeforces Round #332 (Div. 2) B. Spongebob and Joke(水题,构造)
- 细说UI设计
- php中__autoload()函数是如何运作的?