<?php

$this->breadcrumbs = array('eaAssets' => array('index'), 'Manage');
$this->menu = array(array('label' => 'List eaAsset', 'url' => array('index')), array('label' => 'Create eaAsset', 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\t\t\$('.search-button').click(function(){\n\t\t\$('.search-form').toggle();\n\t\treturn false;\n});\n\t\t\$('.search-form form').submit(function(){\n\t\t\$.fn.yiiGridView.update('eaAsset-grid', {\n\t\tdata: \$(this).serialize()\n});\n\t\treturn false;\n});\n\t\t");
?>
<div class="page-header">
	<h1>Asset Management</h1>
</div>

<?php 
$this->widget('bootstrap.widgets.BootGridView', array('id' => 'eaAsset-category-grid', 'dataProvider' => eaAssetCategory::model()->mainsearch(), 'itemsCssClass' => 'table table-striped table-bordered', 'template' => '{items}{pager}{summary}', 'columns' => array(array('class' => 'BootButtonColumn'), array('name' => 'inventory_type', 'type' => 'raw', 'value' => 'CHtml::link($data->inventory_type,Yii::app()->createUrl("/m1/eaAsset/admin2",array("id"=>$data->id)))'), 'remarks')));
?>
<hr />
<?php 
$form = $this->beginWidget('bootstrap.widgets.BootActiveForm', array('action' => Yii::app()->createUrl($this->route), 'type' => 'search', 'method' => 'get', 'htmlOptions' => array('class' => 'well')));
echo $form->errorSummary($model);
?>

<?php 
echo $form->textFieldRow($model, 'item', array('class' => 'span3'));
echo CHtml::htmlButton('<i class="icon-search"></i> Search', array('class' => 'btn', 'type' => 'submit'));
$this->endWidget();
$this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
    echo CHtml::image(Yii::app()->request->baseUrl . "/images/asset.jpg", "No Photo", array("height" => "90"));
} else {
    echo CHtml::image(Yii::app()->request->baseUrl . "/images/asset/" . $data->photo, CHtml::encode($data->name), array("height" => "90"));
}
?>
	</div>
	<div class="view-c2">
		<?php 
echo CHtml::link(CHtml::encode($data->item), array('view', 'id' => $data->id));
?>
		<br /> <br /> <b><?php 
echo CHtml::encode($data->getAttributeLabel('category_id'));
?>
:</b>
		<?php 
echo eaAssetCategory::model()->findByPk($data->category_id)->inventory_type;
?>
		<br /> <b><?php 
echo CHtml::encode($data->getAttributeLabel('inventory_code'));
?>
:</b>
		<?php 
echo CHtml::encode($data->inventory_code);
?>
		<br /> <b><?php 
echo CHtml::encode($data->getAttributeLabel('serial_number'));
?>
:</b>
		<?php 
echo CHtml::encode($data->serial_number);
?>
 /**
  * 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 = eaAssetCategory::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }