merge sanjiangyuan-sub branch r4855 - r4867 into sjy-water
This commit is contained in:
commit
1a09f54d42
|
@ -1,117 +1,115 @@
|
||||||
<?php
|
<?php
|
||||||
use Westdc\Visual;
|
use Westdc\Visual;
|
||||||
use Westdc\Metadata;
|
use Westdc\Metadata;
|
||||||
use Helpers\View as view;
|
use Helpers\View as view;
|
||||||
|
|
||||||
class VisualController extends Zend_Controller_Action
|
class VisualController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
|
|
||||||
function preDispatch()
|
function preDispatch()
|
||||||
{
|
{
|
||||||
$this->view->config = Zend_Registry::get('config');
|
$this->view->config = Zend_Registry::get('config');
|
||||||
$this->db=Zend_Registry::get('db');
|
$this->db=Zend_Registry::get('db');
|
||||||
$this->view->nav = array(
|
$this->view->nav = array(
|
||||||
array('link'=>'/','title'=>'<i class="icon-home"></i>'),
|
array('link'=>'/','title'=>'<i class="icon-home"></i>'),
|
||||||
array('link'=>'/data','title'=>$this->view->config->title->data),
|
array('link'=>'/data','title'=>$this->view->config->title->data),
|
||||||
);
|
);
|
||||||
|
|
||||||
$auth = Zend_Auth::getInstance();
|
if(view::User() === false)
|
||||||
if($auth->hasIdentity())
|
{
|
||||||
{
|
view::Post($this,"请先登陆",'/account/login?href='.urlencode($_SERVER['REQUEST_URI']));
|
||||||
$user = $auth->getIdentity();
|
}
|
||||||
$this->uid = $user->id;
|
|
||||||
}else{
|
$this->uid = view::User('id');
|
||||||
$this->_redirect('/account/login?href=/visual');
|
}
|
||||||
}
|
|
||||||
}
|
function indexAction()
|
||||||
|
{
|
||||||
function indexAction()
|
$record_type = $this->_getParam("dataset");
|
||||||
{
|
|
||||||
$record_type = $this->_getParam("dataset");
|
if(empty($record_type))
|
||||||
|
return true;
|
||||||
if(empty($record_type))
|
|
||||||
return true;
|
$sc = Factory::Bootstrap($record_type);
|
||||||
|
}
|
||||||
$sc = Factory::Bootstrap($record_type);
|
|
||||||
}
|
|
||||||
|
//********************************************************
|
||||||
|
|
||||||
//********************************************************
|
/*
|
||||||
|
* dataAction() ajax获取数据
|
||||||
/*
|
*
|
||||||
* dataAction() ajax获取数据
|
* param string $ac //请求的数据类型
|
||||||
*
|
* param string $dt //请求的数据来源(气象,水文)
|
||||||
* param string $ac //请求的数据类型
|
*
|
||||||
* param string $dt //请求的数据来源(气象,水文)
|
* return view
|
||||||
*
|
*/
|
||||||
* return view
|
function dataAction()
|
||||||
*/
|
{
|
||||||
function dataAction()
|
$this->_helper->viewRenderer->setNoRender();
|
||||||
{
|
$this->_helper->layout->disableLayout();
|
||||||
$this->_helper->viewRenderer->setNoRender();
|
|
||||||
$this->_helper->layout->disableLayout();
|
$uuid = $this->_getParam("uuid");
|
||||||
|
$record_type = $this->_getParam("dataset");
|
||||||
$uuid = $this->_getParam("uuid");
|
$record_subset = $this->_getParam("subdataset");
|
||||||
$record_type = $this->_getParam("dataset");
|
|
||||||
$record_subset = $this->_getParam("subdataset");
|
if(empty($record_type))
|
||||||
|
return true;
|
||||||
if(empty($record_type))
|
|
||||||
return true;
|
$record = new Visual\Record($uuid,$record_subset);
|
||||||
|
//$record = Visual\Factory::Bootstrap($record_type);
|
||||||
$record = new Visual\Record($uuid,$record_subset);
|
|
||||||
//$record = Visual\Factory::Bootstrap($record_type);
|
if(!empty($record_subset))
|
||||||
|
{
|
||||||
if(!empty($record_subset))
|
$record->subset = $record_subset;
|
||||||
{
|
}
|
||||||
$record->subset = $record_subset;
|
|
||||||
}
|
$data = $record();
|
||||||
|
|
||||||
$data = $record();
|
$this->jsonexit($data);
|
||||||
|
return true;
|
||||||
$this->jsonexit($data);
|
|
||||||
return true;
|
}//dataAction() Ajax获取数据
|
||||||
|
|
||||||
}//dataAction() Ajax获取数据
|
//viewAction
|
||||||
|
public function viewAction()
|
||||||
//viewAction
|
{
|
||||||
public function viewAction()
|
$uuid = $this->_getParam('uuid');
|
||||||
{
|
|
||||||
$uuid = $this->_getParam('uuid');
|
if(empty($uuid) || \Helpers\Uuid::test($uuid) == false)
|
||||||
|
{
|
||||||
if(empty($uuid) || \Helpers\Uuid::test($uuid) == false)
|
view::Post($this,"参数错误",-1);
|
||||||
{
|
return;
|
||||||
view::Post($this,"参数错误",-1);
|
}
|
||||||
return;
|
|
||||||
}
|
$visual = new Visual\Visual;
|
||||||
|
|
||||||
$visual = new Visual\Visual;
|
$this->view->data = $visual->getVisualVars($uuid);
|
||||||
|
|
||||||
$this->view->data = $visual->getVisualVars($uuid);
|
if(empty($this->view->data))
|
||||||
|
{
|
||||||
if(empty($this->view->data))
|
view::Post($this,"此数据不支持可视化",-1);
|
||||||
{
|
return;
|
||||||
view::Post($this,"此数据不支持可视化",-1);
|
}
|
||||||
return;
|
|
||||||
}
|
$metadata = new Metadata\Metadata;
|
||||||
|
|
||||||
$metadata = new Metadata\Metadata;
|
$this->view->info = $metadata->view($uuid);
|
||||||
|
|
||||||
$this->view->info = $metadata->view($uuid);
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
/*
|
||||||
|
* jsonexit() 退出并返回json数据
|
||||||
/*
|
*
|
||||||
* jsonexit() 退出并返回json数据
|
* param array $data 要返回的JSON数据,可以是任意数组
|
||||||
*
|
*
|
||||||
* param array $data 要返回的JSON数据,可以是任意数组
|
* return application/JSON
|
||||||
*
|
*/
|
||||||
* return application/JSON
|
public function jsonexit($data){
|
||||||
*/
|
$this->getResponse()->setHeader('Content-Type', 'application/json')->appendBody(json_encode($data,JSON_NUMERIC_CHECK));
|
||||||
public function jsonexit($data){
|
return true;
|
||||||
$this->getResponse()->setHeader('Content-Type', 'application/json')->appendBody(json_encode($data,JSON_NUMERIC_CHECK));
|
}//jsonexit() 退出并返回json数据
|
||||||
return true;
|
|
||||||
}//jsonexit() 退出并返回json数据
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -60,7 +60,7 @@
|
||||||
<h4>数据最近更新 <a href="/service/feed" target="_blank"><i class="icon-rss"></i></a></h4>
|
<h4>数据最近更新 <a href="/service/feed" target="_blank"><i class="icon-rss"></i></a></h4>
|
||||||
<ul class="unstyled">
|
<ul class="unstyled">
|
||||||
<?php foreach($this->metadata as $md) : ?>
|
<?php foreach($this->metadata as $md) : ?>
|
||||||
<li><a href="/data/<?php echo $md['uuid'];?>"><i class="icon-map-marker"> </i><?php echo $this->escape($md['title']);?></a><small class="pull-right">[<?= date('Y-m-d',strtotime($md['ts_created'])) ?>]</small></li>
|
<li><a href="/data/<?php echo $md['uuid'];?>"><i class="icon-map-marker"> </i><?php echo $this->escape($md['title']);?></a> <small>[<?= date('Y-m-d',strtotime($md['ts_created'])) ?>]</small></li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -25,7 +25,7 @@ class ApplicantPDF extends FPDI
|
||||||
$this->addPage();
|
$this->addPage();
|
||||||
$this->useTemplate($tplidx);
|
$this->useTemplate($tplidx);
|
||||||
$this->SetFont('ugb','',$this->fontsize);
|
$this->SetFont('ugb','',$this->fontsize);
|
||||||
$this->setXY(74,43);
|
$this->setXY(86,41.5);
|
||||||
$this->Write($this->fontsize,$this->data['realname']);
|
$this->Write($this->fontsize,$this->data['realname']);
|
||||||
$this->SetXY(34,55);
|
$this->SetXY(34,55);
|
||||||
$this->MultiCell (166, 4, str_replace(";","\n",$this->data['westdclist']));
|
$this->MultiCell (166, 4, str_replace(";","\n",$this->data['westdclist']));
|
||||||
|
@ -33,18 +33,18 @@ class ApplicantPDF extends FPDI
|
||||||
$this->MultiCell(166,4,trim($this->data['project']));
|
$this->MultiCell(166,4,trim($this->data['project']));
|
||||||
//$this->setXY(34,239);
|
//$this->setXY(34,239);
|
||||||
//$this->Write($this->fontsize,$this->data['realname']);
|
//$this->Write($this->fontsize,$this->data['realname']);
|
||||||
$this->setXY(32,223);
|
$this->setXY(32,222);
|
||||||
$this->Write($this->fontsize,$this->data['unit']);
|
$this->Write($this->fontsize,$this->data['unit']);
|
||||||
$this->setXY(112,223);
|
$this->setXY(112,222);
|
||||||
$this->Write($this->fontsize,$this->data['email']);
|
$this->Write($this->fontsize,$this->data['email']);
|
||||||
$this->setXY(174,223);
|
$this->setXY(174,222);
|
||||||
$this->Write($this->fontsize,$this->data['postcode']);
|
$this->Write($this->fontsize,$this->data['postcode']);
|
||||||
$this->setXY(32,230);
|
$this->setXY(32,228);
|
||||||
$this->Write($this->fontsize,$this->data['address']);
|
$this->Write($this->fontsize,$this->data['address']);
|
||||||
$this->setXY(112,230);
|
$this->setXY(112,228);
|
||||||
$this->Write($this->fontsize,$this->data['phone']);
|
$this->Write($this->fontsize,$this->data['phone']);
|
||||||
$t=date("Y-m-d");
|
$t=date("Y-m-d");
|
||||||
$this->setXY(174,230);
|
$this->setXY(174,228);
|
||||||
$this->Write($this->fontsize,$t);
|
$this->Write($this->fontsize,$t);
|
||||||
}
|
}
|
||||||
function drawHeihe()
|
function drawHeihe()
|
||||||
|
|
|
@ -312,17 +312,7 @@ class Order
|
||||||
public function pdfPrint($formData,$userid = 0,$save = false,$returnpdf = false)
|
public function pdfPrint($formData,$userid = 0,$save = false,$returnpdf = false)
|
||||||
{
|
{
|
||||||
$sql="SELECT m.title||'('||m.filesize::text||'MB)' as title FROM dataorder d
|
$sql="SELECT m.title||'('||m.filesize::text||'MB)' as title FROM dataorder d
|
||||||
RIGHT JOIN heihemetadata m ON d.uuid=m.uuid
|
RIGHT JOIN normalmetadata m ON d.uuid=m.uuid WHERE d.status=2 AND d.userid=?";
|
||||||
WHERE d.status=2 AND d.userid=?";
|
|
||||||
|
|
||||||
$list = $this->db->fetchAll($sql,array($userid));
|
|
||||||
|
|
||||||
foreach($list as $i=>$row){
|
|
||||||
@$formData['heihelist'].=($i+1).". ".$row['title'].";";
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql="SELECT m.title||'('||m.filesize::text||'MB)' as title FROM dataorder d
|
|
||||||
RIGHT JOIN normalmetadata m ON d.uuid=m.uuid WHERE d.uuid not in (select uuid from heihemetadata) AND d.status=2 AND d.userid=?";
|
|
||||||
$list = $this->db->fetchAll($sql,array($userid));
|
$list = $this->db->fetchAll($sql,array($userid));
|
||||||
|
|
||||||
foreach($list as $i=>$row){
|
foreach($list as $i=>$row){
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
<?php
|
|
||||||
//sync seekspace data
|
|
||||||
error_reporting(E_ALL|E_STRICT);
|
|
||||||
ini_set('display_errors', 1);
|
|
||||||
date_default_timezone_set('Asia/Shanghai');
|
|
||||||
|
|
||||||
// directory setup and class loading
|
|
||||||
set_include_path('.' . PATH_SEPARATOR . '../include/'
|
|
||||||
. PATH_SEPARATOR . '../application/models'
|
|
||||||
. PATH_SEPARATOR . '../application/default/controllers'
|
|
||||||
. PATH_SEPARATOR . get_include_path());
|
|
||||||
include "Zend/Loader.php";
|
|
||||||
Zend_Loader::registerAutoload();
|
|
||||||
$config = new Zend_Config_Ini('config.ini', 'general');
|
|
||||||
$db = Zend_Db::factory($config->db);
|
|
||||||
Zend_Db_Table::setDefaultAdapter($db);
|
|
||||||
$sql="select item_id,title from knl_article";
|
|
||||||
$rs=$db->fetchAll($sql);
|
|
||||||
foreach($rs as $r)
|
|
||||||
{
|
|
||||||
$sql="select item_id,place,keyword from knl_keyword where item_id=?";
|
|
||||||
$rs1=$db->fetchAll($sql,array($r['item_id']));
|
|
||||||
foreach($rs1 as $r1)
|
|
||||||
{
|
|
||||||
$sql="update knl_article set keywords[?]=? where item_id=?";
|
|
||||||
$db->query($sql,array($r1['place'],$r1['keyword'],$r1['item_id']));
|
|
||||||
}
|
|
||||||
$sql="select item_id,place,author from knl_author where item_id=?";
|
|
||||||
$rs1=$db->fetchAll($sql,array($r['item_id']));
|
|
||||||
foreach($rs1 as $r1)
|
|
||||||
{
|
|
||||||
$sql="update knl_article set authors[?]=? where item_id=?";
|
|
||||||
$db->query($sql,array($r1['place'],$r1['author'],$r1['item_id']));
|
|
||||||
}
|
|
||||||
print $r['title']."...\n";
|
|
||||||
}
|
|
||||||
?>
|
|
BIN
data/offline.pdf
BIN
data/offline.pdf
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue