diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 92e74e92..084f5711 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -2651,11 +2651,10 @@ class Admin_DataController extends Zend_Controller_Action { $uuid = $this->_getParam('uuid'); $submit = $this->_getParam('submit'); + $visual = new Visual\Visual; if(!empty($uuid)) - { - $visual = new Visual\Visual; - + { $this->_helper->viewRenderer('visual-add'); $this->view->data = ['uuid' => $uuid]; @@ -2689,6 +2688,9 @@ class Admin_DataController extends Zend_Controller_Action return true; } } + + view::addPaginator($visual->getVisualMetadata(),$this,10); + return; } diff --git a/application/admin/controllers/UserController.php b/application/admin/controllers/UserController.php index 79a21117..88cc57de 100755 --- a/application/admin/controllers/UserController.php +++ b/application/admin/controllers/UserController.php @@ -1,1244 +1,1244 @@ -db=Zend_Registry::get('db'); - $this->view->config = Zend_Registry::get('config'); - $this->messenger=$this->_helper->getHelper('FlashMessenger'); - $this->view->messages = $this->messenger->getMessages(); - $this->view->theme = new Theme(); - $this->_helper->layout->setLayout('administry'); - } - function postDispatch() - { - $this->view->messages = $this->messenger->getMessages(); - } - function indexAction() - { - $sql="select count(id) as total from users"; - $uq=$this->db->query($sql); - $row=$uq->fetch(); - - $sqlt="select count(id) as total from users where usertype='administrator'"; - $uqt=$this->db->query($sqlt); - $adminrow=$uqt->fetch(); - - $this->view->su=$row; - $this->view->suadmin=$adminrow; - - }//indexAction - - function listAction() - { - - $select=$this->db->select(); - - - $select->from('users') - ->where('usertype = ?', 'member') - ->order('users.id desc'); - - - $paginator = Zend_Paginator::factory($select); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage(30); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); - $this->view->paginator=$paginator; - }//listAction - - function searchAction() - { - $search = $this->_getParam('search'); - $realname = $this->view->realname = $this->_getParam('realname'); - $unit = $this->view->unit = $this->_getParam('unit'); - $project = $this->view->project = $this->_getParam('project'); - - $select=$this->db->select(); - - if(!empty($search) && ( !empty($realname) || !empty($unit) || !empty($project) )) - { - $this->messenger->addMessage('搜索结果'); - $select->from('users'); - if(!empty($realname)) - { - $select->where('realname like ? ', '%'.$realname.'%'); - $select->orWhere('username like ? ', '%'.$realname.'%'); - } - if(!empty($unit)) - $select->where('unit like ? ', '%'.$unit.'%'); - if(!empty($project)) - $select->where('project like ? ', '%'.$project.'%'); - - $select->order('users.id desc'); - - - - $paginator = Zend_Paginator::factory($select); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage(30); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - $this->_helper->viewRenderer('list'); - - } - else { - $this->_redirect("/admin/user/list"); - } - - - - - }//searchAction - - function deleteAction() - { - $delete=(int)$this->_getParam('id'); - $deletename = $this->_getParam('uname'); - - if (isset($delete)) - { - $sql="delete from users where id=?"; - try { - $this->db->query($sql,array($delete)); - $this->messenger->addMessage('您已经成功的删除了用户:'.$deletename); - } catch (Exception $e) { - $this->messenger->addMessage($e->getMessage()); - } - $this->_redirect("/admin/user/list"); - } - } - - function adminlistAction() - { - $select=$this->db->select(); - $select->from('users') - ->where('usertype = ?', $this->view->config->auth->identifier) - ->order('users.id desc'); - - - $paginator = Zend_Paginator::factory($select); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage(30); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); - $this->view->paginator=$paginator; - - $ac = $this->_getParam('ac'); - - if($ac == 'sync') - { - $sql = "SELECT id FROM users WHERE usertype='administrator'"; - $rs = $this->db->query($sql); - $ids = $rs->fetchAll(); - - $data = array(); - foreach($ids as $v) - { - $data[] = $v['id']; - } - unset($ids); - - $ids = join(",",$data); - - $gn_sql = "update users set profile='Administrator' where id in ($ids)"; - $gn_db = new PDO(array( - 'host'=> $this->view->config->geonetwork->params->host, - 'port' => 5432, - 'user' => $this->view->config->geonetwork->params->username, - 'pwd' => $this->view->config->geonetwork->params->password , - 'db' => $this->view->config->geonetwork->params->dbname - )); - - $gn_db->exec("update users set profile='Editor' where id>1 and profile='Administrator'"); - $gn_db->exec($gn_sql); - - view::Post($this,"同步成功!",-1); - } - } - - function showAction() - { - $id=(int)$this->_getParam('id'); - if (isset($id)) - { - try { - $user = new \Users\Users; - $this->view->infos=$user->getUser($id); - $this->view->usertypes = $user->getUserType(); - - } catch (Exception $e) { - $this->messenger->addMessage($e->getMessage()); - } - } - else - { - $this->_redirect("/admin/user/list"); - } - }//showAction() - - function upAction() - { - $id=(int)$this->_getParam('id'); - - if (isset($id)) - { - try { - - $sql="select u.*,m.id as mid from users u left join mdexperts m on m.id=u.id where u.id='$id'"; - $result = $this->db->query($sql); - $ex = $result->fetch(); - if(empty($ex['mid'])){ - - $submit=$this->_getParam('submit'); - $speciality = $this->_getParam('speciality'); - - if($submit) - { - $sql="insert into mdexperts (id,speciality) values ('$id','$speciality')"; - if($this->db->exec($sql)>0) - { - $this->messenger->addMessage('已经成功将用户提升为评审专家'); - $this->_redirect("/admin/user/list"); - } - } - else - { - $this->view->infos = $ex; - } - - }else - { - $this->messenger->addMessage("该用户已经是评审专家"); - $this->_redirect("/admin/user/list"); - } - - } catch (Exception $e) { - $this->messenger->addMessage($e->getMessage()); - $this->_redirect("/admin/user/list"); - } - } - else - { - $this->_redirect("/admin/user/list"); - } - - }//upAction() 把用户提升为评审专家 - - function editAction() - { - $id=(int)$this->_getParam('id'); - $usertype=$this->_getParam('usertype'); - $newpwd=$this->_getParam('newpwd'); - $cfnewpwd=$this->_getParam('cfnewpwd'); - $sql=""; - $updates=array(); - if (isset($id)) - { - - if(!empty($newpwd)&&!empty($cfnewpwd)) - { - if($newpwd==$cfnewpwd) - { - $password=md5($newpwd); - $updates[]="password='$password'"; - } - else - { - $this->messenger->addMessage('两次密码不相同'); - $this->_redirect("/admin/user/show/id/$id"); - } - } - if(isset($usertype)) - { - $updates[]="usertype='$usertype'"; - } - - $update=join(',',$updates); - $sql="update users set $update where id='$id'"; - - try { - $this->db->query($sql); - $this->messenger->addMessage('编辑成功!'); - } catch (Exception $e) { - $this->messenger->addMessage($e->getMessage()); - } - - $this->_redirect("/admin/user/show/id/$id"); - } - else { - $this->_redirect("/admin/user/list"); - } - - } - - function fetchpwdAction() - { - $id=(int)$this->_getParam('id'); - $email=$this->_getParam('email'); - if (!empty($email)) - { - try { - $sql="select * from users where email=?"; - $uq=$this->db->query($sql,$email); - if ($urow=$uq->fetch()) - { - //email the url to user - $username=$urow['username']; - $sql="update users set activation=? where email=?"; - $uid=uniqid(); - $this->db->query($sql,array($uid,$email)); - $mail=new WestdcMailer($this->view->config->smtp); - $body="尊敬的西部数据中心用户: - 有人提出了针对此用户名的密码重置请求。 - - 用户名:"; - $body.=$username; - $body.=" - - 若想重置您的密码请打开下面的链接,否则请忽略此邮件,一切如常。 -"; - $body.="http://westdc.westgis.ac.cn/account/fetchpwd/".$username."/".$uid; - $mail->setBodyText($body); - $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); - $mail->addTo($email); - $mail->setSubject('密码已重置'); - $mail->send(); - $this->messenger->addMessage('密码重置成功!'); - } - } catch (Exception $e) { - $this->messenger->addMessage($e->getMessage().$email); - } - $this->_redirect("/admin/user/show/id/$id"); - } - else { - $this->_redirect("/admin/user/list"); - } - - } //overview - - - /* - * groupAction() 用户组管理 - * - */ - function groupAction(){ - - $ac = $this->_getParam('ac'); - $groupsTable = "groups"; - $userGroupTable = "usergroup"; - $nameField = $paramName = "name"; - include_once("Users.php"); - $u = new Users($this->db); - - if(empty($ac) || $ac == "index") - { - $select=$this->db->select(); - - - $select->from($groupsTable) - ->order('groups.id desc'); - - - $paginator = Zend_Paginator::factory($select); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage(30); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); - $this->view->paginator=$paginator; - }//首页 - - if($ac == "add") - { - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - - $data[$nameField] = $this->_getParam($paramName); - - if(empty($data[$nameField])) - { - $this->jsonexit(array("error"=>'请输入组名')); - return true; - } - - if($this->db->insert($groupsTable,$data)) - { - $this->jsonexit(array("status"=>1)); - return true; - }else{ - $this->jsonexit(array("error"=>"出现错误,请重试")); - return true; - } - - return true; - }//增加用户组 - - if($ac == "edit") - { - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - - $id = $this->_getParam('id'); - $data[$nameField] = $this->_getParam($paramName); - - if(empty($id)) - { - $this->jsonexit(array("error"=>'参数错误')); - return true; - } - - if(empty($data[$nameField])) - { - $this->jsonexit(array("error"=>'请输入组名')); - return true; - } - - if($this->db->update($groupsTable,$data,"id=$id")) - { - $this->jsonexit(array("status"=>1,"name"=>$data[$nameField])); - return true; - }else{ - $this->jsonexit(array("error"=>"出现错误,请重试")); - return true; - } - - return true; - }//编辑 - - if($ac == "del") - { - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - - $id = $this->_getParam('id'); - - if(empty($id)) - { - $this->jsonexit(array("error"=>'参数错误')); - return true; - } - - if($this->db->delete($groupsTable,"id=$id")) - { - $this->jsonexit(array("status"=>1)); - return true; - }else{ - $this->jsonexit(array("error"=>"出现错误,请重试")); - return true; - } - - return true; - }//删除 - - if($ac == "show") - { - $this->_helper->viewRenderer('group-users'); - - $gid = (int)$this->_getParam('id'); - - if(empty($gid)) - { - echo "参数错误!"; - return true; - } - - $this->view->groupid = $gid; - - $sql = "SELECT ug.uid,ug.gid,u.id,u.username,u.realname,u.email FROM $userGroupTable ug - LEFT JOIN users u ON ug.uid=u.id - WHERE ug.gid=$gid - ORDER BY ug.ts_created DESC"; - $sth = $this->db->query($sql); - $rows = $sth->fetchAll(); - - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage(20); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - - }//查看用户 - - if($ac == "adduser") - { - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - - $data['uid'] = $this->_getParam('uid'); - $data['gid'] = $this->_getParam('gid'); - - if(empty($data['uid']) || empty($data['gid'])) - { - $this->jsonexit(array("error"=>'参数错误')); - return true; - } - - $sql = "SELECT * FROM users WHERE id={$data['uid']}"; - $sth = $this->db->query($sql); - $rows = $sth->fetchAll(); - if(count($rows)<1) - { - $this->jsonexit(array("error"=>'用户不存在')); - return true; - } - - $sql = "SELECT * FROM $userGroupTable WHERE uid={$data['uid']} AND gid='{$data['gid']}'"; - $sth = $this->db->query($sql); - $rows = $sth->fetchAll(); - - if(count($rows)>0) - { - $this->jsonexit(array("error"=>'该用户已经存在于要加入的组')); - return true; - } - - if($this->db->insert($userGroupTable,$data)) - { - $this->jsonexit(array("status"=>1)); - return true; - }else{ - $this->jsonexit(array("error"=>"出现错误,请重试")); - return true; - } - - return true; - }//往组中添加用户 - - if($ac == "deluser") - { - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - - $uid = $this->_getParam('uid'); - $gid = $this->_getParam('gid'); - - if(empty($uid) || empty($gid)) - { - $this->jsonexit(array("error"=>'参数错误')); - return true; - } - - if($this->db->delete($userGroupTable,"uid=$uid AND gid=$gid")) - { - $this->jsonexit(array("status"=>1)); - return true; - }else{ - $this->jsonexit(array("error"=>"出现错误,请重试")); - return true; - } - - return true; - }//从组中删除用户 - - - }// groupAction() - - //管理用户权限 - public function userauthAction() - { - $this->_helper->viewRenderer('auth-user'); - include_once("Users.php"); - $User = new Users($this->db); - $uid = $this->_getParam('uid'); - if(!empty($uid)) - { - $this->view->uid = $uid; - } - - $ac = $this->_getParam('ac'); - - if(empty($ac) || $ac == "index") - { - if(empty($uid)) - { - $this->view->error = "参数错误"; - return true; - } - - $paginator = Zend_Paginator::factory($User->UAuthFetch($uid)); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage(20); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - - }//index - - if($ac == "add") - { - $this->_helper->viewRenderer('auth-user-add'); - $this->view->ac = "add"; - - if(empty($uid)) - { - $this->view->msg = "参数错误"; - return true; - } - - $submit = $this->_getParam('submit'); - if(!empty($submit)) - { - $module = $this->_getParam('name_module'); - $controller = $this->_getParam('name_controller'); - $action = $this->_getParam('name_action'); - $special = $this->_getparam('name_special'); - $allow = $this->_getParam('allow'); - - if(empty($module) && empty($controller) && empty($action) && empty($special)) - { - $this->view->error = "参数错误"; - return true; - } - - $options = array( - 'module'=>$module, - 'controller'=>$controller, - 'action'=>$action, - 'special'=>$special - ); - - if($User->UAuthAdd($uid,$options,$allow)) - { - $this->view->msg = "添加成功!"; - $this->view->jump_url = "/admin/user/userauth?uid=".$uid; - }else{ - $this->view->msg = "添加失败,请重试"; - } - } - }//add - - if($ac == "del") - { - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - - $id = $this->_getParam('id'); - if(empty($id)) - { - $data = array("error"=>'参数错误'); - $this->jsonexit($data); - return true; - } - - if($User->UAuthDel($id)) - { - $this->jsonexit(array('deleted'=>$id)); - return true; - }else{ - $this->jsonexit(array('error'=>'移除失败,请重试')); - return true; - } - - }//del - - if($ac == "clearall") - { - if(empty($uid)) - { - $this->view->error = "参数错误"; - return true; - } - - if($User->UAuthDel(-1,$uid)) - { - $this->view->msg = "清除成功!"; - $this->view->jump_url = "/admin/user/userauth?uid=".$uid; - return true; - }else{ - $this->view->msg = "清除失败,请重试"; - $this->view->jump_url = "/admin/user/userauth?uid=".$uid; - return true; - } - - }//clearall - - if($ac == "clone") - { - if(empty($uid)) - { - $this->view->msg = "参数错误"; - return true; - } - - $this->_helper->viewRenderer('auth-user-clone'); - $this->view->ac = "clone"; - - $submit = $this->_getParam('submit'); - - if(!empty($submit)) - { - $target = $this->_getParam('target'); - if(empty($target)) - { - $this->view->error = "请输入将此用户权限要克隆到的用户ID"; - return true; - } - - if($User->AuthClone($uid,$target)>0) - { - $this->view->msg = "克隆成功"; - return true; - }else{ - $this->view->error = "克隆失败,请查证Email的正确性"; - return true; - } - } - - }//clone - - }//userauthAction() - - //组权限 - public function groupauthAction(){ - - $this->_helper->viewRenderer('auth-group'); - include_once("Users.php"); - $User = new Users($this->db); - $gid = $this->_getParam('gid'); - if(!empty($gid)) - { - $this->view->gid = $gid; - } - - $ac = $this->_getParam('ac'); - - if(empty($ac) || $ac == "index") - { - if(empty($gid)) - { - $this->view->error = "参数错误"; - return true; - } - - $paginator = Zend_Paginator::factory($User->GAuthFetch($gid)); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage(20); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - - }//index - - if($ac == "add") - { - $this->_helper->viewRenderer('auth-group-add'); - $this->view->ac = "add"; - - if(empty($gid)) - { - $this->view->msg = "参数错误"; - return true; - } - - $submit = $this->_getParam('submit'); - if(!empty($submit)) - { - $module = $this->_getParam('name_module'); - $controller = $this->_getParam('name_controller'); - $action = $this->_getParam('name_action'); - $special = $this->_getparam('name_special'); - $allow = $this->_getParam('allow'); - - if(empty($module) && empty($controller) && empty($action) && empty($special)) - { - $this->view->error = "参数错误"; - return true; - } - - $options = array( - 'module'=>$module, - 'controller'=>$controller, - 'action'=>$action, - 'special'=>$special - ); - - if($User->GAuthAdd($gid,$options,$allow)) - { - $this->view->msg = "添加成功!"; - $this->view->jump_url = "/admin/user/groupauth?gid=".$gid; - }else{ - $this->view->msg = "添加失败,请重试"; - } - } - }//add - - if($ac == "del") - { - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - - $id = $this->_getParam('id'); - if(empty($id)) - { - $data = array("error"=>'参数错误'); - $this->jsonexit($data); - return true; - } - - if($User->GAuthDel($id)) - { - $this->jsonexit(array('deleted'=>$id)); - return true; - }else{ - $this->jsonexit(array('error'=>'移除失败,请重试')); - return true; - } - - }//del - - if($ac == "clearall") - { - if(empty($gid)) - { - $this->view->error = "参数错误"; - return true; - } - - if($User->GAuthDel(-1,$gid)) - { - $this->view->msg = "清除成功!"; - $this->view->jump_url = "/admin/user/userauth?gid=".$gid; - return true; - }else{ - $this->view->msg = "清除失败,请重试"; - $this->view->jump_url = "/admin/user/userauth?gid=".$gid; - return true; - } - - }//clearall - - } - - /* - * - * 给时间长没有登录的用户发送邀请邮件 - * - */ - public function sendmailAction(){ - - $ac = $this->_getParam('ac'); - - if(empty($ac) || $ac=='index') - { - $time = date("Y-m-d H:i:s",time()-3*365*24*3600); - - $sql = "SELECT * FROM users - WHERE ts_last_login<'$time' - ORDER BY ts_last_login DESC"; - $sth = $this->db->query($sql); - $rows = $sth->fetchAll(); - - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage(20); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - - $this->view->count_users = count($rows); - return true; - - } - - if($ac == "send") - { - $this->_helper->viewRenderer('sendmail-send'); - - //当前进行到的数量 - $now = $this->_getParam('now'); - - //需要将起始的时间传递过来,防止sql中出现多余的用户 - $time = $this->_getParam('time'); - if(empty($time)) - { - $time = date("Y-m-d H:i:s",time()-3*365*24*3600); - } - $this->view->gotime = $time; - - //当前处理的页数 - $page = $this->_getParam('page'); - if(empty($page)) - { - $page = 0; - } - - $step = 20; - - $sql = "SELECT count(id) as c FROM users - WHERE ts_last_login<'$time'"; - - $sth = $this->db->query($sql); - $row = $sth->fetch(); - - $total = $row['c']; - - if(empty($now)) - { - $now = 0; - } - - //此次读取的起点 - $start = $now + $step; - - if($start>$total) - { - $this->view->stop = "YES"; - $msg = array( - "title"=>"为长时间未登录用户发送邀请", - "body"=>"在 ".time()." 时间给最后登陆时间在". $time ."之前的用户发送了邀请访问邮件。 " - ); - include_once("message.php"); - message::post($this->db,0,-1,$msg['title'],$msg['body']); - return true; - } - - $sql = "SELECT * FROM users - WHERE ts_last_login<'$time' - ORDER BY ts_last_login DESC - LIMIT $step - OFFSET $start"; - - $sth = $this->db->query($sql); - $rows = $sth->fetchAll(); - - $result = array(); - - foreach($rows as $k=>$v) - { - include_once("EmailText.php"); - $mail=new WestdcMailer($this->view->config->smtp); - $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); - $mailtp=new EmailText($this->db,"user-invite",array( - 'user' => $v['username'], - 'uid' => $v['id'], - 'realname'=> $v['realname'], - 'lastlogin'=> date("Y-m-d",strtotime($v['ts_last_login'])), - )); - $mail->setBodyText($mailtp->getBody()); - $mail->setSubject($mailtp->getSubject()); - @$mail->addTo($v['email']); - $result[$v['id']] = array( - 'username'=>$v['username'], - 'email'=>$v['email'], - 'lastlogin'=>date("Y-m-d",strtotime($v['ts_last_login'])) - ); - //@$mail->send(); - } - - - $this->view->result = $result; - $this->view->now = $start; - $this->view->total = $total; - - $percent = round( ( $start / $total ) * 100 ,1); - $this->view->percent = $percent; - - $page ++; - - $this->view->page = $page; - - return true; - - } - - //黑河用户邮件 - if($ac == "heihe") - { - - $this->_helper->viewRenderer('sendmail-heihe'); - - $sql = "SELECT * FROM heiheuser ORDER BY id DESC"; - - $sth = $this->db->query($sql); - - $rows = $sth->fetchAll(); - - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage(20); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - - $this->view->count_users = count($rows); - - return true; - - } - - //黑河邮件发送 - if($ac == "heihemail") - { - $this->_helper->viewRenderer('sendmail-heihe-send'); - - //当前进行到的数量 - $now = $this->_getParam('now'); - - //当前处理的页数 - $page = $this->_getParam('page'); - if(empty($page)) - { - $page = 0; - } - - $step = 20; - - $sql = "SELECT count(id) as c FROM heiheuser"; - - $sth = $this->db->query($sql); - $row = $sth->fetch(); - - $total = $row['c']; - - if(empty($now)) - { - $now = 0; - } - - //此次读取的起点 - $start = $now + $step; - - if($start>$total) - { - $this->view->stop = "YES"; - $msg = array( - "title"=>"为数字黑河用户发送了邮件通知", - "body"=>"在 ".time()." 时间给数字黑河用户发送了邮件通知 " - ); - include_once("message.php"); - message::post($this->db,0,-1,$msg['title'],$msg['body']); - return true; - } - - $sql = "SELECT * FROM heiheuser - ORDER BY id DESC - LIMIT $step - OFFSET $start"; - - $sth = $this->db->query($sql); - $rows = $sth->fetchAll(); - - $result = array(); - - foreach($rows as $k=>$v) - { - - include_once("EmailText.php"); - $mail=new WestdcMailer($this->view->config->smtp); - $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); - $mailtp=new EmailText($this->db,"user-heihe-invite",array( - 'user' => $v['username'], - 'uid' => $v['id'], - 'lastlogin'=> date("Y-m-d",strtotime($v['lastlogin'])), - )); - $mail->setBodyText($mailtp->getBody()); - $mail->setSubject($mailtp->getSubject()); - @$mail->addTo($v['email']); - - $result[$v['id']] = array( - 'username'=>$v['username'], - 'email'=>$v['email'], - 'lastlogin'=>date("Y-m-d",strtotime($v['lastlogin'])) - ); - //@$mail->send(); - } - - - $this->view->result = $result; - $this->view->now = $start; - $this->view->total = $total; - - $percent = round( ( $start / $total ) * 100 ,1); - $this->view->percent = $percent; - - $page ++; - - $this->view->page = $page; - - $this->view->url = "/admin/user/sendmail/ac/heihemail?now=".$start."&page=".$page; - - return true; - } - - //节日祝贺邮件 - if($ac == "holiday") - { - $this->_helper->viewRenderer('sendmail-holiday'); - - $sql = "SELECT count(id) as c FROM users"; - $sth = $this->db->query($sql); - $row = $sth->fetch(); - - $this->view->count_users = $row['c']; - - $sql = "SELECT * FROM emailtext WHERE \"template\"='user-holiday-email'"; - $sth = $this->db->query($sql); - $row = $sth->fetch(); - - $this->view->mailtemp = $row; - - return true; - } - - //节日祝贺邮件 - if($ac == "holidaymail") - { - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - - $title = $this->_getParam('title'); - $body = $this->_getParam('content'); - - if(empty($title) || empty($body)) - { - $this->jsonexit(array("error"=>"请填写邮件标题和内容")); - return true; - } - - //当前进行到的数量 - $now = $this->_getParam('now'); - - //当前处理的页数 - $page = $this->_getParam('page'); - if(empty($page)) - { - $page = 0; - } - - $step = 20; - - $sql = "SELECT count(id) as c FROM users"; - - $sth = $this->db->query($sql); - $row = $sth->fetch(); - - $total = $row['c']; - - if(empty($now)) - { - $now = 0; - } - - //此次读取的起点 - $start = $now + $step; - - if($start>$total) - { - $stop = "YES"; - $msg = array( - "title"=>"为用户发送了节日祝贺邮件", - "body"=>"在 ".time()." 为用户发送了节日祝贺邮件 " - ); - include_once("message.php"); - message::post($this->db,0,-1,$msg['title'],$msg['body']); - } - - $sql = "SELECT * FROM users - ORDER BY id DESC - LIMIT $step - OFFSET $start"; - - $sth = $this->db->query($sql); - $rows = $sth->fetchAll(); - - $result = array(); - $sended = 0; - - foreach($rows as $k=>$v) - { - $replace_data = array( - 'username' => $v['username'], - 'uid' => $v['id'], - 'lastlogin'=> date("Y-m-d",strtotime($v['ts_last_login'])), - ); - - $patterns = array(); - $replacements = array(); - foreach($replace_data as $k=>$v) - { - $patterns[]='/{'.$k.'}/i'; - $replacements[]=$v; - } - ksort($patterns); - ksort($replacements); - $send_body = preg_replace($patterns, $replacements, $body); - $send_subject = preg_replace($patterns, $replacements, $title); - - - /* - $mail=new WestdcMailer($this->view->config->smtp); - $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); - $mail->setBodyText($send_body); - $mail->setSubject($send_subject); - @$mail->addTo($v['email']); - if(@$mail->send()) - { - $sended ++; - $status = "成功"; - }else{ - $status = "失败"; - } - */ - - $sended ++; - /* - 调试时前台循环输出result - $result[$v['id']] = array( - 'username'=>$v['username'], - 'email'=>$v['email'], - 'send_body'=>$send_body, - 'send_subject'=>$send_subject - ); - */ - - - } - - $percent = round( ( $start / $total ) * 100 ,1); - - if($percent > 100) - { - $percent = 100; - } - $page ++; - - $data = array( - 'now'=>$start, - 'total'=>$total, - 'percent'=>$percent, - 'page'=>$page, - 'sended'=>$sended, - 'url'=> "/admin/user/sendmail/ac/holidaymail?now=".$start."&page=".$page."&title=".$title."&body=".urlencode($body), - 'content'=>$body, - 'title'=>$title, - 'status'=>1, - 'result'=>$result //用于调试 - ); - - if(!empty($stop)) - { - $data['stop'] = $stop; - $data['status'] = 0; - } - - $this->jsonexit($data); - return true; - } - - }//sendemailAction() - - - - public function jsonexit($data){ - $this->getResponse()->setHeader('Content-Type', 'application/json')->appendBody(json_encode($data,JSON_NUMERIC_CHECK)); - return true; - } -} - +db=Zend_Registry::get('db'); + $this->view->config = Zend_Registry::get('config'); + $this->messenger=$this->_helper->getHelper('FlashMessenger'); + $this->view->messages = $this->messenger->getMessages(); + $this->view->theme = new Theme(); + $this->_helper->layout->setLayout('administry'); + } + function postDispatch() + { + $this->view->messages = $this->messenger->getMessages(); + } + function indexAction() + { + $sql="select count(id) as total from users"; + $uq=$this->db->query($sql); + $row=$uq->fetch(); + + $sqlt="select count(id) as total from users where usertype='administrator'"; + $uqt=$this->db->query($sqlt); + $adminrow=$uqt->fetch(); + + $this->view->su=$row; + $this->view->suadmin=$adminrow; + + }//indexAction + + function listAction() + { + + $select=$this->db->select(); + + + $select->from('users') + ->where('usertype = ?', 'member') + ->order('users.id desc'); + + + $paginator = Zend_Paginator::factory($select); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(30); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + }//listAction + + function searchAction() + { + $search = $this->_getParam('search'); + $realname = $this->view->realname = $this->_getParam('realname'); + $unit = $this->view->unit = $this->_getParam('unit'); + $project = $this->view->project = $this->_getParam('project'); + + $select=$this->db->select(); + + if(!empty($search) && ( !empty($realname) || !empty($unit) || !empty($project) )) + { + $this->messenger->addMessage('搜索结果'); + $select->from('users'); + if(!empty($realname)) + { + $select->where('realname like ? ', '%'.$realname.'%'); + $select->orWhere('username like ? ', '%'.$realname.'%'); + } + if(!empty($unit)) + $select->where('unit like ? ', '%'.$unit.'%'); + if(!empty($project)) + $select->where('project like ? ', '%'.$project.'%'); + + $select->order('users.id desc'); + + + + $paginator = Zend_Paginator::factory($select); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(30); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + $this->_helper->viewRenderer('list'); + + } + else { + $this->_redirect("/admin/user/list"); + } + + + + + }//searchAction + + function deleteAction() + { + $delete=(int)$this->_getParam('id'); + $deletename = $this->_getParam('uname'); + + if (isset($delete)) + { + $sql="delete from users where id=?"; + try { + $this->db->query($sql,array($delete)); + $this->messenger->addMessage('您已经成功的删除了用户:'.$deletename); + } catch (Exception $e) { + $this->messenger->addMessage($e->getMessage()); + } + $this->_redirect("/admin/user/list"); + } + } + + function adminlistAction() + { + $select=$this->db->select(); + $select->from('users') + ->where('usertype = ?', $this->view->config->auth->identifier) + ->order('users.id desc'); + + + $paginator = Zend_Paginator::factory($select); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(30); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + + $ac = $this->_getParam('ac'); + + if($ac == 'sync') + { + $sql = "SELECT id FROM users WHERE usertype='administrator'"; + $rs = $this->db->query($sql); + $ids = $rs->fetchAll(); + + $data = array(); + foreach($ids as $v) + { + $data[] = $v['id']; + } + unset($ids); + + $ids = join(",",$data); + + $gn_sql = "update users set profile='Administrator' where id in ($ids)"; + $gn_db = new PDO(array( + 'host'=> $this->view->config->geonetwork->params->host, + 'port' => 5432, + 'user' => $this->view->config->geonetwork->params->username, + 'pwd' => $this->view->config->geonetwork->params->password , + 'db' => $this->view->config->geonetwork->params->dbname + )); + + $gn_db->exec("update users set profile='Editor' where id>1 and profile='Administrator'"); + $gn_db->exec($gn_sql); + + view::Post($this,"同步成功!",-1); + } + } + + function showAction() + { + $id=(int)$this->_getParam('id'); + if (isset($id)) + { + try { + $user = new \Users\Users; + $this->view->infos=$user->getUser($id); + $this->view->usertypes = $user->getUserType(); + + } catch (Exception $e) { + $this->messenger->addMessage($e->getMessage()); + } + } + else + { + $this->_redirect("/admin/user/list"); + } + }//showAction() + + function upAction() + { + $id=(int)$this->_getParam('id'); + + if (isset($id)) + { + try { + + $sql="select u.*,m.id as mid from users u left join mdexperts m on m.id=u.id where u.id='$id'"; + $result = $this->db->query($sql); + $ex = $result->fetch(); + if(empty($ex['mid'])){ + + $submit=$this->_getParam('submit'); + $speciality = $this->_getParam('speciality'); + + if($submit) + { + $sql="insert into mdexperts (id,speciality) values ('$id','$speciality')"; + if($this->db->exec($sql)>0) + { + $this->messenger->addMessage('已经成功将用户提升为评审专家'); + $this->_redirect("/admin/user/list"); + } + } + else + { + $this->view->infos = $ex; + } + + }else + { + $this->messenger->addMessage("该用户已经是评审专家"); + $this->_redirect("/admin/user/list"); + } + + } catch (Exception $e) { + $this->messenger->addMessage($e->getMessage()); + $this->_redirect("/admin/user/list"); + } + } + else + { + $this->_redirect("/admin/user/list"); + } + + }//upAction() 把用户提升为评审专家 + + function editAction() + { + $id=(int)$this->_getParam('id'); + $usertype=$this->_getParam('usertype'); + $newpwd=$this->_getParam('newpwd'); + $cfnewpwd=$this->_getParam('cfnewpwd'); + $sql=""; + $updates=array(); + if (isset($id)) + { + + if(!empty($newpwd)&&!empty($cfnewpwd)) + { + if($newpwd==$cfnewpwd) + { + $password=md5($newpwd); + $updates[]="password='$password'"; + } + else + { + $this->messenger->addMessage('两次密码不相同'); + $this->_redirect("/admin/user/show/id/$id"); + } + } + if(isset($usertype)) + { + $updates[]="usertype='$usertype'"; + } + + $update=join(',',$updates); + $sql="update users set $update where id='$id'"; + + try { + $this->db->query($sql); + $this->messenger->addMessage('编辑成功!'); + } catch (Exception $e) { + $this->messenger->addMessage($e->getMessage()); + } + + $this->_redirect("/admin/user/show/id/$id"); + } + else { + $this->_redirect("/admin/user/list"); + } + + } + + function fetchpwdAction() + { + $id=(int)$this->_getParam('id'); + $email=$this->_getParam('email'); + if (!empty($email)) + { + try { + $sql="select * from users where email=?"; + $uq=$this->db->query($sql,$email); + if ($urow=$uq->fetch()) + { + //email the url to user + $username=$urow['username']; + $sql="update users set activation=? where email=?"; + $uid=uniqid(); + $this->db->query($sql,array($uid,$email)); + $mail=new WestdcMailer($this->view->config->smtp); + $body="尊敬的西部数据中心用户: + 有人提出了针对此用户名的密码重置请求。 + + 用户名:"; + $body.=$username; + $body.=" + + 若想重置您的密码请打开下面的链接,否则请忽略此邮件,一切如常。 +"; + $body.="http://westdc.westgis.ac.cn/account/fetchpwd/".$username."/".$uid; + $mail->setBodyText($body); + $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); + $mail->addTo($email); + $mail->setSubject('密码已重置'); + $mail->send(); + $this->messenger->addMessage('密码重置成功!'); + } + } catch (Exception $e) { + $this->messenger->addMessage($e->getMessage().$email); + } + $this->_redirect("/admin/user/show/id/$id"); + } + else { + $this->_redirect("/admin/user/list"); + } + + } //overview + + + /* + * groupAction() 用户组管理 + * + */ + function groupAction(){ + + $ac = $this->_getParam('ac'); + $groupsTable = "groups"; + $userGroupTable = "usergroup"; + $nameField = $paramName = "name"; + include_once("Users.php"); + $u = new Users($this->db); + + if(empty($ac) || $ac == "index") + { + $select=$this->db->select(); + + + $select->from($groupsTable) + ->order('groups.id desc'); + + + $paginator = Zend_Paginator::factory($select); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(30); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); + $this->view->paginator=$paginator; + }//首页 + + if($ac == "add") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $data[$nameField] = $this->_getParam($paramName); + + if(empty($data[$nameField])) + { + $this->jsonexit(array("error"=>'请输入组名')); + return true; + } + + if($this->db->insert($groupsTable,$data)) + { + $this->jsonexit(array("status"=>1)); + return true; + }else{ + $this->jsonexit(array("error"=>"出现错误,请重试")); + return true; + } + + return true; + }//增加用户组 + + if($ac == "edit") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $id = $this->_getParam('id'); + $data[$nameField] = $this->_getParam($paramName); + + if(empty($id)) + { + $this->jsonexit(array("error"=>'参数错误')); + return true; + } + + if(empty($data[$nameField])) + { + $this->jsonexit(array("error"=>'请输入组名')); + return true; + } + + if($this->db->update($groupsTable,$data,"id=$id")) + { + $this->jsonexit(array("status"=>1,"name"=>$data[$nameField])); + return true; + }else{ + $this->jsonexit(array("error"=>"出现错误,请重试")); + return true; + } + + return true; + }//编辑 + + if($ac == "del") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $id = $this->_getParam('id'); + + if(empty($id)) + { + $this->jsonexit(array("error"=>'参数错误')); + return true; + } + + if($this->db->delete($groupsTable,"id=$id")) + { + $this->jsonexit(array("status"=>1)); + return true; + }else{ + $this->jsonexit(array("error"=>"出现错误,请重试")); + return true; + } + + return true; + }//删除 + + if($ac == "show") + { + $this->_helper->viewRenderer('group-users'); + + $gid = (int)$this->_getParam('id'); + + if(empty($gid)) + { + echo "参数错误!"; + return true; + } + + $this->view->groupid = $gid; + + $sql = "SELECT ug.uid,ug.gid,u.id,u.username,u.realname,u.email FROM $userGroupTable ug + LEFT JOIN users u ON ug.uid=u.id + WHERE ug.gid=$gid + ORDER BY ug.ts_created DESC"; + $sth = $this->db->query($sql); + $rows = $sth->fetchAll(); + + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(20); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + + }//查看用户 + + if($ac == "adduser") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $data['uid'] = $this->_getParam('uid'); + $data['gid'] = $this->_getParam('gid'); + + if(empty($data['uid']) || empty($data['gid'])) + { + $this->jsonexit(array("error"=>'参数错误')); + return true; + } + + $sql = "SELECT * FROM users WHERE id={$data['uid']}"; + $sth = $this->db->query($sql); + $rows = $sth->fetchAll(); + if(count($rows)<1) + { + $this->jsonexit(array("error"=>'用户不存在')); + return true; + } + + $sql = "SELECT * FROM $userGroupTable WHERE uid={$data['uid']} AND gid='{$data['gid']}'"; + $sth = $this->db->query($sql); + $rows = $sth->fetchAll(); + + if(count($rows)>0) + { + $this->jsonexit(array("error"=>'该用户已经存在于要加入的组')); + return true; + } + + if($this->db->insert($userGroupTable,$data)) + { + $this->jsonexit(array("status"=>1)); + return true; + }else{ + $this->jsonexit(array("error"=>"出现错误,请重试")); + return true; + } + + return true; + }//往组中添加用户 + + if($ac == "deluser") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $uid = $this->_getParam('uid'); + $gid = $this->_getParam('gid'); + + if(empty($uid) || empty($gid)) + { + $this->jsonexit(array("error"=>'参数错误')); + return true; + } + + if($this->db->delete($userGroupTable,"uid=$uid AND gid=$gid")) + { + $this->jsonexit(array("status"=>1)); + return true; + }else{ + $this->jsonexit(array("error"=>"出现错误,请重试")); + return true; + } + + return true; + }//从组中删除用户 + + + }// groupAction() + + //管理用户权限 + public function userauthAction() + { + $this->_helper->viewRenderer('auth-user'); + include_once("Users.php"); + $User = new Users($this->db); + $uid = $this->_getParam('uid'); + if(!empty($uid)) + { + $this->view->uid = $uid; + } + + $ac = $this->_getParam('ac'); + + if(empty($ac) || $ac == "index") + { + if(empty($uid)) + { + $this->view->error = "参数错误"; + return true; + } + + $paginator = Zend_Paginator::factory($User->UAuthFetch($uid)); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(20); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + + }//index + + if($ac == "add") + { + $this->_helper->viewRenderer('auth-user-add'); + $this->view->ac = "add"; + + if(empty($uid)) + { + $this->view->msg = "参数错误"; + return true; + } + + $submit = $this->_getParam('submit'); + if(!empty($submit)) + { + $module = $this->_getParam('name_module'); + $controller = $this->_getParam('name_controller'); + $action = $this->_getParam('name_action'); + $special = $this->_getparam('name_special'); + $allow = $this->_getParam('allow'); + + if(empty($module) && empty($controller) && empty($action) && empty($special)) + { + $this->view->error = "参数错误"; + return true; + } + + $options = array( + 'module'=>$module, + 'controller'=>$controller, + 'action'=>$action, + 'special'=>$special + ); + + if($User->UAuthAdd($uid,$options,$allow)) + { + $this->view->msg = "添加成功!"; + $this->view->jump_url = "/admin/user/userauth?uid=".$uid; + }else{ + $this->view->msg = "添加失败,请重试"; + } + } + }//add + + if($ac == "del") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $id = $this->_getParam('id'); + if(empty($id)) + { + $data = array("error"=>'参数错误'); + $this->jsonexit($data); + return true; + } + + if($User->UAuthDel($id)) + { + $this->jsonexit(array('deleted'=>$id)); + return true; + }else{ + $this->jsonexit(array('error'=>'移除失败,请重试')); + return true; + } + + }//del + + if($ac == "clearall") + { + if(empty($uid)) + { + $this->view->error = "参数错误"; + return true; + } + + if($User->UAuthDel(-1,$uid)) + { + $this->view->msg = "清除成功!"; + $this->view->jump_url = "/admin/user/userauth?uid=".$uid; + return true; + }else{ + $this->view->msg = "清除失败,请重试"; + $this->view->jump_url = "/admin/user/userauth?uid=".$uid; + return true; + } + + }//clearall + + if($ac == "clone") + { + if(empty($uid)) + { + $this->view->msg = "参数错误"; + return true; + } + + $this->_helper->viewRenderer('auth-user-clone'); + $this->view->ac = "clone"; + + $submit = $this->_getParam('submit'); + + if(!empty($submit)) + { + $target = $this->_getParam('target'); + if(empty($target)) + { + $this->view->error = "请输入将此用户权限要克隆到的用户ID"; + return true; + } + + if($User->AuthClone($uid,$target)>0) + { + $this->view->msg = "克隆成功"; + return true; + }else{ + $this->view->error = "克隆失败,请查证Email的正确性"; + return true; + } + } + + }//clone + + }//userauthAction() + + //组权限 + public function groupauthAction(){ + + $this->_helper->viewRenderer('auth-group'); + include_once("Users.php"); + $User = new Users($this->db); + $gid = $this->_getParam('gid'); + if(!empty($gid)) + { + $this->view->gid = $gid; + } + + $ac = $this->_getParam('ac'); + + if(empty($ac) || $ac == "index") + { + if(empty($gid)) + { + $this->view->error = "参数错误"; + return true; + } + + $paginator = Zend_Paginator::factory($User->GAuthFetch($gid)); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(20); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + + }//index + + if($ac == "add") + { + $this->_helper->viewRenderer('auth-group-add'); + $this->view->ac = "add"; + + if(empty($gid)) + { + $this->view->msg = "参数错误"; + return true; + } + + $submit = $this->_getParam('submit'); + if(!empty($submit)) + { + $module = $this->_getParam('name_module'); + $controller = $this->_getParam('name_controller'); + $action = $this->_getParam('name_action'); + $special = $this->_getparam('name_special'); + $allow = $this->_getParam('allow'); + + if(empty($module) && empty($controller) && empty($action) && empty($special)) + { + $this->view->error = "参数错误"; + return true; + } + + $options = array( + 'module'=>$module, + 'controller'=>$controller, + 'action'=>$action, + 'special'=>$special + ); + + if($User->GAuthAdd($gid,$options,$allow)) + { + $this->view->msg = "添加成功!"; + $this->view->jump_url = "/admin/user/groupauth?gid=".$gid; + }else{ + $this->view->msg = "添加失败,请重试"; + } + } + }//add + + if($ac == "del") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $id = $this->_getParam('id'); + if(empty($id)) + { + $data = array("error"=>'参数错误'); + $this->jsonexit($data); + return true; + } + + if($User->GAuthDel($id)) + { + $this->jsonexit(array('deleted'=>$id)); + return true; + }else{ + $this->jsonexit(array('error'=>'移除失败,请重试')); + return true; + } + + }//del + + if($ac == "clearall") + { + if(empty($gid)) + { + $this->view->error = "参数错误"; + return true; + } + + if($User->GAuthDel(-1,$gid)) + { + $this->view->msg = "清除成功!"; + $this->view->jump_url = "/admin/user/userauth?gid=".$gid; + return true; + }else{ + $this->view->msg = "清除失败,请重试"; + $this->view->jump_url = "/admin/user/userauth?gid=".$gid; + return true; + } + + }//clearall + + } + + /* + * + * 给时间长没有登录的用户发送邀请邮件 + * + */ + public function sendmailAction(){ + + $ac = $this->_getParam('ac'); + + if(empty($ac) || $ac=='index') + { + $time = date("Y-m-d H:i:s",time()-3*365*24*3600); + + $sql = "SELECT * FROM users + WHERE ts_last_login<'$time' + ORDER BY ts_last_login DESC"; + $sth = $this->db->query($sql); + $rows = $sth->fetchAll(); + + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(20); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + + $this->view->count_users = count($rows); + return true; + + } + + if($ac == "send") + { + $this->_helper->viewRenderer('sendmail-send'); + + //当前进行到的数量 + $now = $this->_getParam('now'); + + //需要将起始的时间传递过来,防止sql中出现多余的用户 + $time = $this->_getParam('time'); + if(empty($time)) + { + $time = date("Y-m-d H:i:s",time()-3*365*24*3600); + } + $this->view->gotime = $time; + + //当前处理的页数 + $page = $this->_getParam('page'); + if(empty($page)) + { + $page = 0; + } + + $step = 20; + + $sql = "SELECT count(id) as c FROM users + WHERE ts_last_login<'$time'"; + + $sth = $this->db->query($sql); + $row = $sth->fetch(); + + $total = $row['c']; + + if(empty($now)) + { + $now = 0; + } + + //此次读取的起点 + $start = $now + $step; + + if($start>$total) + { + $this->view->stop = "YES"; + $msg = array( + "title"=>"为长时间未登录用户发送邀请", + "body"=>"在 ".time()." 时间给最后登陆时间在". $time ."之前的用户发送了邀请访问邮件。 " + ); + include_once("message.php"); + message::post($this->db,0,-1,$msg['title'],$msg['body']); + return true; + } + + $sql = "SELECT * FROM users + WHERE ts_last_login<'$time' + ORDER BY ts_last_login DESC + LIMIT $step + OFFSET $start"; + + $sth = $this->db->query($sql); + $rows = $sth->fetchAll(); + + $result = array(); + + foreach($rows as $k=>$v) + { + include_once("EmailText.php"); + $mail=new WestdcMailer($this->view->config->smtp); + $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); + $mailtp=new EmailText($this->db,"user-invite",array( + 'user' => $v['username'], + 'uid' => $v['id'], + 'realname'=> $v['realname'], + 'lastlogin'=> date("Y-m-d",strtotime($v['ts_last_login'])), + )); + $mail->setBodyText($mailtp->getBody()); + $mail->setSubject($mailtp->getSubject()); + @$mail->addTo($v['email']); + $result[$v['id']] = array( + 'username'=>$v['username'], + 'email'=>$v['email'], + 'lastlogin'=>date("Y-m-d",strtotime($v['ts_last_login'])) + ); + //@$mail->send(); + } + + + $this->view->result = $result; + $this->view->now = $start; + $this->view->total = $total; + + $percent = round( ( $start / $total ) * 100 ,1); + $this->view->percent = $percent; + + $page ++; + + $this->view->page = $page; + + return true; + + } + + //黑河用户邮件 + if($ac == "heihe") + { + + $this->_helper->viewRenderer('sendmail-heihe'); + + $sql = "SELECT * FROM heiheuser ORDER BY id DESC"; + + $sth = $this->db->query($sql); + + $rows = $sth->fetchAll(); + + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(20); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + + $this->view->count_users = count($rows); + + return true; + + } + + //黑河邮件发送 + if($ac == "heihemail") + { + $this->_helper->viewRenderer('sendmail-heihe-send'); + + //当前进行到的数量 + $now = $this->_getParam('now'); + + //当前处理的页数 + $page = $this->_getParam('page'); + if(empty($page)) + { + $page = 0; + } + + $step = 20; + + $sql = "SELECT count(id) as c FROM heiheuser"; + + $sth = $this->db->query($sql); + $row = $sth->fetch(); + + $total = $row['c']; + + if(empty($now)) + { + $now = 0; + } + + //此次读取的起点 + $start = $now + $step; + + if($start>$total) + { + $this->view->stop = "YES"; + $msg = array( + "title"=>"为数字黑河用户发送了邮件通知", + "body"=>"在 ".time()." 时间给数字黑河用户发送了邮件通知 " + ); + include_once("message.php"); + message::post($this->db,0,-1,$msg['title'],$msg['body']); + return true; + } + + $sql = "SELECT * FROM heiheuser + ORDER BY id DESC + LIMIT $step + OFFSET $start"; + + $sth = $this->db->query($sql); + $rows = $sth->fetchAll(); + + $result = array(); + + foreach($rows as $k=>$v) + { + + include_once("EmailText.php"); + $mail=new WestdcMailer($this->view->config->smtp); + $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); + $mailtp=new EmailText($this->db,"user-heihe-invite",array( + 'user' => $v['username'], + 'uid' => $v['id'], + 'lastlogin'=> date("Y-m-d",strtotime($v['lastlogin'])), + )); + $mail->setBodyText($mailtp->getBody()); + $mail->setSubject($mailtp->getSubject()); + @$mail->addTo($v['email']); + + $result[$v['id']] = array( + 'username'=>$v['username'], + 'email'=>$v['email'], + 'lastlogin'=>date("Y-m-d",strtotime($v['lastlogin'])) + ); + //@$mail->send(); + } + + + $this->view->result = $result; + $this->view->now = $start; + $this->view->total = $total; + + $percent = round( ( $start / $total ) * 100 ,1); + $this->view->percent = $percent; + + $page ++; + + $this->view->page = $page; + + $this->view->url = "/admin/user/sendmail/ac/heihemail?now=".$start."&page=".$page; + + return true; + } + + //节日祝贺邮件 + if($ac == "holiday") + { + $this->_helper->viewRenderer('sendmail-holiday'); + + $sql = "SELECT count(id) as c FROM users"; + $sth = $this->db->query($sql); + $row = $sth->fetch(); + + $this->view->count_users = $row['c']; + + $sql = "SELECT * FROM emailtext WHERE \"template\"='user-holiday-email'"; + $sth = $this->db->query($sql); + $row = $sth->fetch(); + + $this->view->mailtemp = $row; + + return true; + } + + //节日祝贺邮件 + if($ac == "holidaymail") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $title = $this->_getParam('title'); + $body = $this->_getParam('content'); + + if(empty($title) || empty($body)) + { + $this->jsonexit(array("error"=>"请填写邮件标题和内容")); + return true; + } + + //当前进行到的数量 + $now = $this->_getParam('now'); + + //当前处理的页数 + $page = $this->_getParam('page'); + if(empty($page)) + { + $page = 0; + } + + $step = 20; + + $sql = "SELECT count(id) as c FROM users"; + + $sth = $this->db->query($sql); + $row = $sth->fetch(); + + $total = $row['c']; + + if(empty($now)) + { + $now = 0; + } + + //此次读取的起点 + $start = $now + $step; + + if($start>$total) + { + $stop = "YES"; + $msg = array( + "title"=>"为用户发送了节日祝贺邮件", + "body"=>"在 ".time()." 为用户发送了节日祝贺邮件 " + ); + include_once("message.php"); + message::post($this->db,0,-1,$msg['title'],$msg['body']); + } + + $sql = "SELECT * FROM users + ORDER BY id DESC + LIMIT $step + OFFSET $start"; + + $sth = $this->db->query($sql); + $rows = $sth->fetchAll(); + + $result = array(); + $sended = 0; + + foreach($rows as $k=>$v) + { + $replace_data = array( + 'username' => $v['username'], + 'uid' => $v['id'], + 'lastlogin'=> date("Y-m-d",strtotime($v['ts_last_login'])), + ); + + $patterns = array(); + $replacements = array(); + foreach($replace_data as $k=>$v) + { + $patterns[]='/{'.$k.'}/i'; + $replacements[]=$v; + } + ksort($patterns); + ksort($replacements); + $send_body = preg_replace($patterns, $replacements, $body); + $send_subject = preg_replace($patterns, $replacements, $title); + + + /* + $mail=new WestdcMailer($this->view->config->smtp); + $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); + $mail->setBodyText($send_body); + $mail->setSubject($send_subject); + @$mail->addTo($v['email']); + if(@$mail->send()) + { + $sended ++; + $status = "成功"; + }else{ + $status = "失败"; + } + */ + + $sended ++; + /* + 调试时前台循环输出result + $result[$v['id']] = array( + 'username'=>$v['username'], + 'email'=>$v['email'], + 'send_body'=>$send_body, + 'send_subject'=>$send_subject + ); + */ + + + } + + $percent = round( ( $start / $total ) * 100 ,1); + + if($percent > 100) + { + $percent = 100; + } + $page ++; + + $data = array( + 'now'=>$start, + 'total'=>$total, + 'percent'=>$percent, + 'page'=>$page, + 'sended'=>$sended, + 'url'=> "/admin/user/sendmail/ac/holidaymail?now=".$start."&page=".$page."&title=".$title."&body=".urlencode($body), + 'content'=>$body, + 'title'=>$title, + 'status'=>1, + 'result'=>$result //用于调试 + ); + + if(!empty($stop)) + { + $data['stop'] = $stop; + $data['status'] = 0; + } + + $this->jsonexit($data); + return true; + } + + }//sendemailAction() + + + + public function jsonexit($data){ + $this->getResponse()->setHeader('Content-Type', 'application/json')->appendBody(json_encode($data,JSON_NUMERIC_CHECK)); + return true; + } +} + diff --git a/application/admin/views/scripts/data/left.phtml b/application/admin/views/scripts/data/left.phtml index 37283f40..8ec3a7f9 100644 --- a/application/admin/views/scripts/data/left.phtml +++ b/application/admin/views/scripts/data/left.phtml @@ -1,11 +1,14 @@ - \ No newline at end of file +
+ +
\ No newline at end of file diff --git a/application/admin/views/scripts/data/md.phtml b/application/admin/views/scripts/data/md.phtml index 128427a2..e437e616 100644 --- a/application/admin/views/scripts/data/md.phtml +++ b/application/admin/views/scripts/data/md.phtml @@ -1,85 +1,92 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb('数据管理'); - $this->breadcrumb('元数据管理'); - $this->breadcrumb()->setSeparator(' > '); - $this->theme->AppendPlus($this,'colorbox'); -?> -
-partial('data/left.phtml'); ?> -
-
-msg or $this->messages) :?> -
-msg) : ?> -

msg; ?>

-messages): foreach($this->messages as $msg): ?> -

- -
- - -
元数据管理
- - - -下载全部xml元数据 -paginator)): ?> -
- -
- -paginator; ?> -
- \ No newline at end of file diff --git a/application/admin/views/scripts/data/visual.phtml b/application/admin/views/scripts/data/visual.phtml index ad30c23d..caccb88b 100644 --- a/application/admin/views/scripts/data/visual.phtml +++ b/application/admin/views/scripts/data/visual.phtml @@ -1,20 +1,39 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb('数据管理'); - $this->breadcrumb('同步GEONETWORK元数据'); - $this->breadcrumb()->setSeparator(' > '); -?> -
-
- partial('data/left.phtml'); ?> -
- -
- -
-
+headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('数据管理'); + $this->breadcrumb('同步GEONETWORK元数据'); + $this->breadcrumb()->setSeparator(' > '); +?> +
+
+ partial('data/left.phtml'); ?> +
+ +
+ paginator)): ?> +
+
    + paginator as $item): ?> +
  • +

    +

    大小:M,创建时间:

    + +

    数据贡献者:

    + +

    +

    + 操作: + 编辑可视化要素 +

    +
  • + +
+
+ + paginator; ?> +
+
diff --git a/application/admin/views/scripts/down/data.phtml b/application/admin/views/scripts/down/data.phtml index 49f952d7..1b8571bd 100755 --- a/application/admin/views/scripts/down/data.phtml +++ b/application/admin/views/scripts/down/data.phtml @@ -1,62 +1,68 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); - $this->breadcrumb('首页'); - $this->breadcrumb('后台管理首页'); - $this->breadcrumb('申请管理'); - $this->breadcrumb('在线下载记录'); - $this->breadcrumb()->setSeparator(' > '); - $this->headScript()->appendFile('/js/prototype.js'); -?> - -
-partial('down/left.phtml'); ?> -
-
-msg or $this->messages) :?> -
-msg) : ?> -

msg; ?>

-messages): foreach($this->messages as $msg): ?> -

- -
- - -
title)) echo $this->title;?>共 count;?> 数据下载记录
- - - - - - - - - -paginator)): ?> - -paginator as $item): ?> - - - - - - - - -
数据下载次数操作
-'>详细 -邮件通知 -
- +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台管理首页'); + $this->breadcrumb('申请管理'); + $this->breadcrumb('在线下载记录'); + $this->breadcrumb()->setSeparator(' > '); + $this->headScript()->appendFile('/js/prototype.js'); +?> +
+
+ partial('down/left.phtml'); ?> +
+
+ +

title)) echo $this->title;?>共 count;?> 数据下载记录

+
+ + msg or $this->messages) :?> +
+ msg) : ?> +

msg; ?>

+ messages): foreach($this->messages as $msg): ?> +

+ +
+ + +
+
+ +
+
+ + + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + + +
数据下载次数操作
+ '>详细 + 邮件通知 +
+ +
\ No newline at end of file diff --git a/application/admin/views/scripts/down/index.phtml b/application/admin/views/scripts/down/index.phtml index aaae3534..62349970 100644 --- a/application/admin/views/scripts/down/index.phtml +++ b/application/admin/views/scripts/down/index.phtml @@ -2,15 +2,16 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); $this->breadcrumb('首页'); $this->breadcrumb('后台首页'); $this->breadcrumb('申请管理'); $this->breadcrumb()->setSeparator(' > '); ?> -
-partial('down/left.phtml'); ?> -
-
- +
+
+ partial('down/left.phtml'); ?> +
+
+ +
\ No newline at end of file diff --git a/application/admin/views/scripts/down/left.phtml b/application/admin/views/scripts/down/left.phtml index 292331de..b35a8918 100644 --- a/application/admin/views/scripts/down/left.phtml +++ b/application/admin/views/scripts/down/left.phtml @@ -1,8 +1,11 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/application/admin/views/scripts/down/offline.phtml b/application/admin/views/scripts/down/offline.phtml index c4dcb6d7..0cd0fd4b 100644 --- a/application/admin/views/scripts/down/offline.phtml +++ b/application/admin/views/scripts/down/offline.phtml @@ -1,193 +1,194 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb('申请管理'); - $this->Theme->AppendPlus($this,'colorbox'); - $this->Theme->AppendPlus($this,'uploadify'); - $this->breadcrumb('离线数据申请管理'); - $this->breadcrumb()->setSeparator(' > '); -?> - -
-
- partial('down/left.phtml'); ?> -
-
- msg or $this->messages) :?> -
- msg) : ?> -

msg; ?>

- messages): foreach($this->messages as $msg): ?> -

- -
- - -

离线数据服务记录

- - -
-
- - - - -
-
-paginator)): ?> - - - - - - - - - - - - - - - paginator as $item): ?> - - - - - - - - - - - - -
姓名单位地址邮编用途数据清单申请时间操作
- page; ?>">编辑 | - 删除 | - PDF | - 详细 | - 重新通过 | - 上传签字申请表 - - | 查看签字申请表 - -
- - -
-
- - - +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('申请管理'); + $this->Theme->AppendPlus($this,'colorbox'); + $this->Theme->AppendPlus($this,'uploadify'); + $this->breadcrumb('离线数据申请管理'); + $this->breadcrumb()->setSeparator(' > '); +?> + +
+
+ partial('down/left.phtml'); ?> +
+
+ +

离线数据服务记录

+
+ + msg or $this->messages) :?> +
+ msg) : ?> +

msg; ?>

+ messages): foreach($this->messages as $msg): ?> +

+ +
+ + +
+
+ + + + +
+
+paginator)): ?> + + + + + + + + + + + + + + + paginator as $item): ?> + + + + + + + + + + + + +
姓名单位地址邮编用途数据清单申请时间操作
+ page; ?>">编辑 | + 删除 | + PDF | + 详细 | + 重新通过 | + 上传签字申请表 + + | 查看签字申请表 + +
+ + +
+
+ + + diff --git a/application/admin/views/scripts/down/offlineapp.phtml b/application/admin/views/scripts/down/offlineapp.phtml index a0ac93ea..aa774690 100644 --- a/application/admin/views/scripts/down/offlineapp.phtml +++ b/application/admin/views/scripts/down/offlineapp.phtml @@ -1,199 +1,200 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb('申请管理'); - $this->Theme->AppendPlus($this,'colorbox'); - $this->Theme->AppendPlus($this,'uploadify'); - $this->breadcrumb('离线数据申请管理'); - $this->breadcrumb()->setSeparator(' > '); -?> -
-
- partial('down/left.phtml'); ?> -
-
- msg or $this->messages) :?> -
- msg) : ?> -

msg; ?>

- messages): foreach($this->messages as $msg): ?> -

- -
- - -

离线数据申请管理

- -
- - -
-
- - - - -
-
-
- -
- paginator)): - echo '
-
-
- - +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('申请管理'); + $this->Theme->AppendPlus($this,'colorbox'); + $this->Theme->AppendPlus($this,'uploadify'); + $this->breadcrumb('离线数据申请管理'); + $this->breadcrumb()->setSeparator(' > '); +?> +
+
+ partial('down/left.phtml'); ?> +
+
+

离线数据申请管理

+
+ + msg or $this->messages) :?> +
+ msg) : ?> +

msg; ?>

+ messages): foreach($this->messages as $msg): ?> +

+ +
+ + +
+ + +
+
+ + + + +
+
+
+ +
+ paginator)): + echo '
+
+
+ + diff --git a/application/admin/views/scripts/down/online.phtml b/application/admin/views/scripts/down/online.phtml index 2bf31ae0..0d0ac5b6 100644 --- a/application/admin/views/scripts/down/online.phtml +++ b/application/admin/views/scripts/down/online.phtml @@ -2,69 +2,71 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); $this->breadcrumb('首页'); $this->breadcrumb('后台首页'); $this->breadcrumb('申请管理'); $this->breadcrumb('在线数据下载记录'); $this->breadcrumb()->setSeparator(' > '); ?> -
-partial('down/left.phtml'); ?> -
-msg or $this->messages) :?> -
-msg) : ?> -

msg; ?>

-messages): foreach($this->messages as $msg): ?> -

- -
- - - -
- -
title)) echo $this->title;?>共有 count;?> 条在线下载记录
- - - - - - - - - - - - - - -paginator)): ?> - -paginator as $item): ?> - - - - - - - - - - - -
姓名单位数据用途下载时间操作
-'>详细 -/' onclick="return confirm('确定将此记录删除?')">删除 -
- +
+
+ partial('down/left.phtml'); ?> +
+ +
+ +

title)) echo $this->title;?>共有 count;?> 条在线下载记录

+
+ + msg or $this->messages) :?> +
+ msg) : ?> +

msg; ?>

+ messages): foreach($this->messages as $msg): ?> +

+ +
+ + + + + + + + + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + + + + + +
姓名单位数据用途下载时间操作
+ '>详细 + /' onclick="return confirm('确定将此记录删除?')">删除 +
+ +
\ No newline at end of file diff --git a/application/admin/views/scripts/down/user.phtml b/application/admin/views/scripts/down/user.phtml index 746875c5..48f4fc90 100755 --- a/application/admin/views/scripts/down/user.phtml +++ b/application/admin/views/scripts/down/user.phtml @@ -2,7 +2,6 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); $this->breadcrumb('首页'); $this->breadcrumb('后台管理首页'); $this->breadcrumb('申请管理'); @@ -10,53 +9,59 @@ $this->breadcrumb()->setSeparator(' > '); $this->headScript()->appendFile('/js/prototype.js'); ?> -
-partial('down/left.phtml'); ?> -
-
-msg or $this->messages) :?> -
-msg) : ?> -

msg; ?>

-messages): foreach($this->messages as $msg): ?> -

- -
- - -
title)) echo $this->title;?>共 count;?> 数据下载记录
- - - - - - - - - - -paginator)): ?> - -paginator as $item): ?> - - - - - - - - - -
姓名单位下载次数操作
-'>详细 -
- +
+
+ partial('down/left.phtml'); ?> +
+
+ +

title)) echo $this->title;?>共 count;?> 数据下载记录

+
+ + msg or $this->messages) :?> +
+ msg) : ?> +

msg; ?>

+ messages): foreach($this->messages as $msg): ?> +

+ +
+ + +
+
+ +
+
+ + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + + + +
姓名单位下载次数操作
+ '>详细 +
+ +
\ No newline at end of file diff --git a/application/admin/views/scripts/index/index.phtml b/application/admin/views/scripts/index/index.phtml index 079ab866..6ab30e67 100755 --- a/application/admin/views/scripts/index/index.phtml +++ b/application/admin/views/scripts/index/index.phtml @@ -1,28 +1,39 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); - $this->headLink()->appendStylesheet('/static/css/jquery.jgrowl.css'); - $this->headScript()->appendFile('/js/jquery-1.7.min.js'); - $this->headScript()->appendFile('/static/js/jquery.jgrowl_minimized.js'); - $this->breadcrumb('首页'); - $this->breadcrumb('后台管理首页'); - $this->breadcrumb()->setSeparator(' > '); -?> -
-partial('data/left.phtml'); ?> -partial('down/left.phtml'); ?> -partial('user/left.phtml'); ?> -partial('review/left.phtml'); ?> -partial('news/left.phtml'); ?> -partial('stat/left.phtml'); ?> +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headLink()->appendStylesheet('/static/css/jquery.jgrowl.css'); + $this->headScript()->appendFile('/js/jquery-1.7.min.js'); + $this->headScript()->appendFile('/static/js/jquery.jgrowl_minimized.js'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台管理首页'); + $this->breadcrumb()->setSeparator(' > '); +?> +
+
+ partial('data/left.phtml'); ?> +
+
+ partial('down/left.phtml'); ?> +
+
+ partial('user/left.phtml'); ?> +
+
+ partial('review/left.phtml'); ?> +
+
+ partial('news/left.phtml'); ?> +
+
+ partial('stat/left.phtml'); ?> +
- \ No newline at end of file diff --git a/application/admin/views/scripts/news/index.phtml b/application/admin/views/scripts/news/index.phtml index 147fcf0f..8d9c8a49 100644 --- a/application/admin/views/scripts/news/index.phtml +++ b/application/admin/views/scripts/news/index.phtml @@ -1,49 +1,41 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->headScript()->appendFile('/js/jquery-1.7.min.js'); - $this->headLink()->appendStylesheet('/css/admin.css'); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb('新闻中心'); -?> - -
-partial('news/left.phtml'); ?> -
-
-msg or $this->messages) :?> -
-msg) : ?> -

msg; ?>

-messages): foreach($this->messages as $msg): ?> -

- -
- - -

统计

-
-
    -
  • totle['c'];?> 条档案
  • -
  • 栏目 typec['c'];?> 个
  • -
-
- \ No newline at end of file diff --git a/application/admin/views/scripts/news/left.phtml b/application/admin/views/scripts/news/left.phtml index e6664d9d..ccac1fcb 100644 --- a/application/admin/views/scripts/news/left.phtml +++ b/application/admin/views/scripts/news/left.phtml @@ -1,6 +1,9 @@ - \ No newline at end of file +
+ +
\ No newline at end of file diff --git a/application/admin/views/scripts/news/newslist.phtml b/application/admin/views/scripts/news/newslist.phtml index 8a6ae07c..aed1d91c 100644 --- a/application/admin/views/scripts/news/newslist.phtml +++ b/application/admin/views/scripts/news/newslist.phtml @@ -1,132 +1,140 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); - $this->headScript()->appendFile('/js/jquery.colorbox-min.js'); - $this->headLink()->appendStylesheet('/css/author.css'); - $this->headLink()->appendStylesheet('/css/colorbox.css'); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb('新闻中心'); - $this->breadcrumb('新闻列表'); -?> - - -
-partial('news/left.phtml'); ?> -
-
-msg or $this->messages) :?> -
-msg) : ?> -

msg; ?>

-messages): foreach($this->messages as $msg): ?> -

- -
- -
- -  -所有新闻列表 -
- - - - - - - - - - - paginator)) - { - $list = ""; - foreach ($this->paginator as $v) - { - $list .= ' - - - - - - - '; - } - echo $list; - } - else - { - echo ' - - '; - } - ?> - - -
新闻标题栏目状态新闻管理
- '.$v['title'].' - - '.$v['type_title'].' - '; - if($v['ts_published']0) - { - $list.="已发布"; - } - if($v['ts_published']>time() and $v['is_pub']>0) - { - $list.= date('Y-m-d H:i',$v['ts_published']) . '发布'; - } - if($v['is_pub']==0) - { - $list.="草稿"; - } - if($v['is_pub']<0) - { - $list.="未发布"; - } - $list .= ' - 浏览 - 编辑 - 删除
暂无数据
- -
- +
+
+ partial('news/left.phtml'); ?> +
+ +
+ +

新闻管理

+
+ + msg or $this->messages) :?> +
+ msg) : ?> +

msg; ?>

+ messages): foreach($this->messages as $msg): ?> +

+ +
+ + +
+ + +   + 所有新闻列表 +
+ + + + + + + + + + + paginator)) + { + $list = ""; + foreach ($this->paginator as $v) + { + $list .= ' + + + + + + + '; + } + echo $list; + } + else + { + echo ' + + '; + } + ?> + + +
新闻标题栏目状态新闻管理
+ '.$v['title'].' + + '.$v['type_title'].' + '; + if($v['ts_published']0) + { + $list.="已发布"; + } + if($v['ts_published']>time() and $v['is_pub']>0) + { + $list.= date('Y-m-d H:i',$v['ts_published']) . '发布'; + } + if($v['is_pub']==0) + { + $list.="草稿"; + } + if($v['is_pub']<0) + { + $list.="未发布"; + } + $list .= ' + 浏览 + 编辑 + 删除
暂无数据
+ +
+
+ \ No newline at end of file diff --git a/application/admin/views/scripts/review/index.phtml b/application/admin/views/scripts/review/index.phtml index e960af89..d0bf5e93 100644 --- a/application/admin/views/scripts/review/index.phtml +++ b/application/admin/views/scripts/review/index.phtml @@ -1,62 +1,65 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb('元数据评审'); - $this->breadcrumb()->setSeparator(' > '); -?> -
-partial('review/left.phtml'); ?> -
-
-msg or $this->messages) :?> -
-msg) : ?> -

msg; ?>

-messages): foreach($this->messages as $msg): ?> -

- -
- - - 最近十条元数据 - - - - - - - queue)): ?> - - queue as $item): ?> - - - - - - - - -
元数据标题管理员状态
-
- 我管理的最近十条元数据 - - - - - - queue)): ?> - - queue as $item): ?> - - - - - - - -
元数据标题状态
+headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('元数据评审'); + $this->breadcrumb()->setSeparator(' > '); +?> +
+
+ partial('review/left.phtml'); ?> +
+
+ msg or $this->messages) :?> +
+ msg) : ?> +

msg; ?>

+ messages): foreach($this->messages as $msg): ?> +

+ +
+ + +

最近十条元数据

+
+ + + + + + + queue)): ?> + + queue as $item): ?> + + + + + + + + +
元数据标题管理员状态
+
+

我管理的最近十条元数据

+
+ + + + + + queue)): ?> + + queue as $item): ?> + + + + + + + +
元数据标题状态
+
\ No newline at end of file diff --git a/application/admin/views/scripts/review/left.phtml b/application/admin/views/scripts/review/left.phtml index f88b3ff1..3ca4c06f 100644 --- a/application/admin/views/scripts/review/left.phtml +++ b/application/admin/views/scripts/review/left.phtml @@ -1,12 +1,15 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/application/admin/views/scripts/stat/index.phtml b/application/admin/views/scripts/stat/index.phtml index 5d57a7b3..775d1f03 100644 --- a/application/admin/views/scripts/stat/index.phtml +++ b/application/admin/views/scripts/stat/index.phtml @@ -1,76 +1,81 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb()->setSeparator(' > '); - $this->headScript()->appendFile('/js/jquery-1.6.4.min.js'); - $this->headScript()->appendFile('/js/jquery.masonry.min.js'); -?> -
-partial('stat/left.phtml'); ?> -
-
-
-
概况
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
用户总数:stat['alluser']; ?>人
元数据条数:stat['alldata']; ?>条
在线数据下载数:stat['onlinedown']; ?>条
离线数据下载数:stat['offlinedown']; ?>条
已通过的离线申请:stat['offlinepass']; ?>次
未完成的离线申请:stat['offlineunfinished']; ?>次
被拒绝的离线数据:stat['offlinedenied']; ?>条
有记录的在线下载数:stat['onlineapp']; ?>次
+headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb()->setSeparator(' > '); + $this->headScript()->appendFile('/js/jquery-1.6.4.min.js'); + $this->headScript()->appendFile('/js/jquery.masonry.min.js'); +?> +
+
+ partial('stat/left.phtml'); ?>
- -
-
数据下载量概况
- - - - - - - - - - - - - - - - - -
单位:GB
总下载数据量allsize['num'],2);?>
离线下载数据量offlinesize['num'],2);?>
在线下载数据量onlinesize['num'],2);?>
+
+
+
+

概况

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
用户总数:stat['alluser']; ?>人
元数据条数:stat['alldata']; ?>条
在线数据下载数:stat['onlinedown']; ?>条
离线数据下载数:stat['offlinedown']; ?>条
已通过的离线申请:stat['offlinepass']; ?>次
未完成的离线申请:stat['offlineunfinished']; ?>次
被拒绝的离线数据:stat['offlinedenied']; ?>条
有记录的在线下载数:stat['onlineapp']; ?>次
+
+ +
+

数据下载量概况

+
+ + + + + + + + + + + + + + + + + +
单位:GB
总下载数据量allsize['num'],2);?>
离线下载数据量offlinesize['num'],2);?>
在线下载数据量onlinesize['num'],2);?>
+
+
- -
+
diff --git a/application/admin/views/scripts/stat/left.phtml b/application/admin/views/scripts/stat/left.phtml index 3deab535..a99db3c1 100644 --- a/application/admin/views/scripts/stat/left.phtml +++ b/application/admin/views/scripts/stat/left.phtml @@ -1,7 +1,10 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/application/admin/views/scripts/user/adminlist.phtml b/application/admin/views/scripts/user/adminlist.phtml index e2ca9439..7f0a58fc 100755 --- a/application/admin/views/scripts/user/adminlist.phtml +++ b/application/admin/views/scripts/user/adminlist.phtml @@ -1,46 +1,48 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb('用户管理'); - $this->breadcrumb()->setSeparator(' > '); -?> -
-partial('user/left.phtml'); ?> -
- -
-
管理员列表
- - - - - - - - - - - -paginator)): ?> - -paginator as $item): ?> - - - - - - - - - - - -
用户名电子邮箱用户类型真实姓名电话操作
-'>查看详细 -
- +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('用户管理'); + $this->breadcrumb()->setSeparator(' > '); +?> +
+
+ partial('user/left.phtml'); ?> +
+ +
+

管理员列表

+
+ + + + + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + + + + + +
用户名电子邮箱用户类型真实姓名电话操作
+ '>查看详细 +
+ +
\ No newline at end of file diff --git a/application/admin/views/scripts/user/index.phtml b/application/admin/views/scripts/user/index.phtml index bd8d7911..22de2dcc 100755 --- a/application/admin/views/scripts/user/index.phtml +++ b/application/admin/views/scripts/user/index.phtml @@ -1,43 +1,43 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->breadcrumb('首页'); - $this->breadcrumb('后台管理首页'); - $this->breadcrumb()->setSeparator(' > '); -?> -
-
- partial('user/left.phtml'); ?> -
- -
-

用户总数: su['total'];?>,其中管理员: suadmin['total'];?>

-
- -
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- - -
-
-
+headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台管理首页'); + $this->breadcrumb()->setSeparator(' > '); +?> +
+
+ partial('user/left.phtml'); ?> +
+ +
+

用户总数: su['total'];?>,其中管理员: suadmin['total'];?>

+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+
+
\ No newline at end of file diff --git a/application/admin/views/scripts/user/left.phtml b/application/admin/views/scripts/user/left.phtml index 10c088a7..359d795f 100755 --- a/application/admin/views/scripts/user/left.phtml +++ b/application/admin/views/scripts/user/left.phtml @@ -1,6 +1,9 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/application/admin/views/scripts/user/list.phtml b/application/admin/views/scripts/user/list.phtml index d53be7ed..9bbe056f 100755 --- a/application/admin/views/scripts/user/list.phtml +++ b/application/admin/views/scripts/user/list.phtml @@ -1,72 +1,72 @@ -headTitle($this->config->title->site); - $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb('用户管理'); - $this->breadcrumb()->setSeparator(' > '); -?> -
-
- partial('user/left.phtml'); ?> -
- -
-

用户列表

-
- msg or $this->messages) :?> -
- - msg) : ?> - msg; ?> - messages): foreach($this->messages as $msg): ?> - - -
- - - - -
- - - - - - - - - - - - paginator)): ?> - - paginator as $item): ?> - - - - - - - - - - - -
用户名电子邮箱用户组单位真实姓名操作
- '>查看详细 -
- -
+headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('用户管理'); + $this->breadcrumb()->setSeparator(' > '); +?> +
+
+ partial('user/left.phtml'); ?> +
+ +
+

用户列表

+
+ msg or $this->messages) :?> +
+ + msg) : ?> + msg; ?> + messages): foreach($this->messages as $msg): ?> + + +
+ + + + +
+ + + + + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + + + + + +
用户名电子邮箱用户组单位真实姓名操作
+ '>查看详细 +
+ +
\ No newline at end of file