public function getNamaStatusAttribute()
 {
     $name = $this->attributes['status'];
     $data = StatusPegawai::find($name);
     if ($data) {
         return $data->nama_status;
     }
     return '-';
 }
 /**
  * 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 $id the ID of the model to be loaded
  * @return StatusPegawai the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = StatusPegawai::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemple #3
0
				<?php 
echo $form->textField($model, 'kartu_askes_pegawai', array('size' => 60, 'maxlength' => 100, 'class' => 'input-block-level'));
?>
				<?php 
echo $form->error($model, 'kartu_askes_pegawai');
?>
			</div>
		</div>
		<div class="tab-pane fade" id="dtpangkat">

			<div class="row">
				<?php 
echo $form->labelEx($model, 'status_pegawai_pangkat');
?>
				<?php 
$this->widget('ext.chosen.Chosen', array('name' => 'Pegawai[status_pegawai_pangkat]', 'value' => $model->status_pegawai_pangkat, 'data' => array('' => 'Semua') + CHtml::listData(StatusPegawai::model()->findAll(), 'id_status_pegawai', 'nama_status')));
?>
				<?php 
echo $form->error($model, 'status_pegawai_pangkat');
?>
			</div>
			<br>

			<div class="row">
				<?php 
echo $form->labelEx($model, 'id_golongan');
?>
				<?php 
$this->widget('ext.chosen.Chosen', array('name' => 'Pegawai[id_golongan]', 'value' => $model->id_golongan, 'data' => array('' => 'Semua') + CHtml::listData(Golongan::model()->findAll(), 'id_golongan', 'golongan')));
?>
				<?php 
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     //
     $data = array('status' => StatusPegawai::DropdownStatusPegawai(), 'golongan' => Golongan::DropdownGolongan());
     return Response::json($data);
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     //
     $data = array('status' => StatusPegawai::DropdownStatusPegawai(), 'golongan' => Golongan::DropdownGolongan(), 'jabatan' => Jabatan::DropdownJabatan(), 'unitkerja' => UnitKerja::DropdownUnit(), 'satuankerja' => SatuanKerja::DropdownSatKer(), 'lokasikerja' => LokasiKerja::DropdownLokasiKerja(), 'eselon' => Eselon::DropdownEselon(), 'statusjabatan' => StatusJabatan::DropdownStatusJabatan());
     return Response::json($data);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     $statuspegawai = StatusPegawai::find($id);
     if ($statuspegawai->delete()) {
         return Response::json(array('success' => TRUE));
     }
 }