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

📄 query.php

📁 极限网络智能办公系统 Office Automation V3.0官方100%源代码.
💻 PHP
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
include_once("inc/utility.php");
?>

<html>
<head>
<title>车辆使用管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script>
function delete_usage(VU_ID,VU_STATUS)
{
 msg='确认要删除该车辆使用申请么?';
 if(window.confirm(msg))
 {
  URL="delete.php?VU_ID=" + VU_ID + "&VU_STATUS=" + VU_STATUS;
  window.location=URL;
 }
}

function receive_usage(VU_ID)
{
 msg='确认要收回使用中的车辆么?';
 if(window.confirm(msg))
 {
  URL="checkup.php?VU_ID=" + VU_ID + "&VU_STATUS=" + 4;
  window.location=URL;
 }
}

</script>

</head>
<body class="bodycolor" topmargin="5">

<?
 $connection=OpenConnection();

    if($VU_STATUS==0)
       $VU_STATUS_DESC="待批申请";
    elseif($VU_STATUS==1)
       $VU_STATUS_DESC="已准申请";
    elseif($VU_STATUS==2)
       $VU_STATUS_DESC="使用中车辆";
    elseif($VU_STATUS==3)
      $VU_STATUS_DESC="未准申请";
    elseif($VU_STATUS==4)
      $VU_STATUS_DESC="使用结束车辆";

    $query = "SELECT count(*) from VEHICLE_USAGE where VU_OPERATOR='$LOGIN_USER_ID' and VU_STATUS='$VU_STATUS'";

    $cursor= exequery($connection,$query);
    $VU_COUNT=0;
    if($ROW=mysql_fetch_array($cursor))
       $VU_COUNT=$ROW[0];

    if($VU_COUNT==0)
    {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/menu/vehicle.gif" width="24" height="24"><span class="big3"> <?=$VU_STATUS_DESC?></span>
    </td>
  </tr>
</table>

<?
   Message("","无".$VU_STATUS_DESC);
   exit;;
 }

?>

<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/menu/vehicle.gif" width="24" height="24"><span class="big3"> <?=$VU_STATUS_DESC?></span>
    </td>

    <td valign="bottom" class="small1">共<span class="big4">&nbsp;<?=$VU_COUNT?></span>&nbsp;条车辆记录
    </td>
    </tr>
</table>

<table border="0" cellspacing="1" width="95%" class="small" bgcolor="#000000" cellpadding="3">
  <tr class="TableHeader">
      <td nowrap align="center">车牌号</td>
      <td nowrap align="center">用车人</td>
      <td align="center">事由</td>
      <td nowrap align="center">开始时间</td>
      <td nowrap align="center">结束时间</td>
      <td align="center">备注</td>
      <td nowrap align="center">操作</td>
    </tr>

<?
    //============================ 显示已发布公告 =======================================
    $query = "SELECT * from VEHICLE_USAGE where VU_OPERATOR='$LOGIN_USER_ID' and VU_STATUS='$VU_STATUS' order by VU_START";

    $cursor= exequery($connection,$query);
    $VU_COUNT=0;
    while($ROW=mysql_fetch_array($cursor))
    {
       $VU_COUNT++;

       $VU_ID=$ROW["VU_ID"];
       $V_ID=$ROW["V_ID"];
       $VU_PROPOSER=$ROW["VU_PROPOSER"];
       $VU_REQUEST_DATE=$ROW["VU_REQUEST_DATE"];
       $VU_USER=$ROW["VU_USER"];
       $VU_REASON=$ROW["VU_REASON"];
       $VU_START =$ROW["VU_START"];
       $VU_END=$ROW["VU_END"];
       $VU_MILEAGE=$ROW["VU_MILEAGE"];
       $VU_DEPT=$ROW["VU_DEPT"];
       $VU_STATUS=$ROW["VU_STATUS"];
       $VU_REMARK=$ROW["VU_REMARK"];

       if($VU_START=="0000-00-00 00:00:00")
          $VU_START="";
       if($VU_END=="0000-00-00 00:00:00")
          $VU_END="";

       if($VU_COUNT%2==1)
          $TableLine="TableLine1";
       else
          $TableLine="TableLine2";

       $query = "SELECT * from VEHICLE where V_ID='$V_ID'";
       $cursor2= exequery($connection,$query);
       if($ROW2=mysql_fetch_array($cursor2))
          $V_NUM=$ROW2["V_NUM"];
?>
    <tr class="<?=$TableLine?>">
      <td nowrap align="center"><a href="javascript:;" onClick="window.open('../vehicle_detail.php?V_ID=<?=$V_ID?>','','height=360,width=500,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,left=280,top=160,resizable=yes');"><?=$V_NUM?></a></td>
      <td nowrap align="center"><?=$VU_USER?></td>
      <td align="center"><?=$VU_REASON?></td>
      <td nowrap align="center"><?=$VU_START?></a></td>
      <td nowrap align="center"><?=$VU_END?></a></td>
      <td align="center"><?=$VU_REMARK?></td>
      <td nowrap align="center">
      <a href="javascript:;" onClick="window.open('../usage_detail.php?VU_ID=<?=$VU_ID?>','','height=380,width=400,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=200,left=280,resizable=yes');">详细信息</a>&nbsp;
<?
   if($VU_STATUS==0)
   {
      echo "<a href='checkup.php?VU_ID=$VU_ID&VU_STATUS=1'> 批准</a>&nbsp;";
      echo "<a href='checkup.php?VU_ID=$VU_ID&VU_STATUS=3'> 不准</a>&nbsp;";
   }
   elseif($VU_STATUS==1)
   {
      echo "<a href='checkup.php?VU_ID=$VU_ID&VU_STATUS=0'> 撤销</a>&nbsp;";
   }
   elseif($VU_STATUS==2)
   {
?>
      <a href="javascript:receive_usage('<?=$VU_ID?>');"> 收回</a>&nbsp
<?
   }
   elseif($VU_STATUS==3)
   {
      echo "<a href='checkup.php?VU_ID=$VU_ID&VU_STATUS=1'> 批准</a>&nbsp;";
   }

?>
      <a href="edit.php?VU_ID=<?=$VU_ID?>&VU_STATUS=<?=$VU_STATUS?>">修改</a>&nbsp;
      <a href="javascript:delete_usage('<?=$VU_ID?>','<?=$VU_STATUS?>');">删除</a>
      </td>
    </tr>
<?
   }
?>

</table>
</body>

</html>

⌨️ 快捷键说明

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