⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 通达OA官方提供的30源代码,感觉很实在
💻 PHP
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
?>
<html>
<head>
<title>投票项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<script>
function delete_item(ITEM_ID, VOTE_ID)
{
   if (window.confirm("您真的要删除该条选项吗?\n\n注意:该操作不可恢复!"))
      window.location="delete.php?ITEM_ID="+ITEM_ID+"&VOTE_ID="+VOTE_ID;
}
</script>
<body class="bodycolor" topmargin="5">
<?
 $query = "SELECT * from VOTE_TITLE where VOTE_ID='$VOTE_ID'";
 if($LOGIN_USER_PRIV!="1")
    $query.=" and FROM_ID='$LOGIN_USER_ID'";
 $cursor= exequery($connection,$query);
 if($ROW=mysql_fetch_array($cursor))
 {
    $SUBJECT=$ROW["SUBJECT"];
    $PARENT_ID=$ROW["PARENT_ID"];
    $ANONYMITY=$ROW["ANONYMITY"];
 }
 else
    exit;
?>
<table border="0" width="90%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/menu/vote.gif" align="absmiddle"><span class="big3"> 投票项目管理 - <?=$SUBJECT?></span>
    </td>
  </tr>
</table>

<table class="TableList" width="100%" align="center">
  <tr class="TableHeader" align="center">
    <td>选项</td>
    <td width="60">票数</td>
    <td width="280">投票人员</td>
    <td width="80">操作</td>
  </tr>
<?
$query = "SELECT * from VOTE_ITEM where VOTE_ID='$VOTE_ID' order by ITEM_ID";
$cursor= exequery($connection,$query);
while($ROW=mysql_fetch_array($cursor))
{
   $ITEM_ID=$ROW["ITEM_ID"];
   $ITEM_NAME=$ROW["ITEM_NAME"];
   $VOTE_COUNT=$ROW["VOTE_COUNT"];
   $VOTE_USER=$ROW["VOTE_USER"];

   if($ANONYMITY=="0")
   {
      $VOTE_USER_NAME="";
      $query = "SELECT * from USER where find_in_set(USER_ID,'$VOTE_USER')";
      $cursor1= exequery($connection,$query);
      while($ROW1=mysql_fetch_array($cursor1))
         $VOTE_USER_NAME.=$ROW1["USER_NAME"].",";
      $VOTE_USER_NAME=substr($VOTE_USER_NAME,0,-2);
   }
?>
  <tr class="TableData">
    <form name="form<?=$ITEM_ID?>" method="post" action="update.php">
    <td>&nbsp;<input type="text" name="ITEM_NAME" class="SmallInput" value="<?=$ITEM_NAME?>" size="50"></td>
    <td align="right"><?=$VOTE_COUNT?>票</td>
    <td style="cursor:hand" title="<?=$VOTE_USER_NAME?>"><?=csubstr($VOTE_USER_NAME,0,30).(strlen($VOTE_USER_NAME)>30?"...":"")?></td>
    <td align="center">
    <input type="hidden" name="ITEM_ID" value="<?=$ITEM_ID?>">
    <input type="hidden" name="VOTE_ID" value="<?=$VOTE_ID?>">
    <input type="submit" name="submit" value="修改" class="SmallButton">&nbsp;
    <input type="button" value="删除" class="SmallButton" name="button" onclick="delete_item('<?=$ITEM_ID?>','<?=$VOTE_ID?>')">
    </td>
    </form>
  </tr>
<?
}
?>
  <tr class="TableControl">
    <form name="form0" method="post" action="add.php">
    <td colspan="4">添加项目:
    <input type="text" name="ITEM_NAME" class="SmallInput" size="40">
    <input type="hidden" name="VOTE_ID" value="<?=$VOTE_ID?>">&nbsp;&nbsp;
    <input type="submit" name="submit" class="SmallButton" value="添加"></td>
    </form>
  </tr>
</table>

<div align="center">
   <br>
<?
if($PARENT_ID==0)
{
?>
   <input type="button" class="BigButton" value="返回" onclick="location='../index1.php?start=<?=$start?>'">
<?
}
else
{
?>
   <input type="button" class="BigButton" value="返回" onclick="location='../vote.php?PARENT_ID=<?=$PARENT_ID?>&start=<?=$start?>'">
<?
}
?>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -