git-svn-id: http://xe-core.googlecode.com/svn/trunk@388 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-13 04:25:48 +00:00
parent 9697d8a0e2
commit 4a0d78077e
12 changed files with 175 additions and 49 deletions

View file

@ -69,6 +69,31 @@
// DB 객체 생성
$oDB = &DB::getInstance();
// 검색 옵션 정리
$search_target = trim(Context::get('search_target'));
$search_keyword = trim(Context::get('search_keyword'));
if($search_target && $search_keyword) {
switch($search_target) {
case 'filename' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_filename = $search_keyword;
break;
case 'filesize' :
$args->s_filesize = (int)$search_keyword;
break;
case 'download_count' :
$args->s_download_count = (int)$search_keyword;
break;
case 'regdate' :
$args->s_regdate = $search_keyword;
break;
case 'ipaddress' :
$args->s_ipaddress= $search_keyword;
break;
}
}
// 변수 설정
$args->sort_index = $obj->sort_index;
$args->page = $obj->page?$obj->page:1;

View file

@ -16,4 +16,13 @@
$lang->msg_cart_is_null = '삭제할 글을 선택해주세요';
$lang->msg_checked_file_is_deleted = '%d개의 첨부파일이 삭제되었습니다';
$lang->search_target_list = array(
'filename' => '파일이름',
'filesize' => '파일크기 (byte, 이상)',
'download_count' => '다운로드 회수 (이상)',
'regdate' => '등록일',
'ipaddress' => 'IP 주소',
);
?>

View file

@ -1,14 +1,21 @@
<query id="getFileList" action="select">
<tables>
<table name="files" />
</tables>
<columns>
<column name="*" />
</columns>
<navigation>
<index var="sort_index" order="desc" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
<tables>
<table name="files" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="like" column="uploaded_filename" var="s_filename" />
<condition operation="more" column="file_size" var="s_filesize" pipe="or" />
<condition operation="more" column="downloaded_count" var="s_download_count" pipe="or" />
<condition operation="like_prefix" column="regdate" var="s_regdate" pipe="or" />
<condition operation="like_prefix" column="ipaddress" var="s_ipaddress" pipe="or" />
</conditions>
<navigation>
<index var="sort_index" order="desc" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>

View file

@ -19,6 +19,7 @@
<th>{$lang->file_size}</th>
<th>{$lang->download_count}</th>
<th>{$lang->date}</th>
<th>{$lang->ipaddress}</th>
<th>{$lang->cmd_move_to_document}</th>
<th>{$lang->cmd_download}</th>
</tr>
@ -31,6 +32,7 @@
<td>{$val->file_size}</td>
<td>{$val->downloaded_count}</td>
<td>{zdate($val->regdate,"Y-m-d")}</td>
<td>{$val->ipaddress}</td>
<td><a href="#" onclick="window.open('./?document_srl={$val->document_srl}');return false">{$lang->cmd_move}</a></td>
<td><a href="./?mid={$val->mid}&amp;act=procDownloadFile&amp;file_srl={$val->file_srl}&amp;sid={$val->sid}&amp;document_srl={$val->document_srl}">{$lang->cmd_download}</a></td>
</tr>
@ -45,6 +47,27 @@
</form>
<!-- 검색 -->
<div>
<form action="./" method="get">
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="mo" value="{$mo}" />
<input type="hidden" name="act" value="{$act}" />
<div>
<select name="search_target">
<option value="">{$lang->search_target}</option>
<!--@foreach($lang->search_target_list as $key => $val)-->
<option value="{$key}" <!--@if($search_target==$key)-->selected="true"<!--@end-->>{$val}</option>
<!--@end-->
</select>
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
<input type="submit" value="{$lang->cmd_search}" />
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('','module',$module,'mo',$mo,'act',$act)}'"/>
</div>
</form>
</div>
<!-- 페이지 네비게이션 -->
<div>
<a href="{getUrl('page','','file_srl','')}">[{$lang->first_page}]</a>