Commit 26548753 by Andre Sihombing

Melakukan Perbaikan Seminar

parent cb27ac84
<?php
namespace backend\modules\ubux\controllers;
use Yii;
use backend\modules\ubux\models\Satpam;
use backend\modules\ubux\models\JamKerja;
use backend\modules\ubux\models\search\SatpamSearch;
use backend\modules\ubux\models\search\LaporanSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* SatpamController implements the CRUD actions for Satpam model.
*/
class SatpamController extends Controller
{
public function behaviors()
{
return [
//TODO: crud controller actions are bypassed by default, set the appropriate privilege
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
];
}
/**
* Lists all Satpam 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 Satpam model.
* @param integer $id
* @return mixed
*/
public function actionView($laporan_id)
{
$model = JamKerja::find()->where(['laporan_id' => $laporan_id])->All();
return $this->render('view',
array('model' => $this->findModel($laporan_id), 'satpamModel' => $model)
);
}
/**
* Creates a new Satpam model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new Satpam();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->satpam_id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing Satpam 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->satpam_id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Satpam 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 Satpam model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Satpam the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Satpam::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
public function actionAddGaji($satpam_id)
{
$model = $this->findModel($satpam_id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['laporan/view', 'id' => $model->laporan_id]);
} else {
return $this->render('add-gaji', [
'model' => $model,
]);
}
}
}
......@@ -14,8 +14,7 @@ class ubuxAsset extends AssetBundle{
public $js = [
'js/jquery.plugin.js',
'js/jquery.datepick.js',
'js/jscript.js',
'js/rupiah.js',
'js/jscript.js',
];
public $depends = [
......
......@@ -129,8 +129,8 @@ $this->beginPage();
<?php
MenuRenderer::renderSidebarMenu(\Yii::$app->params['sidebarMenu']);
?>
<li><a href="/copy/backend/web/index.php/ubux/laporan"><i class="fa fa-circle-o text-red"></i> <span>Laporan Satpam</span></a></li>
<li><a href="/copy/backend/web/index.php/ubux/satpam"><i class="fa fa-circle-o text-red"></i> <span>Data Satpam</span></a></li>
<li><a href="/cis-lite/backend/web/index.php/ubux/laporan"><i class="fa fa-circle-o text-red"></i> <span>Laporan Satpam</span></a></li>
<li><a href="/cis-lite/backend/web/index.php/ubux/satpam"><i class="fa fa-circle-o text-red"></i> <span>Data Satpam</span></a></li>
<!-- <li class="header">LABELS</li>
<li><a href="#"><i class="fa fa-circle-o text-red"></i> <span>Important</span></a></li>
<li><a href="#"><i class="fa fa-circle-o text-yellow"></i> <span>Warning</span></a></li>
......
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