forked from xiaoyao-work/TP-Admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lizhiliang
committed
Jan 8, 2016
1 parent
c46701a
commit 57abcd0
Showing
15 changed files
with
480 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
// +---------------------------------------------------------------------- | ||
// | TP-Admin [ 多功能后台管理系统 ] | ||
// +---------------------------------------------------------------------- | ||
// | Copyright (c) 2013-2015 http://www.hhailuo.com All rights reserved. | ||
// +---------------------------------------------------------------------- | ||
// | Author: XiaoYao <[email protected]> | ||
// +---------------------------------------------------------------------- | ||
|
||
namespace Admin\Controller; | ||
use Admin\Controller\CommonController; | ||
|
||
/** | ||
* 附件操作 | ||
*/ | ||
class AttachmentController extends CommonController { | ||
protected $db; | ||
function __construct() { | ||
parent::__construct(); | ||
$this->db = model("Attachment"); | ||
} | ||
public function index() { | ||
echo "等待开发中……"; | ||
} | ||
|
||
public function album_list() { | ||
$search = array(); | ||
if (isset($_GET['search'])) { | ||
if($_GET['start_time'] && !is_numeric($_GET['start_time'])) { | ||
$search['_string'] = "uploadtime >= " . strtotime($_GET['start_time']); | ||
} | ||
if($_GET['end_time'] && !is_numeric($_GET['end_time'])) { | ||
if ( isset($search['_string'])) { | ||
$search['_string'] .= " and uploadtime <= " . strtotime($_GET['end_time']); | ||
} else { | ||
$search['uploadtime'] = array( 'lt',strtotime($_GET['end_time']) ); | ||
} | ||
} | ||
if ($_GET['filename']) { | ||
$search['name'] = array('like', "%".safe_replace($_GET['filename'])."%"); | ||
} | ||
} | ||
|
||
if (isset($_GET['CKEditor'])) { | ||
$data = $this->db->attachment_list($search, "id desc", '32'); | ||
$this->assign('attachs', $data['data']); | ||
$this->assign('pages', $data['pages']); | ||
$this->display("album_for_ckeditor"); | ||
} else { | ||
$data = $this->db->attachment_list($search); | ||
$this->assign('attachs', $data['data']); | ||
$this->assign('pages', $data['pages']); | ||
$this->assign('params', explode(',', $_GET['args'])); | ||
$this->display(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.