예제 #1
0
	<?php 
echo $form->textFieldRow($model->postItem, 'title', array('class' => 'span5', 'maxlength' => 100, 'placeholder' => 'Title'));
?>

	<?php 
echo $form->redactorRow($model->postItem, 'description', array('height' => '250px', 'options' => array('source' => true, 'paragraph' => true, 'buttons' => array('formatting', '|', 'bold', 'italic', 'deleted', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'image', 'link', '|', 'alignment', '|', 'horizontalrule'))));
?>

	<?php 
echo $form->hiddenField($model->postItem, 'excerpt');
?>

	
	
	<?php 
echo $form->dropDownListRow($model->certification, 'certification_cat_id', CHtml::listData(CertificationCat::getAllCertCats(), 'certification_cat_id', 'certification_cat_name'), array('empty' => 'Select a category'));
?>
	
	<?php 
if (Yii::app()->user->isAdmin() || Yii::app()->user->isSuperAdmin()) {
    ?>

		<?php 
    echo $form->textFieldRow($model->certification, 'provider', array('class' => 'span5', 'maxlength' => 100, 'placeholder' => 'Provider Name'));
    ?>
		<?php 
    echo $form->dropDownListRow($model->certification, 'provider_id', CHtml::listData(Employer::getAllEmployers(), 'user_id', 'company_name'), array('labelOptions' => array('label' => false), 'hint' => 'Note: Select from the dropdown if the provider is a registered employer.', 'empty' => 'Select the employer'));
    ?>

	<?php 
} elseif (Yii::app()->user->isEmployer()) {
<?php

/* @var $this Controller */
/* @var $model ViewStudentTitle */
/* @var $form TbActiveForm */
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'certification-search-form', 'type' => 'search', 'action' => Yii::app()->createUrl($this->route), 'method' => 'get'));
?>

<div class="normal-search">
<?php 
echo $form->textFieldRow($model, 'title', array('placeholder' => 'Search title', 'prepend' => '<i class="icon-search"></i>'));
?>
 
<?php 
echo $form->dropDownList($model, 'certification_cat_id', CHtml::listData(CertificationCat::getAllCertCats(), 'certification_cat_id', 'certification_cat_name'), array('prompt' => 'Select a Category'));
?>
   
<?php 
echo $form->dropDownList($model, 'provider', CHtml::listData(Certification::getAllProviders(), 'provider', 'provider'), array('prompt' => 'Select a provider'));
?>
 
<?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'label' => 'Search', 'type' => 'primary'));
?>
 
<?php 
//$this->widget('bootstrap.widgets.TbButton', array('buttonType'=>'button', 'label'=>'Advance Options','htmlOptions'=>array('id'=>'btn-cert-adv-search')));
?>


</div>
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = CertificationCat::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }