Пример #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}'))));
Пример #2
3
    echo $model->photo;
    ?>
" width="20%"><br/>
        	</div>
        </div>
    </div>
    <?php 
}
?>

	<?php 
echo $form->fileFieldGroup($model, 'photo', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5', 'maxlength' => 100))));
?>

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

	<?php 
echo $form->textFieldGroup($model, 'salary', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5')), 'prepend' => 'Rp.', 'append' => '.00'));
?>

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

	

	

<div class="form-actions">
Пример #3
1
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //gets all submitted apps to extract their user ids
     $applications = SubmittedApplication::all();
     $applicants = [];
     foreach ($applications as $application) {
         //get biodata and regnumber with user id
         $applicant = new stdClass();
         $biodata = Biodata::find($application->user_id)->toArray();
         $reg_num = Scholarship::find($application->user_id)->toArray();
         //build applicant object
         foreach ($biodata as $key => $value) {
             $applicant->{$key} = $value;
         }
         $applicant->reg_num = $reg_num['reg_number'];
         $applicants[] = $applicant;
     }
     return Response::json($applicants, 200);
 }
Пример #4
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))))));
Пример #5
-1
 /**
  * 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 = Biodata::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }