• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Khcn_Api类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Khcn_Api的典型用法代码示例。如果您正苦于以下问题:PHP Khcn_Api类的具体用法?PHP Khcn_Api怎么用?PHP Khcn_Api使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Khcn_Api类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     $this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
     $this->addElement('Hidden', 'search', array('value' => 1));
     $tieu_de = new Zend_Form_Element_Text('tieu_de');
     $tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
     $cateOptions = Khcn_Api::_()->getDbTable('loai_thong_tin', 'default')->getListAssoc();
     $loai_thong_tin_id = new Zend_Form_Element_Select('loai_thong_tin_id');
     $loai_thong_tin_id->setLabel('Loại (*)')->addMultiOptions($cateOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
     $statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
     $trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
     $trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $noi_dung = new Zend_Form_Element_Textarea('noi_dung');
     $noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
     $noi_bat = new Zend_Form_Element_Select('noi_bat');
     $noi_bat->setLabel('Nổi Bật')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $photo = new Zend_Form_Element_File('photo');
     $photo->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/thong_tin')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $_SERVER['HTTP_REFERER'] . '"'));
     $this->addElements(array($loai_thong_tin_id, $tieu_de, $noi_dung, $trang_thai, $noi_bat, $photo, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
 }
开发者ID:nhochong,项目名称:sdcd,代码行数:28,代码来源:ThongTin.php


示例2: init

 public function init()
 {
     $this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
     $this->addElement('Hidden', 'search', array('value' => 1));
     $tieu_de = new Zend_Form_Element_Text('tieu_de');
     $tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
     $cateOptions = Khcn_Api::_()->getDbTable('loai_su_diep', 'default')->getListAssoc();
     $loai_su_diep_id = new Zend_Form_Element_Select('loai_su_diep_id');
     $loai_su_diep_id->setLabel('Loại (*)')->addMultiOptions($cateOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
     $statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
     $trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
     $trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $noi_dung = new Zend_Form_Element_Textarea('noi_dung');
     $noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
     $soundcloud_embed = new Zend_Form_Element_Text('soundcloud_embed');
     $soundcloud_embed->setLabel('SoundCloud')->setDescription('How to get SoundCloud embed code? <a href="http://help.soundcloud.com/customer/portal/articles/243751-how-can-i-put-my-track-or-playlist-on-my-site-or-blog-" target="_blank">Click here</a>')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'div', 'escape' => false, 'placement' => 'append')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
     $youtube_embed = new Zend_Form_Element_Text('youtube_embed');
     $youtube_embed->setLabel('Youtube')->setDescription('How to get Youtube embed code? <a href="https://support.google.com/youtube/answer/171780?hl=en" target="_blank">Click here</a>')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'div', 'escape' => false, 'placement' => 'append')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
     $noi_bat = new Zend_Form_Element_Select('noi_bat');
     $noi_bat->setLabel('Nổi Bật')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $photo = new Zend_Form_Element_File('photo');
     $photo->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/su_diep')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $_SERVER['HTTP_REFERER'] . '"'));
     $this->addElements(array($loai_su_diep_id, $tieu_de, $noi_dung, $soundcloud_embed, $youtube_embed, $noi_bat, $photo, $trang_thai, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
 }
开发者ID:nhochong,项目名称:sdcd,代码行数:32,代码来源:SuDiep.php


示例3: init

 public function init()
 {
     $this->setName('f2')->setAttrib('class', 'form_create_nhan_su');
     $ho_ten = new Zend_Form_Element_Text('ho_ten');
     $ho_ten->setLabel('Họ tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $chuc_vu = new Zend_Form_Element_Text('chuc_vu');
     $chuc_vu->setLabel('Chức vụ')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $website = new Zend_Form_Element_Text('website');
     $website->setLabel('Website')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $so_dien_thoai = new Zend_Form_Element_Text('so_dien_thoai');
     $so_dien_thoai->setLabel('Số điện thoại')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $file = new Zend_Form_Element_File('file');
     $file->setLabel('Ảnh cá nhân')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/nhan_su/')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $maxOrder = Khcn_Api::_()->getDbTable('nhan_su', 'default')->getMaxOrder();
     $order = new Zend_Form_Element_Text('order');
     $order->setLabel('Số thứ tự')->setValue($maxOrder)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input tinysmall-input');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'gioi-thieu', 'action' => 'nhan-su'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Không lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ho_ten, $chuc_vu, $email, $website, $so_dien_thoai, $file, $order, $submit, $cancel));
     $this->addDisplayGroup(array('submit', 'cancel'), 'submitbtn', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:28,代码来源:Create.php


示例4: init

 public function init()
 {
     $this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
     $this->addElement('Hidden', 'search', array('value' => 1));
     $tieu_de = new Zend_Form_Element_Text('tieu_de');
     $tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
     $cateOptions = Khcn_Api::_()->getDbTable('loai_audio', 'default')->getListAssoc();
     $loai_audio_id = new Zend_Form_Element_Select('loai_audio_id');
     $loai_audio_id->setLabel('Loại (*)')->addMultiOptions($cateOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
     $noi_dung = new Zend_Form_Element_Textarea('noi_dung');
     $noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
     $soundcloud_embed = new Zend_Form_Element_Text('soundcloud_embed');
     $soundcloud_embed->setLabel('Embed SoundCloud')->setDescription('How to get SoundCloud embed code? <a href="http://help.soundcloud.com/customer/portal/articles/243751-how-can-i-put-my-track-or-playlist-on-my-site-or-blog-" target="_blank">Click here</a>')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'div', 'escape' => false, 'placement' => 'append')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
     $statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
     $trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
     $trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $_SERVER['HTTP_REFERER'] . '"'));
     $this->addElements(array($tieu_de, $loai_audio_id, $noi_dung, $soundcloud_embed, $trang_thai, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
 }
开发者ID:nhochong,项目名称:sdcd,代码行数:26,代码来源:Audio.php


示例5: init

 public function init()
 {
     $this->setName('f2')->setMethod('post');
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 255))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input medium-input'));
     $statusOptions = array("multiOptions" => array(1 => 'Thuộc SGU', 0 => 'Liên kết trang mạng'));
     $is_sgu = new Zend_Form_Element_Radio('is_sgu', $statusOptions);
     $is_sgu->setRequired(true)->setLabel('Liên kết')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $url = new Zend_Form_Element_Text('url');
     $url->setLabel('Url (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 255))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $file = new Zend_Form_Element_File('file');
     $file->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/small/images/lien_ket')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $maxOrder = Khcn_Api::_()->getDbTable('lien_ket', 'default')->getMaxOrderItem();
     $order = new Zend_Form_Element_Text('order');
     $order->setLabel('Thứ tự *')->setValue($maxOrder->order + 1)->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input tinysmall-input'));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $Url = new Zend_View_Helper_Url();
     $link = $Url->url(array('module' => 'admin', 'controller' => 'lien-ket', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ten, $is_sgu, $url, $file, $order, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'lien_ket')), 'Form'));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:27,代码来源:LienKet.php


示例6: changePassAction

 public function changePassAction()
 {
     // Set up require's
     $this->_helper->requireUser();
     $viewer = Khcn_Api::_()->getViewer();
     // Can specifiy custom id
     $id = $this->_getParam('id', null);
     if (null === $id) {
         $user = $viewer;
     } else {
         $user = Khcn_Api::_()->getItem('default_nguoi_dung', $id);
     }
     $form = new Default_Form_ChangePass();
     $form->submit->setLabel('Lưu');
     $form->cancel->setLabel('Không lưu');
     $this->view->form = $form;
     if (!$this->getRequest()->isPost()) {
         return;
     }
     if (!$form->checkIsValid($this->getRequest()->getPost(), $user)) {
         return;
     }
     $values = $form->getValues();
     $mat_khau = $values['mat_khau1'];
     $user->mat_khau = md5($mat_khau);
     $user->save();
     return $this->_forward('thong-bao', 'index', 'default', array('messages' => array(Zend_Registry::get('Zend_Translate')->_('Thành công. Dữ liệu đã được cập nhật.'))));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:28,代码来源:NguoiDungController.php


示例7: isAllowed

 /**
  * Gets the specified permission for the context
  *
  * @param Core_Model_Item_Abstract|string $resource The resource type or object that is being accessed
  * @param Core_Model_Item_Abstract $role The item (user) performing the action
  * @param string $action The name of the action being performed
  * @return mixed 0/1 for allowed, or data for settings
  */
 public function isAllowed($resource, $role, $action = 'view')
 {
     if (null === $resource) {
         return false;
     }
     if (null === $role) {
         $viewer = Khcn_Api::_()->getViewer();
         if (null !== $viewer && $viewer->getIdentity()) {
             $role = $viewer;
         } else {
             $role = 'everyone';
         }
     }
     if (!is_string($action)) {
         throw new Khcn_Api_Exception('action must be a string');
     }
     // Iterate over each adapter and check permission
     $final = Default_Model_DbTable_Permissions::LEVEL_DISALLOW;
     $adapter = Khcn_Api::_()->getDbtable('permissions', 'default');
     $result = $adapter->isAllowed($resource, $role, $action);
     switch ($result) {
         // Unknown value, ignore, nonboolean
         case Default_Model_DbTable_Permissions::LEVEL_DISALLOW:
             return Default_Model_DbTable_Permissions::LEVEL_DISALLOW;
             break;
         case Default_Model_DbTable_Permissions::LEVEL_MODERATE:
             return Default_Model_DbTable_Permissions::LEVEL_ALLOW;
             break;
         case Default_Model_DbTable_Permissions::LEVEL_ALLOW:
             $final = Default_Model_DbTable_Permissions::LEVEL_ALLOW;
             break;
     }
     return $final;
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:42,代码来源:Authorization.php


示例8: getAvailableTypes

 public function getAvailableTypes()
 {
     if (null === $this->_types) {
         $this->_types = Khcn_Api::_()->getDbtable('search', 'default')->getAdapter()->query('SELECT DISTINCT `type` FROM `search`')->fetchAll(Zend_Db::FETCH_COLUMN);
     }
     return $this->_types;
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:7,代码来源:Search.php


示例9: gopYAction

 public function gopYAction()
 {
     // Set up require's
     $this->view->viewer = $viewer = Khcn_Api::_()->getViewer();
     if (!$this->_helper->requireUser()->isValid()) {
         return;
     }
     $table = Khcn_Api::_()->getDbTable('gop_y', 'default');
     $this->view->form = $form = new Default_Form_HopThu_GopY();
     if (!$this->getRequest()->isPost()) {
         return;
     }
     if (!$form->isValid($this->getRequest()->getPost())) {
         return;
     }
     $db = $table->getAdapter();
     $db->beginTransaction();
     try {
         $values = $form->getValues();
         $gop_y = $table->createRow();
         $gop_y->nguoi_dung_id = $viewer->getIdentity();
         $gop_y->loai_id = $values['loai_id'];
         $gop_y->ten = $values['ten'];
         $gop_y->mo_ta = $values['mo_ta'];
         $gop_y->ngay_tao = date('Y-m-d H:i:s');
         $gop_y->save();
         $db->commit();
         return $this->_forward('thong-bao', 'index', 'default', array('messages' => array(Zend_Registry::get('Zend_Translate')->_("Thành công. Cảm ơn bạn đã góp ý cho chúng tôi."))));
     } catch (Exception $e) {
         $db->rollBack();
         throw $e;
     }
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:33,代码来源:HopThuController.php


示例10: checkRequire

 public function checkRequire()
 {
     try {
         $subject = Khcn_Api::_()->default()->getSubject();
     } catch (Exception $e) {
         $subject = null;
     }
     $actionName = $this->getFrontController()->getRequest()->getActionName();
     $ret = true;
     if (!$subject instanceof Khcn_Model_Item_Abstract || !$subject->getIdentity()) {
         $ret = false;
     } else {
         if (null !== $this->_requiredType && $subject->getType() != $this->_requiredType) {
             $ret = false;
         } else {
             if (null !== ($requireType = $this->getActionRequireType($actionName)) && $subject->getType() != $requireType) {
                 $ret = false;
             }
         }
     }
     if (!$ret && APPLICATION_ENV == 'development' && Zend_Registry::isRegistered('Zend_Log') && ($log = Zend_Registry::get('Zend_Log')) instanceof Zend_Log) {
         $target = $this->getRequest()->getModuleName() . '.' . $this->getRequest()->getControllerName() . '.' . $this->getRequest()->getActionName();
         $log->log('Require class ' . get_class($this) . ' failed check for: ' . $target, Zend_Log::DEBUG);
     }
     return $ret;
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:26,代码来源:RequireSubject.php


示例11: errorAction

 public function errorAction()
 {
     $error = $this->_getParam('error_handler');
     $this->view->error_code = $error_code = Khcn_Api::getErrorCode(true);
     // Handle missing pages
     switch ($error->type) {
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
             return $this->_forward('notfound');
             break;
         default:
             break;
     }
     // Log this message
     if (isset($error->exception) && Zend_Registry::isRegistered('Zend_Log') && ($log = Zend_Registry::get('Zend_Log')) instanceof Zend_Log) {
         // Only log if in production or the exception is not an instance of Engine_Exception
         $e = $error->exception;
         if ('production' === APPLICATION_ENV || !$e instanceof Engine_Exception) {
             $output = '';
             $output .= PHP_EOL . 'Error Code: ' . $error_code . PHP_EOL;
             $output .= $e->__toString();
             $log->log($output, Zend_Log::CRIT);
         }
     }
     //$this->getResponse()->setRawHeader('HTTP/1.1 500 Internal server error');
     $this->view->status = false;
     $this->view->errorName = get_class($error->exception);
     if (APPLICATION_ENV != 'production') {
         if ($error->exception instanceof Exception) {
             $this->view->error = $error->exception->__toString();
         }
     } else {
         $this->view->message = Zend_Registry::get('Zend_Translate')->_('An error has occurred');
     }
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:35,代码来源:ErrorController.php


示例12: _delete

 /**
  * Pre-delete hook. If overridden, should be called at end of function.
  *
  * @return void
  */
 protected function _delete()
 {
     $hinhAnhs = Khcn_Api::_()->getDbTable('hinh_anh_chuyen_de', 'default')->getHinhAnhByChuyenDe($this->getIdentity());
     foreach ($hinhAnhs as $hinh_anh) {
         $hinh_anh->delete();
     }
     parent::_delete();
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:13,代码来源:SinhHoatChuyenDe.php


示例13: chiTietAction

 public function chiTietAction()
 {
     $id = $this->getRequest()->getParam('id');
     $this->view->chuong_trinh = $chuong_trinh = Khcn_Api::_()->getItem('default_chuong_trinh', $id);
     if (!$chuong_trinh) {
         return $this->_helper->requireSubject()->forward();
     }
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:8,代码来源:ChuongTrinhController.php


示例14: isNew

 public function isNew()
 {
     $thong_bao_moi = Khcn_Api::_()->getApi('settings', 'default')->getSetting('thong_bao_moi', 10);
     if (strtotime($this->ngay_tao) > strtotime("-{$thong_bao_moi} days")) {
         return true;
     }
     return false;
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:8,代码来源:DanhSachLop.php


示例15: chiTietAction

 public function chiTietAction()
 {
     $id = $this->getRequest()->getParam('id');
     $this->view->tai_lieu = $tai_lieu = Khcn_Api::_()->getItem('default_tai_lieu', $id);
     if (!$tai_lieu) {
         return $this->_helper->requireSubject()->forward();
     }
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:8,代码来源:TaiLieuController.php


示例16: init

    public function init()
    {
        $this->setName('form_giang_vien_ncs')->setMethod('post')->setAttrib('class', 'global_form');
        $this->addElement('Heading', 'account', array('value' => 'Thông tin cá nhân'));
        $this->account->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $viewer = Khcn_Api::_()->getViewer();
        $this->addElement('Text', 'ho_ten', array('label' => 'Họ và tên (*)', 'allowEmpty' => false, 'required' => true, 'filters' => array('StripTags'), 'value' => $viewer->getDisplayname()));
        $this->addElement('Calendar', 'ngay_sinh', array('label' => 'Ngày tháng năm sinh'));
        $don_vi = new Default_Model_DonVi();
        $this->addElement('Select', 'ma_don_vi', array('label' => 'Đơn vị công tác(*)', 'multiOptions' => $don_vi->getDSDVSGU(), 'value' => 1));
        $this->addElement('Text', 'ten_luan_an', array('label' => 'Tên luận án *', 'allowEmpty' => false, 'required' => true, 'filters' => array('StripTags')));
        $this->addElement('Text', 'chuyen_nganh_dao_tao', array('label' => 'Chuyên ngành đào tạo'));
        $this->addElement('Text', 'co_so_dao_tao', array('label' => 'Cơ sở đào tạo'));
        $this->addElement('Heading', 'thoi_gian_dao_tao', array('label' => 'Thời gian đào tạo'));
        $this->addElement('Calendar', 'tgdt_from', array('label' => 'Từ', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Calendar', 'tgdt_to', array('label' => 'Đến', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Heading', 'qd_ncs', array('value' => 'Quyết định công nhận Nghiên cứu sinh'));
        $this->qd_ncs->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Text', 'ncs_so', array('label' => 'Số'));
        $this->addElement('Calendar', 'ngay_ky', array('label' => 'Ký ngày', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Text', 'nguoi_ky', array('label' => 'Người ký'));
        $this->addElement('Heading', 'ke_hoach_bao_ve_chuyen_de', array('value' => 'Kế hoạch bảo vệ chuyên đề'));
        $this->ke_hoach_bao_ve_chuyen_de->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Heading', 'chuyen_de_1', array('label' => 'Chuyên đề 1'));
        $this->addElement('Calendar', 'thoi_gian_chuyen_de_1', array('label' => 'Thời gian', 'calendarOptions' => array('yearRangeCount' => 10), 'attribs' => array('name' => 'thoi_gian_chuyen_de[]')));
        $this->addElement('Text', 'ten_chuyen_de_1', array('label' => 'Tên chuyên đề', 'attribs' => array('name' => 'ten_chuyen_de[]')));
        $this->addElement('Hidden', 'tong_chuyen_de', array('value' => 1));
        $this->addElement('Dummy', 'them_chuyen_de', array('content' => '<a href="javascript:void(0)" onclick="themChuyenDe()" id="them_chuyen_de">Thêm chuyên đề</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" onclick="xoaChuyenDe()" id="xoa_chuyen_de" style="display: none;">Xóa chuyên đề</a>'));
        $this->addElement('Heading', 'ke_hoach_bao_ve_luan_an', array('value' => 'Kế hoạch bảo vệ luận án'));
        $this->ke_hoach_bao_ve_luan_an->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Dummy', 'bvla_cap_bo_mon', array('content' => 'Dự kiến kế hoạch bảo về luận án cấp bộ môn'));
        $this->addElement('Calendar', 'thoi_gian_bvla_cap_bo_mon', array('label' => 'Thời gian', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Text', 'dia_diem_bvla_cap_bo_mon', array('label' => 'Địa điểm'));
        $this->addElement('Dummy', 'bvla_cap_truong', array('content' => 'Dự kiến kế hoạch bảo về luận án cấp trường'));
        $this->addElement('Calendar', 'thoi_gian_bvla_cap_truong', array('label' => 'Thời gian', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Text', 'dia_diem_bvla_cap_truong', array('label' => 'Địa điểm'));
        $this->addElement('Heading', 'bai_bao_ctkh', array('value' => 'Bài báo/công trình khoa học đã công bố'));
        $this->bai_bao_ctkh->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Text', 'ten_san_pham', array('label' => 'Tên sản phẩm'));
        $this->addElement('Textarea', 'phuong_thuc_pho_bien', array('label' => 'Phương thức phổ biến'));
        $this->addElement('Dummy', 'phuong_thuc_pho_bien_luu_y', array('content' => '*Lưu ý: 	</br>- Đối với Tạp chí cần nêu rõ xếp loại tạp chí (SCI, SCIE…); Số kỳ, thời gian phát hành…
									</br>- Đối với Kỷ yếu Hội thảo cần nêu rõ: Quy mô của Hội thảo; Hình thức phát hành kỷ yếu (Bài viết có phản biện…), có báo cáo tại Hội thảo hay không?
'));
        $this->addElement('Heading', 'ket_qua_bao_ve_luan_an', array('value' => 'Kết quả bảo vệ luận văn/luận án'));
        $this->ket_qua_bao_ve_luan_an->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Calendar', 'thoi_gian_bao_ve', array('label' => 'Thời gian', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Text', 'dia_diem_bao_ve', array('label' => 'Địa điểm'));
        $this->addElement('Text', 'ket_qua_bao_ve', array('label' => 'Kết quả'));
        $this->addElement('Dummy', 'ho_so_nop_cho_phong_qlkhsdh', array('content' => "<strong>Hồ sơ nộp cho Phòng QLKH-SĐH:</strong></br>\n\t\t\t- Văn bản luận án đóng thành tập: 1 cuốn;</br>\n\t\t\t- Đĩa CD chứa nội dung luận án: 1 đĩa;</br>\n\t\t\t- Văn bản liên quan:</br>\n\t\t\t<span style='margin-left: 20px'>+ Quyết định bảo vệ của cơ sở đào tạo;</span></br>\n\t\t\t<span style='margin-left: 20px'>+ Giấy chứng nhận đã bảo về luận án.</span>"));
        $this->addElement('Heading', 'y_kien_ncs_heading', array('value' => 'Các ý kiến của Nghiên cứu sinh (nếu có)'));
        $this->y_kien_ncs_heading->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Textarea', 'y_kien_ncs', array());
        $this->addElement('Button', 'submit', array('label' => 'Lưu', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper'), 'attribs' => array('class' => 'art-button')));
        $url = new Zend_View_Helper_Url();
        $link = $url->url(array('module' => 'default', 'controller' => 'index', 'action' => 'index'));
        $this->addElement('Cancel', 'cancel', array('label' => 'Không lưu', 'onclick' => 'window.location.href="' . $link . '"', 'decorators' => array('ViewHelper'), 'attribs' => array('class' => 'art-button')));
        $this->addDisplayGroup(array('submit', 'cancel'), 'submitbtn');
    }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:58,代码来源:NCS.php


示例17: chiTietAction

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Kint类代码示例发布时间:2022-05-23
下一篇:
PHP Key类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap