2012-06-11 03:26:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class OfflinePdfForm extends Zend_Form
|
|
|
|
{
|
|
|
|
public function __construct($options = null)
|
|
|
|
{
|
|
|
|
parent::__construct($options);
|
|
|
|
$this->setName('OfflinePdf');
|
2013-04-08 08:43:11 +00:00
|
|
|
$this->setAttrib('class','form-horizontal');
|
2012-06-11 03:26:41 +00:00
|
|
|
|
|
|
|
$email=new Zend_Form_Element_Text('email');
|
|
|
|
$email->setLabel('E-Mail')
|
|
|
|
->addFilter('StringTrim')
|
|
|
|
->addValidator('NotEmpty')
|
|
|
|
->setRequired(true)
|
|
|
|
->addValidator('EmailAddress');
|
|
|
|
|
|
|
|
$realname=new Zend_Form_Element_Text('realname');
|
|
|
|
$realname->setLabel('真实姓名')->setRequired(true);
|
|
|
|
|
|
|
|
$phone=new Zend_Form_Element_Text('phone');
|
|
|
|
$phone->setLabel('电话')->setRequired(true);
|
|
|
|
|
|
|
|
$unit=new Zend_Form_Element_Text('unit');
|
|
|
|
$unit->setLabel('单位')->setRequired(true);
|
|
|
|
|
|
|
|
$postcode=new Zend_Form_Element_Text('postcode');
|
|
|
|
$postcode->setLabel('邮编')->setRequired(true);
|
|
|
|
|
|
|
|
$address=new Zend_Form_Element_Text('address');
|
|
|
|
$address->setLabel('联系地址')->setRequired(true);
|
|
|
|
|
2012-06-11 11:48:54 +00:00
|
|
|
$project_id=new Zend_Form_Element_Text('project_id');
|
2012-06-11 03:26:41 +00:00
|
|
|
$project_id->setLabel('项目编号')->setRequired(true);
|
2013-06-06 04:35:20 +00:00
|
|
|
|
2012-06-11 11:48:54 +00:00
|
|
|
$project_type=new Zend_Form_Element_Select('project_type');
|
2012-06-11 03:26:41 +00:00
|
|
|
$project_type->setLabel('项目类型')->setRequired(true);
|
2013-06-06 04:35:20 +00:00
|
|
|
$project_type->addMultiOption("", "请选择项目类型");
|
2012-06-11 03:26:41 +00:00
|
|
|
$project_type->addMultiOption("国家973计划项目课题", "国家973计划项目课题");
|
|
|
|
$project_type->addMultiOption("国家863计划课题", "国家863计划课题");
|
|
|
|
$project_type->addMultiOption("国家级科技支撑课题", "国家级科技支撑课题");
|
|
|
|
$project_type->addMultiOption("国家级科技重大专项", "国家级科技重大专项");
|
|
|
|
$project_type->addMultiOption("国家级国家重大工程", "国家级国家重大工程");
|
|
|
|
$project_type->addMultiOption("国家级国家自然科学基金", "国家级国家自然科学基金");
|
|
|
|
$project_type->addMultiOption("国际合作项目", "国际合作项目");
|
|
|
|
$project_type->addMultiOption("省部级项目", "省部级项目");
|
|
|
|
$project_type->addMultiOption("其他项目工程", "其他项目工程");
|
|
|
|
|
2013-06-06 04:35:20 +00:00
|
|
|
$project_title=new Zend_Form_Element_Text('project_title');
|
|
|
|
$project_title->setLabel('项目名称')->setRequired(true)->setAttrib('class','input-block-level');
|
|
|
|
|
2012-06-11 03:26:41 +00:00
|
|
|
$project=new Zend_Form_Element_Textarea('project');
|
2013-06-06 04:35:20 +00:00
|
|
|
$project->setLabel('用途<br/>(请详细描述使用目的)')->setRequired(true)->setAttrib('rows',3)->setAttrib('class','input-block-level');
|
2012-06-11 03:26:41 +00:00
|
|
|
|
|
|
|
$id = new Zend_Form_Element_Hidden('id');
|
|
|
|
|
|
|
|
$save = new Zend_Form_Element_Submit('save');
|
2013-04-08 08:43:11 +00:00
|
|
|
$save ->setAttrib('id', 'savebutton')
|
2013-06-06 04:35:20 +00:00
|
|
|
->setAttrib('class', 'btn')
|
|
|
|
->setLabel('预览PDF');
|
2013-04-08 08:43:11 +00:00
|
|
|
|
2012-06-11 03:26:41 +00:00
|
|
|
$submit = new Zend_Form_Element_Submit('submit');
|
2013-04-08 08:43:11 +00:00
|
|
|
$submit->setAttrib('id', 'submitbutton')
|
|
|
|
->setAttrib('class', 'btn btn-primary')
|
|
|
|
->setLabel('提交申请到数据中心');
|
|
|
|
|
|
|
|
|
2013-06-06 04:35:20 +00:00
|
|
|
$elements = array($realname,$email,$phone,$unit,$address,$postcode,$project_id,$project_type,$project_title,$project,$id,$save,$submit);
|
2013-04-08 08:43:11 +00:00
|
|
|
|
|
|
|
foreach($elements as $k=>$v)
|
|
|
|
{
|
|
|
|
$v->setDecorators(array(array('ViewScript', array(
|
|
|
|
'viewScript' => 'form_element.phtml',
|
|
|
|
'class' => 'control-group'
|
|
|
|
))));
|
|
|
|
}
|
|
|
|
|
|
|
|
$save->setDecorators(array(
|
|
|
|
'ViewHelper',
|
|
|
|
'Errors',
|
|
|
|
array('Description', array('escape' => false, 'tag' => '', 'placement' => 'append') ),
|
|
|
|
));
|
|
|
|
$submit->setDecorators(array(
|
|
|
|
'ViewHelper',
|
|
|
|
'Errors',
|
|
|
|
array('Description', array('escape' => false, 'tag' => '', 'placement' => 'append')
|
|
|
|
),
|
|
|
|
));
|
|
|
|
|
|
|
|
$this->addElements($elements);
|
2012-06-11 03:26:41 +00:00
|
|
|
}
|
2013-04-08 08:43:11 +00:00
|
|
|
|
|
|
|
|
2009-03-06 03:20:46 +00:00
|
|
|
}
|