<?php /* @var $this ComponentdetailController */ /* @var $model Componentdetail */ $this->breadcrumbs = array('Component Details' => array('index'), 'Manage'); $this->menu = array(array('label' => 'List Component Details', 'url' => array('index')), array('label' => 'Create Component Details', 'url' => array('create'))); Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#componentdetail-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); ?> <h1>Manage Component Details</h1> <p> You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done. </p> <?php echo CHtml::link('Advanced Search', '#', array('class' => 'search-button')); ?> <div class="search-form" style="display:none"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'componentdetail-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'fk_componentType', 'type' => 'raw', 'value' => '$data->fkComponentType->name', 'filter' => CHtml::listData(componentType::model()->findAll(array('order' => 'name ASC')), 'id', 'name')), 'tagNo', 'serialNo', 'description', 'project', 'deviceStatus', array('header' => 'Issue/Return', 'name' => 'issue_device', 'value' => '$data->setLinks()', 'type' => 'raw'), array('class' => 'CButtonColumn'))));
<?php $form = $this->beginWidget('CActiveForm', array('id' => 'componentdetail-form', 'enableAjaxValidation' => false)); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); ?> <div class="row"> <?php echo $form->labelEx($model, 'fk_componentType'); ?> <?php echo $form->dropDownList($model, 'fk_componentType', CHtml::listData(componentType::model()->findAll(array('order' => 'name ASC')), 'id', 'name'), array('prompt' => 'Select Component Type')); ?> <?php echo $form->error($model, 'fk_componentType'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'tagNo'); ?> <?php echo $form->textField($model, 'tagNo', array('size' => 10, 'maxlength' => 10)); ?> <?php echo $form->error($model, 'tagNo');