班级抽签系统

最近招聘会开始流行起来了,可惜华师拿到的门票实在是少,处处要抽签,很残酷啊,闲着无聊就做了个抽签系统,以事公正,在这里将代码粘贴如下,做得实在太急了,很不完善,先凑合着吧!

 风致雅阁抽签系统
<!-- 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&gt;$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="\&quot;show\&quot;">";
            for ($i = 0; $i &lt; $number; $i++)             {                 $value = rand($star, $end);                 if(!in_array($value, $rand)) $rand[] = $value;             }             foreach($rand as $key =&gt; $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="\&quot;class1content\&quot;">
<tbody>
<tr>
<td width="\&quot;30px\&quot;">编号</td>
<td width="\&quot;500px\&quot;">抽取记录</td>
<td>公证人</td>
<td>时间&amp; lt;/td&gt;";
    foreach($content as $key =&gt; $value)
    {
    echo"</td>
</tr>
<tr>
<td>$key</td>
<td>$value</td>
</tr>
<tr>";
    }
echo "</tr>
</tbody>
</table>
 
 
";
 
?&gt;</div>

关键词:,

转载注明:转自风致雅阁

  1. No comments yet.

  1. No trackbacks yet.







2012 五月
« 十一    
 123456
78910111213
14151617181920
21222324252627
28293031