Commit c1099927 by Andre Sihombing

Membuat CRUD Satpam dan membuat fungsi import

parent a0dd962c
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -120,6 +120,7 @@ class GajiController extends Controller
}
public function actionImport(){
$searchModel = new GajiSearch();
$modelImport = new \yii\base\DynamicModel([
'fileImport'=>'File Import',
]);
......@@ -133,7 +134,7 @@ class GajiController extends Controller
$objReader = \PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($modelImport->fileImport->tempName);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
$baseRow = 2;
$baseRow = 3;
while(!empty($sheetData[$baseRow]['A'])){
$model = new \backend\modules\ubux\models\Gaji;
$model->tanggal_scan = (string)$sheetData[$baseRow]['A'];
......
<?php
namespace backend\modules\ubux\controllers;
use Yii;
use backend\modules\ubux\models\Husband;
use backend\modules\ubux\models\Wife;
use backend\modules\ubux\models\search\HusbandSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* HusbandController implements the CRUD actions for Husband model.
*/
class HusbandController extends Controller
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all Husband models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new HusbandSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Husband model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new Husband model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
/*public function actionCreate()
{
$model = new Husband();
$wife = new Wife();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
}
if ($wife->load(Yii::$app->request->post()) && $wife->save()) {
return $this->redirect(['view', 'id' => $wife->id]);
}
else {
return $this->render('create',array(
'model'=>$model,
'wife'=>$wife,
));
}
}*/
/*public function actionCreate()
{
$model=new Husband;
$wife=new Wife;
if(isset($_POST['Husband']))
{
$model->attributes=$_POST['Husband'];
}
if(isset($_POST['Wife']))
{
$wife->attributes=$_POST['Wife'];
}
$valid=$model->validate();
$valid=$wife->validate() && $valid;
if($valid)
{
if($model->save() && $wife->save())
$this->redirect(array('view','id'=>$model->id));
}
else {
return $this->render('create',array(
'model'=>$model,
'wife'=>$wife,
));
}
}*/
public function actionCreate()
{
$model = new Husband();
$wife = new Wife();
if ($model->load(Yii::$app->request->post()) && $wife->load(Yii::$app->request->post())) {
$transaction = Yii::$app->db->beginTransaction();
if($model->save(false) && $model->addWife($wife)) {
$transaction->commit();
return $this->redirect(['view', 'id' => $model->id]);
}
else {
$transaction->rollBack();
}
}
return $this->render('create', [
'model' => $model,
'wife' => $wife
]);
}
/**
* Updates an existing Husband model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
$wife = $model->wife;
if ($model->load(Yii::$app->request->post()) && $wife->load(Yii::$app->request->post())) {
$transaction = Yii::$app->db->beginTransaction();
if($model->save(false) && $model->addWife($wife)) {
$transaction->commit();
return $this->redirect(['view', 'id' => $model->id]);
}
else {
$transaction->rollBack();
}
}
return $this->render('update', [
'model' => $model,
'wife' => $wife
]);
}
/*public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}*/
/**
* Deletes an existing Husband model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Husband model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Husband the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Husband::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
......@@ -3,7 +3,6 @@
namespace backend\modules\ubux\controllers;
use Yii;
use yii\data\ActiveDataProvider;
use backend\modules\ubux\models\Satpam;
use backend\modules\ubux\models\Pegawai;
use backend\modules\ubux\models\search\SatpamSearch;
......@@ -64,8 +63,31 @@ class SatpamController extends Controller
{
$model = new Satpam();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
if ($model->load(Yii::$app->request->post())) {
$Pmodel = new Pegawai();
$Pmodel->nama = $model->nama;
$Pmodel->nip = $model->nip;
$Pmodel->tgl_lahir = $model->tanggalLahir;
$Pmodel->alamat = $model->alamat;
if($Pmodel->save()){
$model->pegawai_id = $Pmodel->pegawai_id;
$model->aktif_star = Yii::$app->formatter->asDate($_POST['Satpam']['aktif_star'], 'yyyy-MM-dd');
$model->aktif_end = Yii::$app->formatter->asDate($_POST['Satpam']['aktif_end'], 'yyyy-MM-dd');
$model->tanggalLahir = Yii::$app->formatter->asDate($_POST['Satpam']['tanggalLahir'], 'yyyy-MM-dd');
if($model->validate()){
// echo $model->aktif_star . " " . $model->aktif_end . " " . $Pmodel->tgl_lahir . " " . $Pmodel->alamat;
$model->save();
return $this->redirect(['view', 'id' => $model->satpam_id]);
}else{
$errors = $model->errors;
print_r(array_values($errors));
}
}else{
$errors = $Pmodel->errors;
print_r(array_values($errors));
}
} else {
return $this->render('create', [
'model' => $model,
......@@ -120,13 +142,4 @@ class SatpamController extends Controller
throw new NotFoundHttpException('The requested page does not exist.');
}
}
public function showPegawai()
{ $dataProvider = new ActiveDataProvider([
'query' => Pegawai::find(),
]);
return $dataProvider;
}
}
......@@ -27,15 +27,13 @@ use common\behaviors\DeleteBehavior;
* @property string $mesin
* @property integer $deleted
* @property string $deleted_at
* @property string $deleted_by
* @property string $created_at
* @property string $created_by
* @property string $updated_at
* @property string $deleted_by
* @property string $created_by
* @property string $updated_by
* @property integer $jam_kerja_id
* @property integer $laporan_id
*
* @property UbuxJamKerja $jamKerja
* @property UbuxLaporan $laporan
*/
class Gaji extends \yii\db\ActiveRecord
......@@ -73,12 +71,11 @@ class Gaji extends \yii\db\ActiveRecord
public function rules()
{
return [
[['tanggal_scan', 'tanggal', 'jam', 'pin', 'nip', 'nama', 'jabatan', 'verifikasi', 'i_o', 'workcode', 'mesin'], 'required'],
[['tanggal_scan'], 'required'],
[['tanggal_scan', 'tanggal', 'jam', 'deleted_at', 'created_at', 'updated_at'], 'safe'],
[['pin', 'nip', 'verifikasi', 'i_o', 'workcode', 'deleted', 'jam_kerja_id', 'laporan_id'], 'integer'],
[['pin', 'nip', 'verifikasi', 'i_o', 'workcode', 'deleted', 'laporan_id'], 'integer'],
[['nama', 'jabatan', 'departemen', 'kantor', 'mesin'], 'string', 'max' => 45],
[['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
[['jam_kerja_id'], 'exist', 'skipOnError' => true, 'targetClass' => JamKerja::className(), 'targetAttribute' => ['jam_kerja_id' => 'jam_kerja_id']],
[['laporan_id'], 'exist', 'skipOnError' => true, 'targetClass' => Laporan::className(), 'targetAttribute' => ['laporan_id' => 'laporan_id']]
];
}
......@@ -105,12 +102,11 @@ class Gaji extends \yii\db\ActiveRecord
'mesin' => 'Mesin',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
'deleted_by' => 'Deleted By',
'created_at' => 'Created At',
'created_by' => 'Created By',
'updated_at' => 'Updated At',
'deleted_by' => 'Deleted By',
'created_by' => 'Created By',
'updated_by' => 'Updated By',
'jam_kerja_id' => 'Jam Kerja ID',
'laporan_id' => 'Laporan ID',
];
}
......@@ -118,14 +114,6 @@ class Gaji extends \yii\db\ActiveRecord
/**
* @return \yii\db\ActiveQuery
*/
public function getJamKerja()
{
return $this->hasOne(UbuxJamKerja::className(), ['jam_kerja_id' => 'jam_kerja_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getLaporan()
{
return $this->hasOne(UbuxLaporan::className(), ['laporan_id' => 'laporan_id']);
......
<?php
namespace backend\modules\ubux\models;
use Yii;
use common\behaviors\TimestampBehavior;
use common\behaviors\BlameableBehavior;
use common\behaviors\DeleteBehavior;
/**
* This is the model class for table "husband".
*
* @property integer $id
* @property string $name
* @property integer $deleted
* @property string $deleted_at
* @property string $created_at
* @property string $updated_at
* @property string $deleted_by
* @property string $created_by
* @property string $updated_by
*
* @property Wife[] $wives
*/
class Husband extends \yii\db\ActiveRecord
{
/**
* behaviour to add created_at and updatet_at field with current datetime (timestamp)
* and created_by and updated_by field with current user id (blameable)
*/
/*public function behaviors(){
return [
'timestamp' => [
'class' => TimestampBehavior::className(),
],
'blameable' => [
'class' => BlameableBehavior::className(),
],
'delete' => [
'class' => DeleteBehavior::className(),
]
];
}*/
/**
* @inheritdoc
*/
public static function tableName()
{
return 'husband';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['deleted'], 'integer'],
[['deleted_at', 'created_at', 'updated_at'], 'safe'],
[['name'], 'string', 'max' => 45],
[['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32]
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'name' => 'Name',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
'deleted_by' => 'Deleted By',
'created_by' => 'Created By',
'updated_by' => 'Updated By',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getWives()
{
return $this->hasMany(Wife::className(), ['husband_id' => 'id']);
}
public function addWife($wife)
{
$wife->link('husband', $this); // isi nilai husband_id
return $wife->save(false);
}
}
......@@ -13,7 +13,6 @@ use common\behaviors\DeleteBehavior;
*
* @property integer $laporan_id
* @property string $bulan_laporan
* @property integer $gaji_id
* @property integer $deleted
* @property string $deleted_at
* @property string $deleted_by
......@@ -21,8 +20,10 @@ use common\behaviors\DeleteBehavior;
* @property string $created_by
* @property string $updated_at
* @property string $updated_by
* @property integer $jam_kerja_id
*
* @property UbuxGaji[] $ubuxGajis
* @property UbuxJamKerja $jamKerja
*/
class Laporan extends \yii\db\ActiveRecord
{
......@@ -59,11 +60,11 @@ class Laporan extends \yii\db\ActiveRecord
public function rules()
{
return [
[['bulan_laporan'], 'required'],
[['gaji_id', 'deleted'], 'integer'],
[['deleted', 'jam_kerja_id'], 'integer'],
[['deleted_at', 'created_at', 'updated_at'], 'safe'],
[['bulan_laporan'], 'string', 'max' => 45],
[['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32]
[['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
[['jam_kerja_id'], 'exist', 'skipOnError' => true, 'targetClass' => JamKerja::className(), 'targetAttribute' => ['jam_kerja_id' => 'jam_kerja_id']]
];
}
......@@ -75,7 +76,6 @@ class Laporan extends \yii\db\ActiveRecord
return [
'laporan_id' => 'Laporan ID',
'bulan_laporan' => 'Bulan Laporan',
'gaji_id' => 'Gaji ID',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
'deleted_by' => 'Deleted By',
......@@ -83,6 +83,7 @@ class Laporan extends \yii\db\ActiveRecord
'created_by' => 'Created By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By',
'jam_kerja_id' => 'Jam Kerja ID',
];
}
......@@ -93,4 +94,12 @@ class Laporan extends \yii\db\ActiveRecord
{
return $this->hasMany(UbuxGaji::className(), ['laporan_id' => 'laporan_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getJamKerja()
{
return $this->hasOne(UbuxJamKerja::className(), ['jam_kerja_id' => 'jam_kerja_id']);
}
}
......@@ -141,16 +141,16 @@ class Pegawai extends \yii\db\ActiveRecord
[['ext_num'], 'string', 'max' => 3],
[['jabatan', 'status_akhir', 'status'], 'string', 'max' => 1],
[['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
[['jenis_kelamin_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRJenisKelamin::className(), 'targetAttribute' => ['jenis_kelamin_id' => 'jenis_kelamin_id']],
[['agama_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRAgama::className(), 'targetAttribute' => ['agama_id' => 'agama_id']],
[['golongan_darah_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRGolonganDarah::className(), 'targetAttribute' => ['golongan_darah_id' => 'golongan_darah_id']],
[['jabatan_akademik_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRJabatanAkademik::className(), 'targetAttribute' => ['jabatan_akademik_id' => 'jabatan_akademik_id']],
[['kabupaten_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRKabupaten::className(), 'targetAttribute' => ['kabupaten_id' => 'kabupaten_id']],
[['ref_kbk_id'], 'exist', 'skipOnError' => true, 'targetClass' => InstProdi::className(), 'targetAttribute' => ['ref_kbk_id' => 'ref_kbk_id']],
[['status_aktif_pegawai_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRStatusAktifPegawai::className(), 'targetAttribute' => ['status_aktif_pegawai_id' => 'status_aktif_pegawai_id']],
[['status_ikatan_kerja_pegawai_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRStatusIkatanKerjaPegawai::className(), 'targetAttribute' => ['status_ikatan_kerja_pegawai_id' => 'status_ikatan_kerja_pegawai_id']],
[['status_marital_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRStatusMarital::className(), 'targetAttribute' => ['status_marital_id' => 'status_marital_id']],
[['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => SysxUser::className(), 'targetAttribute' => ['user_id' => 'user_id']]
// [['jenis_kelamin_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRJenisKelamin::className(), 'targetAttribute' => ['jenis_kelamin_id' => 'jenis_kelamin_id']],
// [['agama_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRAgama::className(), 'targetAttribute' => ['agama_id' => 'agama_id']],
// [['golongan_darah_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRGolonganDarah::className(), 'targetAttribute' => ['golongan_darah_id' => 'golongan_darah_id']],
// [['jabatan_akademik_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRJabatanAkademik::className(), 'targetAttribute' => ['jabatan_akademik_id' => 'jabatan_akademik_id']],
// [['kabupaten_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRKabupaten::className(), 'targetAttribute' => ['kabupaten_id' => 'kabupaten_id']],
// [['ref_kbk_id'], 'exist', 'skipOnError' => true, 'targetClass' => InstProdi::className(), 'targetAttribute' => ['ref_kbk_id' => 'ref_kbk_id']],
// [['status_aktif_pegawai_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRStatusAktifPegawai::className(), 'targetAttribute' => ['status_aktif_pegawai_id' => 'status_aktif_pegawai_id']],
// [['status_ikatan_kerja_pegawai_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRStatusIkatanKerjaPegawai::className(), 'targetAttribute' => ['status_ikatan_kerja_pegawai_id' => 'status_ikatan_kerja_pegawai_id']],
// [['status_marital_id'], 'exist', 'skipOnError' => true, 'targetClass' => MrefRStatusMarital::className(), 'targetAttribute' => ['status_marital_id' => 'status_marital_id']],
[['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['user_id' => 'user_id']]
];
}
......@@ -397,6 +397,6 @@ class Pegawai extends \yii\db\ActiveRecord
*/
public function getUbuxSatpams()
{
return $this->hasMany(UbuxSatpam::className(), ['pegawai_id' => 'pegawai_id']);
return $this->hasMany(Satpam::className(), ['pegawai_id' => 'pegawai_id']);
}
}
......@@ -28,12 +28,13 @@ use common\behaviors\DeleteBehavior;
*/
class Satpam extends \yii\db\ActiveRecord
{
public $nama, $nip, $tanggalLahir, $alamat;
/**
* behaviour to add created_at and updatet_at field with current datetime (timestamp)
* and created_by and updated_by field with current user id (blameable)
*/
/*public function behaviors(){
public function behaviors(){
return [
'timestamp' => [
'class' => TimestampBehavior::className(),
......@@ -45,7 +46,7 @@ class Satpam extends \yii\db\ActiveRecord
'class' => DeleteBehavior::className(),
]
];
}*/
}
/**
* @inheritdoc
......@@ -61,9 +62,10 @@ class Satpam extends \yii\db\ActiveRecord
public function rules()
{
return [
[['aktif_star', 'aktif_end', 'deleted_at', 'created_at', 'update_at'], 'safe'],
[['aktif_star', 'aktif_end', 'deleted_at', 'created_at', 'updated_at', 'tanggalLahir'], 'safe'],
[['pegawai_id', 'deleted'], 'integer'],
[['deleted_by', 'created_by', 'update_by'], 'string', 'max' => 32],
[['deleted_by', 'created_by', 'updated_by', 'nama', 'nip', 'alamat'], 'string', 'max' => 32],
[['tanggalLahir', 'aktif_star', 'aktif_end'], 'date', 'format' => 'yyyy-MM-dd'],
[['pegawai_id'], 'exist', 'skipOnError' => true, 'targetClass' => Pegawai::className(), 'targetAttribute' => ['pegawai_id' => 'pegawai_id']]
];
}
......@@ -83,8 +85,8 @@ class Satpam extends \yii\db\ActiveRecord
'deleted_by' => 'Deleted By',
'created_at' => 'Created At',
'created_by' => 'Created By',
'update_at' => 'Update At',
'update_by' => 'Update By',
'updated_at' => 'Update At',
'updated_by' => 'Update By',
];
}
......@@ -103,13 +105,4 @@ class Satpam extends \yii\db\ActiveRecord
{
return $this->hasOne(Pegawai::className(), ['pegawai_id' => 'pegawai_id']);
}
public function showPegawai()
{ $dataProvider = new ActiveDataProvider([
'query' => Pegawai::find(),
]);
return $dataProvider;
}
}
<?php
namespace backend\modules\ubux\models;
use Yii;
use common\behaviors\TimestampBehavior;
use common\behaviors\BlameableBehavior;
use common\behaviors\DeleteBehavior;
/**
* This is the model class for table "sysx_user".
*
* @property integer $user_id
* @property integer $profile_id
* @property string $sysx_key
* @property integer $authentication_method_id
* @property string $username
* @property string $auth_key
* @property string $password_hash
* @property string $password_reset_token
* @property string $email
* @property integer $status
* @property string $created_at
* @property string $updated_at
* @property string $created_by
* @property string $updated_by
* @property integer $deleted
* @property string $deleted_at
* @property string $deleted_by
*
* @property ArspArsip[] $arspArsips
* @property ArtkPost[] $artkPosts
* @property DimxDim[] $dimxDims
* @property HrdxPegawai[] $hrdxPegawais
* @property InvtPelaporanBarangRusak[] $invtPelaporanBarangRusaks
* @property InvtPeminjamanBarang[] $invtPeminjamanBarangs
* @property InvtPeminjamanBarang[] $invtPeminjamanBarangs0
* @property InvtUnitCharged[] $invtUnitChargeds
* @property PrklKrsReview[] $prklKrsReviews
* @property RprtComplaint[] $rprtComplaints
* @property RprtResponse[] $rprtResponses
* @property RprtUserHasBagian[] $rprtUserHasBagians
* @property SchdEventInvitee[] $schdEventInvitees
* @property SrvyKuesionerJawabanPeserta[] $srvyKuesionerJawabanPesertas
* @property SysxLog[] $sysxLogs
* @property SysxTelkomSsoUser[] $sysxTelkomSsoUsers
* @property SysxAuthenticationMethod $authenticationMethod
* @property SysxProfile $profile
* @property SysxUserConfig[] $sysxUserConfigs
* @property SysxUserHasRole[] $sysxUserHasRoles
* @property SysxRole[] $roles
* @property SysxUserHasWorkgroup[] $sysxUserHasWorkgroups
* @property SysxWorkgroup[] $workgroups
* @property TmbhPengumuman[] $tmbhPengumumen
*/
class User extends \yii\db\ActiveRecord
{
/**
* behaviour to add created_at and updatet_at field with current datetime (timestamp)
* and created_by and updated_by field with current user id (blameable)
*/
public function behaviors(){
return [
'timestamp' => [
'class' => TimestampBehavior::className(),
],
'blameable' => [
'class' => BlameableBehavior::className(),
],
'delete' => [
'class' => DeleteBehavior::className(),
]
];
}
/**
* @inheritdoc
*/
public static function tableName()
{
return 'sysx_user';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['profile_id', 'authentication_method_id', 'status', 'deleted'], 'integer'],
[['username', 'auth_key', 'password_hash', 'email'], 'required'],
[['created_at', 'updated_at', 'deleted_at'], 'safe'],
[['sysx_key', 'auth_key', 'deleted_by'], 'string', 'max' => 32],
[['username', 'password_hash', 'password_reset_token', 'email'], 'string', 'max' => 255],
[['created_by', 'updated_by'], 'string', 'max' => 45],
[['authentication_method_id'], 'exist', 'skipOnError' => true, 'targetClass' => SysxAuthenticationMethod::className(), 'targetAttribute' => ['authentication_method_id' => 'authentication_method_id']],
[['profile_id'], 'exist', 'skipOnError' => true, 'targetClass' => SysxProfile::className(), 'targetAttribute' => ['profile_id' => 'profile_id']]
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'user_id' => 'User ID',
'profile_id' => 'Profile ID',
'sysx_key' => 'Sysx Key',
'authentication_method_id' => 'Authentication Method ID',
'username' => 'Username',
'auth_key' => 'Auth Key',
'password_hash' => 'Password Hash',
'password_reset_token' => 'Password Reset Token',
'email' => 'Email',
'status' => 'Status',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
'created_by' => 'Created By',
'updated_by' => 'Updated By',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
'deleted_by' => 'Deleted By',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getArspArsips()
{
return $this->hasMany(ArspArsip::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getArtkPosts()
{
return $this->hasMany(ArtkPost::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getDimxDims()
{
return $this->hasMany(DimxDim::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getHrdxPegawais()
{
return $this->hasMany(HrdxPegawai::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getInvtPelaporanBarangRusaks()
{
return $this->hasMany(InvtPelaporanBarangRusak::className(), ['pelapor' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getInvtPeminjamanBarangs()
{
return $this->hasMany(InvtPeminjamanBarang::className(), ['approved_by' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getInvtPeminjamanBarangs0()
{
return $this->hasMany(InvtPeminjamanBarang::className(), ['oleh' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getInvtUnitChargeds()
{
return $this->hasMany(InvtUnitCharged::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getPrklKrsReviews()
{
return $this->hasMany(PrklKrsReview::className(), ['comment_by' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getRprtComplaints()
{
return $this->hasMany(RprtComplaint::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getRprtResponses()
{
return $this->hasMany(RprtResponse::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getRprtUserHasBagians()
{
return $this->hasMany(RprtUserHasBagian::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getSchdEventInvitees()
{
return $this->hasMany(SchdEventInvitee::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getSrvyKuesionerJawabanPesertas()
{
return $this->hasMany(SrvyKuesionerJawabanPeserta::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getSysxLogs()
{
return $this->hasMany(SysxLog::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getSysxTelkomSsoUsers()
{
return $this->hasMany(SysxTelkomSsoUser::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getAuthenticationMethod()
{
return $this->hasOne(SysxAuthenticationMethod::className(), ['authentication_method_id' => 'authentication_method_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getProfile()
{
return $this->hasOne(SysxProfile::className(), ['profile_id' => 'profile_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getSysxUserConfigs()
{
return $this->hasMany(SysxUserConfig::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getSysxUserHasRoles()
{
return $this->hasMany(SysxUserHasRole::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getRoles()
{
return $this->hasMany(SysxRole::className(), ['role_id' => 'role_id'])->viaTable('sysx_user_has_role', ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getSysxUserHasWorkgroups()
{
return $this->hasMany(SysxUserHasWorkgroup::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getWorkgroups()
{
return $this->hasMany(SysxWorkgroup::className(), ['workgroup_id' => 'workgroup_id'])->viaTable('sysx_user_has_workgroup', ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getTmbhPengumumen()
{
return $this->hasMany(TmbhPengumuman::className(), ['owner' => 'user_id']);
}
}
<?php
namespace backend\modules\ubux\models;
use Yii;
use common\behaviors\TimestampBehavior;
use common\behaviors\BlameableBehavior;
use common\behaviors\DeleteBehavior;
/**
* This is the model class for table "wife".
*
* @property integer $husband_id
* @property string $name
*
* @property Husband $husband
*/
class Wife extends \yii\db\ActiveRecord
{
/**
* behaviour to add created_at and updatet_at field with current datetime (timestamp)
* and created_by and updated_by field with current user id (blameable)
*/
/*public function behaviors(){
return [
'timestamp' => [
'class' => TimestampBehavior::className(),
],
'blameable' => [
'class' => BlameableBehavior::className(),
],
'delete' => [
'class' => DeleteBehavior::className(),
]
];
}*/
/**
* @inheritdoc
*/
public static function tableName()
{
return 'wife';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['husband_id'], 'required'],
[['husband_id'], 'integer'],
[['name'], 'string', 'max' => 45],
[['husband_id'], 'exist', 'skipOnError' => true, 'targetClass' => Husband::className(), 'targetAttribute' => ['husband_id' => 'id']]
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'husband_id' => 'Husband ID',
'name' => 'Name',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getHusband()
{
return $this->hasOne(Husband::className(), ['id' => 'husband_id']);
}
public function addWife($wife)
{
$wife->link('husband', $this); // isi nilai husband_id
return $wife->save(false);
}
}
......@@ -18,7 +18,7 @@ class GajiSearch extends Gaji
public function rules()
{
return [
[['gaji_id', 'pin', 'nip', 'verifikasi', 'i_o', 'workcode', 'deleted', 'jam_kerja_id', 'laporan_id'], 'integer'],
[['gaji_id', 'laporan_id', 'pin', 'nip', 'verifikasi', 'i_o', 'workcode', 'deleted'], 'integer'],
[['tanggal_scan', 'tanggal', 'jam', 'nama', 'jabatan', 'departemen', 'kantor', 'mesin', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'],
];
}
......@@ -57,6 +57,7 @@ class GajiSearch extends Gaji
$query->andFilterWhere([
'gaji_id' => $this->gaji_id,
'laporan_id' => $this->laporan_id,
'tanggal_scan' => $this->tanggal_scan,
'tanggal' => $this->tanggal,
'jam' => $this->jam,
......@@ -69,8 +70,6 @@ class GajiSearch extends Gaji
'deleted_at' => $this->deleted_at,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'jam_kerja_id' => $this->jam_kerja_id,
'laporan_id' => $this->laporan_id,
]);
$query->andFilterWhere(['like', 'nama', $this->nama])
......
<?php
namespace backend\modules\ubux\models\search;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\ubux\models\Husband;
/**
* HusbandSearch represents the model behind the search form about `backend\modules\ubux\models\Husband`.
*/
class HusbandSearch extends Husband
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id', 'deleted'], 'integer'],
[['name', 'deleted_at', 'created_at', 'updated_at', 'deleted_by', 'created_by', 'updated_by'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Husband::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
$query->andFilterWhere([
'id' => $this->id,
'deleted' => $this->deleted,
'deleted_at' => $this->deleted_at,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'name', $this->name])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by]);
return $dataProvider;
}
}
......@@ -18,7 +18,7 @@ class LaporanSearch extends Laporan
public function rules()
{
return [
[['laporan_id', 'gaji_id', 'deleted'], 'integer'],
[['laporan_id', 'deleted', 'jam_kerja_id'], 'integer'],
[['bulan_laporan', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'],
];
}
......@@ -57,11 +57,11 @@ class LaporanSearch extends Laporan
$query->andFilterWhere([
'laporan_id' => $this->laporan_id,
'gaji_id' => $this->gaji_id,
'deleted' => $this->deleted,
'deleted_at' => $this->deleted_at,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'jam_kerja_id' => $this->jam_kerja_id,
]);
$query->andFilterWhere(['like', 'bulan_laporan', $this->bulan_laporan])
......
......@@ -19,7 +19,7 @@ class SatpamSearch extends Satpam
{
return [
[['satpam_id', 'pegawai_id', 'deleted'], 'integer'],
[['aktif_star', 'aktif_end', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'update_at', 'update_by'], 'safe'],
[['aktif_star', 'aktif_end', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'],
];
}
......@@ -63,12 +63,12 @@ class SatpamSearch extends Satpam
'deleted' => $this->deleted,
'deleted_at' => $this->deleted_at,
'created_at' => $this->created_at,
'update_at' => $this->update_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'update_by', $this->update_by]);
->andFilterWhere(['like', 'updated_by', $this->updated_by]);
return $dataProvider;
}
......
......@@ -12,6 +12,10 @@ use yii\widgets\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'gaji_id')->textInput() ?>
<?= $form->field($model, 'laporan_id')->textInput() ?>
<?= $form->field($model, 'tanggal_scan')->textInput() ?>
<?= $form->field($model, 'tanggal')->textInput() ?>
......@@ -50,11 +54,7 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'updated_at')->textInput() ?>
<?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'jam_kerja_id')->textInput() ?>
<?= $form->field($model, 'laporan_id')->textInput() ?>
<?= $form->field($model, 'update_by')->textInput(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
......
......@@ -17,13 +17,15 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'gaji_id') ?>
<?= $form->field($model, 'laporan_id') ?>
<?= $form->field($model, 'tanggal_scan') ?>
<?= $form->field($model, 'tanggal') ?>
<?= $form->field($model, 'jam') ?>
<?= $form->field($model, 'pin') ?>
<?php // echo $form->field($model, 'pin') ?>
<?php // echo $form->field($model, 'nip') ?>
......@@ -55,11 +57,7 @@ use yii\widgets\ActiveForm;
<?php // echo $form->field($model, 'updated_at') ?>
<?php // echo $form->field($model, 'updated_by') ?>
<?php // echo $form->field($model, 'jam_kerja_id') ?>
<?php // echo $form->field($model, 'laporan_id') ?>
<?php // echo $form->field($model, 'update_by') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
......
......@@ -25,14 +25,15 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'gaji_id',
// 'gaji_id',
// 'laporan_id',
'tanggal_scan',
'tanggal',
//'tanggal',
'jam',
'pin',
// 'nip',
// 'nama',
// 'jabatan',
'nip',
'nama',
'jabatan',
// 'departemen',
// 'kantor',
// 'verifikasi',
......@@ -45,9 +46,7 @@ $this->params['breadcrumbs'][] = $this->title;
// 'created_at',
// 'created_by',
// 'updated_at',
// 'updated_by',
// 'jam_kerja_id',
// 'laporan_id',
// 'update_by',
['class' => 'yii\grid\ActionColumn'],
],
......
......@@ -28,7 +28,8 @@ $this->params['breadcrumbs'][] = $this->title;
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'gaji_id',
// 'gaji_id',
// 'laporan_id',
'tanggal_scan',
'tanggal',
'jam',
......@@ -48,9 +49,7 @@ $this->params['breadcrumbs'][] = $this->title;
'created_at',
'created_by',
'updated_at',
'updated_by',
'jam_kerja_id',
'laporan_id',
'update_by',
],
]) ?>
......
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Husband */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="husband-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($wife, 'name')->textInput(['maxlength' => true]) ?>
<!-- <?= $form->field($model, 'deleted')->textInput() ?>
<?= $form->field($model, 'deleted_at')->textInput() ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<?= $form->field($model, 'deleted_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'created_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?> -->
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\search\HusbandSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="husband-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id') ?>
<?= $form->field($model, 'name') ?>
<?= $form->field($model, 'deleted') ?>
<?= $form->field($model, 'deleted_at') ?>
<?= $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<?php // echo $form->field($model, 'deleted_by') ?>
<?php // echo $form->field($model, 'created_by') ?>
<?php // echo $form->field($model, 'updated_by') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Husband */
$this->title = 'Create Husband';
$this->params['breadcrumbs'][] = ['label' => 'Husbands', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="husband-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
'wife' => $wife
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\search\HusbandSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Husbands';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="husband-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a('Create Husband', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'name',
'deleted',
'deleted_at',
'created_at',
// 'updated_at',
// 'deleted_by',
// 'created_by',
// 'updated_by',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Husband */
$this->title = 'Update Husband: ' . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Husbands', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="husband-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
'wife' => $wife
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Husband */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Husbands', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="husband-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'name',
'deleted',
'deleted_at',
'created_at',
'updated_at',
'deleted_by',
'created_by',
'updated_by',
],
]) ?>
</div>
......@@ -14,21 +14,7 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'bulan_laporan')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'gaji_id')->textInput() ?>
<?= $form->field($model, 'deleted')->textInput() ?>
<?= $form->field($model, 'deleted_at')->textInput() ?>
<?= $form->field($model, 'deleted_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'created_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
......
......@@ -19,13 +19,11 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'bulan_laporan') ?>
<?= $form->field($model, 'gaji_id') ?>
<?= $form->field($model, 'deleted') ?>
<?= $form->field($model, 'deleted_at') ?>
<?php // echo $form->field($model, 'deleted_by') ?>
<?= $form->field($model, 'deleted_by') ?>
<?php // echo $form->field($model, 'created_at') ?>
......@@ -35,6 +33,8 @@ use yii\widgets\ActiveForm;
<?php // echo $form->field($model, 'updated_by') ?>
<?php // echo $form->field($model, 'jam_kerja_id') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
......
......@@ -27,14 +27,14 @@ $this->params['breadcrumbs'][] = $this->title;
'laporan_id',
'bulan_laporan',
'gaji_id',
'deleted',
'deleted_at',
// 'deleted_by',
'deleted_by',
// 'created_at',
// 'created_by',
// 'updated_at',
// 'updated_by',
// 'jam_kerja_id',
['class' => 'yii\grid\ActionColumn'],
],
......
......@@ -30,7 +30,6 @@ $this->params['breadcrumbs'][] = $this->title;
'attributes' => [
'laporan_id',
'bulan_laporan',
'gaji_id',
'deleted',
'deleted_at',
'deleted_by',
......@@ -38,6 +37,7 @@ $this->params['breadcrumbs'][] = $this->title;
'created_by',
'updated_at',
'updated_by',
'jam_kerja_id',
],
]) ?>
......
......@@ -2,6 +2,7 @@
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\jui\DatePicker;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Satpam */
......@@ -12,25 +13,28 @@ use yii\widgets\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'aktif_star')->textInput() ?>
<?= $form->field($model, 'aktif_star')->widget(\yii\jui\DatePicker::classname(), [
'language' => 'id',
'dateFormat' => 'yyyy-MM-dd',
]) ?>
<?= $form->field($model, 'aktif_end')->textInput() ?>
<?= $form->field($model, 'aktif_end')->widget(\yii\jui\DatePicker::classname(), [
'language' => 'id',
'dateFormat' => 'yyyy-MM-dd',
]) ?>
<!-- <?= $form->field($model, 'pegawai_id')->textInput() ?>
<?= $form->field($model, 'nama')->textInput() ?>
<?= $form->field($model, 'deleted')->textInput() ?>
<?= $form->field($model, 'nip')->textInput() ?>
<?= $form->field($model, 'deleted_at')->textInput() ?>
<?= $form->field($model, 'alamat')->textInput() ?>
<?= $form->field($model, 'deleted_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'tanggalLahir')->widget(\yii\jui\DatePicker::classname(), [
'language' => 'id',
'dateFormat' => 'yyyy-MM-dd',
])
?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'created_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'update_at')->textInput() ?>
<?= $form->field($model, 'update_by')->textInput(['maxlength' => true]) ?> -->
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
......
......@@ -19,37 +19,17 @@ $this->params['breadcrumbs'][] = $this->title;
<?= Html::a('Create Satpam', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php
echo GridView::widget([
'dataProvider' => $this->context->showPegawai(),
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'nama',
'user_name',
'tgl_lahir',
'tempat_lahir',
'nip',
'telepon',
'alamat',
'kecamatan',
'kota',
//'aktif_star',
//'aktif_end',
// 'pegawai_id',
// 'deleted',
// 'deleted_at',
// 'deleted_by',
// 'created_at',
// 'created_by',
// 'update_at',
// 'update_by',
'satpam_id',
'aktif_star',
'aktif_end',
'pegawai_id',
'deleted',
['class' => 'yii\grid\ActionColumn'],
],
......
......@@ -28,17 +28,21 @@ $this->params['breadcrumbs'][] = $this->title;
<?= DetailView::widget([
'model' => $model,
'attributes' => [
// 'satpam_id',
//'satpam_id',
'pegawai.nama',
'pegawai.nip',
'pegawai.tgl_lahir',
'pegawai.alamat',
'aktif_star',
'aktif_end',
// 'pegawai_id',
//'pegawai_id',
// 'deleted',
// 'deleted_at',
// 'deleted_by',
// 'created_at',
// 'created_by',
// 'update_at',
// 'update_by',
// 'updated_at',
// 'updated_by',
],
]) ?>
......
......@@ -36,6 +36,6 @@ class V2Asset extends AssetBundle {
];
public $publishOptions = [
'forceCopy' => true
'forceCopy' => false
];
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment