📄 sch_vote.php
字号:
<?php
require_once('libs/session.inc');
require_once('libs/config.inc');
require_once('libs/dbmanager.inc');
require_once('libs/function.inc');
$conn = DBManager::getConnection();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><?php echo $arr[goodsname]; ?></title>
<link rel="stylesheet" type="text/css" href="skin/style.css" />
</head>
<script language="javascript" type="text/javascript" src="js/menu.js"></script>
<body>
<?php require_once('pagetag/page_top.html'); ?>
<table align="center" width="964" cellpadding="0" cellspacing="0">
<tr><td height="10"></td></tr>
<tr>
<td width="203" valign="top">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center" colspan="3" height="9" background="skin/line_top.gif"></td>
</tr>
<tr>
<td width="1" class="line1"></td>
<td valign="top" width="201" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td><img src="skin/search.gif" /></td>
</tr>
<tr>
<td height="10" align="center"><img src="skin/m_m.gif" width="180" height="1" /></td>
</tr>
</table>
<?php require_once('pagetag/search_page.php'); ?>
</td>
<td width="1" class="line1"></td>
</tr>
<tr>
<td colspan="3" height="11" background="skin/sch_bot.gif"></td>
</tr>
<tr>
<td height="5"></td>
</tr>
</table>
<table height="149" width="100%" cellpadding="0" cellspacing="0" background="skin/star_shopbak.gif">
<tr>
<td height="8"></td>
</tr>
<tr>
<td height="24" align="center"><img src="skin/s_b.gif" /></td>
</tr>
<tr>
<td align="center" valign="top"><?php require_once('pagetag/showtextstar.php'); ?>
</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td height="10"></td>
</tr>
<tr>
<td align="center" colspan="3" height="9" background="skin/line_top.gif"></td>
</tr>
<tr>
<td width="1" class="line1"></td>
<td valign="top" width="201" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td><img src="skin/new.gif" /></td>
</tr>
<tr>
<td height="10" align="center"><img src="skin/m_m.gif" width="180" height="1" /></td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php require_once('pagetag/new_user.html'); ?>
</td><td width="15"></td>
</tr>
</table>
</td>
<td width="1" class="line1"></td>
</tr>
<tr>
<td colspan="3" height="11" background="skin/sch_bot.gif"></td>
</tr>
</table>
</td>
<td width="10"></td>
<td valign="top">
<?php
if($_GET[action] == sch){
?>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td height="40" background="skin/m_l.gif" width="8"></td>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" background="skin/m_m.gif" height="1"></td>
</tr>
<tr height="38">
<td width="40"><img src="skin/m_pic.gif" /></td>
<td>学校列表</td>
</tr>
<tr>
<td colspan="2" background="skin/m_m.gif" height="1"></td>
</tr>
</table>
</td>
<td background="skin/m_r.gif" width="8"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
</table>
<table border="1" style="border-collapse:collapse" bordercolor="#CCCCCC" width="100%" cellpadding="4" cellspacing="0">
<tr align="center" class="blue">
<td width="10%">序号</td>
<td width="52%">学校名称</td>
<td width="20%">店铺数(家)</td>
<td width="18%">二手信息数(条)</td>
</tr>
<?php
$result = $conn->query("SELECT * FROM ".$tablepre."school ORDER BY schoolid DESC");
$total = 0;
while($akr = $result->fetch_assoc()){
$total++;
}
$page = new ShowPage;
$page->PageSize = 20;
$page->Total = $total;
$page->mode = "action=sch&";
$page->LinkAry = array();
$showpage = $page->ShowLink();
$result = $conn->query("SELECT * FROM ".$tablepre."school ORDER BY schoolid DESC LIMIT ".$page->OffSet());
while($arr = $result->fetch_assoc()){
$rest = $conn->query("SELECT shopid FROM ".$tablepre."shop WHERE shopschool='$arr[schoolid]'");
$shopnum=0;
while($apr = $rest->fetch_assoc()){
$shopnum++;
}
$res = $conn->query("SELECT secondid FROM ".$tablepre."second WHERE secondschool='$arr[schoolid]'");
$secondnum=0;
while($air = $res->fetch_assoc()){
$secondnum++;
}
?>
<tr align="center">
<td><?php echo $arr[schoolid]; ?></td>
<td><a href="shop_list.php?action=fromschool&school=<?php echo $arr[schoolid] ?>" target="_parent" title="点击查看该校内店铺"><?php echo $arr[schoolname]; ?></a></td>
<td><?php echo $shopnum; ?></td>
<td><?php echo $secondnum; ?></td>
</tr>
<?php
}
?>
<tr>
<td align="right" colspan="4"><?php echo $showpage; ?> </td>
</tr>
</table>
<?php
}elseif($_GET[action] == vote){
if($_POST[vote] == ok){
$add = $_POST[checkvote];
if($add !== "")
{
if(is_array($add))
{
$ids = $comma = "";
foreach($add as $id)
{
$ids .= "$comma'$id'";
$comma = ",";
}
$update=$conn->query("UPDATE ".$tablepre."vote SET `votenum`=`votenum`+1 WHERE voteid IN ($ids)");
if($update == true){
msgbox("投票成功",GoUrl,"sch_vote.php?action=vote");
}
else{
msgbox("未知名错误,请联系源码提供商!",Back,"");
}
}
}}
?>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td height="40" background="skin/m_l.gif" width="8"></td>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" background="skin/m_m.gif" height="1"></td>
</tr>
<tr height="38">
<td width="40"><img src="skin/m_pic.gif" /></td>
<td>网站调查</td>
</tr>
<tr>
<td colspan="2" background="skin/m_m.gif" height="1"></td>
</tr>
</table>
</td>
<td background="skin/m_r.gif" width="8"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
</table>
<table border="1" style="border-collapse:collapse" bordercolor="#CCCCCC" width="100%" cellpadding="4" cellspacing="0">
<?php
$result = $conn->query("SELECT * FROM ".$tablepre."vote ORDER BY voteid ASC");
$sethigh = 500;
$res = $conn->query("SELECT max(`votenum`) AS maxer FROM ".$tablepre."vote");
$aor = $res->fetch_assoc();
$highest = $aor[maxer];
$bei = $highest/$sethigh;
if($bei == 0) $bei = 1;
while($arr = $result->fetch_assoc()){
if($arr[voteid] == 1) continue;
$height = $arr[votenum]/$bei;
?>
<tr>
<td>
<?php
echo $arr[votename];
?><br>
<img src="skin/vote.gif" height="20" width="<?php echo $height; ?>" /> <span class="red"><?php echo $arr[votenum]; ?></span> 票
</td>
</tr>
<?php
}
?>
</table>
<?php
}
?>
</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" >
<tr>
<td height="20"></td>
</tr>
</table>
<?php
require_once('pagetag/bottommation.php');
$conn->close();
?>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -