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

📄 detail.php

📁 通达OA官方提供的30源代码,感觉很实在
💻 PHP
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_file.php");
?>

<html>
<head>
<title>图书详细资料 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<?
 $query = "SELECT * from BOOK_INFO where BOOK_ID='$BOOK_ID'";
 $cursor= exequery($connection,$query);
 if($ROW=mysql_fetch_array($cursor))
 {
    $BOOK_NAME=$ROW["BOOK_NAME"];
    $TYPE_ID=$ROW["TYPE_ID"];
    $AUTHOR=$ROW["AUTHOR"];
    $ISBN=$ROW["ISBN"];
    $PUB_HOUSE=$ROW["PUB_HOUSE"];
    $PUB_DATE=$ROW["PUB_DATE"];
    $AREA=$ROW["AREA"];
    $AMT=$ROW["AMT"];
    $PRICE=$ROW["PRICE"];
    $BRIEF=$ROW["BRIEF"];
    $ATTACHMENT_ID=$ROW["ATTACHMENT_ID"];
    $ATTACHMENT_NAME=$ROW["ATTACHMENT_NAME"];


    $OPEN=$ROW["OPEN"];
    $LEND=$ROW["LEND"];
    $BORR_PERSON=$ROW["BORR_PERSON"];
    $MEMO=$ROW["MEMO"];
    $DEPT=$ROW["DEPT"];
    $BOOK_NO=$ROW["BOOK_NO"];

    $BOOK_NAME=str_replace("<","&lt",$BOOK_NAME);
    $BOOK_NAME=str_replace(">","&gt",$BOOK_NAME);
    $BOOK_NAME=stripslashes($BOOK_NAME);

    $AUTHOR=str_replace("<","&lt",$AUTHOR);
    $AUTHOR=str_replace(">","&gt",$AUTHOR);
    $AUTHOR=stripslashes($AUTHOR);

    $ISBN=str_replace("<","&lt",$ISBN);
    $ISBN=str_replace(">","&gt",$ISBN);
    $ISBN=stripslashes($ISBN);

    $PUB_HOUSE=str_replace("<","&lt",$PUB_HOUSE);
    $PUB_HOUSE=str_replace(">","&gt",$PUB_HOUSE);
    $PUB_HOUSE=stripslashes($PUB_HOUSE);

    $PUB_DATE=str_replace("<","&lt",$PUB_DATE);
    $PUB_DATE=str_replace(">","&gt",$PUB_DATE);
    $PUB_DATE=stripslashes($PUB_DATE);

    $AREA=str_replace("<","&lt",$AREA);
    $AREA=str_replace(">","&gt",$AREA);
    $AREA=stripslashes($AREA);

    $AMT=str_replace("<","&lt",$AMT);
    $AMT=str_replace(">","&gt",$AMT);
    $AMT=stripslashes($AMT);

    $PRICE=str_replace("<","&lt",$PRICE);
    $PRICE=str_replace(">","&gt",$PRICE);
    $PRICE=stripslashes($PRICE);

    $BRIEF=str_replace("<","&lt",$BRIEF);
    $BRIEF=str_replace(">","&gt",$BRIEF);
    $BRIEF=stripslashes($BRIEF);

    $BRIEF=str_replace("  ","&nbsp;&nbsp;",$BRIEF);
    $BRIEF=str_replace("\n","<br>",$BRIEF);

    $BORR_PERSON=str_replace("<","&lt",$BORR_PERSON);
    $BORR_PERSON=str_replace(">","&gt",$BORR_PERSON);
    $BORR_PERSON=stripslashes($BORR_PERSON);

    $MEMO=str_replace("<","&lt",$MEMO);
    $MEMO=str_replace(">","&gt",$MEMO);
    $MEMO=stripslashes($MEMO);

 }

 $query = "SELECT TYPE_NAME from BOOK_INFO A,BOOK_TYPE B where A.TYPE_ID=B.TYPE_ID and A.BOOK_ID=$BOOK_ID";
 $cursor= exequery($connection,$query);
 if($ROW=mysql_fetch_array($cursor))
 {
    $TYPE_NAME=$ROW["TYPE_NAME"];
 }

?>

<body class="bodycolor" topmargin="5">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/edit.gif" WIDTH="22" HEIGHT="20" align="absmiddle"><span class="big3"> 图书详细信息</span>
    </td>
  </tr>
</table>

<table class="TableBlock"  width="450" align="center">
  <form name="form1">
   <tr>
    <td nowrap class="TableData" width="70">部门:</td>
    <td nowrap class="TableData"  width="280">
<?
   $query = "SELECT B.DEPT_NAME from BOOK_INFO A,DEPARTMENT B where A.DEPT=B.DEPT_ID and A.DEPT='$DEPT'";
   $cursor= exequery($connection,$query);
   if($ROW=mysql_fetch_array($cursor))
      $DEPT_NAME=$ROW[0];
?>
      <?=$DEPT_NAME?>&nbsp;
    </td>
    <td class="TableData" rowspan="6" width="100">
<?
   $MODULE=attach_sub_dir();
   $ATTACHMENT_ID1=$ATTACHMENT_ID;
   $YM=substr($ATTACHMENT_ID1,0,strpos($ATTACHMENT_ID1,"_"));
   if($YM)
      $ATTACHMENT_ID1=substr($ATTACHMENT_ID1,strpos($ATTACHMENT_ID,"_")+1);
   $ATTACHMENT_ID_ENCODED=attach_id_encode($ATTACHMENT_ID1,$ATTACHMENT_NAME); 
     
   if($ATTACHMENT_NAME=="")
      echo "<center>暂无封面</center>";
   else
   {
?>
       <a href="/inc/attach.php?MODULE=<?=$MODULE?>&YM=<?=$YM?>&ATTACHMENT_ID=<?=$ATTACHMENT_ID_ENCODED?>&ATTACHMENT_NAME=<?=urlencode($ATTACHMENT_NAME)?>&DIRECT_VIEW=1?>" title="点击查看放大图片" target="_blank"><img src="/inc/attach.php?MODULE=<?=$MODULE?>&YM=<?=$YM?>&ATTACHMENT_ID=<?=$ATTACHMENT_ID_ENCODED?>&ATTACHMENT_NAME=<?=urlencode($ATTACHMENT_NAME)?>" width='100' border=1 alt="文件名:<?=$ATTACHMENT_NAME?>"></a>
<?
   }
?>
   </td>
   </tr>
   <tr>
    <td nowrap class="TableData">书名:</td>
    <td nowrap class="TableData"><?=$BOOK_NAME?>&nbsp;</td>
   </tr>
   <tr>
    <td nowrap class="TableData">编号:</td>
    <td nowrap class="TableData">
    <?=$BOOK_NO?>&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">图书类别:</td>
    <td nowrap class="TableData">
    <?=$TYPE_NAME?>&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">作者:</td>
    <td nowrap class="TableData">
    <?=$AUTHOR?>&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">ISBN号:</td>
    <td nowrap class="TableData">
    <?=$ISBN?>&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">出版社:</td>
    <td nowrap class="TableData" colspan="2">
    <?=$PUB_HOUSE?>&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">出版日期:</td>
    <td nowrap class="TableData" colspan="2">
    <?=$PUB_DATE?>&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">存放地点:</td>
    <td nowrap class="TableData" colspan="2">
    <?=$AREA?>&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">数量:</td>
    <td nowrap class="TableData" colspan="2">
    <?=$AMT?>&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">借书待批:</td>
    <td class="TableData" colspan="2">
<?
$query = "SELECT * from BOOK_MANAGE where BOOK_NO='$BOOK_NO' and (BOOK_STATUS='0' and  STATUS='0')";
$cursor= exequery($connection,$query);
$COUNT=0;
while($ROW=mysql_fetch_array($cursor))
{
   $COUNT++;

   $BUSER_ID=$ROW["BUSER_ID"];
   $BORROW_DATE=$ROW["BORROW_DATE"];
   $RETURN_DATE=$ROW["RETURN_DATE"];

   $query1 = "SELECT * from USER where USER_ID='$BUSER_ID'";
   $cursor1= exequery($connection,$query1);
   if($ROW1=mysql_fetch_array($cursor1))
      $USER_NAME=$ROW1["USER_NAME"];

   if($COUNT==1)
   {
?>
<table class="TableList"  width="100%"  align="center" >
   <tr align="center">
     <td nowrap class="TableData">借书人</td>
     <td nowrap class="TableData">借书日期</td>
     <td nowrap class="TableData">归还日期</td>
     <td nowrap class="TableData">数量</td>
   </tr>
<?
   }
?>
   <tr align="center">
     <td nowrap class="TableData"><?=$USER_NAME?></td>
     <td nowrap class="TableData"><?=$BORROW_DATE?></td>
     <td nowrap class="TableData"><?=$RETURN_DATE?></td>
     <td nowrap class="TableData">1</td>
   </tr>
<?
}//while

if($COUNT>0)
   echo "</table>";
else
   echo "无记录"
?>
   <tr>
    <td nowrap class="TableData">未还记录:</td>
    <td class="TableData" colspan="2">
<?
$query = "SELECT * from BOOK_MANAGE where BOOK_NO='$BOOK_NO' and ((BOOK_STATUS='0' and  STATUS='1') or (BOOK_STATUS='1'and (STATUS='0' or STATUS='2')))";
$cursor= exequery($connection,$query);
$LEND_COUNT=0;
while($ROW=mysql_fetch_array($cursor))
{
   $LEND_COUNT++;

   $BUSER_ID=$ROW["BUSER_ID"];
   $BORROW_DATE=$ROW["BORROW_DATE"];
   $RETURN_DATE=$ROW["RETURN_DATE"];

   $query1 = "SELECT * from USER where USER_ID='$BUSER_ID'";
   $cursor1= exequery($connection,$query1);
   if($ROW1=mysql_fetch_array($cursor1))
      $USER_NAME=$ROW1["USER_NAME"];

   if($LEND_COUNT==1)
   {
?>
<table class="TableList" width="100%" align="center" >
   <tr align="center">
     <td nowrap class="TableData">借书人</td>
     <td nowrap class="TableData">借书日期</td>
     <td nowrap class="TableData">归还日期</td>
     <td nowrap class="TableData">数量</td>
   </tr>
<?
   }
?>
   <tr align="center">
     <td nowrap class="TableData"><?=$USER_NAME?></td>
     <td nowrap class="TableData"><?=$BORROW_DATE?></td>
     <td nowrap class="TableData"><?=$RETURN_DATE?></td>
     <td nowrap class="TableData">1</td>
   </tr>
<?
}//while

if($LEND_COUNT>0)
   echo "</table>";
else
   echo "无记录"
?>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">价格:</td>
    <td nowrap class="TableData" colspan="2">
    <?=$PRICE?>&nbsp;元
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">内容简介:</td>
    <td class="TableData" colspan="2">
    <?=$BRIEF?>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">借阅范围:</td>
    <td nowrap class="TableData" colspan="2">
<?
if($OPEN=="1")
{
?>
   全体
<?
    }
else if($OPEN=="0")
{
?>
   本部门
<?
}
else
{
	$query="select DEPT_ID,DEPT_NAME from DEPARTMENT";
  $cursor= exequery($connection,$query);
  while($ROW=mysql_fetch_array($cursor))
  {
    $DEPT_ID=$ROW["DEPT_ID"];
    $DEPT_NAME=$ROW["DEPT_NAME"];
    if(find_id($OPEN,$DEPT_ID))
       $TO_NAME.=$DEPT_NAME.",";
  }
  if($OPEN=="ALL_DEPT")
     $TO_NAME="全体部门";

  echo $TO_NAME;
}
?>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">借阅状态:</td>
    <td nowrap class="TableData" colspan="2">
<?
if($LEND=="1")
{
?>
已借出
<?
}
else
{
?>
未借出
<?
}
?>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">新建人:</td>
    <td nowrap class="TableData" colspan="2">
    <?=$BORR_PERSON?>&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">备注:</td>
    <td nowrap class="TableData" colspan="2">
    <?=$MEMO?>&nbsp;
    </td>
   </tr>
   <tr align="center" class="TableControl">
     <td colspan="3">
       <input type="button" value="关闭" class="BigButton" onClick="javascript:window.close();">
     </td>
   </tr>
  </form>
</table>

</body>
</html>

⌨️ 快捷键说明

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