Example #1
0
<?php

$this->breadcrumbs = array('Posts' => array('index'), 'Manage');
$this->menu = array(array('label' => 'List Post', 'url' => array('index')), array('label' => 'Create Post', '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\$.fn.yiiGridView.update('post-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>
<div class="row-fluid">
<h1>Manajemen Berita</h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</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 btn'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'post-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'title', 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->title), $data->url)'), array('name' => 'status', 'value' => 'Status::item("PostStatus",$data->status)', 'filter' => Status::items('PostStatus')), array('name' => 'create_time', 'type' => 'datetime', 'filter' => false), array('class' => 'TbButtonColumn'))));
?>

</div>
Example #2
0
/kcfinder/upload.php?type=files',
         filebrowserImageUploadUrl: '<?php 
echo Yii::app()->baseUrl;
?>
/kcfinder/upload.php?type=images',
         filebrowserFlashUploadUrl: '<?php 
echo Yii::app()->baseUrl;
?>
/kcfinder/upload.php?type=flash'
    });
</script>
     <?php 
echo $form->labelEx($model, 'tags');
$this->widget('CAutoComplete', array('model' => $model, 'attribute' => 'tags', 'url' => array('suggestTags'), 'multiple' => true, 'htmlOptions' => array('size' => 50)));
?>
        <p class="help-block"><small>Please separate different tags with commas.</small></p>
        
	<?php 
echo $form->labelEx($model, 'status');
echo $form->dropDownList($model, 'status', Status::items('PostStatus'));
?>

	
	<div class="form-actions">
		<?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Simpan' : 'Save'));
?>
	</div>

<?php 
$this->endWidget();
<?php

$this->menu = array(array('label' => 'Create Purchase Order', 'url' => array('/suppliers/purchaseOrder')), array('label' => 'Add A New Suppliers', 'url' => array('/suppliers/create')));
?>



<h1>Purchase Orders</h1>

 
<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'purchase-order-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('order_number', array('name' => 'supplier_name', 'type' => 'raw', 'value' => 'CHtml::link($data->suppliers->name,Yii::app()->createUrl("purchaseOrder/preview" , array("id"=>$data->id,)))'), array('name' => 'user_name', 'header' => 'Raised By', 'value' => '$data->user->username'), array('name' => 'order_status', 'value' => 'Status::item("Status",$data->order_status)', 'filter' => Status::items('Status')), array('name' => 'date_of_order', 'value' => '$data->date_of_order==null ? "":date("d-M-Y",$data->date_of_order)', 'filter' => false), array('name' => 'date_of_order_recieved', 'value' => '$data->date_of_order_recieved==null ? "":date("d-M-Y",$data->date_of_order_recieved)', 'filter' => false), array('class' => 'CButtonColumn', 'template' => '{update}', 'buttons' => array('update' => array('url' => 'Yii::app()->createUrl("purchaseOrder/preview" , array("id"=>$data->id,))'))))));