班级抽签系统
- 十一月 17th, 2009
- Posted in PHP
- Write comment
最近招聘会开始流行起来了,可惜华师拿到的门票实在是少,处处要抽签,很残酷啊,闲着无聊就做了个抽签系统,以事公正,在这里将代码粘贴如下,做得实在太急了,很不完善,先凑合着吧!
风致雅阁抽签系统 <!-- h2 { background-color:#003399; color:#FFFFFF; padding:2px; height:30px; overflow:hidden;} h2 a {color:#FFFFFF; font-size:12px; text-decoration:none; margin-left:450px;} form{ width:300px; float:left; height:250px;} table {font-size:13px; clear:both; width:800px;} td{border:solid 1px #003399; margin:1px;} .show { width:500px; float:right;} .show span { display:inline-block; width:200px; border:solid 1px #003399; float:left; margin:1px;} h2 img{ vertical-align:middle; margin-top:-20px; float:right;} span#stateBut{cursor:pointer;} --> <div style="width: 800px; margin: 0pt auto; color: #003399;"> <h2> 风致雅阁抽签系统<a href="index.html">风致雅阁主页</a><script type="text/javascript"><!--mce:0--></script></h2> <form id="form" method="post"> 登录密码: <input name="password" type="password" /> 公证人: <input name="name" type="text" /> 开始数: <input name="star" type="text" /> 结束数: <input name="end" type="text" /> 抽取数量: <input name="number" type="text" /> <input type="submit" value="随机抽取" /> <span id="stateBut">展开记录</span> </form> <script type="text/javascript"><!--mce:1--></script> $end or $number>$end-$star) echo "<script type="text/javascript"><!--mce:2--></script>"; date_default_timezone_set('Asia/Shanghai'); $record="record.txt"; $fpwrite=fopen($record,"a"); $rand = array(); if ($password!="06ec82" ) { echo "<script type="text/javascript"><!--mce:3--></script>"; } elseif (isset($_COOKIE["Cookie"])){ echo "<script type="text/javascript"><!--mce:4--></script>"; } else { if (!empty($star) and !empty($end) and !empty($number)) { echo "时间:".date('Y年m月d日 H:i:m',time())." "; echo "开始的号码是:".$star." 结束的号码是:".$end." <div class="\"show\"">"; for ($i = 0; $i < $number; $i++) { $value = rand($star, $end); if(!in_array($value, $rand)) $rand[] = $value; } foreach($rand as $key => $value) { $i=$key+1; $text.=$value."——"; echo "<span>第 $i 个抽到的是 $value </span>"; } $text=rtrim($text,"——"); $count_new=fwrite($fpwrite,$text); $time=" ".$name." ".date('Y年m月d日 H:i:m',time())."|"; $count_new.=fwrite($fpwrite,$time); echo "</div> "; } } $read=file_get_contents($record); $read=rtrim($read,"|"); $content=explode("|",$read); $content=array_reverse($content); echo " <table id="\"class1content\""> <tbody> <tr> <td width="\"30px\"">编号</td> <td width="\"500px\"">抽取记录</td> <td>公证人</td> <td>时间& lt;/td>"; foreach($content as $key => $value) { echo"</td> </tr> <tr> <td>$key</td> <td>$value</td> </tr> <tr>"; } echo "</tr> </tbody> </table> "; ?></div> |

No comments yet.