묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
키워드로 검색된 게시물이 열리지 않습니다. ㅠㅠ
2007.02.28 20:16
http://www.curriculum.or.kr/menu3-3.php게시물을 키워드로 검색을 하면 게시물이 찾아집니다. 페이지수가 정상적으로 보여지는데
두 번째 페이지 이후로는 클릭을 하면 보여지질 않습니다. ㅠㅠ;
검색방법이 "저자로 검색" 과 "키워드로 검색" 두 가지가 있는데요 키워드로 검색을 하면
예를 들어 "교사"라는 검색어를 이용하여 검색하면 검색된 게시물이 73개가 나오고
아래 페이지수가 15페이지가 나옵니다. 그런데 첫 번째 페이지 게시물만 정상적으로
보여지고 두 번째 페이지부터는 클릭을 하면 연결이 되지 않습니다. ㅠㅠ;
소스를 아무리 봐도 뭐가 잘못인지 잘 모르겠습니다. 고수님들의 도움 꼭...부탁드립니다.
아래 사이트입니다.
http://www.curriculum.or.kr/menu3-3.php
죄송합니다. ^^; 소스를 무식하게 올려봅니다.
<?php
if($menu33mode==get_file) {
include("_head.php");
if(!$member[no]) {
echo "<script>alert('회원만 다운로드 가능합니다.'); history.go(-1);</script>";
exit;
}
pr_get_file();
exit;
}else if($menu33mode==delete_file) {
include("_head.php");
if(($member[level]>3)||(!$member[level])) {
echo "<script>alert('권한이 없습니다.'); history.go(-1);</script>";
exit;
}else {
pr_delete_file();
exit;
}
}else if($menu33mode==up_file) {
include("./_head.php");
if(($member[level]>3)||(!$member[level])) {
echo "<script> alert('권한이 없습니다!'); history.go(-1); </script>";
exit;
}
?>
<style>
<!-- @import url("./style.css"); -->
</style>
<script language="javascript">
<!--
function check_submits() {
if(!write.input_title.value) {alert("제목을 입력하여 주십시요.");write.input_title.focus(); return false;}
if(!write.input_file.value) {alert("파일을 입력하여 주십시요.");write.input_file.focus(); return false;}
if(!write.input_yearmade.value) {alert("연도를 입력하여 주십시요.");write.input_yearmade.focus(); return false;}
if(!write.input_monthmade.value) {alert("연도를 입력하여 주십시요.");write.input_monthmade.focus(); return false;}
}
-->
</script>
<center><br>
새 글 등록<p>
<table cellspacing=1 cellpadding=5 width=90% style="border-style:solid;border-width:1px;border-color:#C3822C;">
<form name=write action=menu3-3publicationlist.php method=post enctype=multipart/form-data onsubmit="return check_submits();">
<input type=hidden name=menu33mode value=up_file_ok>
<tr>
<td width=80 align=center bgcolor=#FFCB65>제목</td>
<td bgcolor=#F9F6EF> <input type=text name=input_title size=50 class=zv3_input></td>
</tr>
<tr>
<td width=80 align=center bgcolor=#FFCB65>키워드</td>
<td bgcolor=#F9F6EF> <input type=text name=input_keywords size=50 class=zv3_input></td>
</tr>
<tr>
<td align=center bgcolor=#FFCB65>저자</td>
<td bgcolor=#F9F6EF> <input type=text name=input_writer size=30 maxlength=100 class=zv3_input>
</tr>
<tr>
<td align=center bgcolor=#FFCB65>간행물</td>
<td bgcolor=#F9F6EF> <select name=kan_publication class=zv3_input onChange="javascript:searchpublication(1);">
<option value=1 <? if($kan==1) echo "selected"; ?>>교육과정연구</option>
<option value=2 <? if($kan==2) echo "selected"; ?>>교육과정연구의 과제</option>
<option value=3 <? if($kan==3) echo "selected"; ?>>연차학술대회 발표논문 토론집</option>
</select>
</tr>
<tr>
<td align=center bgcolor=#FFCB65>페이지 수</td>
<td bgcolor=#F9F6EF> <input type=text name=input_numofpages size=4 maxlength=4 class=zv3_input> 페이지
</tr>
<tr>
<td align=center bgcolor=#FFCB65>권</td>
<td bgcolor=#F9F6EF> <input type=text name=input_kwon size=4 maxlength=4 class=zv3_input> 권
</tr>
<tr>
<td align=center bgcolor=#FFCB65>호</td>
<td bgcolor=#F9F6EF> <input type=text name=input_ho size=4 maxlength=4 class=zv3_input> 호
</tr>
<tr>
<td align=center bgcolor=#FFCB65>파일</td>
<td bgcolor=#F9F6EF> <input type=file name=input_file size=50 class=zv3_input></td>
</tr>
<tr>
<td align=center bgcolor=#FFCB65>만들어진 연도</td>
<td bgcolor=#F9F6EF> <input type=text name=input_yearmade size=4 maxlength=4 class=zv3_input> 년
</tr>
<tr>
<td colspan=2 align=center><input type=image src=./images/btn_writeok.gif> <a href="javascript:history.back();"> <img src=./images/btn_writecancel.gif border=0></a></td>
</tr>
</form>
</table>
<?php
exit;
}else if($menu33mode==up_file_ok) {
include("./_head.php");
if(($member[level]>3)||(!$member[level])) {
echo "<script> alert('권한이 없습니다!'); history.go(-1); </script>";
exit;
}
$input_kwon=trim($input_kwon);
$input_kan=trim($input_kan);
$input_ho=trim($input_ho);
if($input_file_size>10000000)
{
echo "<SCRIPT language="JavaScript">
<!--
alert('+ '+ '10메가 파일까지만 올릴 수 있습니다.');
history.go(-1);
//--> </script> ";
exit;
}
$query="select no from curriculum_publication order by no DESC";
$result=mysql_query($query);
if(mysql_num_rows($result)>0) {
$row=mysql_fetch_row($result);
$no=$row[0]+1;
} else $no=1;
$originalfilename=$input_file_name; $save_file=$no; // 데이터 자료실 경로 지정
$datapath = "./publication/"; /* 업로드 파일 처리 */
if ($input_file)
{ // 파일 복사하기
if (!copy ($input_file,$datapath.$save_file)) {
echo "<SCRIPT language="JavaScript">
<!--
alert("파일 복사중 에러가 났습니다.");
history.go(-1);
//-->
</script>";
exit ;
}
}
$time=time();
$query="insert into curriculum_publication values($no,'$input_title','$input_writer','$time',0,$input_kwon,$input_ho,'$input_yearmade',$input_numofpages,$kan_publication,'$input_keywords','$input_file_name',$input_file_size)";
if(mysql_query($query)) {
echo "<SCRIPT language="JavaScript"> <!--
alert('성공적으로 업로드하였습니다!!');
//-->
</script> ";
movepage("./menu3-3publicationlist.php");
}else {
echo "<SCRIPT language="JavaScript"> <!--
alert('파일 등록중 에러가 났습니다!!');
history.go(-1); //-->
</script> ";
}
exit;
}
include("_head.php");
$limit=5; // 한화면에 표시
if(!$searchword) {
if(!$kan) $kan=1;
if(!$kwon) {
$result=mysql_query("select * from curriculum_publication where kan=$kan order by kwon DESC");
$line=@mysql_fetch_array($result);
$kwon=$line["kwon"];
}
if(!$ho) {
$result=mysql_query("select * from curriculum_publication where kan=$kan and kwon=$kwon order by ho DESC");
$line=@mysql_fetch_array($result);
$ho=$line["ho"];
}
$result=mysql_query("select * from curriculum_publication where kan=$kan and kwon=$kwon and ho=$ho order by no DESC");
}else {
if($searchmode=="keywordmode")
$result=mysql_query("select * from curriculum_publication where (title like '%".$searchword."%') or (keywords like '%".$searchword."%') order by no DESC");
else
$result=mysql_query("select * from curriculum_publication where (writer like '%".$searchword."%') order by no DESC");
}
if(!$pageno) $pageno=1;
?>
<style>
<!-- @import url("./style.css"); -->
</style>
<body>
<center><br>
<script language="javascript">
<!--
function check_submits() {
if(!search.searchword.value) {alert("검색어를 입력하여 주십시요.");search.searchword.focus(); return false;}
}
-->
</script>
<table border=0 cellpadding=0 cellspacing=0 width=90%>
<tr><form method=post name=search action=./menu3-3publicationlist.php onsubmit="javascript:check_submits();">
<td valign=middle align=right height=40 colspan=2><font color=#666666>검색 : <input type=text name=searchword size=30 maxlength=100 class=zv3_input align=absmiddle> <input type=image src=./images/btn_search.gif align=absmiddle><br><input type=radio name=searchmode value="namemode">저자 이름으로 검색 <input type=radio name=searchmode value="keywordmode" checked>키워드로 검색
</td>
</form>
</tr>
<tr><td align=left valign=top>
<font color=#666666>검색된 글 수 : <font color=#990000><b><?
$numofarticles=@mysql_num_rows($result);
echo $numofarticles;
?></td><td align=right valign=top>
<?
if($searchword) {
echo "<font color=#666666>검색어 : <font color=red><b>".$searchword."</b></font><font color=#666666> (<font color=#990000>";
if($searchmode=="namemode") echo "저자 이름으로 검색";
else echo "키워드로 검색";
echo "<font color=#666666>)";
}
@mysql_data_seek($result,($pageno-1)*5);
for($i=0;$i<$limit;$i++) {
$line=@mysql_fetch_array($result);
if(!$line["no"]) break;
else {
?></td>
</tr>
<tr>
<td align=center colspan=2>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="BORDER-BOTTOM: #CCCCCC 1px solid; border-top:#CCCCCC 1px solid; ">
<table cellpadding="0" cellspacing="1" width="100%" bgcolor="#f7f7f7">
<tr>
<td nowrap valign="top" width="30">
<b><?=$line["no"] ?> </b>: </td>
<td><b><a href="./menu3-3publicationlist.php?menu33mode=get_file&article_no=<?=$line["no"] ?>" style='cursor:hand;color:0033CC' onmouseover="this.style.color='ff3300'" onmouseout="this.style.color='0033CC'" target=_self><?=$line["title"] ?> </a></b>
<?php
if(($member[level]<4)&&($member[level]!=0)) echo "[<a href=menu3-3publicationlist.php?menu33mode=delete_file&article_no=".$line["no"]." onclick="javascript:return confirm('정말 삭제하시겠습니까?'); " target=_self>삭제</a>]";
?>
</td>
</tr>
<tr>
<td nowrap valign="top" width="30"> </td>
<td><?=$line["writer"] ?></td>
</tr>
<tr>
<td nowrap valign="top" width="30" height="14"> </td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="62%"><? switch($line["kan"]) {
case 1: echo "교육과정연구";break;
case 2: echo "교육과정연구의 과제";break;
case 3: echo "기타 간행물";break;
}
?> | <?=$line["yearmade"] ?>
</td>
<td width="38%">
<div align="right">
<span style="font-size:8pt;">
<a href="./menu3-3publicationlist.php?menu33mode=get_file&article_no=<?=$line["no"] ?>" target=_self>
(<?=substr($line["originalfilename"],-3) ?> file / <?=$line["numofpages"] ?> pages / <?=$line["hits"] ?> hits) <?php
if(ereg("pdf$",strtolower($line["originalfilename"]))) {
echo "<img src=images/bulletpdf.gif border=0 align=absmiddle>";
}else if(ereg("hwp$",strtolower($line["originalfilename"]))) {
echo "<img src=images/bullethangul.gif border=0 align=absmiddle>";
}else if(ereg("doc$",strtolower($line["originalfilename"]))) {
echo "<img src=images/bulletword.gif border=0 align=absmiddle>";
}
?>
</a>
</span>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table><br>
<?php
}
}
?>
</td>
</tr>
<tr>
<td align=center colspan=2>
<?php
/////////////////////// 페이지 수 시작
if(@mysql_num_rows($result)>0) {
if((@mysql_num_rows($result)%$limit)==0) {
$totalpagenum=@mysql_num_rows($result)/$limit;
}else {
$totalpagenum=ceil(@mysql_num_rows($result)/$limit);
}
}else $totalpagenum=0;
for($i=1;$i<=$totalpagenum;$i++) {
if($pageno!=$i) {
if($searchword) {
echo "<a href=./menu3-3publicationlist.php?pageno=".$i."&searchword=".$searchword." target=_self>$i</a> ";
}else {
echo "<a href=./menu3-3publicationlist.php?pageno=".$i."&kan=".$kan."&kwon=".$kwon."&ho=".$ho." target=_self>$i</a> ";
}
}else {
echo "<font color=#9CA2CF><b>$i</b></font> ";
}
}
/////////////////////// 페이지 수 끝
?>
</td>
</tr>
<tr>
<td align=right colspan=2>
<?php
if(($member[level]<4)&&($member[level]!=0)) echo "<a href=menu3-3publicationlist.php?menu33mode=up_file&pageno=".$i."&kan=".$kan."&kwon=".$kwon."&ho=".$ho." target=_self>새 글 등록</a>";
?>
</td>
</tr>
</table><?php
function pr_delete_file() {
global $article_no;
if(!unlink("./publication/".$article_no)) echo "<script>alert('삭제중 잘못되었습니다.'); history.go(-1);</script>";
if(!mysql_query("delete from curriculum_publication where no=".$article_no)) echo "<script>alert('삭제중 잘못되었습니다.'); history.go(-1);</script>";
else echo "<script>alert('삭제되었습니다.'); </script>";
movepage("./menu3-3publicationlist.php");
}
function pr_get_file(){
global $article_no;
$fp=fopen("./config.php","r");
fgets($fp);
$DBhost=trim(fgets($fp));
$DBid=trim(fgets($fp));
$DBpasswd=trim(fgets($fp));
$DBname=trim(fgets($fp));
fclose($fp);
$link=mysql_connect($DBhost,$DBid,$DBpasswd);
if(mysql_select_db($DBname,$link)!=TRUE) die("데이터베이스 설정이 잘못되었습니다.");
$query="select originalfilename,ufs from curriculum_publication where no=".$article_no; // 쿼리스트링에서의 번호와 일치하는 레코드 선택..
$result=mysql_query($query);
list($originalfilename,$ufs)=mysql_fetch_array($result);
$path="./publication/".$article_no;
$bfp = fopen($path, "rb");
Header("Content-type: application1/newslettern");
Header("Content-disposition: attachment; filename=$originalfilenamenn");
$buf = fread($bfp, $ufs);
printf("%s", $buf);
flush();
fclose($bfp);
mysql_query("update curriculum_publication set hits=hits+1 where no=$article_no");
exit(0);
} // 파일 다운로드할 때 프로시져
?>
두 번째 페이지 이후로는 클릭을 하면 보여지질 않습니다. ㅠㅠ;
검색방법이 "저자로 검색" 과 "키워드로 검색" 두 가지가 있는데요 키워드로 검색을 하면
예를 들어 "교사"라는 검색어를 이용하여 검색하면 검색된 게시물이 73개가 나오고
아래 페이지수가 15페이지가 나옵니다. 그런데 첫 번째 페이지 게시물만 정상적으로
보여지고 두 번째 페이지부터는 클릭을 하면 연결이 되지 않습니다. ㅠㅠ;
소스를 아무리 봐도 뭐가 잘못인지 잘 모르겠습니다. 고수님들의 도움 꼭...부탁드립니다.
아래 사이트입니다.
http://www.curriculum.or.kr/menu3-3.php
죄송합니다. ^^; 소스를 무식하게 올려봅니다.
<?php
if($menu33mode==get_file) {
include("_head.php");
if(!$member[no]) {
echo "<script>alert('회원만 다운로드 가능합니다.'); history.go(-1);</script>";
exit;
}
pr_get_file();
exit;
}else if($menu33mode==delete_file) {
include("_head.php");
if(($member[level]>3)||(!$member[level])) {
echo "<script>alert('권한이 없습니다.'); history.go(-1);</script>";
exit;
}else {
pr_delete_file();
exit;
}
}else if($menu33mode==up_file) {
include("./_head.php");
if(($member[level]>3)||(!$member[level])) {
echo "<script> alert('권한이 없습니다!'); history.go(-1); </script>";
exit;
}
?>
<style>
<!-- @import url("./style.css"); -->
</style>
<script language="javascript">
<!--
function check_submits() {
if(!write.input_title.value) {alert("제목을 입력하여 주십시요.");write.input_title.focus(); return false;}
if(!write.input_file.value) {alert("파일을 입력하여 주십시요.");write.input_file.focus(); return false;}
if(!write.input_yearmade.value) {alert("연도를 입력하여 주십시요.");write.input_yearmade.focus(); return false;}
if(!write.input_monthmade.value) {alert("연도를 입력하여 주십시요.");write.input_monthmade.focus(); return false;}
}
-->
</script>
<center><br>
새 글 등록<p>
<table cellspacing=1 cellpadding=5 width=90% style="border-style:solid;border-width:1px;border-color:#C3822C;">
<form name=write action=menu3-3publicationlist.php method=post enctype=multipart/form-data onsubmit="return check_submits();">
<input type=hidden name=menu33mode value=up_file_ok>
<tr>
<td width=80 align=center bgcolor=#FFCB65>제목</td>
<td bgcolor=#F9F6EF> <input type=text name=input_title size=50 class=zv3_input></td>
</tr>
<tr>
<td width=80 align=center bgcolor=#FFCB65>키워드</td>
<td bgcolor=#F9F6EF> <input type=text name=input_keywords size=50 class=zv3_input></td>
</tr>
<tr>
<td align=center bgcolor=#FFCB65>저자</td>
<td bgcolor=#F9F6EF> <input type=text name=input_writer size=30 maxlength=100 class=zv3_input>
</tr>
<tr>
<td align=center bgcolor=#FFCB65>간행물</td>
<td bgcolor=#F9F6EF> <select name=kan_publication class=zv3_input onChange="javascript:searchpublication(1);">
<option value=1 <? if($kan==1) echo "selected"; ?>>교육과정연구</option>
<option value=2 <? if($kan==2) echo "selected"; ?>>교육과정연구의 과제</option>
<option value=3 <? if($kan==3) echo "selected"; ?>>연차학술대회 발표논문 토론집</option>
</select>
</tr>
<tr>
<td align=center bgcolor=#FFCB65>페이지 수</td>
<td bgcolor=#F9F6EF> <input type=text name=input_numofpages size=4 maxlength=4 class=zv3_input> 페이지
</tr>
<tr>
<td align=center bgcolor=#FFCB65>권</td>
<td bgcolor=#F9F6EF> <input type=text name=input_kwon size=4 maxlength=4 class=zv3_input> 권
</tr>
<tr>
<td align=center bgcolor=#FFCB65>호</td>
<td bgcolor=#F9F6EF> <input type=text name=input_ho size=4 maxlength=4 class=zv3_input> 호
</tr>
<tr>
<td align=center bgcolor=#FFCB65>파일</td>
<td bgcolor=#F9F6EF> <input type=file name=input_file size=50 class=zv3_input></td>
</tr>
<tr>
<td align=center bgcolor=#FFCB65>만들어진 연도</td>
<td bgcolor=#F9F6EF> <input type=text name=input_yearmade size=4 maxlength=4 class=zv3_input> 년
</tr>
<tr>
<td colspan=2 align=center><input type=image src=./images/btn_writeok.gif> <a href="javascript:history.back();"> <img src=./images/btn_writecancel.gif border=0></a></td>
</tr>
</form>
</table>
<?php
exit;
}else if($menu33mode==up_file_ok) {
include("./_head.php");
if(($member[level]>3)||(!$member[level])) {
echo "<script> alert('권한이 없습니다!'); history.go(-1); </script>";
exit;
}
$input_kwon=trim($input_kwon);
$input_kan=trim($input_kan);
$input_ho=trim($input_ho);
if($input_file_size>10000000)
{
echo "<SCRIPT language="JavaScript">
<!--
alert('+ '+ '10메가 파일까지만 올릴 수 있습니다.');
history.go(-1);
//--> </script> ";
exit;
}
$query="select no from curriculum_publication order by no DESC";
$result=mysql_query($query);
if(mysql_num_rows($result)>0) {
$row=mysql_fetch_row($result);
$no=$row[0]+1;
} else $no=1;
$originalfilename=$input_file_name; $save_file=$no; // 데이터 자료실 경로 지정
$datapath = "./publication/"; /* 업로드 파일 처리 */
if ($input_file)
{ // 파일 복사하기
if (!copy ($input_file,$datapath.$save_file)) {
echo "<SCRIPT language="JavaScript">
<!--
alert("파일 복사중 에러가 났습니다.");
history.go(-1);
//-->
</script>";
exit ;
}
}
$time=time();
$query="insert into curriculum_publication values($no,'$input_title','$input_writer','$time',0,$input_kwon,$input_ho,'$input_yearmade',$input_numofpages,$kan_publication,'$input_keywords','$input_file_name',$input_file_size)";
if(mysql_query($query)) {
echo "<SCRIPT language="JavaScript"> <!--
alert('성공적으로 업로드하였습니다!!');
//-->
</script> ";
movepage("./menu3-3publicationlist.php");
}else {
echo "<SCRIPT language="JavaScript"> <!--
alert('파일 등록중 에러가 났습니다!!');
history.go(-1); //-->
</script> ";
}
exit;
}
include("_head.php");
$limit=5; // 한화면에 표시
if(!$searchword) {
if(!$kan) $kan=1;
if(!$kwon) {
$result=mysql_query("select * from curriculum_publication where kan=$kan order by kwon DESC");
$line=@mysql_fetch_array($result);
$kwon=$line["kwon"];
}
if(!$ho) {
$result=mysql_query("select * from curriculum_publication where kan=$kan and kwon=$kwon order by ho DESC");
$line=@mysql_fetch_array($result);
$ho=$line["ho"];
}
$result=mysql_query("select * from curriculum_publication where kan=$kan and kwon=$kwon and ho=$ho order by no DESC");
}else {
if($searchmode=="keywordmode")
$result=mysql_query("select * from curriculum_publication where (title like '%".$searchword."%') or (keywords like '%".$searchword."%') order by no DESC");
else
$result=mysql_query("select * from curriculum_publication where (writer like '%".$searchword."%') order by no DESC");
}
if(!$pageno) $pageno=1;
?>
<style>
<!-- @import url("./style.css"); -->
</style>
<body>
<center><br>
<script language="javascript">
<!--
function check_submits() {
if(!search.searchword.value) {alert("검색어를 입력하여 주십시요.");search.searchword.focus(); return false;}
}
-->
</script>
<table border=0 cellpadding=0 cellspacing=0 width=90%>
<tr><form method=post name=search action=./menu3-3publicationlist.php onsubmit="javascript:check_submits();">
<td valign=middle align=right height=40 colspan=2><font color=#666666>검색 : <input type=text name=searchword size=30 maxlength=100 class=zv3_input align=absmiddle> <input type=image src=./images/btn_search.gif align=absmiddle><br><input type=radio name=searchmode value="namemode">저자 이름으로 검색 <input type=radio name=searchmode value="keywordmode" checked>키워드로 검색
</td>
</form>
</tr>
<tr><td align=left valign=top>
<font color=#666666>검색된 글 수 : <font color=#990000><b><?
$numofarticles=@mysql_num_rows($result);
echo $numofarticles;
?></td><td align=right valign=top>
<?
if($searchword) {
echo "<font color=#666666>검색어 : <font color=red><b>".$searchword."</b></font><font color=#666666> (<font color=#990000>";
if($searchmode=="namemode") echo "저자 이름으로 검색";
else echo "키워드로 검색";
echo "<font color=#666666>)";
}
@mysql_data_seek($result,($pageno-1)*5);
for($i=0;$i<$limit;$i++) {
$line=@mysql_fetch_array($result);
if(!$line["no"]) break;
else {
?></td>
</tr>
<tr>
<td align=center colspan=2>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="BORDER-BOTTOM: #CCCCCC 1px solid; border-top:#CCCCCC 1px solid; ">
<table cellpadding="0" cellspacing="1" width="100%" bgcolor="#f7f7f7">
<tr>
<td nowrap valign="top" width="30">
<b><?=$line["no"] ?> </b>: </td>
<td><b><a href="./menu3-3publicationlist.php?menu33mode=get_file&article_no=<?=$line["no"] ?>" style='cursor:hand;color:0033CC' onmouseover="this.style.color='ff3300'" onmouseout="this.style.color='0033CC'" target=_self><?=$line["title"] ?> </a></b>
<?php
if(($member[level]<4)&&($member[level]!=0)) echo "[<a href=menu3-3publicationlist.php?menu33mode=delete_file&article_no=".$line["no"]." onclick="javascript:return confirm('정말 삭제하시겠습니까?'); " target=_self>삭제</a>]";
?>
</td>
</tr>
<tr>
<td nowrap valign="top" width="30"> </td>
<td><?=$line["writer"] ?></td>
</tr>
<tr>
<td nowrap valign="top" width="30" height="14"> </td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="62%"><? switch($line["kan"]) {
case 1: echo "교육과정연구";break;
case 2: echo "교육과정연구의 과제";break;
case 3: echo "기타 간행물";break;
}
?> | <?=$line["yearmade"] ?>
</td>
<td width="38%">
<div align="right">
<span style="font-size:8pt;">
<a href="./menu3-3publicationlist.php?menu33mode=get_file&article_no=<?=$line["no"] ?>" target=_self>
(<?=substr($line["originalfilename"],-3) ?> file / <?=$line["numofpages"] ?> pages / <?=$line["hits"] ?> hits) <?php
if(ereg("pdf$",strtolower($line["originalfilename"]))) {
echo "<img src=images/bulletpdf.gif border=0 align=absmiddle>";
}else if(ereg("hwp$",strtolower($line["originalfilename"]))) {
echo "<img src=images/bullethangul.gif border=0 align=absmiddle>";
}else if(ereg("doc$",strtolower($line["originalfilename"]))) {
echo "<img src=images/bulletword.gif border=0 align=absmiddle>";
}
?>
</a>
</span>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table><br>
<?php
}
}
?>
</td>
</tr>
<tr>
<td align=center colspan=2>
<?php
/////////////////////// 페이지 수 시작
if(@mysql_num_rows($result)>0) {
if((@mysql_num_rows($result)%$limit)==0) {
$totalpagenum=@mysql_num_rows($result)/$limit;
}else {
$totalpagenum=ceil(@mysql_num_rows($result)/$limit);
}
}else $totalpagenum=0;
for($i=1;$i<=$totalpagenum;$i++) {
if($pageno!=$i) {
if($searchword) {
echo "<a href=./menu3-3publicationlist.php?pageno=".$i."&searchword=".$searchword." target=_self>$i</a> ";
}else {
echo "<a href=./menu3-3publicationlist.php?pageno=".$i."&kan=".$kan."&kwon=".$kwon."&ho=".$ho." target=_self>$i</a> ";
}
}else {
echo "<font color=#9CA2CF><b>$i</b></font> ";
}
}
/////////////////////// 페이지 수 끝
?>
</td>
</tr>
<tr>
<td align=right colspan=2>
<?php
if(($member[level]<4)&&($member[level]!=0)) echo "<a href=menu3-3publicationlist.php?menu33mode=up_file&pageno=".$i."&kan=".$kan."&kwon=".$kwon."&ho=".$ho." target=_self>새 글 등록</a>";
?>
</td>
</tr>
</table><?php
function pr_delete_file() {
global $article_no;
if(!unlink("./publication/".$article_no)) echo "<script>alert('삭제중 잘못되었습니다.'); history.go(-1);</script>";
if(!mysql_query("delete from curriculum_publication where no=".$article_no)) echo "<script>alert('삭제중 잘못되었습니다.'); history.go(-1);</script>";
else echo "<script>alert('삭제되었습니다.'); </script>";
movepage("./menu3-3publicationlist.php");
}
function pr_get_file(){
global $article_no;
$fp=fopen("./config.php","r");
fgets($fp);
$DBhost=trim(fgets($fp));
$DBid=trim(fgets($fp));
$DBpasswd=trim(fgets($fp));
$DBname=trim(fgets($fp));
fclose($fp);
$link=mysql_connect($DBhost,$DBid,$DBpasswd);
if(mysql_select_db($DBname,$link)!=TRUE) die("데이터베이스 설정이 잘못되었습니다.");
$query="select originalfilename,ufs from curriculum_publication where no=".$article_no; // 쿼리스트링에서의 번호와 일치하는 레코드 선택..
$result=mysql_query($query);
list($originalfilename,$ufs)=mysql_fetch_array($result);
$path="./publication/".$article_no;
$bfp = fopen($path, "rb");
Header("Content-type: application1/newslettern");
Header("Content-disposition: attachment; filename=$originalfilenamenn");
$buf = fread($bfp, $ufs);
printf("%s", $buf);
flush();
fclose($bfp);
mysql_query("update curriculum_publication set hits=hits+1 where no=$article_no");
exit(0);
} // 파일 다운로드할 때 프로시져
?>