Commit bad4e51a by NAGAITAN\Adi

-- Final Project

-- Bug From Tester is Fixed.
parent cec2ee01
...@@ -51,46 +51,9 @@ class DimxDimController extends Controller ...@@ -51,46 +51,9 @@ class DimxDimController extends Controller
*/ */
public function actionView($id) public function actionView($id)
{ {
$model = new \common\models\DimxDim(); return $this->render('view', [
$modelsikkLog = new \common\models\SikkLog(); 'model' => $this->findModel($id),
if ($model->load(Yii::$app->request->post())) { ]);
$cari = \common\models\DimxDim::findOne(['nim'=>$model->nim]);
$modelsikkLog->mhs_id=$cari->dim_id;
$sql='SELECT log_id FROM sikk_log WHERE mhs_id='.$cari->dim_id.' AND time_out IS NULL';
$hasilQuery = Yii::$app->db->createCommand($sql)->queryAll();
if($hasilQuery==NULL){
Yii::$app->session->setFlash('success', '<b>Anda diizinkan untuk masuk!<b>');
date_default_timezone_set('Asia/Jakarta');
$date = date_create(date('Y-m-d H:i:s'));
$modelsikkLog->time_in=date('Y-m-d H:i:s');
$modelsikkLog->created_at=date('Y-m-d H:i:s');
if($modelsikkLog->save()){
return $this->redirect(['dimx-dim/view', 'id' => $cari->dim_id]);
}
}
if($hasilQuery!=NULL){
date_default_timezone_set('Asia/Jakarta');
$date = date_create(date('Y-m-d H:i:s'));
$date1=date('Y-m-d H:i:s');
$tanggal="'".$date1."'";
Yii::$app->session->setFlash('success', '<b>Anda diizinkan untuk keluar!<b>');
$sql1='UPDATE sikk_log SET time_out='.$tanggal.' WHERE mhs_id='.$cari->dim_id.'';
Yii::$app->db->createCommand($sql1)->execute();
return $this->redirect(['dimx-dim/view', 'id' => $cari->dim_id]);
}else{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
}
return $this->render('view', [
'model' => $this->findModel($id),
]);
} }
/** /**
......
...@@ -52,7 +52,6 @@ class SikkLogController extends Controller ...@@ -52,7 +52,6 @@ class SikkLogController extends Controller
*/ */
public function actionView($id) public function actionView($id)
{ {
return $this->render('view', [ return $this->render('view', [
'model' => $this->findModel($id), 'model' => $this->findModel($id),
]); ]);
...@@ -76,8 +75,8 @@ class SikkLogController extends Controller ...@@ -76,8 +75,8 @@ class SikkLogController extends Controller
if($hasilQuery==NULL){ if($hasilQuery==NULL){
Yii::$app->session->setFlash('success', '<b>Anda diizinkan untuk masuk!<b>'); Yii::$app->session->setFlash('success', '<b>Anda diizinkan untuk masuk!<b>');
date_default_timezone_set('Asia/Jakarta'); date_default_timezone_set('Asia/Jakarta');
$date = date_create(date('Y-m-d H:i:s')); $date = date('Y-m-d H:i:s');
$modelsikkLog->time_in=date('Y-m-d H:i:s'); $modelsikkLog->time_in=date_format($date, 'd-m-Y H:i:s');
$modelsikkLog->created_at=date('Y-m-d H:i:s'); $modelsikkLog->created_at=date('Y-m-d H:i:s');
if($modelsikkLog->save()){ if($modelsikkLog->save()){
return $this->redirect(['dimx-dim/view', 'id' => $cari->dim_id]); return $this->redirect(['dimx-dim/view', 'id' => $cari->dim_id]);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
use yii\helpers\Html; use yii\helpers\Html;
use yii\widgets\DetailView; use yii\widgets\DetailView;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model common\models\DimxDim */ /* @var $model common\models\DimxDim */
...@@ -14,16 +14,6 @@ $this->params['breadcrumbs'][] = $this->title; ...@@ -14,16 +14,6 @@ $this->params['breadcrumbs'][] = $this->title;
<!--<h1><?= Html::encode($this->title) ?></h1>--> <!--<h1><?= Html::encode($this->title) ?></h1>-->
<h2>Keluar Masuk Mahasiswa</h2> <h2>Keluar Masuk Mahasiswa</h2>
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'nim')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Submit', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
......
...@@ -30,12 +30,11 @@ $roleID = $akunID->role_id; ...@@ -30,12 +30,11 @@ $roleID = $akunID->role_id;
'dataProvider' => $dataProvider, 'dataProvider' => $dataProvider,
'filterModel' => $searchModel, 'filterModel' => $searchModel,
'columns' => [ 'columns' => [
// ['class' => 'yii\grid\SerialColumn'], ['class' => 'yii\grid\SerialColumn'],
'izin_keluar_id', 'izin_keluar_id',
'mhs.nama', 'mhs.nama',
'date_start', 'date_start',
'date_end', 'date_end',
'alasan',
['class' => 'yii\grid\ActionColumn'], ['class' => 'yii\grid\ActionColumn'],
], ],
]); ]);
......
...@@ -5,7 +5,7 @@ use yii\helpers\Html; ...@@ -5,7 +5,7 @@ use yii\helpers\Html;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model common\models\SikkIzinKeluar */ /* @var $model common\models\SikkIzinKeluar */
$this->title = 'Update Izin Keluar'; $this->title = 'Update Sikk Izin Keluar: ' . $model->izin_keluar_id;
$this->params['breadcrumbs'][] = ['label' => 'Sikk Izin Keluars', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => 'Sikk Izin Keluars', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->izin_keluar_id, 'url' => ['view', 'id' => $model->izin_keluar_id]]; $this->params['breadcrumbs'][] = ['label' => $model->izin_keluar_id, 'url' => ['view', 'id' => $model->izin_keluar_id]];
$this->params['breadcrumbs'][] = 'Update'; $this->params['breadcrumbs'][] = 'Update';
...@@ -14,14 +14,8 @@ $this->params['breadcrumbs'][] = 'Update'; ...@@ -14,14 +14,8 @@ $this->params['breadcrumbs'][] = 'Update';
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
<?= <?= $this->render('_form', [
$this->render('_form', [
'model' => $model, 'model' => $model,
'modelchk' => $modelchk, ]) ?>
'id_wali' => $id_wali,
'nama_wali' => $nama_wali,
'arrayNamaDosen' => $arrayNamaDosen,
])
?>
</div> </div>
...@@ -115,13 +115,12 @@ $roleID = $akunID->role_id; ...@@ -115,13 +115,12 @@ $roleID = $akunID->role_id;
?> ?>
<div class="sikk-approval-view"> <div class="sikk-approval-view">
<?php <?php
if ($roleID == 1 && $status == 3) { if ($roleID == 2) {
echo Html::a('Print', ['/sikk/sikk-izin-keluar/show','id'=>$model->izin_keluar_id], ['class' => 'btn btn-primary']); echo Html::a('Print', ['/sikk/sikk-izin-keluar/show'], ['class' => 'btn btn-primary']);
} else { } else {
} }
?> ?>
</div> </div>
</div> </div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\SikkIzinKeluar */
$this->title = "Request Anda";
$this->params['breadcrumbs'][] = ['label' => 'Sikk Izin Keluars', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$mus = Yii::$app->user->identity->id;
$akunID = \common\models\SikkAkun::findOne(array('akun_id' => $mus));
$roleID = $akunID->role_id;
//var_dump($roleID);
//die();
?>
<div class="sikk-izin-keluar-view">
<table>
<tr>
<td>SURAT IZIN KELUAR</td>
</tr>>
</table>
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?php
if ($roleID == 4) {
?>
<?= Html::a('Accept', ['acceptwali', 'id' => $model->izin_keluar_id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Reject', ['rejectwali', 'id' => $model->izin_keluar_id], ['class' => 'btn btn-primary']) ?>
<?=
Html::a('Delete', ['delete', 'id' => $model->izin_keluar_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
])
?>
<?php
} else if ($roleID == 3) {
?>
<?= Html::a('Accept', ['acceptkeasramaan', 'id' => $model->izin_keluar_id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Reject', ['rejectkeasramaan', 'id' => $model->izin_keluar_id], ['class' => 'btn btn-primary']) ?>
<?=
Html::a('Delete', ['delete', 'id' => $model->izin_keluar_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
])
?>
<?php
} else if ($roleID == 2) {
?>
<?= Html::a('Accept', ['acceptdp', 'id' => $model->izin_keluar_id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Reject', ['rejectdp', 'id' => $model->izin_keluar_id], ['class' => 'btn btn-primary']) ?>
<?=
Html::a('Delete', ['delete', 'id' => $model->izin_keluar_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
])
?>
<?php
} else if ($roleID == 2) {
?>
<?= Html::a('Accept', ['acceptdp', 'id' => $model->izin_keluar_id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Reject', ['rejectdp', 'id' => $model->izin_keluar_id], ['class' => 'btn btn-primary']) ?>
<?=
Html::a('Delete', ['delete', 'id' => $model->izin_keluar_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
])
?>
<?php
}
?>
</p>
<?=
DetailView::widget([
'model' => $model,
'attributes' => [
// 'izin_keluar_id',
// 'mhs_id',
/* [
'label' => 'Nama',
'value' => $nama_request,
], */
'alasan',
'date_start',
'date_end',
'time_start',
'time_end',
// 'deleted',
// 'created_at',
// 'created_by',
// 'updated_at',
// 'updated_by',
// 'status',
],
])
?>
<div class="sikk-approval-view">
<?php
if ($roleID == 1 && $status == 3) {
echo Html::a('Print', ['/sikk/sikk-izin-keluar/show','id'=>$model->izin_keluar_id], ['class' => 'btn btn-primary']);
} else {
}
?>
</div>
</div>
...@@ -28,15 +28,15 @@ $this->params['breadcrumbs'][] = $this->title; ...@@ -28,15 +28,15 @@ $this->params['breadcrumbs'][] = $this->title;
<?= DetailView::widget([ <?= DetailView::widget([
'model' => $model, 'model' => $model,
'attributes' => [ 'attributes' => [
// 'log_id', 'log_id',
// 'mhs_id', 'mhs_id',
'time_in', 'time_in',
'time_out', 'time_out',
// 'deleted', 'deleted',
// 'created_at', 'created_at',
// 'created_by', 'created_by',
// 'updated_at', 'updated_at',
// 'updated_by', 'updated_by',
], ],
]) ?> ]) ?>
......
...@@ -8,9 +8,7 @@ use yii\helpers\Html; ...@@ -8,9 +8,7 @@ use yii\helpers\Html;
<header class="main-header"> <header class="main-header">
<?= <?= Html::a('<span class="logo-mini">SIKK</span><span class="logo-lg">' . Yii::$app->name . '</span>', Yii::$app->homeUrl, ['class' => 'logo']) ?>
// $nama ="test";
Html::a('<span class="logo-mini">SIKK</span><span class="logo-lg"> SIKK D4b </span>', Yii::$app->homeUrl, ['class' => 'logo']) ?>
<nav class="navbar navbar-static-top" role="navigation"> <nav class="navbar navbar-static-top" role="navigation">
......
...@@ -2,24 +2,22 @@ ...@@ -2,24 +2,22 @@
/* @var $this yii\web\View */ /* @var $this yii\web\View */
$this->title = 'SIKK'; $this->title = 'My Yii Application';
?> ?>
<div class="site-index"> <div class="site-index">
<div class="jumbotron"> <div class="jumbotron">
<h2>Sistem Izin Keluar Masuk Kampus</h2> <h1>Congratulations!</h1>
<p class="lead"></p> <p class="lead">You have successfully created your Yii-powered application.</p>
<p><a class="btn btn-lg btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p>
</div> </div>
<div class="body-content"> <div class="body-content">
<div class="row"> <div class="row">
<img src="http://localhost/ITD-KEMAHASISWAAN3/backend/web/images/home.jpg"> <div class="col-lg-4">
<!-- <div class="col-lg-4">
<h2>Heading</h2> <h2>Heading</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
...@@ -38,7 +36,18 @@ $this->title = 'SIKK'; ...@@ -38,7 +36,18 @@ $this->title = 'SIKK';
fugiat nulla pariatur.</p> fugiat nulla pariatur.</p>
<p><a class="btn btn-default" href="http://www.yiiframework.com/forum/">Yii Forum &raquo;</a></p> <p><a class="btn btn-default" href="http://www.yiiframework.com/forum/">Yii Forum &raquo;</a></p>
--> </div> </div>
<div class="col-lg-4">
<h2>Heading</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.</p>
<p><a class="btn btn-default" href="http://www.yiiframework.com/extensions/">Yii Extensions &raquo;</a></p>
</div>
</div>
</div> </div>
</div> </div>
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