增加离线申请项目信息支持,并把对应信息写入到pdf中,后台可查看对应的项目支持信息

This commit is contained in:
wlx 2012-06-11 11:48:54 +00:00
parent d6cfe5e054
commit 33a8c86f49
5 changed files with 16 additions and 14 deletions

View File

@ -45,7 +45,7 @@
<td><?= $item['unit']; ?></td>
<td><?= $item['address']; ?></td>
<td><?= $item['postcode']; ?></td>
<td><textarea readonly="readonly" style="width:300px;height:100px;border:none;font-size:12px;<?php if($autoindex%2 == 0) echo 'background:#CCCCCC;'; else echo 'background:#FFF;'; ?>"><?= $item['project']; ?></textarea></td>
<td><textarea readonly="readonly" style="width:300px;height:100px;border:none;font-size:12px;<?php if($autoindex%2 == 0) echo 'background:#CCCCCC;'; else echo 'background:#FFF;'; ?>"><?= $item['project'].'['.$item['project_title'].' | '.$item['project_type'].' | '.$item['project_id'].']'; ?></textarea></td>
<td><textarea readonly="readonly" style="width:300px;height:100px;border:none;font-size:12px;<?php if($autoindex%2 == 0) echo 'background:#CCCCCC;'; else echo 'background:#FFF;'; ?>"><?= $item['datalist']; ?></textarea></td>
<td><?= date('Y-m-d',strtotime($item['ts_created'])); ?></td>
<td>

View File

@ -52,7 +52,7 @@
<td><?= $item['unit']; ?></td>
<td><?= $item['address']; ?></td>
<td><?= $item['postcode']; ?></td>
<td><textarea readonly="readonly" style="width:300px;height:100px;border:none;font-size:12px;<?php if($autoindex%2 == 0) echo 'background:#CCCCCC;'; else echo 'background:#FFF;'; ?>"><?= $item['project']; ?></textarea></td>
<td><textarea readonly="readonly" style="width:300px;height:100px;border:none;font-size:12px;<?php if($autoindex%2 == 0) echo 'background:#CCCCCC;'; else echo 'background:#FFF;'; ?>"><?= $item['project'].'['.$item['project_title'].' | '.$item['project_type'].' | '.$item['project_id'].']'; ?></textarea></td>
<td><textarea readonly="readonly" style="width:300px;height:100px;border:none;font-size:12px;<?php if($autoindex%2 == 0) echo 'background:#CCCCCC;'; else echo 'background:#FFF;'; ?>"><?= $item['datalist']; ?></textarea></td>
<td><?= date('Y-m-d',strtotime($item['ts_created'])); ?></td>
<td>

View File

@ -1256,16 +1256,17 @@ class DataController extends Zend_Controller_Action
$row=$this->db->fetchRow($sql,array($userid));
if ($row) {
$sql="update offlineapp set username=?,email=?,phone=?,address=?,postcode=?,project=?,unit=?,datalist=?,ts_created=now(),project_type=?,project_id=?,project_title=? where id=?";
$this->db->query($sql,array($formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$formData['projecttype'],$formData['projectid'],$formData['projecttitle'],$row['id']));
$this->db->query($sql,array($formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$formData['project_type'],$formData['project_id'],$formData['project_title'],$row['id']));
} else {
$sql="insert into offlineapp (userid,username,email,phone,address,postcode,project,unit,datalist,project_type,project_id,project_title) values(?,?,?,?,?,?,?,?,?,?,?,?)";
$this->db->query($sql,array($userid,$formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$formData['projecttype'],$formData['projectid'],$formData['projecttitle']));
$this->db->query($sql,array($userid,$formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$formData['project_type'],$formData['project_id'],$formData['project_title']));
}
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
//生成PDF
$pdf = new ApplicantPDF();
$pdf->template=$this->view->config->offline->template;
$pdf->template=$this->view->config->offline->template;
$formData['project'].='['.$formData['project_title'].' | '.$formData['project_type'].' | '.$formData['project_id'].']';
$pdf->data = $formData;
$pdf->drawWestdc();
$pdf->addRef($rows);
@ -1280,8 +1281,9 @@ class DataController extends Zend_Controller_Action
//提交
//生成PDF
$pdf = new ApplicantPDF();
$pdf->template=$this->view->config->offline->template;
$pdf->data = $formData;
$pdf->template=$this->view->config->offline->template;
$pdf->data = $formData;
$pdf->data['project'].='['.$formData['project_title'].' | '.$formData['project_type'].' | '.$formData['project_id'].']';
$pdf->drawWestdc();
$pdf->addRef($rows);
$pdf->addSecurity($this->view->config->offline->security);
@ -1293,10 +1295,10 @@ class DataController extends Zend_Controller_Action
$row=$this->db->fetchRow($sql,array($userid));
if ($row) {
$sql="update offlineapp set username=?,email=?,phone=?,address=?,postcode=?,project=?,unit=?,datalist=?,ts_created=now(),pdflink=?,project_type=?,project_id=?,project_title=? where id=?";
$this->db->query($sql,array($formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$fn,$formData['projecttype'],$formData['projectid'],$formData['projecttitle'],$row['id']));
$this->db->query($sql,array($formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$fn,$formData['project_type'],$formData['project_id'],$formData['project_title'],$row['id']));
} else {
$sql="insert into offlineapp (userid,username,email,phone,address,postcode,project,unit,datalist,pdflink,project_type,project_id,project_title) values(?,?,?,?,?,?,?,?,?,?,?,?,?)";
$this->db->query($sql,array($userid,$formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$fn,$formData['projecttype'],$formData['projectid'],$formData['projecttitle']));
$this->db->query($sql,array($userid,$formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$fn,$formData['project_type'],$formData['project_id'],$formData['project_title']));
$sql="select id from offlineapp where userid=? and pdflink=?";
$row=$this->db->fetchRow($sql,array($userid,$fn));
}
@ -1323,7 +1325,7 @@ class DataController extends Zend_Controller_Action
}
}
} else {
$sql="select u.*,o.postcode,o.project_type as projecttype,o.project_id as projectid,o.project_title as projecttitle from users u left join offlineapp o on u.id=o.userid where u.id=?";
$sql="select u.* from users u left join offlineapp o on u.id=o.userid where u.id=?";
$row=$this->db->fetchRow($sql,array($userid));
/*$row=$ut->fetchRow('id='.$userid);
$formData['email']=$row->email;

View File

@ -20,7 +20,7 @@
</div>
<div id="data2">
<p> 为促进中国西部资源与生态环境科学研究,更好的为西部大开发服务,充分利用数据中心多年来的数据积累及国家自然科学基金委员会“中国西部环境与生态科学研究计划”、数字流域等的数据产出,
根据我国科学数据共享和基金项目数据管理的有关规定, 中科院寒区旱区环境与工程研究所(简称甲方)同意接收__________以下简称乙方的数据申请,并签订数据使用协议(<strong>其中用途部分,请填写您的项目名称、项目编号、项目类型以及使用目的如自然科学基金、863、973等以便能更快通过申请。</strong>
根据我国科学数据共享和基金项目数据管理的有关规定, 中科院寒区旱区环境与工程研究所(简称甲方)同意接收__________以下简称乙方的数据申请,并签订数据使用协议(<strong>其中用途部分,请填写您的详细使用目的;项目类型请从列表中选择,若无对应的项目支持,请选择其他项目工程;如项目无编号信息,则填写“无”;硕博论文请在用途中注明;详细准确的信息能使您更快通过申请。</strong>
</p>
<p style="color:red;"> 您必须点击 “提交申请到数据中心” 后西部数据中心才能开始受理您的数据申请!</p>
<h1>数据清单</h1>

View File

@ -30,13 +30,13 @@ class OfflinePdfForm extends Zend_Form
$address=new Zend_Form_Element_Text('address');
$address->setLabel('联系地址')->setRequired(true);
$project_id=new Zend_Form_Element_Text('projectid');
$project_id=new Zend_Form_Element_Text('project_id');
$project_id->setLabel('项目编号')->setRequired(true);
$project_title=new Zend_Form_Element_Text('projecttitle');
$project_title=new Zend_Form_Element_Text('project_title');
$project_title->setLabel('项目名称')->setRequired(true);
$project_type=new Zend_Form_Element_Select('projecttype');
$project_type=new Zend_Form_Element_Select('project_type');
$project_type->setLabel('项目类型')->setRequired(true);
$project_type->addMultiOption("国家973计划项目课题", "国家973计划项目课题");
$project_type->addMultiOption("国家863计划课题", "国家863计划课题");