Commit 2a8cf861 by Andre Sihombing

Melakukan Perbaikan Fungsi

parent 53dbc9a3
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
namespace backend\modules\ubux\controllers;
use yii\web\Controller;
/**
* Default controller for the `ubux` module
*/
class DefaultController extends Controller
{
/**
* Renders the index view for the module
* @return string
*/
public function actionIndex()
{
return $this->render('index');
}
}
<?php
namespace backend\modules\ubux\controllers;
use Yii;
use backend\modules\ubux\models\Gaji;
use backend\modules\ubux\models\Satpam;
use backend\modules\ubux\models\Laporan;
use backend\modules\ubux\models\JamKerja;
use backend\modules\ubux\models\search\GajiSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* GajiController implements the CRUD actions for Gaji model.
*/
class GajiController extends Controller
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all Gaji models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new GajiSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Gaji model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new Gaji model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate($id, $nip)
{
$modelCek = JamKerja::find()->where(['laporan_id' => $id])->andWhere(['nip' => $nip])->one();
$cek = $modelCek->tanggal;
$models = JamKerja::find()->where(['laporan_id' => $id])->andWhere(['nip' => $nip])->All();
$jlh = 1;
foreach ($models as $data) {
if($cek != $data->tanggal){
$jlh++;
$cek = $data->tanggal;
}
}
$model = new Gaji();
if ($model->load(Yii::$app->request->post())) {
$total_gaji = $jlh * $model['total_gaji'];
$gajiku = 'Rp. ' . $total_gaji;
$model->total_gaji = $gajiku;
if ($model->validate()) {
$model->save();
return $this->redirect(['view', 'id' => $model->gaji_id]);
} else {
$errors = $model->$errors;
print_r(array_values($errors));
}
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
// public function actionCreate($nip)
// {
// $model = new Gaji();
// $model1 = new JamKerja();
// $models = $model1->find()->where(['nip' => $nip])->one();
// echo $models['nip'];
// die();
// $count = count($models);
// if ($model->load(Yii::$app->request->post())) {
// $model->nip = $nip;
// $total_gaji = $count * $model['total_gaji'];
// $gajiku = 'Rp.' . $total_gaji;
// if ($model->validate()) {
// $model->save();
// return $this->redirect(['view', 'id' => $model->satpam_id]);
// } else {
// $errors = $model->errors;
// print_r(array_values($errors));
// }
// } else {
// return $this->render('create', [
// 'model' => $model,
// ]);
// }
// }
/**
* Updates an existing Gaji 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);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->gaji_id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Gaji 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 Gaji model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Gaji the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Gaji::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
<?php
namespace backend\modules\ubux\controllers;
use Yii;
use backend\modules\ubux\models\JamKerja;
use backend\modules\ubux\models\search\JamKerjaSearch;
use backend\modules\ubux\models\Pegawai;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use backend\modules\ubux\models\Satpam;
/**
* JamKerjaController implements the CRUD actions for JamKerja model.
*/
class JamKerjaController extends Controller
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all JamKerja models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new JamKerjaSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single JamKerja model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new JamKerja model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new JamKerja();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->jam_kerja_id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing JamKerja 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);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->jam_kerja_id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing JamKerja 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 JamKerja model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return JamKerja the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = JamKerja::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
public function actionImport($id){
$searchModel = new JamKerjaSearch();
$modelImport = new \yii\base\DynamicModel([
'fileImport'=>'File Import',
]);
$modelImport->addRule(['fileImport'],'required');
$modelImport->addRule(['fileImport'],'file',['extensions'=>'ods,xls,xlsx'],['maxSize'=>1024*1024]);
if(Yii::$app->request->post()){
$modelImport->fileImport = \yii\web\UploadedFile::getInstance($modelImport,'fileImport');
if($modelImport->fileImport && $modelImport->validate()){
$inputFileType = \PHPExcel_IOFactory::identify($modelImport->fileImport->tempName);
$objReader = \PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($modelImport->fileImport->tempName);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
$baseRow = 3;
//$baseRow2 = 3;
while(!empty($sheetData[$baseRow]['A'])){
$model = new \backend\modules\ubux\models\JamKerja;
$model2 = new \backend\modules\ubux\models\Satpam;
$model->tanggal_scan = (string)$sheetData[$baseRow]['A'];
$model->tanggal = (string)$sheetData[$baseRow]['B'];
$model->jam = (string)$sheetData[$baseRow]['C'];
$model->pin = (string)$sheetData[$baseRow]['D'];
$model->nip = (string)$sheetData[$baseRow]['E'];
$model->nama = (string)$sheetData[$baseRow]['F'];
$model->jabatan = (string)$sheetData[$baseRow]['G'];
$model->departemen = (string)$sheetData[$baseRow]['H'];
$model->kantor = (string)$sheetData[$baseRow]['I'];
$model->verifikasi = (string)$sheetData[$baseRow]['J'];
$model->i_o = (string)$sheetData[$baseRow]['K'];
$model->workcode = (string)$sheetData[$baseRow]['L'];
$model->mesin = (string)$sheetData[$baseRow]['M'];
$model->laporan_id = $id;
$model2->nama = (string)$sheetData[$baseRow]['F'];
$model2->nip = (string)$sheetData[$baseRow]['E'];
if(strpos($model2->nip,'H')!==false){
$model2->status='Harian';
}else
$model2->status = 'Tetap';
$idSatpam;
//if(!($sheetData[$baseRow]['F'] == $sheetData[$baseRow-1]['F'])){
//if($)
if(!Satpam::find()->where(['nip'=>$model->nip])->exists()){
$model2->save();
$idSatpam=$model2->satpam_id;
}
else{
$satpam=Satpam::find()->where(['nip'=>$model->nip])->one();
$idSatpam = $satpam->satpam_id;
}
//}
// $model->satpam_id = $idSatpam;
$model->save();
$baseRow++;
}
Yii::$app->getSession()->setFlash('success','Success');
return $this->redirect(['/ubux/laporan/index']);
}else{
Yii::$app->getSession()->setFlash('error','Error');
return $this->redirect(['import']);
}
}
return $this->render('import',[
'modelImport' => $modelImport,
]);
}
// public function actionImport($id){
// $searchModel = new JamKerjaSearch();
// $modelImport = new \yii\base\DynamicModel([
// 'fileImport'=>'File Import',
// ]);
// $modelImport->addRule(['fileImport'],'required');
// $modelImport->addRule(['fileImport'],'file',['extensions'=>'ods,xls,xlsx'],['maxSize'=>1024*1024]);
// if(Yii::$app->request->post()){
// $modelImport->fileImport = \yii\web\UploadedFile::getInstance($modelImport,'fileImport');
// if($modelImport->fileImport && $modelImport->validate()){
// $inputFileType = \PHPExcel_IOFactory::identify($modelImport->fileImport->tempName);
// $objReader = \PHPExcel_IOFactory::createReader($inputFileType);
// $objPHPExcel = $objReader->load($modelImport->fileImport->tempName);
// $sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
// $baseRow = 3;
// while(!empty($sheetData[$baseRow]['A'])){
// $model = new \backend\modules\ubux\models\JamKerja;
// $model->tanggal_scan = (string)$sheetData[$baseRow]['A'];
// $model->tanggal = (string)$sheetData[$baseRow]['B'];
// $model->jam = (string)$sheetData[$baseRow]['C'];
// $model->pin = (string)$sheetData[$baseRow]['D'];
// $model->nip = (string)$sheetData[$baseRow]['E'];
// $model->nama = (string)$sheetData[$baseRow]['F'];
// $model->jabatan = (string)$sheetData[$baseRow]['G'];
// $model->departemen = (string)$sheetData[$baseRow]['H'];
// $model->kantor = (string)$sheetData[$baseRow]['I'];
// $model->verifikasi = (string)$sheetData[$baseRow]['J'];
// $model->i_o = (string)$sheetData[$baseRow]['K'];
// $model->workcode = (string)$sheetData[$baseRow]['L'];
// $model->mesin = (string)$sheetData[$baseRow]['M'];
// $model->laporan_id = $id;
// $model->save();
// $baseRow++;
// }
// Yii::$app->getSession()->setFlash('success','Success');
// return $this->redirect(['/ubux/laporan/view', 'id' => $id]);
// }else{
// Yii::$app->getSession()->setFlash('error','Error');
// return $this->redirect(['import']);
// }
// }
// return $this->render('import',[
// 'modelImport' => $modelImport,
// ]);
// }
}
<?php
namespace backend\modules\ubux\controllers;
use Yii;
use backend\modules\ubux\models\Laporan;
use backend\modules\ubux\models\JamKerja;
use backend\modules\ubux\models\search\LaporanSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* LaporanController implements the CRUD actions for Laporan model.
*/
class LaporanController extends Controller
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all Laporan models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new LaporanSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Laporan model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
$model = JamKerja::find()->where(['laporan_id' => $id])->All();
return $this->render('view',
array('model' => $this->findModel($id), 'gajiModel' => $model)
);
}
public function actionViewDetail($id, $nip)
{
$model = JamKerja::find()->where(['laporan_id' => $id])->andWhere(['nip' => $nip])->All();
// $i = 0;
// foreach ($model as $key) {
// $i++;
// }
// print_r($i);die();
return $this->render('view-detail',[
'model' => $model,
]);
}
/**
* Creates a new Laporan model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new Laporan();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->laporan_id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing Laporan 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);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->laporan_id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Laporan 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)->softdelete();
return $this->redirect(['index']);
}
/**
* Finds the Laporan model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Laporan the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Laporan::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
namespace backend\modules\ubux\controllers; namespace backend\modules\ubux\controllers;
use Yii; use Yii;
use backend\modules\ubux\models\Haha; use backend\modules\ubux\models\Pegawai;
use backend\modules\ubux\models\search\HahaSearch; use backend\modules\ubux\models\search\PegawaiSearch;
use yii\web\Controller; use yii\web\Controller;
use yii\web\NotFoundHttpException; use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter; use yii\filters\VerbFilter;
/** /**
* HahaController implements the CRUD actions for Haha model. * PegawaiController implements the CRUD actions for Pegawai model.
*/ */
class HahaController extends Controller class PegawaiController extends Controller
{ {
public function behaviors() public function behaviors()
{ {
...@@ -24,15 +24,15 @@ class HahaController extends Controller ...@@ -24,15 +24,15 @@ class HahaController extends Controller
], ],
], ],
]; ];
} }
/** /**
* Lists all Haha models. * Lists all Pegawai models.
* @return mixed * @return mixed
*/ */
public function actionIndex() public function actionIndex()
{ {
$searchModel = new HahaSearch(); $searchModel = new PegawaiSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [ return $this->render('index', [
...@@ -42,7 +42,7 @@ class HahaController extends Controller ...@@ -42,7 +42,7 @@ class HahaController extends Controller
} }
/** /**
* Displays a single Haha model. * Displays a single Pegawai model.
* @param integer $id * @param integer $id
* @return mixed * @return mixed
*/ */
...@@ -54,16 +54,16 @@ class HahaController extends Controller ...@@ -54,16 +54,16 @@ class HahaController extends Controller
} }
/** /**
* Creates a new Haha model. * Creates a new Pegawai model.
* If creation is successful, the browser will be redirected to the 'view' page. * If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed * @return mixed
*/ */
public function actionCreate() public function actionCreate()
{ {
$model = new Haha(); $model = new Pegawai();
if ($model->load(Yii::$app->request->post()) && $model->save()) { if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]); return $this->redirect(['view', 'id' => $model->pegawai_id]);
} else { } else {
return $this->render('create', [ return $this->render('create', [
'model' => $model, 'model' => $model,
...@@ -72,7 +72,7 @@ class HahaController extends Controller ...@@ -72,7 +72,7 @@ class HahaController extends Controller
} }
/** /**
* Updates an existing Haha model. * Updates an existing Pegawai model.
* If update is successful, the browser will be redirected to the 'view' page. * If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id * @param integer $id
* @return mixed * @return mixed
...@@ -82,7 +82,7 @@ class HahaController extends Controller ...@@ -82,7 +82,7 @@ class HahaController extends Controller
$model = $this->findModel($id); $model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) { if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]); return $this->redirect(['view', 'id' => $model->pegawai_id]);
} else { } else {
return $this->render('update', [ return $this->render('update', [
'model' => $model, 'model' => $model,
...@@ -91,7 +91,7 @@ class HahaController extends Controller ...@@ -91,7 +91,7 @@ class HahaController extends Controller
} }
/** /**
* Deletes an existing Haha model. * Deletes an existing Pegawai model.
* If deletion is successful, the browser will be redirected to the 'index' page. * If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id * @param integer $id
* @return mixed * @return mixed
...@@ -104,15 +104,15 @@ class HahaController extends Controller ...@@ -104,15 +104,15 @@ class HahaController extends Controller
} }
/** /**
* Finds the Haha model based on its primary key value. * Finds the Pegawai model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown. * If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id * @param integer $id
* @return Haha the loaded model * @return Pegawai the loaded model
* @throws NotFoundHttpException if the model cannot be found * @throws NotFoundHttpException if the model cannot be found
*/ */
protected function findModel($id) protected function findModel($id)
{ {
if (($model = Haha::findOne($id)) !== null) { if (($model = Pegawai::findOne($id)) !== null) {
return $model; return $model;
} else { } else {
throw new NotFoundHttpException('The requested page does not exist.'); throw new NotFoundHttpException('The requested page does not exist.');
......
...@@ -4,20 +4,19 @@ namespace backend\modules\ubux\controllers; ...@@ -4,20 +4,19 @@ namespace backend\modules\ubux\controllers;
use Yii; use Yii;
use backend\modules\ubux\models\Satpam; use backend\modules\ubux\models\Satpam;
use backend\modules\ubux\models\Hrdxpegawai;
use backend\modules\ubux\models\search\SatpamSearch; use backend\modules\ubux\models\search\SatpamSearch;
use backend\modules\ubux\models\search\PegawaiSearch;
use yii\web\Controller; use yii\web\Controller;
use yii\web\NotFoundHttpException; use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter; use yii\filters\VerbFilter;
use yii\data\ActiveDataProvider;
/** /**
* SatpamController implements the CRUD actions for Satpam model. * SatpamController implements the CRUD actions for Satpam model.
*/ */
class DataSatpamController extends Controller class SatpamController extends Controller
{ {
public function behaviors() public function behaviors()
{ {
return [ return [
'verbs' => [ 'verbs' => [
'class' => VerbFilter::className(), 'class' => VerbFilter::className(),
...@@ -43,17 +42,6 @@ class DataSatpamController extends Controller ...@@ -43,17 +42,6 @@ class DataSatpamController extends Controller
]); ]);
} }
public function actionViewSatpam()
{
$searchModel = new SatpamSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('view_satpam', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/** /**
* Displays a single Satpam model. * Displays a single Satpam model.
* @param integer $id * @param integer $id
...@@ -111,7 +99,7 @@ class DataSatpamController extends Controller ...@@ -111,7 +99,7 @@ class DataSatpamController extends Controller
*/ */
public function actionDelete($id) public function actionDelete($id)
{ {
$this->findModel($id)->softDelete(); $this->findModel($id)->delete();
return $this->redirect(['index']); return $this->redirect(['index']);
} }
...@@ -131,16 +119,4 @@ class DataSatpamController extends Controller ...@@ -131,16 +119,4 @@ class DataSatpamController extends Controller
throw new NotFoundHttpException('The requested page does not exist.'); throw new NotFoundHttpException('The requested page does not exist.');
} }
} }
public function showSatpam(){
$id = "satpam";
$dataProvider = new ActiveDataProvider([
'query' => Hrdxpegawai::find()->where("posisi = 'satpam'"),
'pagination' => [
'pageSize' => 20,
],
]);
return $dataProvider;
}
} }
...@@ -9,23 +9,22 @@ use common\behaviors\BlameableBehavior; ...@@ -9,23 +9,22 @@ use common\behaviors\BlameableBehavior;
use common\behaviors\DeleteBehavior; use common\behaviors\DeleteBehavior;
/** /**
* This is the model class for table "ubux_total_gaji". * This is the model class for table "ubux_gaji".
* *
* @property integer $total_id * @property integer $gaji_id
* @property string $satpam_id * @property integer $satpam_id
* @property string $total_gaji * @property string $total_gaji
* @property integer $deleted * @property integer $delete
* @property string $deleted_at * @property string $deleted_at
* @property string $deleted_by * @property string $deleted_by
* @property string $updated_at
* @property string $updated_by
* @property string $created_at * @property string $created_at
* @property string $created_by * @property string $created_by
* @property integer $laporan_id * @property string $updated_at
* @property string $updated_by
* *
* @property UbuxLaporan $laporan * @property UbuxSatpam $satpam
*/ */
class TotalGaji extends \yii\db\ActiveRecord class Gaji extends \yii\db\ActiveRecord
{ {
/** /**
...@@ -51,7 +50,7 @@ class TotalGaji extends \yii\db\ActiveRecord ...@@ -51,7 +50,7 @@ class TotalGaji extends \yii\db\ActiveRecord
*/ */
public static function tableName() public static function tableName()
{ {
return 'ubux_total_gaji'; return 'ubux_gaji';
} }
/** /**
...@@ -60,11 +59,10 @@ class TotalGaji extends \yii\db\ActiveRecord ...@@ -60,11 +59,10 @@ class TotalGaji extends \yii\db\ActiveRecord
public function rules() public function rules()
{ {
return [ return [
[['deleted', 'laporan_id'], 'integer'], [['satpam_id', 'delete'], 'integer'],
[['deleted_at', 'updated_at', 'created_at'], 'safe'], [['deleted_at', 'created_at', 'updated_at'], 'safe'],
[['satpam_id', 'total_gaji'], 'string', 'max' => 45], [['total_gaji', 'deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 45],
[['deleted_by', 'updated_by', 'created_by'], 'string', 'max' => 32], [['satpam_id'], 'exist', 'skipOnError' => true, 'targetClass' => Satpam::className(), 'targetAttribute' => ['satpam_id' => 'satpam_id']]
[['laporan_id'], 'exist', 'skipOnError' => true, 'targetClass' => Laporan::className(), 'targetAttribute' => ['laporan_id' => 'laporan_id']]
]; ];
} }
...@@ -74,25 +72,24 @@ class TotalGaji extends \yii\db\ActiveRecord ...@@ -74,25 +72,24 @@ class TotalGaji extends \yii\db\ActiveRecord
public function attributeLabels() public function attributeLabels()
{ {
return [ return [
'total_id' => 'Total ID', 'gaji_id' => 'Gaji ID',
'satpam_id' => 'Satpam ID', 'satpam_id' => 'Satpam ID',
'total_gaji' => 'Total Gaji', 'total_gaji' => 'Total Gaji',
'deleted' => 'Deleted', 'delete' => 'Delete',
'deleted_at' => 'Deleted At', 'deleted_at' => 'Deleted At',
'deleted_by' => 'Deleted By', 'deleted_by' => 'Deleted By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By',
'created_at' => 'Created At', 'created_at' => 'Created At',
'created_by' => 'Created By', 'created_by' => 'Created By',
'laporan_id' => 'Laporan ID', 'updated_at' => 'Updated At',
'updated_by' => 'Updated By',
]; ];
} }
/** /**
* @return \yii\db\ActiveQuery * @return \yii\db\ActiveQuery
*/ */
public function getLaporan() public function getSatpam()
{ {
return $this->hasOne(Laporan::className(), ['laporan_id' => 'laporan_id']); return $this->hasOne(Satpam::className(), ['satpam_id' => 'satpam_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 "ubux_jam_kerja".
*
* @property integer $jam_kerja_id
* @property integer $satpam_id
* @property string $tanggal_scan
* @property string $tanggal
* @property string $jam
* @property string $pin
* @property string $nip
* @property string $nama
* @property string $jabatan
* @property string $departemen
* @property string $kantor
* @property string $verifikasi
* @property string $i_o
* @property string $workcode
* @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 $updated_by
*
* @property UbuxSatpam $satpam
*/
class JamKerja 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 'ubux_jam_kerja';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['laporan_id', 'deleted'], 'integer'],
[['jam', 'deleted_at', 'created_at', 'updated_at'], 'safe'],
[['tanggal_scan', 'tanggal', 'pin', 'nip', 'nama', 'jabatan', 'departemen', 'kantor', 'verifikasi', 'i_o', 'workcode', 'mesin', 'deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 45],
[['laporan_id'], 'exist', 'skipOnError' => true, 'targetClass' => Laporan::className(), 'targetAttribute' => ['laporan_id' => 'laporan_id']]
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'jam_kerja_id' => 'Jam Kerja ID',
'laporan_id' => 'Laporan ID',
'tanggal_scan' => 'Tanggal Scan',
'tanggal' => 'Tanggal',
'jam' => 'Jam',
'pin' => 'Pin',
'nip' => 'Nip',
'nama' => 'Nama',
'jabatan' => 'Jabatan',
'departemen' => 'Departemen',
'kantor' => 'Kantor',
'verifikasi' => 'Verifikasi',
'i_o' => 'I O',
'workcode' => 'Workcode',
'mesin' => 'Mesin',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
'deleted_by' => 'Deleted By',
'created_at' => 'Created At',
'created_by' => 'Created By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getLaporan()
{
return $this->hasOne(Laporan::className(), ['laporan_id' => 'laporan_id']);
}
}
...@@ -12,7 +12,9 @@ use common\behaviors\DeleteBehavior; ...@@ -12,7 +12,9 @@ use common\behaviors\DeleteBehavior;
* This is the model class for table "ubux_laporan". * This is the model class for table "ubux_laporan".
* *
* @property integer $laporan_id * @property integer $laporan_id
* @property string $bulan_laporan * @property integer $satpam_id
* @property string $bulan
* @property string $tahun
* @property integer $deleted * @property integer $deleted
* @property string $deleted_at * @property string $deleted_at
* @property string $deleted_by * @property string $deleted_by
...@@ -20,10 +22,9 @@ use common\behaviors\DeleteBehavior; ...@@ -20,10 +22,9 @@ use common\behaviors\DeleteBehavior;
* @property string $created_by * @property string $created_by
* @property string $updated_at * @property string $updated_at
* @property string $updated_by * @property string $updated_by
* @property integer $jam_kerja_id
* *
* @property UbuxGaji[] $ubuxGajis * @property UbuxJamKerja[] $ubuxJamKerjas
* @property UbuxJamKerja $jamKerja * @property UbuxSatpam $satpam
*/ */
class Laporan extends \yii\db\ActiveRecord class Laporan extends \yii\db\ActiveRecord
{ {
...@@ -60,9 +61,9 @@ class Laporan extends \yii\db\ActiveRecord ...@@ -60,9 +61,9 @@ class Laporan extends \yii\db\ActiveRecord
public function rules() public function rules()
{ {
return [ return [
[['laporan_id', 'deleted', 'satpam_id'], 'integer'], [['satpam_id', 'deleted'], 'integer'],
[['laporan_id', 'deleted_at', 'created_at', 'updated_at'], 'safe'], [['deleted_at', 'created_at', 'updated_at'], 'safe'],
[['bulan_laporan', 'tahun_laporan'], 'string', 'max' => 45], [['bulan', 'tahun'], 'string', 'max' => 45],
[['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32], [['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
[['satpam_id'], 'exist', 'skipOnError' => true, 'targetClass' => Satpam::className(), 'targetAttribute' => ['satpam_id' => 'satpam_id']] [['satpam_id'], 'exist', 'skipOnError' => true, 'targetClass' => Satpam::className(), 'targetAttribute' => ['satpam_id' => 'satpam_id']]
]; ];
...@@ -75,8 +76,9 @@ class Laporan extends \yii\db\ActiveRecord ...@@ -75,8 +76,9 @@ class Laporan extends \yii\db\ActiveRecord
{ {
return [ return [
'laporan_id' => 'Laporan ID', 'laporan_id' => 'Laporan ID',
'bulan_laporan' => 'Bulan Laporan', 'satpam_id' => 'Satpam ID',
'tahun_laporan' => 'Tahun Laporan', 'bulan' => 'Bulan',
'tahun' => 'Tahun',
'deleted' => 'Deleted', 'deleted' => 'Deleted',
'deleted_at' => 'Deleted At', 'deleted_at' => 'Deleted At',
'deleted_by' => 'Deleted By', 'deleted_by' => 'Deleted By',
...@@ -84,22 +86,22 @@ class Laporan extends \yii\db\ActiveRecord ...@@ -84,22 +86,22 @@ class Laporan extends \yii\db\ActiveRecord
'created_by' => 'Created By', 'created_by' => 'Created By',
'updated_at' => 'Updated At', 'updated_at' => 'Updated At',
'updated_by' => 'Updated By', 'updated_by' => 'Updated By',
'satpam_id' => 'Satpam ID',
]; ];
} }
/** /**
* @return \yii\db\ActiveQuery * @return \yii\db\ActiveQuery
*/ */
public function getGaji(){ public function getJamKerja()
return $this->hasOne(Gaji::className(), ['laporan_id' => 'laporan_id']); {
return $this->hasMany(JamKerja::className(), ['laporan_id' => 'laporan_id']);
} }
/** /**
* @return \yii\db\ActiveQuery * @return \yii\db\ActiveQuery
*/ */
public function getJamKerja() public function getSatpam()
{ {
return $this->hasOne(jamKerja::className(), ['jam_kerja_id' => 'jam_kerja_id']); return $this->hasOne(Satpam::className(), ['satpam_id' => 'satpam_id']);
} }
} }
...@@ -9,14 +9,26 @@ use common\behaviors\BlameableBehavior; ...@@ -9,14 +9,26 @@ use common\behaviors\BlameableBehavior;
use common\behaviors\DeleteBehavior; use common\behaviors\DeleteBehavior;
/** /**
* This is the model class for table "gaji". * This is the model class for table "ubux_satpam".
* *
* @property string $nip * @property integer $satpam_id
* @property integer $pegawai_id
* @property string $nama * @property string $nama
* @property string $gaji_pokok * @property string $nip
* @property string $tunjangan * @property string $status
* @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 $updated_by
*
* @property UbuxGaji[] $ubuxGajis
* @property UbuxJamKerja[] $ubuxJamKerjas
* @property HrdxPegawai $pegawai
*/ */
class Uang extends \yii\db\ActiveRecord class Satpam extends \yii\db\ActiveRecord
{ {
/** /**
...@@ -42,7 +54,7 @@ class Uang extends \yii\db\ActiveRecord ...@@ -42,7 +54,7 @@ class Uang extends \yii\db\ActiveRecord
*/ */
public static function tableName() public static function tableName()
{ {
return 'gaji'; return 'ubux_satpam';
} }
/** /**
...@@ -51,10 +63,12 @@ class Uang extends \yii\db\ActiveRecord ...@@ -51,10 +63,12 @@ class Uang extends \yii\db\ActiveRecord
public function rules() public function rules()
{ {
return [ return [
[['nip'], 'required'], [['pegawai_id', 'deleted'], 'integer'],
[['gaji_pokok', 'tunjangan'], 'number'], [['nama', 'nip'], 'required'],
[['nip'], 'string', 'max' => 5], [['deleted_at', 'created_at', 'updated_at'], 'safe'],
[['nama'], 'string', 'max' => 20] [['nama', 'nip'], 'string', 'max' => 100],
[['status', 'deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
[['pegawai_id'], 'exist', 'skipOnError' => true, 'targetClass' => Pegawai::className(), 'targetAttribute' => ['pegawai_id' => 'pegawai_id']]
]; ];
} }
...@@ -64,28 +78,48 @@ class Uang extends \yii\db\ActiveRecord ...@@ -64,28 +78,48 @@ class Uang extends \yii\db\ActiveRecord
public function attributeLabels() public function attributeLabels()
{ {
return [ return [
'nip' => 'Nip', 'satpam_id' => 'Satpam ID',
'pegawai_id' => 'Pegawai ID',
'nama' => 'Nama', 'nama' => 'Nama',
'gaji_pokok' => 'Gaji Pokok', 'nip' => 'Nip',
'tunjangan' => 'Tunjangan', 'status' => 'Status',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
'deleted_by' => 'Deleted By',
'created_at' => 'Created At',
'created_by' => 'Created By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By',
]; ];
} }
public function totalGaji() /**
* @return \yii\db\ActiveQuery
*/
public function getGaji()
{ {
$total=$this->gaji_pokok + $this->tunjangan; return $this->hasMany(Gaji::className(), ['satpam_id' => 'satpam_id']);
return $total;
} }
public function pajak() /**
* @return \yii\db\ActiveQuery
*/
public function getJamKerja()
{ {
$total=$this->gaji_pokok + $this->tunjangan; return $this->hasMany(JamKerja::className(), ['satpam_id' => 'satpam_id']);
$pajak=$total * 5/100;
return $pajak;
} }
public function gajiBersih() /**
* @return \yii\db\ActiveQuery
*/
public function getPegawai()
{ {
return $this->totalGaji() - $this->pajak(); return $this->hasOne(Pegawai::className(), ['pegawai_id' => 'pegawai_id']);
} }
public function getLaporan()
{
return $this->hasMany(Laporan::className(), ['satpam_id' => 'satpam_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 "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\search;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\ubux\models\Gaji;
/**
* GajiSearch represents the model behind the search form about `backend\modules\ubux\models\Gaji`.
*/
class GajiSearch extends Gaji
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['gaji_id', 'satpam_id', 'delete'], 'integer'],
[['total_gaji', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', '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 = Gaji::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([
'gaji_id' => $this->gaji_id,
'satpam_id' => $this->satpam_id,
'delete' => $this->delete,
'deleted_at' => $this->deleted_at,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'total_gaji', $this->total_gaji])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by]);
return $dataProvider;
}
}
<?php
namespace backend\modules\ubux\models\search;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\ubux\models\JamKerja;
/**
* JamKerjaSearch represents the model behind the search form about `backend\modules\ubux\models\JamKerja`.
*/
class JamKerjaSearch extends JamKerja
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['jam_kerja_id', 'laporan_id', 'deleted'], 'integer'],
[['tanggal_scan', 'tanggal', 'jam', 'pin', 'nip', 'nama', 'jabatan', 'departemen', 'kantor', 'verifikasi', 'i_o', 'workcode', 'mesin', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', '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 = JamKerja::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([
'jam_kerja_id' => $this->jam_kerja_id,
'laporan_id' => $this->laporan_id,
'jam' => $this->jam,
'deleted' => $this->deleted,
'deleted_at' => $this->deleted_at,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'tanggal_scan', $this->tanggal_scan])
->andFilterWhere(['like', 'tanggal', $this->tanggal])
->andFilterWhere(['like', 'pin', $this->pin])
->andFilterWhere(['like', 'nip', $this->nip])
->andFilterWhere(['like', 'nama', $this->nama])
->andFilterWhere(['like', 'jabatan', $this->jabatan])
->andFilterWhere(['like', 'departemen', $this->departemen])
->andFilterWhere(['like', 'kantor', $this->kantor])
->andFilterWhere(['like', 'verifikasi', $this->verifikasi])
->andFilterWhere(['like', 'i_o', $this->i_o])
->andFilterWhere(['like', 'workcode', $this->workcode])
->andFilterWhere(['like', 'mesin', $this->mesin])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by]);
return $dataProvider;
}
}
...@@ -5,12 +5,12 @@ namespace backend\modules\ubux\models\search; ...@@ -5,12 +5,12 @@ namespace backend\modules\ubux\models\search;
use Yii; use Yii;
use yii\base\Model; use yii\base\Model;
use yii\data\ActiveDataProvider; use yii\data\ActiveDataProvider;
use backend\modules\ubux\models\TotalGaji; use backend\modules\ubux\models\Laporan;
/** /**
* TotalGajiSearch represents the model behind the search form about `backend\modules\ubux\models\TotalGaji`. * LaporanSearch represents the model behind the search form about `backend\modules\ubux\models\Laporan`.
*/ */
class TotalGajiSearch extends TotalGaji class LaporanSearch extends Laporan
{ {
/** /**
* @inheritdoc * @inheritdoc
...@@ -18,8 +18,8 @@ class TotalGajiSearch extends TotalGaji ...@@ -18,8 +18,8 @@ class TotalGajiSearch extends TotalGaji
public function rules() public function rules()
{ {
return [ return [
[['total_id', 'deleted', 'laporan_id'], 'integer'], [['laporan_id', 'satpam_id', 'deleted'], 'integer'],
[['total_gaji', 'deleted_at', 'deleted_by', 'updated_at', 'updated_by', 'created_at', 'created_by'], 'safe'], [['bulan', 'tahun', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'],
]; ];
} }
...@@ -41,7 +41,7 @@ class TotalGajiSearch extends TotalGaji ...@@ -41,7 +41,7 @@ class TotalGajiSearch extends TotalGaji
*/ */
public function search($params) public function search($params)
{ {
$query = TotalGaji::find(); $query = Laporan::find()->where(['deleted' => null]);
$dataProvider = new ActiveDataProvider([ $dataProvider = new ActiveDataProvider([
'query' => $query, 'query' => $query,
...@@ -56,18 +56,19 @@ class TotalGajiSearch extends TotalGaji ...@@ -56,18 +56,19 @@ class TotalGajiSearch extends TotalGaji
} }
$query->andFilterWhere([ $query->andFilterWhere([
'total_id' => $this->total_id, 'laporan_id' => $this->laporan_id,
'satpam_id' => $this->satpam_id,
'deleted' => $this->deleted, 'deleted' => $this->deleted,
'deleted_at' => $this->deleted_at, 'deleted_at' => $this->deleted_at,
'updated_at' => $this->updated_at,
'created_at' => $this->created_at, 'created_at' => $this->created_at,
'laporan_id' => $this->laporan_id, 'updated_at' => $this->updated_at,
]); ]);
$query->andFilterWhere(['like', 'total_gaji', $this->total_gaji]) $query->andFilterWhere(['like', 'bulan', $this->bulan])
->andFilterWhere(['like', 'tahun', $this->tahun])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by]) ->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by]) ->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'created_by', $this->created_by]); ->andFilterWhere(['like', 'updated_by', $this->updated_by]);
return $dataProvider; return $dataProvider;
} }
......
<?php
namespace backend\modules\ubux\models\search;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\ubux\models\Pegawai;
/**
* PegawaiSearch represents the model behind the search form about `backend\modules\ubux\models\Pegawai`.
*/
class PegawaiSearch extends Pegawai
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['pegawai_id', 'ref_kbk_id', 'agama_id', 'jenis_kelamin_id', 'golongan_darah_id', 'kabupaten_id', 'jabatan_akademik_id', 'gbk_1', 'gbk_2', 'status_ikatan_kerja_pegawai_id', 'status_aktif_pegawai_id', 'status_marital_id', 'user_id', 'deleted'], 'integer'],
[['profile_old_id', 'nama', 'user_name', 'nip', 'kpt_no', 'kbk_id', 'alias', 'posisi', 'tempat_lahir', 'tgl_lahir', 'hp', 'telepon', 'alamat', 'alamat_libur', 'kecamatan', 'kota', 'kode_pos', 'no_ktp', 'email', 'ext_num', 'study_area_1', 'study_area_2', 'jabatan', 'status_akhir', 'tanggal_masuk', 'tanggal_keluar', 'nama_bapak', 'nama_ibu', 'status', 'nama_p', 'tgl_lahir_p', 'tmp_lahir_p', 'pekerjaan_ortu', 'deleted_at', 'deleted_by', 'created_by', 'created_at', 'updated_by', 'updated_at'], '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 = Pegawai::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([
'pegawai_id' => $this->pegawai_id,
'ref_kbk_id' => $this->ref_kbk_id,
'tgl_lahir' => $this->tgl_lahir,
'agama_id' => $this->agama_id,
'jenis_kelamin_id' => $this->jenis_kelamin_id,
'golongan_darah_id' => $this->golongan_darah_id,
'kabupaten_id' => $this->kabupaten_id,
'jabatan_akademik_id' => $this->jabatan_akademik_id,
'gbk_1' => $this->gbk_1,
'gbk_2' => $this->gbk_2,
'status_ikatan_kerja_pegawai_id' => $this->status_ikatan_kerja_pegawai_id,
'status_aktif_pegawai_id' => $this->status_aktif_pegawai_id,
'tanggal_masuk' => $this->tanggal_masuk,
'tanggal_keluar' => $this->tanggal_keluar,
'status_marital_id' => $this->status_marital_id,
'tgl_lahir_p' => $this->tgl_lahir_p,
'user_id' => $this->user_id,
'deleted' => $this->deleted,
'deleted_at' => $this->deleted_at,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'profile_old_id', $this->profile_old_id])
->andFilterWhere(['like', 'nama', $this->nama])
->andFilterWhere(['like', 'user_name', $this->user_name])
->andFilterWhere(['like', 'nip', $this->nip])
->andFilterWhere(['like', 'kpt_no', $this->kpt_no])
->andFilterWhere(['like', 'kbk_id', $this->kbk_id])
->andFilterWhere(['like', 'alias', $this->alias])
->andFilterWhere(['like', 'posisi', $this->posisi])
->andFilterWhere(['like', 'tempat_lahir', $this->tempat_lahir])
->andFilterWhere(['like', 'hp', $this->hp])
->andFilterWhere(['like', 'telepon', $this->telepon])
->andFilterWhere(['like', 'alamat', $this->alamat])
->andFilterWhere(['like', 'alamat_libur', $this->alamat_libur])
->andFilterWhere(['like', 'kecamatan', $this->kecamatan])
->andFilterWhere(['like', 'kota', $this->kota])
->andFilterWhere(['like', 'kode_pos', $this->kode_pos])
->andFilterWhere(['like', 'no_ktp', $this->no_ktp])
->andFilterWhere(['like', 'email', $this->email])
->andFilterWhere(['like', 'ext_num', $this->ext_num])
->andFilterWhere(['like', 'study_area_1', $this->study_area_1])
->andFilterWhere(['like', 'study_area_2', $this->study_area_2])
->andFilterWhere(['like', 'jabatan', $this->jabatan])
->andFilterWhere(['like', 'status_akhir', $this->status_akhir])
->andFilterWhere(['like', 'nama_bapak', $this->nama_bapak])
->andFilterWhere(['like', 'nama_ibu', $this->nama_ibu])
->andFilterWhere(['like', 'status', $this->status])
->andFilterWhere(['like', 'nama_p', $this->nama_p])
->andFilterWhere(['like', 'tmp_lahir_p', $this->tmp_lahir_p])
->andFilterWhere(['like', 'pekerjaan_ortu', $this->pekerjaan_ortu])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by]);
return $dataProvider;
}
}
...@@ -5,12 +5,12 @@ namespace backend\modules\ubux\models\search; ...@@ -5,12 +5,12 @@ namespace backend\modules\ubux\models\search;
use Yii; use Yii;
use yii\base\Model; use yii\base\Model;
use yii\data\ActiveDataProvider; use yii\data\ActiveDataProvider;
use backend\modules\ubux\models\Haha; use backend\modules\ubux\models\Satpam;
/** /**
* HahaSearch represents the model behind the search form about `backend\modules\ubux\models\Haha`. * SatpamSearch represents the model behind the search form about `backend\modules\ubux\models\Satpam`.
*/ */
class HahaSearch extends Haha class SatpamSearch extends Satpam
{ {
/** /**
* @inheritdoc * @inheritdoc
...@@ -18,8 +18,8 @@ class HahaSearch extends Haha ...@@ -18,8 +18,8 @@ class HahaSearch extends Haha
public function rules() public function rules()
{ {
return [ return [
[['id', 'deleted', 'pegawai_id'], 'integer'], [['satpam_id', 'pegawai_id', 'deleted'], 'integer'],
[['nip', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'], [['nama', 'nip', 'status', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'],
]; ];
} }
...@@ -41,7 +41,7 @@ class HahaSearch extends Haha ...@@ -41,7 +41,7 @@ class HahaSearch extends Haha
*/ */
public function search($params) public function search($params)
{ {
$query = Haha::find(); $query = Satpam::find()->select(['satpam_id','nama','nip','status']);
$dataProvider = new ActiveDataProvider([ $dataProvider = new ActiveDataProvider([
'query' => $query, 'query' => $query,
...@@ -56,15 +56,17 @@ class HahaSearch extends Haha ...@@ -56,15 +56,17 @@ class HahaSearch extends Haha
} }
$query->andFilterWhere([ $query->andFilterWhere([
'id' => $this->id, 'satpam_id' => $this->satpam_id,
'pegawai_id' => $this->pegawai_id,
'deleted' => $this->deleted, 'deleted' => $this->deleted,
'deleted_at' => $this->deleted_at, 'deleted_at' => $this->deleted_at,
'created_at' => $this->created_at, 'created_at' => $this->created_at,
'updated_at' => $this->updated_at, 'updated_at' => $this->updated_at,
'pegawai_id' => $this->pegawai_id,
]); ]);
$query->andFilterWhere(['like', 'nip', $this->nip]) $query->andFilterWhere(['like', 'nama', $this->nama])
->andFilterWhere(['like', 'nip', $this->nip])
->andFilterWhere(['like', 'status', $this->status])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by]) ->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by]) ->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by]); ->andFilterWhere(['like', 'updated_by', $this->updated_by]);
......
<?php
namespace backend\modules\ubux;
class ubux extends \yii\base\Module
{
public $controllerNamespace = 'backend\modules\ubux\controllers';
public function init()
{
parent::init();
// custom initialization code goes here
}
}
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use backend\modules\ubux\models\JamKerja;
use backend\modules\ubux\models\Satpam;
use backend\modules\ubux\models\Laporan;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Gaji */
/* @var $form yii\widgets\ActiveForm */
$gaji = 50000;
// $nip = post(['nip']);
// $query = JamKerja::find();
// $query->where('MONTH(str_to_date(tanggal_scan, "%m-%Y"))' == 2)->all();
// $query->andWhere('like', 'nip', $nip);
// $bulan = $query;
// $i = 0;
// foreach ($bulan as $key) {
// $i++;
// }
// $total = $i;
// $bulan2 = JamKerja::find()->where('MONTH(str_to_date(tanggal_scan, "%m-%Y"))' == 2)->andWhere('like', 'nip', '0302090176')->all();
?>
<div class="gaji-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'total_gaji')->textInput(['maxlength' => true, 'value' => $gaji]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
...@@ -4,36 +4,36 @@ use yii\helpers\Html; ...@@ -4,36 +4,36 @@ use yii\helpers\Html;
use yii\widgets\ActiveForm; use yii\widgets\ActiveForm;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\search\TotalGajiSearch */ /* @var $model backend\modules\ubux\models\search\GajiSearch */
/* @var $form yii\widgets\ActiveForm */ /* @var $form yii\widgets\ActiveForm */
?> ?>
<div class="total-gaji-search"> <div class="gaji-search">
<?php $form = ActiveForm::begin([ <?php $form = ActiveForm::begin([
'action' => ['index'], 'action' => ['index'],
'method' => 'get', 'method' => 'get',
]); ?> ]); ?>
<?= $form->field($model, 'total_id') ?> <?= $form->field($model, 'gaji_id') ?>
<?= $form->field($model, 'satpam_id') ?>
<?= $form->field($model, 'total_gaji') ?> <?= $form->field($model, 'total_gaji') ?>
<?= $form->field($model, 'deleted') ?> <?= $form->field($model, 'delete') ?>
<?= $form->field($model, 'deleted_at') ?> <?= $form->field($model, 'deleted_at') ?>
<?= $form->field($model, 'deleted_by') ?> <?php // echo $form->field($model, 'deleted_by') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<?php // echo $form->field($model, 'updated_by') ?>
<?php // echo $form->field($model, 'created_at') ?> <?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'created_by') ?> <?php // echo $form->field($model, 'created_by') ?>
<?php // echo $form->field($model, 'laporan_id') ?> <?php // echo $form->field($model, 'updated_at') ?>
<?php // echo $form->field($model, 'updated_by') ?>
<div class="form-group"> <div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?> <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
......
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Gaji */
$this->title = 'Create Gaji';
$this->params['breadcrumbs'][] = ['label' => 'Gajis', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="gaji-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
...@@ -4,19 +4,19 @@ use yii\helpers\Html; ...@@ -4,19 +4,19 @@ use yii\helpers\Html;
use yii\grid\GridView; use yii\grid\GridView;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\search\UangSearch */ /* @var $searchModel backend\modules\ubux\models\search\GajiSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */ /* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Uangs'; $this->title = 'Gajis';
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;
?> ?>
<div class="uang-index"> <div class="gaji-index">
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p> <p>
<?= Html::a('Create Uang', ['create'], ['class' => 'btn btn-success']) ?> <?= Html::a('Create Gaji', ['create'], ['class' => 'btn btn-success']) ?>
</p> </p>
<?= GridView::widget([ <?= GridView::widget([
...@@ -24,11 +24,9 @@ $this->params['breadcrumbs'][] = $this->title; ...@@ -24,11 +24,9 @@ $this->params['breadcrumbs'][] = $this->title;
'filterModel' => $searchModel, 'filterModel' => $searchModel,
'columns' => [ 'columns' => [
['class' => 'yii\grid\SerialColumn'], ['class' => 'yii\grid\SerialColumn'],
'nip', 'total_gaji',
'nama',
'gaji_pokok',
'tunjangan',
['class' => 'yii\grid\ActionColumn'], ['class' => 'yii\grid\ActionColumn'],
], ],
......
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Gaji */
$this->title = 'Update Gaji: ' . ' ' . $model->gaji_id;
$this->params['breadcrumbs'][] = ['label' => 'Gajis', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->gaji_id, 'url' => ['view', 'id' => $model->gaji_id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="gaji-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Gaji */
$this->title = $model->gaji_id;
$this->params['breadcrumbs'][] = ['label' => 'Gajis', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="gaji-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->gaji_id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->gaji_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'total_gaji',
],
]) ?>
</div>
...@@ -4,16 +4,42 @@ use yii\helpers\Html; ...@@ -4,16 +4,42 @@ use yii\helpers\Html;
use yii\widgets\ActiveForm; use yii\widgets\ActiveForm;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Haha */ /* @var $model backend\modules\ubux\models\JamKerja */
/* @var $form yii\widgets\ActiveForm */ /* @var $form yii\widgets\ActiveForm */
?> ?>
<div class="haha-form"> <div class="jam-kerja-form">
<?php $form = ActiveForm::begin(); ?> <?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'satpam_id')->textInput() ?>
<?= $form->field($model, 'tanggal_scan')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'tanggal')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'jam')->textInput() ?>
<?= $form->field($model, 'pin')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'nip')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'nip')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'nama')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'jabatan')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'departemen')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'kantor')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'verifikasi')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'i_o')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'workcode')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'mesin')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'deleted')->textInput() ?> <?= $form->field($model, 'deleted')->textInput() ?>
<?= $form->field($model, 'deleted_at')->textInput() ?> <?= $form->field($model, 'deleted_at')->textInput() ?>
...@@ -28,8 +54,6 @@ use yii\widgets\ActiveForm; ...@@ -28,8 +54,6 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'pegawai_id')->textInput() ?>
<div class="form-group"> <div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div> </div>
......
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\search\JamKerjaSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="jam-kerja-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'jam_kerja_id') ?>
<?= $form->field($model, 'satpam_id') ?>
<?= $form->field($model, 'tanggal_scan') ?>
<?= $form->field($model, 'tanggal') ?>
<?= $form->field($model, 'jam') ?>
<?php // echo $form->field($model, 'pin') ?>
<?php // echo $form->field($model, 'nip') ?>
<?php // echo $form->field($model, 'nama') ?>
<?php // echo $form->field($model, 'jabatan') ?>
<?php // echo $form->field($model, 'departemen') ?>
<?php // echo $form->field($model, 'kantor') ?>
<?php // echo $form->field($model, 'verifikasi') ?>
<?php // echo $form->field($model, 'i_o') ?>
<?php // echo $form->field($model, 'workcode') ?>
<?php // echo $form->field($model, 'mesin') ?>
<?php // echo $form->field($model, 'deleted') ?>
<?php // echo $form->field($model, 'deleted_at') ?>
<?php // echo $form->field($model, 'deleted_by') ?>
<?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'created_by') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<?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>
...@@ -4,13 +4,13 @@ use yii\helpers\Html; ...@@ -4,13 +4,13 @@ use yii\helpers\Html;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Haha */ /* @var $model backend\modules\ubux\models\JamKerja */
$this->title = 'Create Haha'; $this->title = 'Create Jam Kerja';
$this->params['breadcrumbs'][] = ['label' => 'Hahas', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => 'Jam Kerjas', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;
?> ?>
<div class="haha-create"> <div class="jam-kerja-create">
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
......
...@@ -4,19 +4,19 @@ use yii\helpers\Html; ...@@ -4,19 +4,19 @@ use yii\helpers\Html;
use yii\grid\GridView; use yii\grid\GridView;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\search\TotalGajiSearch */ /* @var $searchModel backend\modules\ubux\models\search\JamKerjaSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */ /* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Total Gajis'; $this->title = 'Jam Kerjas';
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;
?> ?>
<div class="total-gaji-index"> <div class="jam-kerja-index">
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p> <p>
<?= Html::a('Create Total Gaji', ['create'], ['class' => 'btn btn-success']) ?> <?= Html::a('Import Excel', ['import'], ['class' => 'btn btn-success']) ?>
</p> </p>
<?= GridView::widget([ <?= GridView::widget([
...@@ -25,16 +25,28 @@ $this->params['breadcrumbs'][] = $this->title; ...@@ -25,16 +25,28 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [ 'columns' => [
['class' => 'yii\grid\SerialColumn'], ['class' => 'yii\grid\SerialColumn'],
// 'total_id', // 'jam_kerja_id',
'total_gaji', // 'satpam_id',
// 'tanggal_scan',
'nama',
'tanggal',
// 'jam',
// 'pin',
// 'nip',
// 'jabatan',
// 'departemen',
// 'kantor',
// 'verifikasi',
// 'i_o',
// 'workcode',
// 'mesin',
// 'deleted', // 'deleted',
// 'deleted_at', // 'deleted_at',
// 'deleted_by', // 'deleted_by',
// 'updated_at',
// 'updated_by',
// 'created_at', // 'created_at',
// 'created_by', // 'created_by',
// 'laporan_id', // 'updated_at',
// 'updated_by',
['class' => 'yii\grid\ActionColumn'], ['class' => 'yii\grid\ActionColumn'],
], ],
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
use yii\helpers\Html; use yii\helpers\Html;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Haha */ /* @var $model backend\modules\ubux\models\JamKerja */
$this->title = 'Update Haha: ' . ' ' . $model->id; $this->title = 'Update Jam Kerja: ' . ' ' . $model->jam_kerja_id;
$this->params['breadcrumbs'][] = ['label' => 'Hahas', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => 'Jam Kerjas', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]]; $this->params['breadcrumbs'][] = ['label' => $model->jam_kerja_id, 'url' => ['view', 'id' => $model->jam_kerja_id]];
$this->params['breadcrumbs'][] = 'Update'; $this->params['breadcrumbs'][] = 'Update';
?> ?>
<div class="haha-update"> <div class="jam-kerja-update">
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
......
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\JamKerja */
$this->title = $model->jam_kerja_id;
$this->params['breadcrumbs'][] = ['label' => 'Jam Kerjas', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="jam-kerja-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->jam_kerja_id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->jam_kerja_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'jam_kerja_id',
'satpam_id',
'tanggal_scan',
'tanggal',
'jam',
'pin',
'nip',
'nama',
'jabatan',
'departemen',
'kantor',
'verifikasi',
'i_o',
'workcode',
'mesin',
'deleted',
'deleted_at',
'deleted_by',
'created_at',
'created_by',
'updated_at',
'updated_by',
],
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Laporan */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="laporan-form">
<?php $form = ActiveForm::begin(); ?>
<?php
$thn = date('Y');
foreach(range(2002-2, $thn) as $i) {
$array[] = $i;
}
?>
<?= $form->field($model, 'bulan')->dropDownlist(['Januari' => 'Januari', 'Februari' => 'Februari', 'Maret' => 'Maret', 'April' => 'April', 'Mei' => 'Mei', 'Juni' => 'Juni', 'Juli' => 'Juli', 'Agustus' => 'Agustus', 'September' => 'September' , 'Oktober' => 'Oktober', 'November' => 'November', 'Desember' => 'Desember'], ['prompt' => 'Pilih Bulan'])?>
<?= $form->field($model, 'tahun')->dropDownList(
$array, ['prompt' => 'Pilih Tahun']
); ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
...@@ -4,26 +4,30 @@ use yii\helpers\Html; ...@@ -4,26 +4,30 @@ use yii\helpers\Html;
use yii\widgets\ActiveForm; use yii\widgets\ActiveForm;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\search\HahaSearch */ /* @var $model backend\modules\ubux\models\search\LaporanSearch */
/* @var $form yii\widgets\ActiveForm */ /* @var $form yii\widgets\ActiveForm */
?> ?>
<div class="haha-search"> <div class="laporan-search">
<?php $form = ActiveForm::begin([ <?php $form = ActiveForm::begin([
'action' => ['index'], 'action' => ['index'],
'method' => 'get', 'method' => 'get',
]); ?> ]); ?>
<?= $form->field($model, 'id') ?> <?= $form->field($model, 'laporan_id') ?>
<?= $form->field($model, 'nip') ?> <?= $form->field($model, 'satpam_id') ?>
<?= $form->field($model, 'bulan') ?>
<?= $form->field($model, 'tahun') ?>
<?= $form->field($model, 'deleted') ?> <?= $form->field($model, 'deleted') ?>
<?= $form->field($model, 'deleted_at') ?> <?php // echo $form->field($model, 'deleted_at') ?>
<?= $form->field($model, 'deleted_by') ?> <?php // echo $form->field($model, 'deleted_by') ?>
<?php // echo $form->field($model, 'created_at') ?> <?php // echo $form->field($model, 'created_at') ?>
...@@ -33,8 +37,6 @@ use yii\widgets\ActiveForm; ...@@ -33,8 +37,6 @@ use yii\widgets\ActiveForm;
<?php // echo $form->field($model, 'updated_by') ?> <?php // echo $form->field($model, 'updated_by') ?>
<?php // echo $form->field($model, 'pegawai_id') ?>
<div class="form-group"> <div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?> <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?> <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
......
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Laporan */
$this->title = 'Create Laporan';
$this->params['breadcrumbs'][] = ['label' => 'Laporans', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="laporan-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use common\components\ToolsColumn;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\search\LaporanSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Import Excel';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="laporan-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a('Import Excel', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'bulan',
'tahun',
['class' => 'common\components\ToolsColumn',
'template' => '{view} {update} {print} {delete}',// {edit} {cancel}',
'header' => 'Aksi',
'buttons' => [
'view' => function ($url, $model){
return ToolsColumn::renderCustomButton($url, $model, 'View Detail', 'fa fa-eye');
},
'update' => function ($url, $model){
return ToolsColumn::renderCustomButton($url, $model, 'Update', 'fa fa-gear');
},
'delete' => function ($url, $model){
return "<li>".Html::a('<span class="fa fa-trash"></span> Hapus', $url, [
'title' => Yii::t('yii', 'Hapus'),
'data-confirm' => Yii::t('yii', 'Apakah anda ingin menghapus ?'),
'data-method' => 'post',
'data-pjax' => '0',
])."</li>";
},
'print' => function ($url, $model){
return ToolsColumn::renderCustomButton($url, $model, 'Print Laporan', 'fa fa-print');
}
],
'urlCreator' => function ($action, $model, $key, $index){
if ($action === 'view') {
return Url::toRoute(['view', 'id' => $key]);
}else if ($action === 'update') {
return Url::toRoute(['update', 'id' => $key]);
}else if ($action === 'delete') {
return Url::toRoute(['delete', 'id' => $key]);
}else if ($action === 'print') {
return Url::toRoute(['print', 'id' => $key]);
}
}
],
],
]); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Laporan */
$this->title = 'Update Laporan: ' . ' ' . $model->laporan_id;
$this->params['breadcrumbs'][] = ['label' => 'Laporans', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->laporan_id, 'url' => ['view', 'id' => $model->laporan_id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="laporan-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\grid\GridView;
use yii\data\ArrayDataProvider;
use yii\helpers\Url;
use common\components\ToolsColumn;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Laporan */
//$this->title = $model->laporan_id;
$this->params['breadcrumbs'][] = ['label' => 'Laporans', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="laporan-view">
<h1><?= Html::encode($this->title) ?></h1>
<?php
$dataProvider = new ArrayDataProvider([
'allModels' => $model,
]);
echo GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
'nama',
[
'attribute' => 'tanggal',
'label' => 'Tanggal',
'format' => ['date', 'php:d M Y'],
'filter' => '',
],
'jam',
// 'laporan.totalGaji.total_gaji',
]
]);
// echo $dataProvider->getTotalCount();
?>
</div>
\ No newline at end of file
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\grid\GridView;
use yii\data\ArrayDataProvider;
use yii\helpers\Url;
use common\components\ToolsColumn;
use backend\modules\ubux\models\Gaji;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Laporan */
//$this->title = $model->laporan_id;
$this->params['breadcrumbs'][] = ['label' => 'Laporans', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="laporan-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Import', ['jam-kerja/import', 'id' => $model->laporan_id], ['class' => 'btn btn-info']) ?>
</p>
<?php
$count = 0;
$data = array();
foreach ($gajiModel as $obj) {
$data[$obj->nip] = $obj;
}
foreach ($data as $key) {
$count++;
}
$dataProvider = new ArrayDataProvider([
'allModels' => $data,
]);
// echo GridView::widget([
// 'dataProvider' => $dataProvider,
// 'columns' => [
// 'nama',
// 'nip',
// ]
// ]);
echo GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'nama',
'nip',
'laporan.satpam.nama',
// [
// 'attribute' => 'laporan.totalGaji.total_id',
// 'value' => 'laporan.totalGaji.total_id',
// ],
['class' => 'common\components\ToolsColumn',
'template' => '{view} {update} {total} {print} ',// {edit} {cancel}',
'header' => 'Aksi',
'buttons' => [
'view' => function ($url, $model){
return ToolsColumn::renderCustomButton($url, $model, 'View Detail', 'fa fa-eye');
},
'total' => function ($url, $model){
return ToolsColumn::renderCustomButton($url, $model, 'Add Gaji', 'fa fa-eye');
},
'delete' => function ($url, $model){
return "<li>".Html::a('<span class="fa fa-trash"></span> Hapus', $url, [
'title' => Yii::t('yii', 'Legitimate'),
'data-confirm' => Yii::t('yii', 'Are you sure to legitimate the program ?'),
'data-method' => 'post',
'data-pjax' => '0',
])."</li>";
},
],
'urlCreator' => function ($action, $model, $key, $index){
if ($action === 'view') {
return Url::toRoute(['view-detail', 'id' => $_GET['id'], 'nip' => $key]);
}else if ($action === 'total') {
return Url::toRoute(['total-gaji/create', 'id' => $_GET['id'], 'nip' => $key]);
}else if ($action === 'delete') {
return Url::toRoute(['delete', 'id' => $key]);
}
}
],
[
'attribute' => 'Add Gaji',
'format' => 'raw',
'value' => function($model, $key){
return Html::a('Gaji', ['gaji/create' , 'id' => $_GET['id'], 'nip' => $key], ['class' => 'btn btn-success']);
}
],
],
]);
// echo "<br>" . $count;
?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Pegawai */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="pegawai-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'profile_old_id')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'nama')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'user_name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'nip')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'kpt_no')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'kbk_id')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'ref_kbk_id')->textInput() ?>
<?= $form->field($model, 'alias')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'posisi')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'tempat_lahir')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'tgl_lahir')->textInput() ?>
<?= $form->field($model, 'agama_id')->textInput() ?>
<?= $form->field($model, 'jenis_kelamin_id')->textInput() ?>
<?= $form->field($model, 'golongan_darah_id')->textInput() ?>
<?= $form->field($model, 'hp')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'telepon')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'alamat')->textInput() ?>
<?= $form->field($model, 'alamat_libur')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'kecamatan')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'kota')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'kabupaten_id')->textInput() ?>
<?= $form->field($model, 'kode_pos')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'no_ktp')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'email')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'ext_num')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'study_area_1')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'study_area_2')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'jabatan')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'jabatan_akademik_id')->textInput() ?>
<?= $form->field($model, 'gbk_1')->textInput() ?>
<?= $form->field($model, 'gbk_2')->textInput() ?>
<?= $form->field($model, 'status_ikatan_kerja_pegawai_id')->textInput() ?>
<?= $form->field($model, 'status_akhir')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'status_aktif_pegawai_id')->textInput() ?>
<?= $form->field($model, 'tanggal_masuk')->textInput() ?>
<?= $form->field($model, 'tanggal_keluar')->textInput() ?>
<?= $form->field($model, 'nama_bapak')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'nama_ibu')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'status')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'status_marital_id')->textInput() ?>
<?= $form->field($model, 'nama_p')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'tgl_lahir_p')->textInput() ?>
<?= $form->field($model, 'tmp_lahir_p')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'pekerjaan_ortu')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'user_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_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<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\PegawaiSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="pegawai-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'pegawai_id') ?>
<?= $form->field($model, 'profile_old_id') ?>
<?= $form->field($model, 'nama') ?>
<?= $form->field($model, 'user_name') ?>
<?= $form->field($model, 'nip') ?>
<?php // echo $form->field($model, 'kpt_no') ?>
<?php // echo $form->field($model, 'kbk_id') ?>
<?php // echo $form->field($model, 'ref_kbk_id') ?>
<?php // echo $form->field($model, 'alias') ?>
<?php // echo $form->field($model, 'posisi') ?>
<?php // echo $form->field($model, 'tempat_lahir') ?>
<?php // echo $form->field($model, 'tgl_lahir') ?>
<?php // echo $form->field($model, 'agama_id') ?>
<?php // echo $form->field($model, 'jenis_kelamin_id') ?>
<?php // echo $form->field($model, 'golongan_darah_id') ?>
<?php // echo $form->field($model, 'hp') ?>
<?php // echo $form->field($model, 'telepon') ?>
<?php // echo $form->field($model, 'alamat') ?>
<?php // echo $form->field($model, 'alamat_libur') ?>
<?php // echo $form->field($model, 'kecamatan') ?>
<?php // echo $form->field($model, 'kota') ?>
<?php // echo $form->field($model, 'kabupaten_id') ?>
<?php // echo $form->field($model, 'kode_pos') ?>
<?php // echo $form->field($model, 'no_ktp') ?>
<?php // echo $form->field($model, 'email') ?>
<?php // echo $form->field($model, 'ext_num') ?>
<?php // echo $form->field($model, 'study_area_1') ?>
<?php // echo $form->field($model, 'study_area_2') ?>
<?php // echo $form->field($model, 'jabatan') ?>
<?php // echo $form->field($model, 'jabatan_akademik_id') ?>
<?php // echo $form->field($model, 'gbk_1') ?>
<?php // echo $form->field($model, 'gbk_2') ?>
<?php // echo $form->field($model, 'status_ikatan_kerja_pegawai_id') ?>
<?php // echo $form->field($model, 'status_akhir') ?>
<?php // echo $form->field($model, 'status_aktif_pegawai_id') ?>
<?php // echo $form->field($model, 'tanggal_masuk') ?>
<?php // echo $form->field($model, 'tanggal_keluar') ?>
<?php // echo $form->field($model, 'nama_bapak') ?>
<?php // echo $form->field($model, 'nama_ibu') ?>
<?php // echo $form->field($model, 'status') ?>
<?php // echo $form->field($model, 'status_marital_id') ?>
<?php // echo $form->field($model, 'nama_p') ?>
<?php // echo $form->field($model, 'tgl_lahir_p') ?>
<?php // echo $form->field($model, 'tmp_lahir_p') ?>
<?php // echo $form->field($model, 'pekerjaan_ortu') ?>
<?php // echo $form->field($model, 'user_id') ?>
<?php // echo $form->field($model, 'deleted') ?>
<?php // echo $form->field($model, 'deleted_at') ?>
<?php // echo $form->field($model, 'deleted_by') ?>
<?php // echo $form->field($model, 'created_by') ?>
<?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'updated_by') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
...@@ -4,13 +4,13 @@ use yii\helpers\Html; ...@@ -4,13 +4,13 @@ use yii\helpers\Html;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Uang */ /* @var $model backend\modules\ubux\models\Pegawai */
$this->title = 'Create Uang'; $this->title = 'Create Pegawai';
$this->params['breadcrumbs'][] = ['label' => 'Uangs', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => 'Pegawais', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;
?> ?>
<div class="uang-create"> <div class="pegawai-create">
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
......
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\search\PegawaiSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Pegawais';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="pegawai-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a('Create Pegawai', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'pegawai_id',
'profile_old_id',
'nama',
'user_name',
'nip',
// 'kpt_no',
// 'kbk_id',
// 'ref_kbk_id',
// 'alias',
// 'posisi',
// 'tempat_lahir',
// 'tgl_lahir',
// 'agama_id',
// 'jenis_kelamin_id',
// 'golongan_darah_id',
// 'hp',
// 'telepon',
// 'alamat',
// 'alamat_libur',
// 'kecamatan',
// 'kota',
// 'kabupaten_id',
// 'kode_pos',
// 'no_ktp',
// 'email:ntext',
// 'ext_num',
// 'study_area_1',
// 'study_area_2',
// 'jabatan',
// 'jabatan_akademik_id',
// 'gbk_1',
// 'gbk_2',
// 'status_ikatan_kerja_pegawai_id',
// 'status_akhir',
// 'status_aktif_pegawai_id',
// 'tanggal_masuk',
// 'tanggal_keluar',
// 'nama_bapak',
// 'nama_ibu',
// 'status',
// 'status_marital_id',
// 'nama_p',
// 'tgl_lahir_p',
// 'tmp_lahir_p',
// 'pekerjaan_ortu',
// 'user_id',
// 'deleted',
// 'deleted_at',
// 'deleted_by',
// 'created_by',
// 'created_at',
// 'updated_by',
// 'updated_at',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
use yii\helpers\Html; use yii\helpers\Html;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\TotalGaji */ /* @var $model backend\modules\ubux\models\Pegawai */
$this->title = 'Update Total Gaji: ' . ' ' . $model->total_id; $this->title = 'Update Pegawai: ' . ' ' . $model->pegawai_id;
$this->params['breadcrumbs'][] = ['label' => 'Total Gajis', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => 'Pegawais', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->total_id, 'url' => ['view', 'id' => $model->total_id]]; $this->params['breadcrumbs'][] = ['label' => $model->pegawai_id, 'url' => ['view', 'id' => $model->pegawai_id]];
$this->params['breadcrumbs'][] = 'Update'; $this->params['breadcrumbs'][] = 'Update';
?> ?>
<div class="total-gaji-update"> <div class="pegawai-update">
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
......
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Pegawai */
$this->title = $model->nip;
$this->params['breadcrumbs'][] = ['label' => 'Pegawais', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="pegawai-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->pegawai_id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->pegawai_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'pegawai_id',
'profile_old_id',
'nama',
'user_name',
'nip',
'kpt_no',
'kbk_id',
'ref_kbk_id',
'alias',
'posisi',
'tempat_lahir',
'tgl_lahir',
'agama_id',
'jenis_kelamin_id',
'golongan_darah_id',
'hp',
'telepon',
'alamat',
'alamat_libur',
'kecamatan',
'kota',
'kabupaten_id',
'kode_pos',
'no_ktp',
'email:ntext',
'ext_num',
'study_area_1',
'study_area_2',
'jabatan',
'jabatan_akademik_id',
'gbk_1',
'gbk_2',
'status_ikatan_kerja_pegawai_id',
'status_akhir',
'status_aktif_pegawai_id',
'tanggal_masuk',
'tanggal_keluar',
'nama_bapak',
'nama_ibu',
'status',
'status_marital_id',
'nama_p',
'tgl_lahir_p',
'tmp_lahir_p',
'pekerjaan_ortu',
'user_id',
'deleted',
'deleted_at',
'deleted_by',
'created_by',
'created_at',
'updated_by',
'updated_at',
],
]) ?>
</div>
...@@ -12,11 +12,13 @@ use yii\widgets\ActiveForm; ...@@ -12,11 +12,13 @@ use yii\widgets\ActiveForm;
<?php $form = ActiveForm::begin(); ?> <?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'pegawai_id')->textInput() ?>
<?= $form->field($model, 'nama')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'nama')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'tgl_lahir')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'nip')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'alamat')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'status')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'deleted')->textInput() ?> <?= $form->field($model, 'deleted')->textInput() ?>
...@@ -32,8 +34,6 @@ use yii\widgets\ActiveForm; ...@@ -32,8 +34,6 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'pegawai_id')->textInput() ?>
<div class="form-group"> <div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div> </div>
......
...@@ -17,13 +17,15 @@ use yii\widgets\ActiveForm; ...@@ -17,13 +17,15 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'satpam_id') ?> <?= $form->field($model, 'satpam_id') ?>
<?= $form->field($model, 'pegawai_id') ?>
<?= $form->field($model, 'nama') ?> <?= $form->field($model, 'nama') ?>
<?= $form->field($model, 'tgl_lahir') ?> <?= $form->field($model, 'nip') ?>
<?= $form->field($model, 'alamat') ?> <?= $form->field($model, 'status') ?>
<?= $form->field($model, 'deleted') ?> <?php // echo $form->field($model, 'deleted') ?>
<?php // echo $form->field($model, 'deleted_at') ?> <?php // echo $form->field($model, 'deleted_at') ?>
...@@ -37,8 +39,6 @@ use yii\widgets\ActiveForm; ...@@ -37,8 +39,6 @@ use yii\widgets\ActiveForm;
<?php // echo $form->field($model, 'updated_by') ?> <?php // echo $form->field($model, 'updated_by') ?>
<?php // echo $form->field($model, 'pegawai_id') ?>
<div class="form-group"> <div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?> <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?> <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
......
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use common\components\ToolsColumn;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\search\SatpamSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Satpams';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="satpam-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<!-- <?= Html::a('Create Satpam', ['create'], ['class' => 'btn btn-success']) ?> -->
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'nama',
'nip',
'status',
'gaji.total_gaji',
['class' => 'common\components\ToolsColumn',
'template' => '{view} {update} {delete}',// {edit} {cancel}',
'header' => 'Aksi',
'buttons' => [
'view' => function ($url, $model){
return ToolsColumn::renderCustomButton($url, $model, 'View Detail', 'fa fa-eye');
},
'update' => function ($url, $model){
return ToolsColumn::renderCustomButton($url, $model, 'Update', 'fa fa-gear');
},
'delete' => function ($url, $model){
return "<li>".Html::a('<span class="fa fa-trash"></span> Hapus', $url, [
'title' => Yii::t('yii', 'Hapus'),
'data-confirm' => Yii::t('yii', 'Apakah anda ingin menghapus ?'),
'data-method' => 'post',
'data-pjax' => '0',
])."</li>";
},
],
'urlCreator' => function ($action, $model, $key, $index){
if ($action === 'view') {
return Url::toRoute(['view', 'id' => $key]);
}else if ($action === 'update') {
return Url::toRoute(['update', 'id' => $key]);
}else if ($action === 'delete') {
return Url::toRoute(['delete', 'id' => $key]);
}
}
],
[
'attribute' => 'Add Gaji',
'format' => 'raw',
'value' => function($model){
return Html::a('Gaji', ['gaji/create' , 'nip' => $model->nip], ['class' => 'btn btn-success']);
}
]
],
]); ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Satpam */
$this->title = $model->nama;
$this->params['breadcrumbs'][] = ['label' => 'Satpams', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="satpam-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->satpam_id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->satpam_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
//'satpam_id',
//'pegawai_id',
'nama',
'nip',
'status',
],
]) ?>
</div>
<?php
namespace backend\modules\ubux\assets;
use yii\web\AssetBundle;
class ubuxAsset extends AssetBundle{
public $sourcePath = '@backend/modules/ubux/assets/web';
public $css = [
'css/jquery.datepick.css',
'css/smoothness.datepick.css'
];
public $js = [
'js/jquery.plugin.js',
'js/jquery.datepick.js',
'js/jscript.js',
];
public $depends = [
'backend\themes\v2\assets\V2Asset'
];
public $publishOptions = [
'forceCopy' => true,
];
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/* Default styling for jQuery Datepicker v5.0.1. */
.datepick {
background-color: #fff;
color: #000;
border: 1px solid #444;
border-radius: 0.25em;
-moz-border-radius: 0.25em;
-webkit-border-radius: 0.25em;
font-family: Arial,Helvetica,Sans-serif;
font-size: 90%;
}
.datepick-rtl {
direction: rtl;
}
.datepick-popup {
z-index: 1000;
}
.datepick-disable {
position: absolute;
z-index: 100;
background-color: white;
opacity: 0.5;
filter: alpha(opacity=50);
}
.datepick a {
color: #fff;
text-decoration: none;
}
.datepick a.datepick-disabled {
color: #888;
cursor: auto;
}
.datepick button {
margin: 0.25em;
padding: 0.125em 0em;
background-color: #fcc;
border: none;
border-radius: 0.25em;
-moz-border-radius: 0.25em;
-webkit-border-radius: 0.25em;
font-weight: bold;
}
.datepick-nav, .datepick-ctrl {
float: left;
width: 100%;
background-color: #000;
color: #fff;
font-size: 90%;
font-weight: bold;
}
.datepick-ctrl {
background-color: #600;
}
.datepick-cmd {
width: 30%;
}
.datepick-cmd:hover {
background-color: #777;
}
.datepick-ctrl .datepick-cmd:hover {
background-color: #f08080;
}
.datepick-cmd-prevJump, .datepick-cmd-nextJump {
width: 8%;
}
a.datepick-cmd {
height: 1.5em;
}
button.datepick-cmd {
text-align: center;
}
.datepick-cmd-prev, .datepick-cmd-prevJump, .datepick-cmd-clear {
float: left;
padding-left: 2%;
}
.datepick-cmd-current, .datepick-cmd-today {
float: left;
width: 35%;
text-align: center;
}
.datepick-cmd-next, .datepick-cmd-nextJump, .datepick-cmd-close {
float: right;
padding-right: 2%;
text-align: right;
}
.datepick-rtl .datepick-cmd-prev, .datepick-rtl .datepick-cmd-prevJump,
.datepick-rtl .datepick-cmd-clear {
float: right;
padding-left: 0%;
padding-right: 2%;
text-align: right;
}
.datepick-rtl .datepick-cmd-current, .datepick-rtl .datepick-cmd-today {
float: right;
}
.datepick-rtl .datepick-cmd-next, .datepick-rtl .datepick-cmd-nextJump,
.datepick-rtl .datepick-cmd-close {
float: left;
padding-left: 2%;
padding-right: 0%;
text-align: left;
}
.datepick-month-nav {
float: left;
background-color: #777;
text-align: center;
}
.datepick-month-nav div {
float: left;
width: 12.5%;
margin: 1%;
padding: 1%;
}
.datepick-month-nav span {
color: #888;
}
.datepick-month-row {
clear: left;
}
.datepick-month {
float: left;
width: 15em;
border: 1px solid #444;
text-align: center;
}
.datepick-month-header, .datepick-month-header select, .datepick-month-header input {
height: 1.5em;
background-color: #444;
color: #fff;
font-weight: bold;
}
.datepick-month-header select, .datepick-month-header input {
height: 1.4em;
margin: 0em;
padding: 0em;
border: none;
font-size: 100%;
}
.datepick-month-header input {
position: absolute;
display: none;
}
.datepick-month table {
width: 100%;
border-collapse: collapse;
}
.datepick-month thead {
border-bottom: 1px solid #aaa;
}
.datepick-month th, .datepick-month td {
margin: 0em;
padding: 0em;
font-weight: normal;
text-align: center;
}
.datepick-month th {
border: 1px solid #777;
}
.datepick-month th, .datepick-month th a {
background-color: #777;
color: #fff;
}
.datepick-month td {
background-color: #eee;
border: 1px solid #aaa;
}
.datepick-month td.datepick-week {
border: 1px solid #777;
}
.datepick-month td.datepick-week * {
background-color: #777;
color: #fff;
border: none;
}
.datepick-month a {
display: block;
width: 100%;
padding: 0.125em 0em;
background-color: #eee;
color: #000;
text-decoration: none;
}
.datepick-month span {
display: block;
width: 100%;
padding: 0.125em 0em;
}
.datepick-month td span {
color: #888;
}
.datepick-month td .datepick-other-month {
background-color: #fff;
}
.datepick-month td .datepick-weekend {
background-color: #ddd;
}
.datepick-month td .datepick-today {
background-color: #f0c0c0;
}
.datepick-month td .datepick-highlight {
background-color: #f08080;
}
.datepick-month td .datepick-selected {
background-color: #777;
color: #fff;
}
.datepick-month th.datepick-week {
background-color: #777;
color: #fff;
}
.datepick-status {
clear: both;
background-color: #ddd;
text-align: center;
}
.datepick-clear-fix {
clear: both;
}
/* Smoothness style sheet for jQuery Datepicker v5.0.1. */
.datepick {
background-color: #fff;
color: #222;
border: 1px solid #aaa;
border-radius: 0.25em;
-moz-border-radius: 0.25em;
-webkit-border-radius: 0.25em;
font-family: Arial,Helvetica,Sans-serif;
font-size: 90%;
}
.datepick-rtl {
direction: rtl;
}
.datepick-popup {
z-index: 1000;
}
.datepick-disable {
position: absolute;
z-index: 100;
background-color: white;
opacity: 0.5;
filter: alpha(opacity=50);
}
.datepick a {
color: #222;
text-decoration: none;
}
.datepick a.datepick-disabled {
color: #888;
cursor: auto;
}
.datepick button {
margin: 0.25em;
padding: 0.125em 0em;
background-color: #fcc;
border: none;
border-radius: 0.25em;
-moz-border-radius: 0.25em;
-webkit-border-radius: 0.25em;
font-weight: bold;
}
.datepick-nav, .datepick-ctrl {
float: left;
width: 100%;
background-color: #fff;
font-size: 90%;
font-weight: bold;
}
.datepick-ctrl {
background-color: #fee6e3;
}
.datepick-cmd {
width: 30%;
}
.datepick-cmd:hover {
background-color: #e0e0e0;
}
.datepick-ctrl .datepick-cmd:hover {
background-color: #f08080;
}
.datepick-cmd-prevJump, .datepick-cmd-nextJump {
width: 8%;
}
a.datepick-cmd {
height: 1.5em;
}
button.datepick-cmd {
text-align: center;
}
.datepick-cmd-prev, .datepick-cmd-prevJump, .datepick-cmd-clear {
float: left;
padding-left: 2%;
}
.datepick-cmd-current, .datepick-cmd-today {
float: left;
width: 35%;
text-align: center;
}
.datepick-cmd-next, .datepick-cmd-nextJump, .datepick-cmd-close {
float: right;
padding-right: 2%;
text-align: right;
}
.datepick-rtl .datepick-cmd-prev, .datepick-rtl .datepick-cmd-prevJump,
.datepick-rtl .datepick-cmd-clear {
float: right;
padding-left: 0%;
padding-right: 2%;
text-align: right;
}
.datepick-rtl .datepick-cmd-current, .datepick-rtl .datepick-cmd-today {
float: right;
}
.datepick-rtl .datepick-cmd-next, .datepick-rtl .datepick-cmd-nextJump,
.datepick-rtl .datepick-cmd-close {
float: left;
padding-left: 2%;
padding-right: 0%;
text-align: left;
}
.datepick-month-nav {
float: left;
text-align: center;
}
.datepick-month-nav div {
float: left;
width: 12.5%;
margin: 1%;
padding: 1%;
}
.datepick-month-nav span {
color: #888;
}
.datepick-month-row {
clear: left;
}
.datepick-month {
float: left;
width: 15em;
border: 1px solid #aaa;
text-align: center;
}
.datepick-month-header, .datepick-month-header select, .datepick-month-header input {
height: 1.5em;
background-color: #e0e0e0;
color: #222;
font-weight: bold;
}
.datepick-month-header select, .datepick-month-header input {
height: 1.4em;
border: none;
}
.datepick-month-header input {
position: absolute;
display: none;
}
.datepick-month table {
width: 100%;
border-collapse: collapse;
}
.datepick-month thead {
border-bottom: 1px solid #aaa;
}
.datepick-month th, .datepick-month td {
margin: 0em;
padding: 0em;
font-weight: normal;
text-align: center;
}
.datepick-month thead tr {
border: 1px solid #aaa;
}
.datepick-month td {
background-color: #eee;
border: 1px solid #aaa;
}
.datepick-month td.datepick-week * {
background-color: #e0e0e0;
color: #222;
border: none;
}
.datepick-month a {
display: block;
width: 100%;
padding: 0.125em 0em;
background-color: #eee;
color: #000;
text-decoration: none;
}
.datepick-month span {
display: block;
width: 100%;
padding: 0.125em 0em;
}
.datepick-month td span {
color: #888;
}
.datepick-month td .datepick-other-month {
background-color: #fff;
}
.datepick-month td .datepick-weekend {
background-color: #ddd;
}
.datepick-month td .datepick-today {
background-color: #fbf9ee;
}
.datepick-month td .datepick-highlight {
background-color: #dadada;
}
.datepick-month td .datepick-selected {
background-color: #fcc;
}
.datepick-status {
clear: both;
text-align: center;
}
.datepick-clear-fix {
clear: both;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
$(document).ready(function() {
$('#multidate').datepick({
multiSelect: 200,
dateFormat: 'yyyy-mm-dd',
showTrigger: '#calImg'
});
$('#finsert').submit(function(e) {
var formObj = $(this);
var formURL = formObj.attr('action');
var formData = new FormData(this);
$.blockUI({ css: {
border: 'none',
padding: '15px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .5,
color: '#fff'
} });
$.ajax({
url: formURL,
type: 'POST',
data: formData,
mimeType:"multipart/form-data",
contentType: false,
cache : false,
processData: false,
success: function(data) {
if(data == 1){
$('#gagal').modal('show');
$.unblockUI();
}
if(data == 2){
$('#sukses').modal('show');
window.setTimeout(function() {
location.href = "?p=libur_kalender";
}, 2000);
$.unblockUI();
}
}
});
return false;
});
});
\ No newline at end of file
...@@ -4,7 +4,9 @@ namespace backend\modules\ubux\controllers; ...@@ -4,7 +4,9 @@ namespace backend\modules\ubux\controllers;
use Yii; use Yii;
use backend\modules\ubux\models\Gaji; use backend\modules\ubux\models\Gaji;
use backend\modules\ubux\models\Satpam;
use backend\modules\ubux\models\Laporan; use backend\modules\ubux\models\Laporan;
use backend\modules\ubux\models\JamKerja;
use backend\modules\ubux\models\search\GajiSearch; use backend\modules\ubux\models\search\GajiSearch;
use yii\web\Controller; use yii\web\Controller;
use yii\web\NotFoundHttpException; use yii\web\NotFoundHttpException;
...@@ -25,7 +27,7 @@ class GajiController extends Controller ...@@ -25,7 +27,7 @@ class GajiController extends Controller
], ],
], ],
]; ];
} }
/** /**
* Lists all Gaji models. * Lists all Gaji models.
...@@ -59,15 +61,35 @@ class GajiController extends Controller ...@@ -59,15 +61,35 @@ class GajiController extends Controller
* If creation is successful, the browser will be redirected to the 'view' page. * If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed * @return mixed
*/ */
public function actionCreate() public function actionCreate($id, $nip)
{ {
$modelCek = JamKerja::find()->where(['laporan_id' => $id])->andWhere(['nip' => $nip])->one();
$cek = $modelCek->tanggal;
$models = JamKerja::find()->where(['laporan_id' => $id])->andWhere(['nip' => $nip])->All();
$jlh = 1;
foreach ($models as $data) {
if($cek != $data->tanggal){
$jlh++;
$cek = $data->tanggal;
}
}
$model = new Gaji(); $model = new Gaji();
$modelSatpam = JamKerja::find()->where(['nip' => $nip])->andWhere(['laporan_id' => $id])->one();
// echo $modelSatpam ->satpam_id;die();
if ($model->load(Yii::$app->request->post())) {
$model->laporan_id = $id;
$model->jam_kerja_id = $modelSatpam->jam_kerja_id;
$total_gaji = $jlh * $model['total_gaji'];
$gajiku = 'Rp. ' . $total_gaji;
$model->total_gaji = $gajiku;
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) { if ($model->validate()) {
$model->save(); $model->save();
return $this->redirect(['view', 'id' => $model->gaji_id]); return $this->redirect(['laporan/view-detail', 'id' => $id, 'nip' => $nip]);
}else{ } else {
$errors = $model->$errors; $errors = $model->$errors;
print_r(array_values($errors)); print_r(array_values($errors));
} }
...@@ -78,35 +100,6 @@ class GajiController extends Controller ...@@ -78,35 +100,6 @@ class GajiController extends Controller
} }
} }
/*public function actionCreate()
{
$model = new Gaji();
if ($model->load(Yii::$app->request->post())) {
$Pmodel = new Laporan();
$Pmodel->bulan_laporan = $model->bulan_laporan;
if($Pmodel->save()){
$model->laporan_id = $Pmodel->laporan_id;
if($model->validate()){
// echo $model->aktif_star . " " . $model->aktif_end . " " . $Pmodel->tgl_lahir . " " . $Pmodel->alamat;
$model->save();
return $this->redirect(['view', 'id' => $model->gaji_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,
]);
}
}*/
/** /**
* Updates an existing Gaji model. * Updates an existing Gaji model.
...@@ -155,63 +148,4 @@ class GajiController extends Controller ...@@ -155,63 +148,4 @@ class GajiController extends Controller
throw new NotFoundHttpException('The requested page does not exist.'); throw new NotFoundHttpException('The requested page does not exist.');
} }
} }
public function actionImport($id){
$searchModel = new GajiSearch();
$modelImport = new \yii\base\DynamicModel([
'fileImport'=>'File Import',
]);
$modelImport->addRule(['fileImport'],'required');
$modelImport->addRule(['fileImport'],'file',['extensions'=>'ods,xls,xlsx'],['maxSize'=>1024*1024]);
if(Yii::$app->request->post()){
$modelImport->fileImport = \yii\web\UploadedFile::getInstance($modelImport,'fileImport');
if($modelImport->fileImport && $modelImport->validate()){
$inputFileType = \PHPExcel_IOFactory::identify($modelImport->fileImport->tempName);
$objReader = \PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($modelImport->fileImport->tempName);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
$baseRow = 3;
while(!empty($sheetData[$baseRow]['A'])){
$model = new \backend\modules\ubux\models\Gaji;
$model->tanggal_scan = (string)$sheetData[$baseRow]['A'];
$model->tanggal = (string)$sheetData[$baseRow]['B'];
$model->jam = (string)$sheetData[$baseRow]['C'];
$model->pin = (string)$sheetData[$baseRow]['D'];
$model->nip = (string)$sheetData[$baseRow]['E'];
$model->nama = (string)$sheetData[$baseRow]['F'];
$model->jabatan = (string)$sheetData[$baseRow]['G'];
$model->departemen = (string)$sheetData[$baseRow]['H'];
$model->kantor = (string)$sheetData[$baseRow]['I'];
$model->verifikasi = (string)$sheetData[$baseRow]['J'];
$model->i_o = (string)$sheetData[$baseRow]['K'];
$model->workcode = (string)$sheetData[$baseRow]['L'];
$model->mesin = (string)$sheetData[$baseRow]['M'];
$model->laporan_id = $id;
$model->save();
$baseRow++;
}
Yii::$app->getSession()->setFlash('success','Success');
return $this->redirect(['/ubux/laporan/view', 'id' => $id]);
}else{
Yii::$app->getSession()->setFlash('error','Error');
return $this->redirect(['import']);
}
}
return $this->render('import',[
'modelImport' => $modelImport,
]);
}
public function actionPrint($id)
{
$pdf_content = $this->renderPartial('view-pdf',[
'model' => $this->findModel($id),
]);
$mpdf = new mPDF();
$mpdf->writeHTML($pdf_content);
$mpdf->Output();
exit();
}
} }
...@@ -4,21 +4,19 @@ namespace backend\modules\ubux\controllers; ...@@ -4,21 +4,19 @@ namespace backend\modules\ubux\controllers;
use Yii; use Yii;
use backend\modules\ubux\models\JamKerja; use backend\modules\ubux\models\JamKerja;
use backend\modules\ubux\models\Hrdxpegawai;
use backend\modules\ubux\models\search\JamKerjaSearch; use backend\modules\ubux\models\search\JamKerjaSearch;
use backend\modules\ubux\models\Pegawai;
use yii\web\Controller; use yii\web\Controller;
use yii\web\NotFoundHttpException; use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter; use yii\filters\VerbFilter;
use yii\data\ActiveDataProvider; use backend\modules\ubux\models\Satpam;
/** /**
* JamKerjaController implements the CRUD actions for JamKerja model. * JamKerjaController implements the CRUD actions for JamKerja model.
*/ */
class JamKerjaController extends Controller class JamKerjaController extends Controller
{ {
public function behaviors() public function behaviors()
{ {
return [ return [
'verbs' => [ 'verbs' => [
'class' => VerbFilter::className(), 'class' => VerbFilter::className(),
...@@ -101,7 +99,7 @@ class JamKerjaController extends Controller ...@@ -101,7 +99,7 @@ class JamKerjaController extends Controller
*/ */
public function actionDelete($id) public function actionDelete($id)
{ {
$this->findModel($id)->softDelete(); $this->findModel($id)->delete();
return $this->redirect(['index']); return $this->redirect(['index']);
} }
...@@ -122,15 +120,128 @@ class JamKerjaController extends Controller ...@@ -122,15 +120,128 @@ class JamKerjaController extends Controller
} }
} }
public function showSatpam(){ public function actionImport($id){
$id = "satpam"; $searchModel = new JamKerjaSearch();
$dataProvider = new ActiveDataProvider([ $modelImport = new \yii\base\DynamicModel([
'query' => Hrdxpegawai::find()->where("posisi = 'satpam'"), 'fileImport'=>'File Import',
'pagination' => [ ]);
'pageSize' => 20, $modelImport->addRule(['fileImport'],'required');
], $modelImport->addRule(['fileImport'],'file',['extensions'=>'ods,xls,xlsx'],['maxSize'=>1024*1024]);
]);
if(Yii::$app->request->post()){
$modelImport->fileImport = \yii\web\UploadedFile::getInstance($modelImport,'fileImport');
if($modelImport->fileImport && $modelImport->validate()){
$inputFileType = \PHPExcel_IOFactory::identify($modelImport->fileImport->tempName);
$objReader = \PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($modelImport->fileImport->tempName);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
$baseRow = 3;
$model2 = Satpam::find()->where(['laporan_id' => $id])->one();
// echo $model2['laporan_id'];die();
//$baseRow2 = 3;
while(!empty($sheetData[$baseRow]['A'])){
$model = new \backend\modules\ubux\models\JamKerja;
$model2 = new \backend\modules\ubux\models\Satpam;
$model->tanggal_scan = (string)$sheetData[$baseRow]['A'];
$model->tanggal = (string)$sheetData[$baseRow]['B'];
$model->jam = (string)$sheetData[$baseRow]['C'];
$model->pin = (string)$sheetData[$baseRow]['D'];
$model->nip = (string)$sheetData[$baseRow]['E'];
$model->nama = (string)$sheetData[$baseRow]['F'];
$model->jabatan = (string)$sheetData[$baseRow]['G'];
$model->departemen = (string)$sheetData[$baseRow]['H'];
$model->kantor = (string)$sheetData[$baseRow]['I'];
$model->verifikasi = (string)$sheetData[$baseRow]['J'];
$model->i_o = (string)$sheetData[$baseRow]['K'];
$model->workcode = (string)$sheetData[$baseRow]['L'];
$model->mesin = (string)$sheetData[$baseRow]['M'];
$model->laporan_id = $id;
$model2->nama = (string)$sheetData[$baseRow]['F'];
$model2->nip = (string)$sheetData[$baseRow]['E'];
// $model2->laporan_id = $id;
if(strpos($model2->nip,'H')!==false){
$model2->status='Harian';
}else
$model2->status = 'Tetap';
$idSatpam;
//if(!($sheetData[$baseRow]['F'] == $sheetData[$baseRow-1]['F'])){
//if($)
if(!Satpam::find()->where(['nip'=>$model->nip])->exists()){
$model2->save();
$idSatpam=$model2->satpam_id;
}
else{
$satpam=Satpam::find()->where(['nip'=>$model->nip])->one();
$idSatpam = $satpam->satpam_id;
}
//}
// $model->satpam_id = $idSatpam;
$model->save();
// $model2->save();
$baseRow++;
}
Yii::$app->getSession()->setFlash('success','Success');
\Yii::$app->messenger->addSuccessFlash("Success");
return $this->redirect(['/ubux/laporan/view', 'id'=>$id]);
}else{
Yii::$app->getSession()->setFlash('error','Error');
return $this->redirect(['import']);
}
}
return $dataProvider; return $this->render('import',[
'modelImport' => $modelImport,
]);
} }
// public function actionImport($id){
// $searchModel = new JamKerjaSearch();
// $modelImport = new \yii\base\DynamicModel([
// 'fileImport'=>'File Import',
// ]);
// $modelImport->addRule(['fileImport'],'required');
// $modelImport->addRule(['fileImport'],'file',['extensions'=>'ods,xls,xlsx'],['maxSize'=>1024*1024]);
// if(Yii::$app->request->post()){
// $modelImport->fileImport = \yii\web\UploadedFile::getInstance($modelImport,'fileImport');
// if($modelImport->fileImport && $modelImport->validate()){
// $inputFileType = \PHPExcel_IOFactory::identify($modelImport->fileImport->tempName);
// $objReader = \PHPExcel_IOFactory::createReader($inputFileType);
// $objPHPExcel = $objReader->load($modelImport->fileImport->tempName);
// $sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
// $baseRow = 3;
// while(!empty($sheetData[$baseRow]['A'])){
// $model = new \backend\modules\ubux\models\JamKerja;
// $model->tanggal_scan = (string)$sheetData[$baseRow]['A'];
// $model->tanggal = (string)$sheetData[$baseRow]['B'];
// $model->jam = (string)$sheetData[$baseRow]['C'];
// $model->pin = (string)$sheetData[$baseRow]['D'];
// $model->nip = (string)$sheetData[$baseRow]['E'];
// $model->nama = (string)$sheetData[$baseRow]['F'];
// $model->jabatan = (string)$sheetData[$baseRow]['G'];
// $model->departemen = (string)$sheetData[$baseRow]['H'];
// $model->kantor = (string)$sheetData[$baseRow]['I'];
// $model->verifikasi = (string)$sheetData[$baseRow]['J'];
// $model->i_o = (string)$sheetData[$baseRow]['K'];
// $model->workcode = (string)$sheetData[$baseRow]['L'];
// $model->mesin = (string)$sheetData[$baseRow]['M'];
// $model->laporan_id = $id;
// $model->save();
// $baseRow++;
// }
// Yii::$app->getSession()->setFlash('success','Success');
// return $this->redirect(['/ubux/laporan/view', 'id' => $id]);
// }else{
// Yii::$app->getSession()->setFlash('error','Error');
// return $this->redirect(['import']);
// }
// }
// return $this->render('import',[
// 'modelImport' => $modelImport,
// ]);
// }
} }
...@@ -4,8 +4,11 @@ namespace backend\modules\ubux\controllers; ...@@ -4,8 +4,11 @@ namespace backend\modules\ubux\controllers;
use Yii; use Yii;
use backend\modules\ubux\models\Laporan; use backend\modules\ubux\models\Laporan;
use backend\modules\ubux\models\JamKerja;
use backend\modules\ubux\models\Gaji; use backend\modules\ubux\models\Gaji;
use backend\modules\ubux\models\satpam;
use backend\modules\ubux\models\search\LaporanSearch; use backend\modules\ubux\models\search\LaporanSearch;
use backend\modules\ubux\models\search\GajiSearch;
use yii\web\Controller; use yii\web\Controller;
use yii\web\NotFoundHttpException; use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter; use yii\filters\VerbFilter;
...@@ -50,24 +53,33 @@ class LaporanController extends Controller ...@@ -50,24 +53,33 @@ class LaporanController extends Controller
*/ */
public function actionView($id) public function actionView($id)
{ {
$model = Gaji::find()->where(['laporan_id' => $id])->All(); $model = JamKerja::find()->where(['laporan_id' => $id])->All();
// foreach($model as $data){
// echo $data->laporan_id;
// echo $data->nama;
// }
return $this->render('view', return $this->render('view',
array('model' => $this->findModel($id), 'gajiModel' => $model) array('model' => $this->findModel($id), 'gajiModel' => $model)
); );
} }
public function actionViewDetail($id, $nip) public function actionViewDetail($id, $nip)
{ {
$model = Gaji::find()->where(['laporan_id' => $id])->andWhere(['nip' => $nip])->All(); // $a = Satpam::find()->where(['nip' => $nip])->one();
// $satpam = Gaji::find()->where(['satpam_id' => $a['satpam_id']])->one();
$a = JamKerja::find()->where(['nip' => $nip])->andWhere(['laporan_id' => $id])->one();
$satpam = Gaji::find()->where(['jam_kerja_id' => $a['jam_kerja_id']])->andWhere(['laporan_id' => $a['laporan_id']])->one();
// echo $satpam_id['total_gaji'];die();
$model = JamKerja::find()->where(['laporan_id' => $id])->andWhere(['nip' => $nip])->All();
// $i = 0;
// foreach ($model as $key) {
// $i++;
// }
// print_r($i);die();
return $this->render('view-detail',[ return $this->render('view-detail',[
'model' => $model, 'model' => $model,
'satpam' => $satpam,
]); ]);
} }
...@@ -79,9 +91,19 @@ class LaporanController extends Controller ...@@ -79,9 +91,19 @@ class LaporanController extends Controller
public function actionCreate() public function actionCreate()
{ {
$model = new Laporan(); $model = new Laporan();
$a = $model->laporan_id;
if ($model->load(Yii::$app->request->post()) && $model->save()) { $models = Satpam::find()->where(['laporan_id' => $a])->one();
return $this->redirect(['view', 'id' => $model->laporan_id]); // echo $models['nama'];die();
if ($model->load(Yii::$app->request->post())) {
$models = $model->laporan_id;
if ($model->validate()) {
$model->save();
return $this->redirect(['view', 'id' => $model->laporan_id]);
} else {
$errors = $model->$errors;
print_r(array_values($errors));
}
} else { } else {
return $this->render('create', [ return $this->render('create', [
'model' => $model, 'model' => $model,
...@@ -116,7 +138,7 @@ class LaporanController extends Controller ...@@ -116,7 +138,7 @@ class LaporanController extends Controller
*/ */
public function actionDelete($id) public function actionDelete($id)
{ {
$this->findModel($id)->softDelete(); $this->findModel($id)->softdelete();
return $this->redirect(['index']); return $this->redirect(['index']);
} }
...@@ -137,18 +159,6 @@ class LaporanController extends Controller ...@@ -137,18 +159,6 @@ class LaporanController extends Controller
} }
} }
public function showAbsen(){
//$id = "satpam";
$dataProvider = new ActiveDataProvider([
'query' => Gaji::find()->where("laporan_id = laporan_id"),
'pagination' => [
'pageSize' => 20,
],
]);
return $dataProvider;
}
public function actionPrint($id) public function actionPrint($id)
{ {
$pdf_content = $this->renderPartial('view-pdf',[ $pdf_content = $this->renderPartial('view-pdf',[
......
...@@ -3,22 +3,20 @@ ...@@ -3,22 +3,20 @@
namespace backend\modules\ubux\controllers; namespace backend\modules\ubux\controllers;
use Yii; use Yii;
use backend\modules\ubux\models\TotalGaji; use backend\modules\ubux\models\Lembur;
use backend\modules\ubux\models\Laporan;
use backend\modules\ubux\models\Gaji; use backend\modules\ubux\models\Gaji;
use backend\modules\ubux\models\search\TotalGajiSearch; use backend\modules\ubux\models\search\LemburSearch;
use yii\data\ArrayDataProvider;
use yii\web\Controller; use yii\web\Controller;
use yii\web\NotFoundHttpException; use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter; use yii\filters\VerbFilter;
/** /**
* TotalGajiController implements the CRUD actions for TotalGaji model. * LemburController implements the CRUD actions for Lembur model.
*/ */
class TotalGajiController extends Controller class LemburController extends Controller
{ {
public function behaviors() public function behaviors()
{ {
return [ return [
'verbs' => [ 'verbs' => [
'class' => VerbFilter::className(), 'class' => VerbFilter::className(),
...@@ -30,12 +28,12 @@ class TotalGajiController extends Controller ...@@ -30,12 +28,12 @@ class TotalGajiController extends Controller
} }
/** /**
* Lists all TotalGaji models. * Lists all Lembur models.
* @return mixed * @return mixed
*/ */
public function actionIndex() public function actionIndex()
{ {
$searchModel = new TotalGajiSearch(); $searchModel = new LemburSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [ return $this->render('index', [
...@@ -45,56 +43,43 @@ class TotalGajiController extends Controller ...@@ -45,56 +43,43 @@ class TotalGajiController extends Controller
} }
/** /**
* Displays a single TotalGaji model. * Displays a single Lembur model.
* @param integer $id * @param integer $id
* @return mixed * @return mixed
*/ */
public function actionView($id) public function actionView($id)
{ {
// return $this->render('view', [ return $this->render('view', [
// 'model' => $this->findModel($id), 'model' => $this->findModel($id),
// ]); ]);
return $this->redirect(['/ubux/laporan/view', 'id' => $id]);
} }
/** /**
* Creates a new TotalGaji model. * Creates a new Lembur model.
* If creation is successful, the browser will be redirected to the 'view' page. * If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed * @return mixed
*/ */
public function actionCreate($id, $nip) public function actionCreate()
{ {
$model = new Lembur();
$model = new TotalGaji();
// $modelSearch = $model->find()->where('nip = '.$id)->one();
$gaji = new Gaji();
$modelCount = $gaji->find()->where('laporan_id = '.$id)->andWhere(['nip' => $nip])->All();
$count = count($modelCount);
if ($model->load(Yii::$app->request->post())) { if ($model->load(Yii::$app->request->post())) {
$model->laporan_id = $id; if ($model->validate()) {
$total_gaji = $count * $model['total_gaji'];
$gajiku = 'Rp.'.$total_gaji;
$model->satpam_id = $nip;
$model->total_gaji = $gajiku;
if ($model->validate()) {
$model->save(); $model->save();
// $modelSearch->save(); return $this->redirect(['view', 'id' => $model->lembur_id]);
return $this->redirect(['view', 'id' => $model->laporan_id]); }else{
} else {
$errors = $model->$errors; $errors = $model->$errors;
print_r(array_values($errors)); print_r(array_values($errors));
} }
} else { } else {
return $this->render('create', [ return $this->render('create', [
'model' => $model, 'model' => $model,
]); ]);
} }
} }
/** /**
* Updates an existing TotalGaji model. * Updates an existing Lembur model.
* If update is successful, the browser will be redirected to the 'view' page. * If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id * @param integer $id
* @return mixed * @return mixed
...@@ -104,7 +89,7 @@ class TotalGajiController extends Controller ...@@ -104,7 +89,7 @@ class TotalGajiController extends Controller
$model = $this->findModel($id); $model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) { if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->total_id]); return $this->redirect(['view', 'id' => $model->lembur_id]);
} else { } else {
return $this->render('update', [ return $this->render('update', [
'model' => $model, 'model' => $model,
...@@ -113,7 +98,7 @@ class TotalGajiController extends Controller ...@@ -113,7 +98,7 @@ class TotalGajiController extends Controller
} }
/** /**
* Deletes an existing TotalGaji model. * Deletes an existing Lembur model.
* If deletion is successful, the browser will be redirected to the 'index' page. * If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id * @param integer $id
* @return mixed * @return mixed
...@@ -126,15 +111,15 @@ class TotalGajiController extends Controller ...@@ -126,15 +111,15 @@ class TotalGajiController extends Controller
} }
/** /**
* Finds the TotalGaji model based on its primary key value. * Finds the Lembur model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown. * If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id * @param integer $id
* @return TotalGaji the loaded model * @return Lembur the loaded model
* @throws NotFoundHttpException if the model cannot be found * @throws NotFoundHttpException if the model cannot be found
*/ */
protected function findModel($id) protected function findModel($id)
{ {
if (($model = TotalGaji::findOne($id)) !== null) { if (($model = Lembur::findOne($id)) !== null) {
return $model; return $model;
} else { } else {
throw new NotFoundHttpException('The requested page does not exist.'); throw new NotFoundHttpException('The requested page does not exist.');
......
...@@ -3,19 +3,19 @@ ...@@ -3,19 +3,19 @@
namespace backend\modules\ubux\controllers; namespace backend\modules\ubux\controllers;
use Yii; use Yii;
use backend\modules\ubux\models\Uang; use backend\modules\ubux\models\Pegawai;
use backend\modules\ubux\models\search\UangSearch; use backend\modules\ubux\models\search\PegawaiSearch;
use yii\web\Controller; use yii\web\Controller;
use yii\web\NotFoundHttpException; use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter; use yii\filters\VerbFilter;
/** /**
* UangController implements the CRUD actions for Uang model. * PegawaiController implements the CRUD actions for Pegawai model.
*/ */
class UangController extends Controller class PegawaiController extends Controller
{ {
public function behaviors() public function behaviors()
{ {
return [ return [
'verbs' => [ 'verbs' => [
'class' => VerbFilter::className(), 'class' => VerbFilter::className(),
...@@ -27,12 +27,12 @@ class UangController extends Controller ...@@ -27,12 +27,12 @@ class UangController extends Controller
} }
/** /**
* Lists all Uang models. * Lists all Pegawai models.
* @return mixed * @return mixed
*/ */
public function actionIndex() public function actionIndex()
{ {
$searchModel = new UangSearch(); $searchModel = new PegawaiSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [ return $this->render('index', [
...@@ -42,8 +42,8 @@ class UangController extends Controller ...@@ -42,8 +42,8 @@ class UangController extends Controller
} }
/** /**
* Displays a single Uang model. * Displays a single Pegawai model.
* @param string $id * @param integer $id
* @return mixed * @return mixed
*/ */
public function actionView($id) public function actionView($id)
...@@ -54,16 +54,16 @@ class UangController extends Controller ...@@ -54,16 +54,16 @@ class UangController extends Controller
} }
/** /**
* Creates a new Uang model. * Creates a new Pegawai model.
* If creation is successful, the browser will be redirected to the 'view' page. * If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed * @return mixed
*/ */
public function actionCreate() public function actionCreate()
{ {
$model = new Uang(); $model = new Pegawai();
if ($model->load(Yii::$app->request->post()) && $model->save()) { if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->nip]); return $this->redirect(['view', 'id' => $model->pegawai_id]);
} else { } else {
return $this->render('create', [ return $this->render('create', [
'model' => $model, 'model' => $model,
...@@ -72,9 +72,9 @@ class UangController extends Controller ...@@ -72,9 +72,9 @@ class UangController extends Controller
} }
/** /**
* Updates an existing Uang model. * Updates an existing Pegawai model.
* If update is successful, the browser will be redirected to the 'view' page. * If update is successful, the browser will be redirected to the 'view' page.
* @param string $id * @param integer $id
* @return mixed * @return mixed
*/ */
public function actionUpdate($id) public function actionUpdate($id)
...@@ -82,7 +82,7 @@ class UangController extends Controller ...@@ -82,7 +82,7 @@ class UangController extends Controller
$model = $this->findModel($id); $model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) { if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->nip]); return $this->redirect(['view', 'id' => $model->pegawai_id]);
} else { } else {
return $this->render('update', [ return $this->render('update', [
'model' => $model, 'model' => $model,
...@@ -91,9 +91,9 @@ class UangController extends Controller ...@@ -91,9 +91,9 @@ class UangController extends Controller
} }
/** /**
* Deletes an existing Uang model. * Deletes an existing Pegawai model.
* If deletion is successful, the browser will be redirected to the 'index' page. * If deletion is successful, the browser will be redirected to the 'index' page.
* @param string $id * @param integer $id
* @return mixed * @return mixed
*/ */
public function actionDelete($id) public function actionDelete($id)
...@@ -104,15 +104,15 @@ class UangController extends Controller ...@@ -104,15 +104,15 @@ class UangController extends Controller
} }
/** /**
* Finds the Uang model based on its primary key value. * Finds the Pegawai model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown. * If the model is not found, a 404 HTTP exception will be thrown.
* @param string $id * @param integer $id
* @return Uang the loaded model * @return Pegawai the loaded model
* @throws NotFoundHttpException if the model cannot be found * @throws NotFoundHttpException if the model cannot be found
*/ */
protected function findModel($id) protected function findModel($id)
{ {
if (($model = Uang::findOne($id)) !== null) { if (($model = Pegawai::findOne($id)) !== null) {
return $model; return $model;
} else { } else {
throw new NotFoundHttpException('The requested page does not exist.'); throw new NotFoundHttpException('The requested page does not exist.');
......
...@@ -4,12 +4,12 @@ namespace backend\modules\ubux\controllers; ...@@ -4,12 +4,12 @@ namespace backend\modules\ubux\controllers;
use Yii; use Yii;
use backend\modules\ubux\models\Satpam; use backend\modules\ubux\models\Satpam;
use backend\modules\ubux\models\Hrdxpegawai; use backend\modules\ubux\models\Pegawai;
use backend\modules\ubux\models\search\SatpamSearch; use backend\modules\ubux\models\search\SatpamSearch;
use backend\modules\ubux\models\search\PegawaiSearch;
use yii\web\Controller; use yii\web\Controller;
use yii\web\NotFoundHttpException; use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter; use yii\filters\VerbFilter;
use yii\data\ActiveDataProvider;
/** /**
* SatpamController implements the CRUD actions for Satpam model. * SatpamController implements the CRUD actions for Satpam model.
...@@ -17,7 +17,7 @@ use yii\data\ActiveDataProvider; ...@@ -17,7 +17,7 @@ use yii\data\ActiveDataProvider;
class SatpamController extends Controller class SatpamController extends Controller
{ {
public function behaviors() public function behaviors()
{ {
return [ return [
'verbs' => [ 'verbs' => [
'class' => VerbFilter::className(), 'class' => VerbFilter::className(),
...@@ -43,24 +43,17 @@ class SatpamController extends Controller ...@@ -43,24 +43,17 @@ class SatpamController extends Controller
]); ]);
} }
public function actionViewSatpam()
{
$searchModel = new SatpamSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('view_satpam', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/** /**
* Displays a single Satpam model. * Displays a single Satpam model.
* @param integer $id * @param integer $id
* @return mixed * @return mixed
*/ */
public function actionView($id) public function actionView($id)
{ {
// $model = new Pegawai();
// $models = $model::find()->where(['pegawai_id' => $model->pegawai_id])->andwhere(['nip' => $model->nip])->one();
// echo $models['user_name'];die();
return $this->render('view', [ return $this->render('view', [
'model' => $this->findModel($id), 'model' => $this->findModel($id),
]); ]);
...@@ -75,8 +68,24 @@ class SatpamController extends Controller ...@@ -75,8 +68,24 @@ class SatpamController extends Controller
{ {
$model = new Satpam(); $model = new Satpam();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->satpam_id]); // if ($model->load(Yii::$app->request->post()) && $model->save()) {
// return $this->redirect(['view', 'id' => $model->satpam_id]);
// } else {
// return $this->render('create', [
// 'model' => $model,
// ]);
// }
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) {
$model->save();
return $this->redirect(['view', 'id' => $model->laporan_id]);
} else {
$errors = $model->$errors;
print_r(array_values($errors));
}
} else { } else {
return $this->render('create', [ return $this->render('create', [
'model' => $model, 'model' => $model,
...@@ -111,7 +120,7 @@ class SatpamController extends Controller ...@@ -111,7 +120,7 @@ class SatpamController extends Controller
*/ */
public function actionDelete($id) public function actionDelete($id)
{ {
$this->findModel($id)->softDelete(); $this->findModel($id)->delete();
return $this->redirect(['index']); return $this->redirect(['index']);
} }
...@@ -131,16 +140,4 @@ class SatpamController extends Controller ...@@ -131,16 +140,4 @@ class SatpamController extends Controller
throw new NotFoundHttpException('The requested page does not exist.'); throw new NotFoundHttpException('The requested page does not exist.');
} }
} }
public function showSatpam(){
$id = "satpam";
$dataProvider = new ActiveDataProvider([
'query' => Hrdxpegawai::find()->where("posisi = 'satpam'"),
'pagination' => [
'pageSize' => 20,
],
]);
return $dataProvider;
}
} }
...@@ -12,28 +12,18 @@ use common\behaviors\DeleteBehavior; ...@@ -12,28 +12,18 @@ use common\behaviors\DeleteBehavior;
* This is the model class for table "ubux_gaji". * This is the model class for table "ubux_gaji".
* *
* @property integer $gaji_id * @property integer $gaji_id
* @property string $tanggal_scan * @property integer $laporan_id
* @property string $tanggal * @property integer $satpam_id
* @property string $jam * @property string $total_gaji
* @property string $pin * @property integer $delete
* @property string $nip
* @property string $nama
* @property string $jabatan
* @property string $departemen
* @property string $kantor
* @property string $verifikasi
* @property string $i_o
* @property string $workcode
* @property string $mesin
* @property integer $deleted
* @property string $deleted_at * @property string $deleted_at
* @property string $created_at
* @property string $updated_at
* @property string $deleted_by * @property string $deleted_by
* @property string $created_at
* @property string $created_by * @property string $created_by
* @property string $updated_at
* @property string $updated_by * @property string $updated_by
* @property integer $laporan_id
* *
* @property UbuxSatpam $satpam
* @property UbuxLaporan $laporan * @property UbuxLaporan $laporan
*/ */
class Gaji extends \yii\db\ActiveRecord class Gaji extends \yii\db\ActiveRecord
...@@ -71,11 +61,10 @@ class Gaji extends \yii\db\ActiveRecord ...@@ -71,11 +61,10 @@ class Gaji extends \yii\db\ActiveRecord
public function rules() public function rules()
{ {
return [ return [
[['tanggal_scan'], 'required'], [['laporan_id', 'satpam_id', 'delete'], 'integer'],
[['tanggal_scan', 'tanggal', 'jam', 'deleted_at', 'created_at', 'updated_at'], 'safe'], [['deleted_at', 'created_at', 'updated_at'], 'safe'],
[['deleted', 'laporan_id'], 'integer'], [['total_gaji', 'deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 45],
[['pin', 'nip', 'nama', 'jabatan', 'departemen', 'kantor', 'verifikasi', 'i_o', 'workcode', 'mesin'], 'string', 'max' => 45], [['satpam_id'], 'exist', 'skipOnError' => true, 'targetClass' => Satpam::className(), 'targetAttribute' => ['satpam_id' => 'satpam_id']],
[['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
[['laporan_id'], 'exist', 'skipOnError' => true, 'targetClass' => Laporan::className(), 'targetAttribute' => ['laporan_id' => 'laporan_id']] [['laporan_id'], 'exist', 'skipOnError' => true, 'targetClass' => Laporan::className(), 'targetAttribute' => ['laporan_id' => 'laporan_id']]
]; ];
} }
...@@ -87,35 +76,37 @@ class Gaji extends \yii\db\ActiveRecord ...@@ -87,35 +76,37 @@ class Gaji extends \yii\db\ActiveRecord
{ {
return [ return [
'gaji_id' => 'Gaji ID', 'gaji_id' => 'Gaji ID',
'tanggal_scan' => 'Tanggal Scan', 'laporan_id' => 'Laporan ID',
'tanggal' => 'Tanggal', 'satpam_id' => 'Satpam ID',
'jam' => 'Jam', 'total_gaji' => 'Total Gaji',
'pin' => 'Pin', 'delete' => 'Delete',
'nip' => 'Nip',
'nama' => 'Nama',
'jabatan' => 'Jabatan',
'departemen' => 'Departemen',
'kantor' => 'Kantor',
'verifikasi' => 'Verifikasi',
'i_o' => 'I O',
'workcode' => 'Workcode',
'mesin' => 'Mesin',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At', 'deleted_at' => 'Deleted At',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
'deleted_by' => 'Deleted By', 'deleted_by' => 'Deleted By',
'created_at' => 'Created At',
'created_by' => 'Created By', 'created_by' => 'Created By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By', 'updated_by' => 'Updated By',
'laporan_id' => 'Laporan ID',
]; ];
} }
/** /**
* @return \yii\db\ActiveQuery * @return \yii\db\ActiveQuery
*/ */
public function getSatpam()
{
return $this->hasOne(Satpam::className(), ['satpam_id' => 'satpam_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getLaporan() public function getLaporan()
{ {
return $this->hasOne(Laporan::className(), ['laporan_id' => 'laporan_id']); return $this->hasOne(Laporan::className(), ['laporan_id' => 'laporan_id']);
} }
public function getJamKerja()
{
return $this->hasOne(Jamkerja::className(), ['jam_kerja_id' => 'jam_kerja_id']);
}
} }
...@@ -12,33 +12,21 @@ use common\behaviors\DeleteBehavior; ...@@ -12,33 +12,21 @@ use common\behaviors\DeleteBehavior;
* This is the model class for table "ubux_gaji". * This is the model class for table "ubux_gaji".
* *
* @property integer $gaji_id * @property integer $gaji_id
* @property string $tanggal_scan * @property integer $satpam_id
* @property string $tanggal * @property string $total_gaji
* @property string $jam * @property integer $delete
* @property integer $pin
* @property integer $nip
* @property string $nama
* @property string $jabatan
* @property string $departemen
* @property string $kantor
* @property integer $verifikasi
* @property integer $i_o
* @property integer $workcode
* @property string $mesin
* @property integer $deleted
* @property string $deleted_at * @property string $deleted_at
* @property string $created_at
* @property string $updated_at
* @property string $deleted_by * @property string $deleted_by
* @property string $created_at
* @property string $created_by * @property string $created_by
* @property string $updated_at
* @property string $updated_by * @property string $updated_by
* @property integer $laporan_id
* *
* @property UbuxLaporan $laporan * @property UbuxSatpam $satpam
*/ */
class Gaji extends \yii\db\ActiveRecord class Gaji extends \yii\db\ActiveRecord
{ {
//public $bulanLaporan;
/** /**
* behaviour to add created_at and updatet_at field with current datetime (timestamp) * 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) * and created_by and updated_by field with current user id (blameable)
...@@ -71,12 +59,10 @@ class Gaji extends \yii\db\ActiveRecord ...@@ -71,12 +59,10 @@ class Gaji extends \yii\db\ActiveRecord
public function rules() public function rules()
{ {
return [ return [
[['tanggal_scan'], 'required'], [['satpam_id', 'delete'], 'integer'],
[['tanggal_scan', 'tanggal', 'jam', 'deleted_at', 'created_at', 'updated_at'], 'safe'], [['deleted_at', 'created_at', 'updated_at'], 'safe'],
[['pin', 'nip', 'verifikasi', 'i_o', 'workcode', 'deleted', 'laporan_id'], 'integer'], [['total_gaji', 'deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 45],
[['nama', 'jabatan', 'departemen', 'kantor', 'mesin'], 'string', 'max' => 45], [['satpam_id'], 'exist', 'skipOnError' => true, 'targetClass' => Satpam::className(), 'targetAttribute' => ['satpam_id' => 'satpam_id']]
[['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
[['laporan_id'], 'exist', 'skipOnError' => true, 'targetClass' => Laporan::className(), 'targetAttribute' => ['laporan_id' => 'laporan_id']]
]; ];
} }
...@@ -87,35 +73,23 @@ class Gaji extends \yii\db\ActiveRecord ...@@ -87,35 +73,23 @@ class Gaji extends \yii\db\ActiveRecord
{ {
return [ return [
'gaji_id' => 'Gaji ID', 'gaji_id' => 'Gaji ID',
'tanggal_scan' => 'Tanggal Scan', 'satpam_id' => 'Satpam ID',
'tanggal' => 'Tanggal', 'total_gaji' => 'Total Gaji',
'jam' => 'Jam', 'delete' => 'Delete',
'pin' => 'Pin',
'nip' => 'Nip',
'nama' => 'Nama',
'jabatan' => 'Jabatan',
'departemen' => 'Departemen',
'kantor' => 'Kantor',
'verifikasi' => 'Verifikasi',
'i_o' => 'I O',
'workcode' => 'Workcode',
'mesin' => 'Mesin',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At', 'deleted_at' => 'Deleted At',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
'deleted_by' => 'Deleted By', 'deleted_by' => 'Deleted By',
'created_at' => 'Created At',
'created_by' => 'Created By', 'created_by' => 'Created By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By', 'updated_by' => 'Updated By',
'laporan_id' => 'Laporan ID',
]; ];
} }
/** /**
* @return \yii\db\ActiveQuery * @return \yii\db\ActiveQuery
*/ */
public function getLaporan() public function getSatpam()
{ {
return $this->hasOne(Laporan::className(), ['laporan_id' => 'laporan_id']); return $this->hasOne(Satpam::className(), ['satpam_id' => 'satpam_id']);
} }
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
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