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

📄 job_download.php

📁 开源的OA系统
💻 PHP
字号:
<?php
session_start();

if (!empty($downfile)) {
	if (!@file_exists($downfile)) {
		echo "<script>alert('你要下的文件不存在!')</script>";
		//echo "下载出错";
	} else {
		$filename = basename($downfile);
		$filename_info = explode('.', $filename);
		$fileext = $filename_info[count($filename_info)-1];
		header('Content-type: application/x-'.$fileext);
		header('Content-Disposition: attachment; filename='.$filename);
		header('Content-Description: PHP Generated Data');
		header('Content-Length: '.filesize($downfile));
		@readfile($downfile);
		exit;
	}
}
include "middle.php";
require_once  "../MessageBox.php";
$Message = new MessageBox;
if ( !empty($_SESSION["userid"]) ) { 
include "../datasource.inc.php";
$page             = $_REQUEST['page'];
$id               = $_REQUEST['id'];

?>
<link href="../css/a1.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0">
<table width="789" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2"><img src="../images/home_12.jpg" width="789" height="12"></td>
  </tr>
  <tr>
    <td width="776" valign="top">

<table width="700" border="0" cellspacing="0" cellpadding="0">
        <tr>
         <TD vAlign=top><FONT color=#565656>&nbsp;&nbsp;<IMG height=14 
      src="../images/closedfold.gif" width=14>&nbsp;&nbsp;您当前的位置<BR>&nbsp;&nbsp;<IMG 
      height=15 src="../images/bar.gif" width=15>&nbsp;&nbsp;<IMG height=14 
      src="../images/openfold.gif" width=14>&nbsp;&nbsp;文件学习</FONT></TD>
        </tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=766 align="right" height=1>
 <tr><td width=766 height=1 bgcolor=#3494d4></td>
 </tr></table>
<?php
switch ($page){
	default:
   // echo "<center>";
	//echo "<form action=job_download.php method=post>";
   // echo "<table border=0 width=680>";
  //  echo "<tr>";
   // echo "<td width=40% bgColor=#ffffff>";
	//echo "按文档名查询:<input type=text size=20 name=search maxlength=20>";
    //echo "&nbsp;<input type=submit value=搜索>";
	//echo "</td>";
    //echo "</tr>";
   // echo "</table>";
   // echo "</form>";
	//if ($_REQUEST['search']){
	//    $sql    = "select * from job_download where job_name like '%$_REQUEST[search]%' order by id desc;";
	//} else {
    //   $sql    = "select * from job_download order by id desc;";	
	//}	
      $sql    = "select * from job_fl order by id asc;";
      $result = mysql_query($sql);
	  while ($row = mysql_fetch_array($result) ) {
	        //echo "<table border=1 cellpadding=0 cellspacing=0 bgcolor=#ffffff>";
			//echo "<tr><td width=10 bgcolor=#ffffff>&nbsp;</td>";
	        echo "<table border=0 cellpadding=0 cellspacing=1 bgcolor=#3494d4 width=776>";
            echo "<tr height=24>";
            echo "<td colspan=3 bgColor=#3494d4><font color=#ffffff><b>$row[fl]</b></font></td>";    	
			echo "</tr><br>";
	        $sql1    = "select * from job_download where job_fl='$row[fl]' order by id asc;";
            $result1 = mysql_query($sql1);
			$num1    = mysql_num_rows($result1);
			if ($num1>0) {
 			    while ($row1 = mysql_fetch_array($result1) ) {
				     echo "<tr bgcolor=ffffff height=22>";
			         echo "<td width=450>$row1[job_name]</td>";
			         echo "<td width=168 align=center><a href=# onClick=\"window.open('job_download_show.php?id=$row1[id]',1,'top=50,left=50,height=450,width=450,scrollbars=yes')\">查看</td>";
	                 $path0     = "../upload-files";
	                 $path1     = $row1['job_path'];
	                 $filepath = "$path0/$path1";
	                 echo "<td width=158 align=center><a href=\"?downfile=".urlencode($filepath)."\">下载</a></td>"; 
					 echo "</tr>";			
     		    }
			}
      }
      echo "</table>";
	break;
	
}

} else {
    $Message->setMessage("对不起,您没有权限进入后台管理!","index.php");
    $Message->showMessage();
}
?>

	</td>
    <td width="13" align="right" height="457" background="../images/home_16.jpg" width="13" ></td>
  </tr>
  <tr>
    <td height="8" colspan="2" valign="top"><img src="../images/home_24.jpg" width="789" height="8"></td>
  </tr>
</table>

⌨️ 快捷键说明

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