Example #1
3
<?php

$this->breadcrumbs = array('Biodata' => array('admin'), 'Kelola');
$this->menu = array(array('label' => 'List Biodata', 'url' => array('index')), array('label' => 'Create Biodata', 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\t\$('.search-button').click(function(){\n\t\t\$('.search-form').toggle();\n\t\treturn false;\n\t});\n\t\$('.search-form form').submit(function(){\n\t\t\$.fn.yiiGridView.update('biodata-grid', {\n\t\t\tdata: \$(this).serialize()\n\t\t});\n\t\treturn false;\n\t});\n");
?>

<h1>Kelola Biodata</h1>

<?php 
$this->widget('booster.widgets.TbButton', array('label' => '', 'context' => 'info', 'size' => 'small', 'url' => array('create'), 'icon' => 'plus-sign', 'buttonType' => 'link'));
?>

<?php 
$this->widget('booster.widgets.TbButton', array('label' => '', 'context' => 'info', 'size' => 'small', 'icon' => 'search', 'htmlOptions' => array('class' => 'search-button')));
?>

<div class="search-form" style="display:none">
	<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('booster.widgets.TbGridView', array('id' => 'biodata-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'type' => 'striped bordered condensed', 'columns' => array(array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'), array('name' => 'nik', 'value' => '$data->nik'), array('name' => 'fullname', 'value' => '$data->fullname'), array('name' => 'address', 'value' => '$data->address'), array('name' => 'phone', 'value' => '$data->phone'), array('name' => 'email', 'value' => '$data->email'), array('name' => 'gender', 'value' => '$data->gender==1 ? "Pria" : "Wanita"', 'filter' => array('1' => 'Pria', '2' => 'Wanita')), array('name' => 'birth_date', 'value' => 'date("d-m-Y",strtotime($data->birth_date))'), array('name' => 'birth_place', 'value' => 'Biodata::getPlace($data->birth_place)', 'filter' => Biodata::getPlace()), array('header' => 'Options', 'class' => 'booster.widgets.TbButtonColumn', 'buttons' => array('view' => array('label' => 'lihat', 'options' => array('class' => 'view'), 'url' => 'Yii::app()->controller->createUrl("view",array("id"=>$data->primaryKey))'), 'update' => array('label' => 'ubah', 'options' => array('class' => 'edit'), 'url' => 'Yii::app()->controller->createUrl("update",array("id"=>$data->primaryKey))'), 'delete' => array('label' => 'hapus', 'options' => array('class' => 'delete'), 'url' => 'Yii::app()->controller->createUrl("delete",array("id"=>$data->primaryKey))')), 'template' => '{view}&nbsp;{update}&nbsp;{delete}'))));
Example #2
1
<?php

$this->breadcrumbs = array('Biodata' => array('admin'), $model->nik);
$this->menu = array(array('label' => 'List Biodata', 'url' => array('index')), array('label' => 'Create Biodata', 'url' => array('create')), array('label' => 'Update Biodata', 'url' => array('update', 'id' => $model->id)), array('label' => 'Delete Biodata', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => 'Manage Biodata', 'url' => array('admin')));
?>

<h1>Lihat Biodata <?php 
echo $model->nik;
?>
</h1>

<?php 
$this->widget('booster.widgets.TbDetailView', array('data' => $model, 'attributes' => array(array('name' => 'photo', 'value' => '<img src="' . Yii::app()->baseUrl . '/public/thumb/' . $model->photo . '"/>', 'type' => 'raw'), array('name' => 'nik', 'value' => $model->nik), array('name' => 'fullname', 'value' => $model->fullname), array('name' => 'address', 'value' => $model->address), array('name' => 'phone', 'value' => $model->phone), array('name' => 'email', 'value' => $model->email), array('name' => 'gender', 'value' => $model->gender == '1' ? 'Pria' : 'Wanita'), array('name' => 'birth_date', 'value' => date('d-m-Y', strtotime($model->birth_date))), array('name' => 'birth_place', 'value' => Biodata::getPlace($model->birth_place)), array('name' => 'blood_type', 'value' => Biodata::getBlood($model->blood_type)), array('name' => 'marital', 'value' => Biodata::getStatusNikah($model->marital)), array('name' => 'wife_husband', 'value' => $model->wife_husband), array('name' => 'child', 'value' => $model->child), array('name' => 'religion', 'value' => Biodata::getAgama($model->religion)), array('name' => 'salary', 'value' => Utility::rupiah($model->salary)), array('name' => 'status', 'value' => Utility::getStatus($model->status)), array('name' => 'created', 'value' => date('d-m-Y H:i:s', strtotime($model->created))), array('name' => 'updated', 'value' => date('d-m-Y H:i:s', strtotime($model->updated))))));
Example #3
0
?>

	<?php 
echo $form->telFieldGroup($model, 'phone', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5', 'maxlength' => 20))));
?>

	<?php 
echo $form->emailFieldGroup($model, 'email', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5', 'maxlength' => 50))));
?>

	<?php 
echo $form->datePickerGroup($model, 'birth_date', array('widgetOptions' => array('options' => array(), 'htmlOptions' => array('class' => 'span5')), 'prepend' => '<i class="glyphicon glyphicon-calendar"></i>', 'append' => 'Click on Month/Year to select a different Month/Year.'));
?>

	<?php 
echo $form->dropDownListGroup($model, 'birth_place', array('widgetOptions' => array('data' => Biodata::getPlace(), 'htmlOptions' => array('class' => 'span5', 'prompt' => '---pilih---'))));
?>

	<?php 
echo $form->radioButtonListGroup($model, 'blood_type', array('widgetOptions' => array('data' => Biodata::getBlood(), 'htmlOptions' => array('class' => 'span5')), 'inline' => true));
?>

	<?php 
echo $form->dropDownListGroup($model, 'gender', array('widgetOptions' => array('data' => array('1' => 'pria', '2' => 'wanita'), 'htmlOptions' => array('class' => 'span5', 'prompt' => '---pilih---'))));
?>

	<?php 
echo $form->dropDownListGroup($model, 'marital', array('widgetOptions' => array('data' => Biodata::getStatusNikah(), 'htmlOptions' => array('class' => 'span5', 'prompt' => '---pilih---'))));
?>

	<div id="tes">