After Integration 1

parent 40ab749e
<?php
namespace backend\modules\ubux\controllers;
use Yii;
use yii\rest\ActiveController;
use yii\helpers\Json;
use yii\data\ArrayDataProvider;
/*
*/
class DataPaketApiController extends ActiveController
{
public $modelClass = 'backend\modules\ubux\models\DataPaket';
/**
*/
public function actionSendNotif($user_id){
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
$subject = "Notifikasi Paket";
$body = "Anda Memiliki Paket di Pos Satpam";
if(\Yii::$app->messenger->sendNotificationToUser((int)$user_id, $body)){
// if(\Yii::$app->messenger->sendEmailToUser((int)$user_id, $subject, $body)){
// return "Berhasil";
// }
// return "Email Gagal Dikirim";
echo Json::encode(["status" => "berhasil"]);
return;
}
else{
echo Json::encode(["status" => "gagal"]);
return;
}
}
}
?>
......@@ -8,7 +8,7 @@ use backend\modules\ubux\models\search\DataPaketSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\web\Response;
/**
* DataPaketController implements the CRUD actions for DataPaket model.
* controller-id: data-paket
......@@ -19,7 +19,7 @@ class DataPaketController extends Controller
public function behaviors()
{
return [
//TODO: crud controller actions are bypassed by default, set the appropriate privilege
// TODO: crud controller actions are bypassed by default, set the appropriate privilege
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
......@@ -85,20 +85,47 @@ class DataPaketController extends Controller
}
/**
* action-id: data-paket-view
* action-desc: Display a package data
* Displays a single DataPaket model.
* action-id: data-paket-view-admin
* action-desc: Display a package data by admin
* Displays a single DataPaket model by admin.
* @param integer $id
* @return mixed
*/
public function actionDataPaketViewAdmin($id)
{
return $this->render('DataPaketViewAdmin', [
'model' => $this->findModel($id),
]);
}
/**
* action-id: data-paket-view-mahasiswa
* action-desc: Display a package data by mahasiswa
* Displays a single DataPaket model by mahasiswa.
* @param integer $id
* @return mixed
*/
public function actionDataPaketView($id)
public function actionDataPaketViewMahasiswa($id)
{
return $this->render('DataPaketView', [
return $this->render('DataPaketViewMahasiswa', [
'model' => $this->findModel($id),
]);
}
/**
* action-id: data-paket-view-pegawai
* action-desc: Display a package data by pegawai
* Displays a single DataPaket model by pegawai.
* @param integer $id
* @return mixed
*/
public function actionDataPaketViewPegawai($id)
{
return $this->render('DataPaketViewPegawai', [
'model' => $this->findModel($id),
]);
}
/**
* action-id: data-paket-add
* action-desc: Menambahkan data paket yang datang
* Creates a new DataPaket model.
......@@ -169,4 +196,5 @@ class DataPaketController extends Controller
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
......@@ -21,11 +21,10 @@ class KendaraanController extends Controller
{
return [
// //TODO: crud controller actions are bypassed by default, set the appropriate privilege
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
......
......@@ -2,6 +2,9 @@
namespace backend\modules\ubux\controllers;
use backend\modules\ubux\models\Kendaraan;
use backend\modules\ubux\models\PemakaianKendaraan;
use backend\modules\ubux\models\Supir;
use Yii;
use backend\modules\ubux\models\LaporanPemakaianKendaraan;
use backend\modules\ubux\models\search\LaporanPemakaianKendaraanSearch;
......@@ -9,6 +12,7 @@ use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use mPDF;
use yii\helpers\Url;
/**
* LaporanPemakaianKendaraanController implements the CRUD actions for LaporanPemakaianKendaraan model.
......@@ -21,11 +25,10 @@ class LaporanPemakaianKendaraanController extends Controller
{
return [
//TODO: crud controller actions are bypassed by default, set the appropriate privilege
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
......@@ -77,8 +80,10 @@ class LaporanPemakaianKendaraanController extends Controller
{
$model = new LaporanPemakaianKendaraan();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->laporan_pemakaian_kendaraan_id]);
if ($model->load(Yii::$app->request->post())) {
if($model->save()){
return $this->redirect(['view', 'id' => $model->laporan_pemakaian_kendaraan_id]);
}
} else {
return $this->render('add', [
'model' => $model,
......@@ -86,6 +91,42 @@ class LaporanPemakaianKendaraanController extends Controller
}
}
public function actionAddLaporanPemakaian($id)
{
$model = new LaporanPemakaianKendaraan();
$pemakaian_kendaraan = PemakaianKendaraan::findOne($id);
if($pemakaian_kendaraan->laporan == 1){
Yii::$app->messenger->addErrorFlash("Laporan Sudah Dibuat");
return $this->redirect(Url::toRoute(['pemakaian-kendaraan/index', 'id' => $id]));
}
if ($model->load(Yii::$app->request->post())) {
if($pemakaian_kendaraan->supir_id != null){
$supir = Supir::findOne($pemakaian_kendaraan->supir_id);
$supir->status = 0;
$supir->save();
}
if($pemakaian_kendaraan->kendaraan_id != null){
$kendaraan = Kendaraan::findOne($pemakaian_kendaraan->kendaraan_id);
$kendaraan->status = 0;
$kendaraan->save();
}
$pemakaian_kendaraan->laporan = 1;
$pemakaian_kendaraan->save();
if($model->save()){
return $this->redirect(['view', 'id' => $model->laporan_pemakaian_kendaraan_id]);
}
} else {
return $this->render('_formLaporanPemakaianKendaraan', [
'model' => $model,
]);
}
}
/**
* action-id: edit
* action-desc: Memperbaharui data laporan
......
......@@ -2,6 +2,8 @@
namespace backend\modules\ubux\controllers;
use backend\modules\ubux\models\Kendaraan;
use backend\modules\ubux\models\Supir;
use Yii;
use backend\modules\ubux\models\PemakaianKendaraan;
use backend\modules\ubux\models\search\PemakaianKendaraanSearch;
......@@ -29,11 +31,10 @@ class PemakaianKendaraanController extends Controller
{
return [
//TODO: crud controller actions are bypassed by default, set the appropriate privilege
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
......@@ -289,7 +290,19 @@ class PemakaianKendaraanController extends Controller
if ($model->load(Yii::$app->request->post())) {
$model->status_request_kemahasiswaan = 2;
$model->status_req_sekretaris_rektorat = 2;
$model->no_hp_supir = $model->supir->no_telepon_supir;
// $model->no_hp_supir = $model->supir->no_telepon_supir;
if($model->supir != null){
$supir = Supir::findOne($model->supir_id);
$supir->status = 1;
$supir->save();
}
if($model->kendaraan_id != null){
$kendaraan = Kendaraan::findOne($model->kendaraan_id);
$kendaraan->status = 1;
$kendaraan->save();
}
if($model->jenis_keperluan_id == 1){
$mahasiswa = PemakaianKendaraanMhs::findOne(['pemakaian_kendaraan_mhs_id' => $model->pemakaian_kendaraan_mhs_id]);
......@@ -315,6 +328,62 @@ class PemakaianKendaraanController extends Controller
}
}
public function actionEditBySekretarisRektorat($id){
$model = $this->findModel($id);
$supirLama = Supir::findOne($model->supir_id);
$kendaraanLama = Kendaraan::findOne($model->kendaraan_id);
if ($model->load(Yii::$app->request->post())) {
$model->status_request_kemahasiswaan = 2;
$model->status_req_sekretaris_rektorat = 2;
// $model->no_hp_supir = $model->supir->no_telepon_supir;
if($model->supir_id != null){
if($supirLama != null){
$supirLama->status = 0;
$supirLama->save();
}
$supir = Supir::findOne($model->supir_id);
$supir->status = 1;
$supir->save();
}
if($model->kendaraan_id != null){
if($kendaraanLama != null){
$kendaraanLama->status = 0;
$kendaraanLama->save();
}
$kendaraan = Kendaraan::findOne($model->kendaraan_id);
$kendaraan->status = 1;
$kendaraan->save();
}
if($model->jenis_keperluan_id == 1){
$mahasiswa = PemakaianKendaraanMhs::findOne(['pemakaian_kendaraan_mhs_id' => $model->pemakaian_kendaraan_mhs_id]);
$mahasiswa->status_req_sekretaris_rektorat = 2;
$mahasiswa->kendaraan_id = $model->kendaraan_id;
$mahasiswa->supir_id = $model->supir_id;
$mahasiswa->no_hp_supir = $model->no_hp_supir;
$mahasiswa->save();
}
if($model->save()){
$searchModel = new PemakaianKendaraanSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('viewBySekretarisRektorat', [
'model' => $this->findModel($id),
]);
}
} else {
return $this->render('_formEditBySekretarisRektorat', [
'model' => $model,
]);
}
}
/*
* action-id: reject-by-sekretaris-rektorat
* action-desc: Menolak request oleh sekretaris rektorat
......@@ -324,6 +393,22 @@ class PemakaianKendaraanController extends Controller
$model->status_request_kemahasiswaan = 3;
$model->status_req_sekretaris_rektorat = 3;
if($model->supir_id != null){
$supir = Supir::findOne($model->supir_id);
$supir->status = 0;
$supir->save();
$model->supir_id = null;
}
if($model->kendaraan_id != null){
$kendaraan = Kendaraan::findOne($model->kendaraan_id);
$kendaraan->status = 0;
$kendaraan->save();
$model->kendaraan_id = null;
}
if($model->jenis_keperluan_id == 1){
$mahasiswa = PemakaianKendaraanMhs::findOne(['pemakaian_kendaraan_mhs_id' => $model->pemakaian_kendaraan_mhs_id]);
$mahasiswa->status_req_sekretaris_rektorat = 3;
......
......@@ -28,11 +28,10 @@ class PemakaianKendaraanMhsController extends Controller
{
return [
//TODO: crud controller actions are bypassed by default, set the appropriate privilege
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
......@@ -111,50 +110,50 @@ class PemakaianKendaraanMhsController extends Controller
$dimModel = Dim::findOne($this->dim_id);
$model->dim_id = $dimModel->dim_id;
//$model->save();
$model->save();
// get the instance of the uploaded file
//$id = $model->pemakaian_kendaraan_mhs_id;
// get the instance of the uploaded file
$id = $model->pemakaian_kendaraan_mhs_id;
$proposalName = $model->mahasiswa->nama;
// $model->file = UploadedFile::getInstance($model, 'file');
// $model->file->saveAs('proposal/'.$id.'. Proposal '.$proposalName.'.'.$model->file->extension);
// save the path in the db column
//$model->proposal = 'proposal/'.$id.'. Proposal '.$proposalName.'.'.$model->file->extension;
if(isset($_FILES['PemakaianKendaraanMhs']['name'])){
$result = \Yii::$app->fileManager->saveUploadedFiles();
if(isset($result)){
if($result->status == 'success'){
$model->kode_proposal = $result->fileinfo[0]->id;
$model->proposal = $result->fileinfo[0]->name;
}
else{
\Yii::$app->messenger->addErrorFlash('Error while uploading file !');
return $this->redirect(\Yii::$app->request->referrer);
}
}//else{
// \Yii::$app->messenger->addErrorFlash('Error while uploading file !');
// return $this->redirect(\Yii::$app->request->referrer);
// }
}
$model->save();
$model->file = UploadedFile::getInstance($model, 'file');
$model->file->saveAs('proposal/'.$id.' Proposal '.$proposalName.'.'.$model->file->extension);
// save the path in the db column
$model->proposal = 'proposal/'.$id.'. Proposal '.$proposalName.'.'.$model->file->extension;
// if(isset($_FILES['PemakaianKendaraanMhs']['name'])){
//
// $result = \Yii::$app->fileManager->saveUploadedFiles();
// if(isset($result)){
// if($result->status == 'success'){
// $model->kode_proposal = $result->fileinfo[0]->id;
// $model->proposal = $result->fileinfo[0]->name;
// }
// else{
// \Yii::$app->messenger->addErrorFlash('Error while uploading file !');
// return $this->redirect(\Yii::$app->request->referrer);
// }
// }else{
// \Yii::$app->messenger->addErrorFlash('Error while uploading file !');
// return $this->redirect(\Yii::$app->request->referrer);
// }
// }
// ==================== Variabel Hard Code ==========================//
$userId = $model->dim_id;
$subject = "Permohonan Pemakaian Kendaraan";
$body = "Permohonan Pemakaian Kendaraan";
// $userId = $model->dim_id;
// $subject = "Permohonan Pemakaian Kendaraan";
// $body = "Permohonan Pemakaian Kendaraan";
// ==================== Email ==========================//
Yii::$app->messenger->sendEmailToUser($userId, $subject, $body);
Yii::$app->messenger->addSuccessFlash("Permohonan Pemakaian Kendaraan Berhasil Dibuat");
Yii::$app->messenger->addSuccessFlash("Email Terkirim");
// Yii::$app->messenger->sendEmailToUser($userId, $subject, $body);
//Yii::$app->messenger->addSuccessFlash("Permohonan Pemakaian Kendaraan Berhasil Dibuat");
// Yii::$app->messenger->addSuccessFlash("Email Terkirim");
return $this->redirect(['view', 'id' => $model->pemakaian_kendaraan_mhs_id]);
if($model->save()){
Yii::$app->messenger->addSuccessFlash("Permohonan Pemakaian Kendaraan Berhasil Dibuat");
return $this->redirect(['view', 'id' => $model->pemakaian_kendaraan_mhs_id]);
}
} else {
return $this->render('add', [
'model' => $model,
......@@ -319,11 +318,8 @@ class PemakaianKendaraanMhsController extends Controller
$model->status_request_kemahasiswaan = 2;
$model->save();
$searchModel = new PemakaianKendaraanMhsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
Yii::$app->messenger->addSuccessFlash("Berhasil");
return $this->redirect('indexByKemahasiswaan');
return $this->redirect('index-by-kemahasiswaan');
}
}else{
$searchModel = new PemakaianKendaraanMhsSearch();
......@@ -350,7 +346,7 @@ class PemakaianKendaraanMhsController extends Controller
$searchModel = new PemakaianKendaraanMhsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->redirect('indexByKemahasiswaan');
return $this->redirect('index-by-kemahasiswaan');
}
}
......@@ -20,10 +20,11 @@ class PosisiPaketController extends Controller
{
return [
//TODO: crud controller actions are bypassed by default, set the appropriate privilege
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
......@@ -50,6 +51,7 @@ class PosisiPaketController extends Controller
]);
}
/**
* action-id: posisi-paket-add
* action-desc: Menambahkan data posisi paket
......@@ -60,9 +62,14 @@ class PosisiPaketController extends Controller
public function actionPosisiPaketAdd()
{
$model = new PosisiPaket();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
\Yii::$app->messenger->addSuccessFlash("Posisi Paket Berhasil ditambahkan");
return $this->redirect(['index']);
} else {
return $this->render('PosisiPaketAdd', [
'model' => $model,
]);
}
}
/**
......@@ -75,11 +82,15 @@ class PosisiPaketController extends Controller
*/
public function actionPosisiPaketEdit($id)
{
$model = $this->findModel($id);
return $this->render('PosisiPaketEdit', [
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
\Yii::$app->messenger->addSuccessFlash("Posisi Paket Berhasil diedit");
return $this->redirect(['index']);
} else {
return $this->render('PosisiPaketAdd', [
'model' => $model,
]);
}
}
/**
......@@ -93,7 +104,7 @@ class PosisiPaketController extends Controller
public function actionPosisiPaketDel($id)
{
$this->findModel($id)->softDelete();
\Yii::$app->messenger->addSuccessFlash("Posisi Paket Berhasil dihapus");
return $this->redirect(['index']);
}
......
......@@ -20,11 +20,10 @@ class SupirController extends Controller
{
return [
//TODO: crud controller actions are bypassed by default, set the appropriate privilege
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'privilege' => [
'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
'skipActions' => [],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
......
......@@ -75,11 +75,12 @@ class DataTamu extends \yii\db\ActiveRecord
{
return [
'data_tamu_id' => 'Data Tamu ID',
'nik' => 'NIK',
'nik' => 'Nik',
'nama' => 'Nama',
'waktu_kedatangan' => 'Waktu Kedatangan',
'desc' => 'Desc',
'waktu_kembali' => 'Waktu Kembali',
'kendaraan'=>'Kendaraan',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
'deleted_by' => 'Deleted By',
......
......@@ -15,6 +15,7 @@ use common\behaviors\DeleteBehavior;
* @property string $kendaraan
* @property integer $daya_tampung_kendaraan
* @property integer $plat_nomor
* @property integer $status
* @property integer $deleted
* @property string $deleted_at
* @property string $deleted_by
......@@ -63,7 +64,7 @@ class Kendaraan extends \yii\db\ActiveRecord
{
return [
[['kendaraan', 'daya_tampung_kendaraan'], 'required'],
[['daya_tampung_kendaraan', 'jumlah_kilometer_pemakaian', 'deleted'], 'integer'],
[['daya_tampung_kendaraan', 'deleted', 'status'], 'integer'],
[['deleted_at', 'created_at', 'updated_at'], 'safe'],
[['kendaraan', 'plat_nomor'], 'string', 'max' => 100],
[['deleted_by', 'created_by', 'updated_by', 'plat_nomor'], 'string', 'max' => 32]
......@@ -80,6 +81,7 @@ class Kendaraan extends \yii\db\ActiveRecord
'kendaraan' => 'Kendaraan',
'daya_tampung_kendaraan' => 'Daya Tampung Kendaraan',
'plat_nomor' => 'Plat Nomor',
'status' => 'Ketersediaan',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
'deleted_by' => 'Deleted By',
......@@ -128,6 +130,9 @@ class Kendaraan extends \yii\db\ActiveRecord
}
public function getKeteranganKendaraan(){
return $this->kendaraan.' '.$this->plat_nomor;
$status = null;
if($this->status == 1) $status = 'Terpakai';
elseif($this->status == 0) $status = 'Tersedia';
return $this->kendaraan.' '.$this->plat_nomor.' ('.$status.')';
}
}
......@@ -27,9 +27,11 @@ use common\behaviors\DeleteBehavior;
* @property string $updated_by
* @property integer $kendaraan_id
* @property integer $supir_id
* @property integer $pemakaian_kendaraan_id
*
* @property Kendaraan $kendaraan
* @property Supir $supir
* @property PemakaianKendaraan $pemakaianKendaraan
*/
class LaporanPemakaianKendaraan extends \yii\db\ActiveRecord
{
......@@ -67,7 +69,7 @@ class LaporanPemakaianKendaraan extends \yii\db\ActiveRecord
{
return [
[['tujuan', 'desc', 'jumlah_penumpang', 'keperluan', 'waktu_keberangkatan', 'waktu_tiba'], 'required'],
[['jumlah_penumpang', 'deleted', 'kendaraan_id', 'supir_id'], 'integer'],
[['jumlah_penumpang', 'deleted', 'kendaraan_id', 'supir_id', 'pemakaian_kendaraan_id'], 'integer'],
[['waktu_keberangkatan', 'waktu_tiba', 'deleted_at', 'created_at', 'updated_at'], 'safe'],
[['tujuan', 'desc', 'keperluan'], 'string'],
[['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
......@@ -98,6 +100,7 @@ class LaporanPemakaianKendaraan extends \yii\db\ActiveRecord
'updated_by' => 'Updated By',
'kendaraan_id' => 'Kendaraan',
'supir_id' => 'Supir',
'pemakaian_kendaraan_id' => 'Pemakaian Kendaraan Id'
];
}
......@@ -116,4 +119,9 @@ class LaporanPemakaianKendaraan extends \yii\db\ActiveRecord
{
return $this->hasOne(Supir::className(), ['supir_id' => 'supir_id']);
}
public function getPemakaianKendaraan()
{
return $this->hasOne(PemakaianKendaraan::className(), ['pemakaian_kendaraan_id' => 'pemakaian_kendaraan_id']);
}
}
......@@ -19,7 +19,7 @@ use common\behaviors\DeleteBehavior;
* @property integer $jumlah_penumpang_kendaraan
* @property string $rencana_waktu_keberangkatan
* @property string $rencana_waktu_kembali
* @property string $status_req_sekretaris_rektorat
* @property int $status_req_sekretaris_rektorat
* @property string $status_request_kemahasiswaan
* @property string $jenis_keperluan_id
* @property string $no_telepon
......@@ -38,6 +38,7 @@ use common\behaviors\DeleteBehavior;
* @property integer $status_request_hrd
* @property integer $status_request_keuangan
* @property integer $status_request_wr2
* @property integer $laporan
*
* @property Supir $supir
* @property Kendaraan $kendaraan
......@@ -86,7 +87,7 @@ class PemakaianKendaraan extends \yii\db\ActiveRecord
{
return [
[['desc', 'tujuan', 'rencana_waktu_keberangkatan', 'rencana_waktu_kembali', 'no_telepon'], 'required'],
[['status_req_sekretaris_rektorat', 'status_request_kemahasiswaan', 'jumlah_penumpang_kendaraan', 'deleted', 'kendaraan_id', 'supir_id', 'pemakaian_kendaraan_mhs_id', 'status_request_kabiro_KSD', 'status_request_hrd', 'status_request_keuangan', 'status_request_wr2', 'jenis_keperluan_id', 'pegawai_id'], 'integer'],
[['status_req_sekretaris_rektorat', 'status_request_kemahasiswaan', 'jumlah_penumpang_kendaraan', 'deleted', 'kendaraan_id', 'supir_id', 'pemakaian_kendaraan_mhs_id', 'status_request_kabiro_KSD', 'status_request_hrd', 'status_request_keuangan', 'status_request_wr2', 'jenis_keperluan_id', 'pegawai_id', 'laporan'], 'integer'],
[['rencana_waktu_keberangkatan', 'rencana_waktu_kembali', 'deleted_at', 'created_at', 'updated_at'], 'safe'],
[['file'], 'file'],
[['no_hp_supir'], 'string', 'max' => 300],
......@@ -133,7 +134,8 @@ class PemakaianKendaraan extends \yii\db\ActiveRecord
'status_request_hrd' => 'Status Persetujuan Hrd',
'status_request_keuangan' => 'Status Persetujuan Keuangan',
'status_request_wr2' => 'Status Persetujuan Wr2',
'pemakaian_kendaraan_mhs_id' => 'Transaksi Kendaraan Mahasiswa ID'
'pemakaian_kendaraan_mhs_id' => 'Transaksi Kendaraan Mahasiswa ID',
'laporan' => 'Laporan Pemakaian',
];
}
......
......@@ -114,7 +114,8 @@ class PemakaianKendaraanMhs extends \yii\db\ActiveRecord
'kendaraan_id' => 'Kendaraan',
'supir_id' => 'Supir',
'no_hp_supir' => 'No Hp Supir',
'kode_proposal' => 'Proposal',
'kode_proposal' => 'Kode Proposal',
'file' => 'File Proposal',
];
}
......
......@@ -14,6 +14,7 @@ use common\behaviors\DeleteBehavior;
* @property integer $supir_id
* @property integer $pegawai_id
* @property string $no_telepon_supir
* @property integer $status
* @property integer $deleted
* @property string $deleted_at
* @property string $deleted_by
......@@ -61,7 +62,7 @@ class Supir extends \yii\db\ActiveRecord
public function rules()
{
return [
[['pegawai_id', 'deleted'], 'integer'],
[['pegawai_id', 'deleted', 'status'], 'integer'],
[['deleted_at', 'created_at', 'updated_at'], 'safe'],
[['no_telepon_supir', 'deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32]
];
......@@ -76,6 +77,7 @@ class Supir extends \yii\db\ActiveRecord
'supir_id' => 'Supir ID',
'pegawai_id' => 'Nama',
'no_telepon_supir' => 'No Telepon Supir',
'status' => 'Ketersediaan',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
'deleted_by' => 'Deleted By',
......@@ -113,6 +115,9 @@ class Supir extends \yii\db\ActiveRecord
}
public function getNamaSupir(){
return $this->pegawai->nama;
$status = null;
if($this->status == 1) $status = 'Di Perjalanan';
elseif($this->status == 0) $status = 'Tersedia';
return $this->pegawai->nama.' ('.$status.')';
}
}
......@@ -50,7 +50,7 @@ class DataPaketSearch extends DataPaket
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination'=>['pageSize'=>10],
'sort' => ['defaultOrder' => ['data_paket_id' => SORT_ASC, 'updated_at' => SORT_DESC, 'created_at' => SORT_DESC]],
'sort' => ['defaultOrder' => ['status_paket_id'=>SORT_ASC,'data_paket_id' => SORT_DESC, 'updated_at' => SORT_DESC, 'created_at' => SORT_DESC]],
]);
$this->load($params);
......@@ -66,7 +66,6 @@ class DataPaketSearch extends DataPaket
'tag' => $this->tag,
'dim_id' => $this->dim_id,
'pegawai_id' => $this->pegawai_id,
'tanggal_kedatangan' => $this->tanggal_kedatangan,
'tanggal_diambil' => $this->tanggal_diambil,
'posisi_paket_id' => $this->posisi_paket_id,
'status_paket_id' => $this->status_paket_id,
......@@ -80,6 +79,8 @@ class DataPaketSearch extends DataPaket
->andFilterWhere(['like', 'hrdx_pegawai.nama', $this->pegawai_nama])
->andFilterWhere(['like', 'pengirim', $this->pengirim])
->andFilterWhere(['like', 'diambil_oleh', $this->diambil_oleh])
->andFilterWhere(['like', 'tanggal_kedatangan',SUBSTR($this->tanggal_kedatangan,1,10)])
->andFilterWhere(['like', 'hrdx_pegawai.nama', $this->pegawai_nama])
->andFilterWhere(['like', 'desc', $this->desc])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by])
......@@ -95,14 +96,13 @@ class DataPaketSearch extends DataPaket
* Search Untuk Paket Mahasiswa
*/
public function searchUserMahasiswa($params){
$dim = Dim::find('dim_id')->where('deleted!=1')->andWhere(['user_id'=>(Yii::$app->user->identity->user_id)])->one();
$query = DataPaket::find()->where('deleted!=1')->andWhere(['dim_id'=>$dim])->orWhere(['dim_id'=>NULL])->andWhere(['pegawai_id'=>NULL]);
$dim = Dim::find('dim_id')->where('deleted!=1')->andWhere(['user_id'=>Yii::$app->user->identity->user_id])->one();
$query = DataPaket::find()->where('deleted!=1')->andWhere(['dim_id'=>$dim->dim_id])
->orWhere(['dim_id'=>NULL,'pegawai_id'=>NULL,'status_paket_id'=>1]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination'=>['pageSize'=>10],
'sort' => ['defaultOrder' => ['data_paket_id' => SORT_ASC, 'updated_at' => SORT_DESC, 'created_at' => SORT_DESC]],
'sort' => ['defaultOrder' => ['dim_id' => SORT_DESC, 'status_paket_id'=>SORT_ASC, 'updated_at' => SORT_DESC, 'created_at' => SORT_DESC]],
]);
$this->load($params);
......@@ -117,7 +117,6 @@ class DataPaketSearch extends DataPaket
'data_paket_id' => $this->data_paket_id,
'tag' => $this->tag,
'dim_id' => $this->dim_id,
'tanggal_kedatangan' => $this->tanggal_kedatangan,
'tanggal_diambil' => $this->tanggal_diambil,
'posisi_paket_id' => $this->posisi_paket_id,
'status_paket_id' => $this->status_paket_id,
......@@ -133,6 +132,7 @@ class DataPaketSearch extends DataPaket
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by])
->andFilterWhere(['like', 'tanggal_kedatangan',SUBSTR($this->tanggal_kedatangan,1,10)])
->andFilterWhere(['not', ['deleted' => 1]]);
return $dataProvider;
......@@ -142,14 +142,15 @@ class DataPaketSearch extends DataPaket
* Search untuk paket Pegawai
*/
public function searchUserPegawai($params){
$pegawai = Pegawai::find('pegawai_id')->where('deleted!=1')->andWhere(['user_id'=>(Yii::$app->user->identity->user_id)])->one();
$pegawai = Pegawai::find()->where('deleted!=1')->andWhere(['user_id'=>(Yii::$app->user->identity->user_id)])->one();
$query = DataPaket::find()->where('deleted!=1')->andWhere(['pegawai_id'=>$pegawai])->orWhere(['pegawai_id'=>NULL])->andWhere(['dim_id'=>NULL]);
$query = DataPaket::find()->where('deleted!=1')->andWhere(['pegawai_id'=>$pegawai->pegawai_id])
->orWhere(['dim_id'=>NULL,'pegawai_id'=>NULL,'status_paket_id'=>1]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination'=>['pageSize'=>10],
'sort' => ['defaultOrder' => ['data_paket_id' => SORT_ASC, 'updated_at' => SORT_DESC, 'created_at' => SORT_DESC]],
'sort' => ['defaultOrder' => ['pegawai_id' => SORT_DESC, 'status_paket_id'=>SORT_ASC, 'updated_at' => SORT_DESC, 'created_at' => SORT_DESC]],
]);
$this->load($params);
......@@ -164,7 +165,6 @@ class DataPaketSearch extends DataPaket
'data_paket_id' => $this->data_paket_id,
'tag' => $this->tag,
'pegawai_id' => $this->pegawai_id,
'tanggal_kedatangan' => $this->tanggal_kedatangan,
'tanggal_diambil' => $this->tanggal_diambil,
'posisi_paket_id' => $this->posisi_paket_id,
'status_paket_id' => $this->status_paket_id,
......@@ -178,6 +178,7 @@ class DataPaketSearch extends DataPaket
->andFilterWhere(['like', 'diambil_oleh', $this->diambil_oleh])
->andFilterWhere(['like', 'desc', $this->desc])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'tanggal_kedatangan',SUBSTR($this->tanggal_kedatangan,1,10)])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by])
->andFilterWhere(['not', ['deleted' => 1]]);
......
......@@ -19,7 +19,7 @@ class DataTamuSearch extends DataTamu
{
return [
[['data_tamu_id', 'deleted'], 'integer'],
[['nik', 'nama', 'waktu_kedatangan', 'desc', 'waktu_kembali', 'deleted_at', 'deleted_by', 'created_by', 'created_at', 'updated_at', 'updated_by'], 'safe'],
[['nik', 'nama', 'waktu_kedatangan','kendaraan', 'desc', 'waktu_kembali', 'deleted_at', 'deleted_by', 'created_by', 'created_at', 'updated_at', 'updated_by'], 'safe'],
];
}
......@@ -58,7 +58,6 @@ class DataTamuSearch extends DataTamu
$query->andFilterWhere([
'data_tamu_id' => $this->data_tamu_id,
'waktu_kedatangan' => $this->waktu_kedatangan,
'waktu_kembali' => $this->waktu_kembali,
'deleted' => $this->deleted,
'deleted_at' => $this->deleted_at,
......@@ -69,6 +68,8 @@ class DataTamuSearch extends DataTamu
$query->andFilterWhere(['like', 'nik', $this->nik])
->andFilterWhere(['like', 'nama', $this->nama])
->andFilterWhere(['like', 'desc', $this->desc])
->andFilterWhere(['like', 'kendaraan', $this->kendaraan])
->andFilterWhere(['like', 'waktu_kedatangan',SUBSTR($this->waktu_kedatangan,1,10)])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by])
......
......@@ -15,8 +15,9 @@ else if($model->pegawai_id!=null){
else{
$this->title = "Paket tidak diketahui";
}
$this->params['breadcrumbs'][] = ['label' => 'Data Paket', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => 'Data Paket', 'url' => ['index-by-admin']];
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->timeZone = 'UTC';
?>
<div class="data-paket-view">
......@@ -24,8 +25,17 @@ $this->params['breadcrumbs'][] = $this->title;
<?= DetailView::widget([
'model' => $model,
'attributes' => [
[
'attribute'=>'tag',
'value'=>function($model){
if($model->tag!=NULL){
return $model->tag;
}
return '-';
}
],
'pengirim',
[
'attribute'=>'tanggal_kedatangan',
'label' => 'Tanggal kedatangan',
......
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\DataPaket */
if($model->dim_id!=null){
$this->title = $model->dim->nama;
}
else{
$this->title = "Paket tidak diketahui";
}
$this->params['breadcrumbs'][] = ['label' => 'Data Paket', 'url' => ['index-by-mahasiswa']];
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->timeZone = 'UTC';
?>
<div class="data-paket-view">
<h1><?= Html::encode($this->title) ?></h1>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
[
'attribute'=>'tag',
'value'=>function($model){
if($model->tag!=NULL){
return $model->tag;
}
return '-';
}
],
'pengirim',
[
'attribute'=>'tanggal_kedatangan',
'label' => 'Tanggal kedatangan',
'format'=> 'raw',
'headerOptions' => ['style' => 'color:#337ab7'],
'value'=>function($model){
if($model->tanggal_kedatangan==NULL){
return '-';
}
else{
return Yii::$app->formatter->asDateTime($model->tanggal_kedatangan, 'php:d M Y H:i:s');
}
}
],
[
'attribute'=>'diambil_oleh',
'format'=>'raw',
'value'=>function($model){
if($model->diambil_oleh!=NULL){
return $model->diambil_oleh;
}
else{
return '-';
}
}
],
[
'attribute'=>'tanggal_diambil',
'label' => 'Tanggal diambil',
'format'=> 'raw',
'headerOptions' => ['style' => 'color:#337ab7'],
'value'=>function($model){
if($model->tanggal_diambil==NULL){
return '-';
}
else{
return Yii::$app->formatter->asDateTime($model->tanggal_diambil, 'php:d M Y H:i:s');
}
}
],
//'posisi',
[
'attribute'=>'posisi_paket_id',
'label'=>'Posisi Paket',
'value'=>$model->posisiPaket->name,
],
[
'attribute'=>'status_paket_id',
'label'=>'Status',
'format'=>'raw',
'value'=>function($model){
if($model->status_paket_id==1){
return '<b class="text-danger">'.$model->statusPaket->status.'</b>';
}
else{
return '<b class="text-success">'.$model->statusPaket->status.'</b>';
}
}
],
[
'attribute'=>'desc',
'label'=>'Deskripsi',
'value'=>function($model){
if($model->desc==NULL){
return '-';
}
else{
return $model->desc;
}
}
],
],
])?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\DataPaket */
if($model->pegawai_id!=null){
$this->title = $model->pegawai->nama;
}
else{
$this->title = "Paket tidak diketahui";
}
$this->params['breadcrumbs'][] = ['label' => 'Data Paket', 'url' => ['index-by-pegawai']];
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->timeZone = 'UTC';
?>
<div class="data-paket-view">
<h1><?= Html::encode($this->title) ?></h1>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
[
'attribute'=>'tag',
'value'=>function($model){
if($model->tag!=NULL){
return $model->tag;
}
return '-';
}
],
'pengirim',
[
'attribute'=>'tanggal_kedatangan',
'label' => 'Tanggal kedatangan',
'format'=> 'raw',
'headerOptions' => ['style' => 'color:#337ab7'],
'value'=>function($model){
if($model->tanggal_kedatangan==NULL){
return '-';
}
else{
return Yii::$app->formatter->asDateTime($model->tanggal_kedatangan, 'php:d M Y H:i:s');
}
}
],
[
'attribute'=>'diambil_oleh',
'format'=>'raw',
'value'=>function($model){
if($model->diambil_oleh!=NULL){
return $model->diambil_oleh;
}
else{
return '-';
}
}
],
[
'attribute'=>'tanggal_diambil',
'label' => 'Tanggal diambil',
'format'=> 'raw',
'headerOptions' => ['style' => 'color:#337ab7'],
'value'=>function($model){
if($model->tanggal_diambil==NULL){
return '-';
}
else{
return Yii::$app->formatter->asDateTime($model->tanggal_diambil, 'php:d M Y H:i:s');
}
}
],
//'posisi',
[
'attribute'=>'posisi_paket_id',
'label'=>'Posisi Paket',
'value'=>$model->posisiPaket->name,
],
[
'attribute'=>'status_paket_id',
'label'=>'Status',
'format'=>'raw',
'value'=>function($model){
if($model->status_paket_id==1){
return '<b class="text-danger">'.$model->statusPaket->status.'</b>';
}
else{
return '<b class="text-success">'.$model->statusPaket->status.'</b>';
}
}
],
[
'attribute'=>'desc',
'label'=>'Deskripsi',
'value'=>function($model){
if($model->desc==NULL){
return '-';
}
else{
return $model->desc;
}
}
],
],
])?>
</div>
......@@ -3,25 +3,47 @@
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\jui\DatePicker;
use backend\modules\ubux\models\PosisiPaket;
use backend\modules\ubux\models\StatusPaket;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\search\DataPaketSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Data Paket';
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->timeZone = 'UTC';
?>
<div class="data-paket-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<?php
$toolbarItemStatusRequest =
"<a href='".Url::to(['index-by-admin'])."' class='btn btn-info '><i class='fa fa-refresh'></i> <span class='toolbar-label'>Refresh</span></a>";
?>
<?=Yii::$app->uiHelper->renderToolbar([
'pull-right' => true,
'groupTemplate' => ['groupStatusExpired'],
'groups' => [
'groupStatusExpired' => [
'template' => ['filterStatus'],
'buttons' => [
'filterStatus' => $toolbarItemStatusRequest,
]
],
],
]) ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel'=>$searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute'=>'dim_id',
'attribute'=>'dim_nama',
'headerOptions' => ['style' => 'color:#3c8dbc'],
'format'=>'raw',
'label'=>'Nama Mahasiswa',
'value'=>function($model,$key,$index){
......@@ -35,7 +57,8 @@ $this->params['breadcrumbs'][] = $this->title;
],
[
'attribute'=>'pegawai_id',
'attribute'=>'pegawai_nama',
'headerOptions' => ['style' => 'color:#3c8dbc'],
'format'=>'raw',
'label'=>'Nama Pegawai',
'value'=>function($model,$key,$index){
......@@ -45,17 +68,24 @@ $this->params['breadcrumbs'][] = $this->title;
else{
return '-';
}
}
},
],
'pengirim',
[
'attribute'=>'tanggal_kedatangan',
'format'=>['Date','php: d M y H:i']
'format'=>['Date','php: d M y H:i'],
'filter'=>DatePicker::widget([
'model'=>$searchModel,
'attribute'=>'tanggal_kedatangan',
'dateFormat' => 'yyyy-MM-dd'
])
],
[
'attribute'=>'posisi_paket_id',
'label'=>'Posisi',
'value'=>'posisiPaket.name'
'value'=>'posisiPaket.name',
'filter'=>ArrayHelper::map(PosisiPaket::find()->where('deleted!=1')->asArray()->all(),'posisi_paket_id','name'),
],
[
'attribute'=>'status_paket_id',
......@@ -68,14 +98,14 @@ $this->params['breadcrumbs'][] = $this->title;
else{
return '<b class="text-success">'.$model->statusPaket->status.'</b>';
}
}
},
'filter'=>ArrayHelper::map(StatusPaket::find()->where('deleted!=1')->asArray()->all(),'status_paket_id','status')
],
['class' => 'common\components\ToolsColumn',
'template' => '{view}',
'urlCreator' => function ($action, $model, $key, $index){
if ($action === 'view') {
return Url::toRoute(['data-paket-view', 'id' => $key]);
return Url::toRoute(['data-paket-view-admin', 'id' => $key]);
}
}
]
......
......@@ -3,25 +3,57 @@
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\jui\DatePicker;
use backend\modules\ubux\models\PosisiPaket;
use backend\modules\ubux\models\StatusPaket;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\search\DataPaketSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Data Paket';
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->timeZone = 'UTC';
?>
<div class="data-paket-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?php
$toolbarItemStatusRequest =
"<a href='".Url::to(['index-by-mahasiswa'])."' class='btn btn-info '><i class='fa fa-refresh'></i> <span class='toolbar-label'>Refresh</span></a>";
?>
<?=Yii::$app->uiHelper->renderToolbar([
'pull-right' => true,
'groupTemplate' => ['groupStatusExpired'],
'groups' => [
'groupStatusExpired' => [
'template' => ['filterStatus'],
'buttons' => [
'filterStatus' => $toolbarItemStatusRequest,
]
],
],
]) ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel'=>$searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute'=>'dim_id',
'headerOptions' => ['style' => 'color:#3c8dbc'],
'label'=>'Tag',
'value'=>function($model,$key,$index){
if($model->tag!=null){
return $model->tag;
}
return '-';
}
],
[
'headerOptions' => ['style' => 'color:#3c8dbc'],
'format'=>'raw',
'label'=>'Nama',
'value'=>function($model,$key,$index){
......@@ -37,32 +69,40 @@ $this->params['breadcrumbs'][] = $this->title;
'pengirim',
[
'attribute'=>'tanggal_kedatangan',
'format'=>['Date','php: d M y H:i']
'format'=>['Date','php: d M y H:i'],
'filter'=>DatePicker::widget([
'model'=>$searchModel,
'attribute'=>'tanggal_kedatangan',
'dateFormat' => 'yyyy-MM-dd'
])
],
[
'attribute'=>'posisi_paket_id',
'label'=>'Posisi',
'value'=>'posisiPaket.name'
],
[
'attribute'=>'status_paket_id',
'format'=>'raw',
'label'=>'Status Paket',
'value'=>function($model,$key,$index){
if($model->status_paket_id==1){
return '<b class="text-danger">'.$model->statusPaket->status.'</b>';
}
else{
[
'attribute'=>'posisi_paket_id',
'label'=>'Posisi',
'value'=>'posisiPaket.name',
'filter'=>ArrayHelper::map(PosisiPaket::find()->where('deleted!=1')->asArray()->all(),'posisi_paket_id','name'),
],
[
'attribute'=>'status_paket_id',
'format'=>'raw',
'label'=>'Status Paket',
'value'=>function($model,$key,$index){
if($model->status_paket_id==1){
return '<b class="text-danger">'.$model->statusPaket->status.'</b>';
}
else{
return '<b class="text-success">'.$model->statusPaket->status.'</b>';
}
}
],
}
},
'filter'=>ArrayHelper::map(StatusPaket::find()->where('deleted!=1')->asArray()->all(),'status_paket_id','status'),
],
['class' => 'common\components\ToolsColumn',
'template' => '{view}',
'urlCreator' => function ($action, $model, $key, $index){
if ($action === 'view') {
return Url::toRoute(['data-paket-view', 'id' => $key]);
return Url::toRoute(['data-paket-view-mahasiswa', 'id' => $key]);
}
}
]
......
......@@ -3,29 +3,62 @@
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\jui\DatePicker;
use backend\modules\ubux\models\PosisiPaket;
use backend\modules\ubux\models\StatusPaket;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\search\DataPaketSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Data Paket';
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->timeZone = 'UTC';
?>
<div class="data-paket-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?php
$toolbarItemStatusRequest =
"<a href='".Url::to(['index-by-pegawai'])."' class='btn btn-info '><i class='fa fa-refresh'></i> <span class='toolbar-label'>Refresh</span></a>";
?>
<?=Yii::$app->uiHelper->renderToolbar([
'pull-right' => true,
'groupTemplate' => ['groupStatusExpired'],
'groups' => [
'groupStatusExpired' => [
'template' => ['filterStatus'],
'buttons' => [
'filterStatus' => $toolbarItemStatusRequest,
]
],
],
]) ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel'=>$searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute'=>'pegawai_id',
'headerOptions' => ['style' => 'color:#3c8dbc'],
'label'=>'Tag',
'value'=>function($model,$key,$index){
if($model->tag!=null){
return $model->tag;
}
return '-';
}
],
[
'headerOptions' => ['style' => 'color:#3c8dbc'],
'format'=>'raw',
'label'=>'Nama',
'value'=>function($model,$key,$index){
if($model->pegawai!=NULL){
if($model->pegawai_id!=NULL){
return $model->pegawai->nama;
}
else {
......@@ -37,32 +70,39 @@ $this->params['breadcrumbs'][] = $this->title;
'pengirim',
[
'attribute'=>'tanggal_kedatangan',
'format'=>['Date','php: d M y H:i']
'format'=>['Date','php: d M y H:i'],
'filter'=>DatePicker::widget([
'model'=>$searchModel,
'attribute'=>'tanggal_kedatangan',
'dateFormat' => 'yyyy-MM-dd'
])
],
[
'attribute'=>'posisi_paket_id',
'label'=>'Posisi',
'value'=>'posisiPaket.name'
],
[
'attribute'=>'status_paket_id',
'format'=>'raw',
'label'=>'Status Paket',
'value'=>function($model,$key,$index){
if($model->status_paket_id==1){
return '<b class="text-danger">'.$model->statusPaket->status.'</b>';
}
else{
[
'attribute'=>'posisi_paket_id',
'label'=>'Posisi',
'value'=>'posisiPaket.name',
'filter'=>ArrayHelper::map(PosisiPaket::find()->where('deleted!=1')->asArray()->all(),'posisi_paket_id','name'),
],
[
'attribute'=>'status_paket_id',
'format'=>'raw',
'label'=>'Status Paket',
'value'=>function($model,$key,$index){
if($model->status_paket_id==1){
return '<b class="text-danger">'.$model->statusPaket->status.'</b>';
}
else{
return '<b class="text-success">'.$model->statusPaket->status.'</b>';
}
}
],
}
},
'filter'=>ArrayHelper::map(StatusPaket::find()->where('deleted!=1')->asArray()->all(),'status_paket_id','status'),
],
['class' => 'common\components\ToolsColumn',
'template' => '{view}',
'urlCreator' => function ($action, $model, $key, $index){
if ($action === 'view') {
return Url::toRoute(['data-paket-view', 'id' => $key]);
return Url::toRoute(['data-paket-view-pegawai', 'id' => $key]);
}
}
]
......
......@@ -9,6 +9,7 @@ use yii\widgets\DetailView;
$this->title = $model->nama;
$this->params['breadcrumbs'][] = ['label' => 'Data Tamu', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->timeZone = 'UTC';
?>
<div class="data-tamu-view">
......@@ -16,7 +17,17 @@ $this->params['breadcrumbs'][] = $this->title;
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'nik',
[
'attribute'=>'nik',
'value'=>function($model){
if($model->nik==NULL){
return '-';
}
else{
return $model->nik;
}
}
],
'nama',
[
'attribute'=>'waktu_kedatangan',
......
......@@ -4,58 +4,102 @@ use yii\helpers\Html;
use yii\grid\GridView;
use common\components\ToolsColumn;
use yii\helpers\Url;
use yii\jui \DatePicker;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\search\DataTamuSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Data Tamu';
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->timeZone = 'UTC';
?>
<div class="data-tamu-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?php
$toolbarItemStatusRequest =
"<a href='".Url::to(['index'])."' class='btn btn-info '><i class='fa fa-refresh'></i> <span class='toolbar-label'>Refresh</span></a>";
?>
<?=Yii::$app->uiHelper->renderToolbar([
'pull-right' => true,
'groupTemplate' => ['groupStatusExpired'],
'groups' => [
'groupStatusExpired' => [
'template' => ['filterStatus'],
'buttons' => [
'filterStatus' => $toolbarItemStatusRequest,
]
],
],
]) ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'tableOptions' => ['class' => 'table table-bordered table-responsive-xl'],
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'nik',
'nama',
//'data_tamu_id',
[
'attribute'=>'waktu_kedatangan',
'format' => ['date', 'php:d M Y H:i:s'],
],
'attribute'=>'nik',
'value'=>function($model,$key,$index){
if($model->nik==NULL){
return '-';
}
else{
return $model->nik;
}
}
],
'nama',
[
'label'=>'Keperluan',
'attribute'=>'desc',
'label'=>'Deskripsi',
'value'=>'desc',
],
[
'attribute'=>'waktu_kembali',
'label' => 'Waktu Kembali',
'attribute'=>'waktu_kedatangan',
'label'=>'Masuk Kampus',
'format'=>['Date','php: d M y H:i'],
'filter'=>DatePicker::widget([
'model'=>$searchModel,
'attribute'=>'waktu_kedatangan',
'dateFormat' => 'yyyy-MM-dd'
])
],
[
'label'=>'Keluar Kampus',
'format'=> 'raw',
'headerOptions' => ['style' => 'color:#337ab7'],
'value'=>function($model,$index,$key){
'value'=>function($model,$key,$index){
if($model->waktu_kembali==NULL){
return '-';
}
else{
return Yii::$app->formatter->asDateTime($model->waktu_kembali, 'php:d M Y H:i:s');
return Yii::$app->formatter->asDateTime($model->waktu_kembali, 'php:d M Y H:i');
}
}
],
// 'deleted',
// 'deleted_at',
// 'deleted_by',
// 'created_by',
// 'created_at',
// 'updated_at',
// 'updated_by',
[
'attribute'=>'kendaraan',
'value'=>function($model,$key,$index){
if($model->kendaraan==NULL){
return '-';
}
else{
return $model->kendaraan;
}
},
'filter'=>array('Tidak Berkendara'=>'Tidak Berkendara',
'Kendaraan Roda 2'=>'Kendaraan Roda 2',
'Kendaraan Roda 4'=>'Kendaraan Roda 4'),
],
['class' => 'common\components\ToolsColumn',
'template' => '{view} {delete}',
......
......@@ -4,6 +4,7 @@ use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use common\components\ToolsColumn;
use yii\base\Model;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\KendaraanSearch */
......@@ -24,6 +25,11 @@ $this->params['breadcrumbs'][] = $this->title;
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'rowOptions' => function($model){
if($model->status == 0)
return ['class' => 'pasif'];
else return ['class' => 'danger'];
},
'columns' => [
['class' => 'yii\grid\SerialColumn'],
......@@ -31,7 +37,13 @@ $this->params['breadcrumbs'][] = $this->title;
'kendaraan',
'plat_nomor',
'daya_tampung_kendaraan',
[
'attribute' => 'Ketersediaan',
'value' => function(Model $model){
if($model->status == 0) return 'Tersedia';
else return 'Terpakai';
}
],
// 'deleted',
// 'deleted_at',
// 'deleted_by',
......
......@@ -2,6 +2,7 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\base\Model;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Kendaraan */
......@@ -32,6 +33,13 @@ $this->params['breadcrumbs'][] = $this->title;
'kendaraan',
'plat_nomor',
'daya_tampung_kendaraan',
[
'attribute' => 'Ketersediaan',
'value' => function(Model $model){
if($model->status == 0) return 'Tersedia';
else return 'Terpakai';
}
],
// 'deleted',
// 'deleted_at',
// 'deleted_by',
......
......@@ -7,6 +7,7 @@ use yii\helpers\ArrayHelper;
use backend\modules\ubux\models\Kendaraan;
use backend\modules\ubux\models\Supir;
use yii\bootstrap\ActiveForm;
use backend\modules\ubux\models\PemakaianKendaraan;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\LaporanPemakaianKendaraan */
......@@ -44,7 +45,7 @@ use yii\bootstrap\ActiveForm;
'autoClose' => true,
'format' => 'yyyy-mm-dd HH:ii:ss',
'todayBtn' => true,
]
],
]); ?>
<?= $form->field($model, 'waktu_tiba')->widget(DateTimePicker::className(),[
......@@ -74,8 +75,8 @@ use yii\bootstrap\ActiveForm;
-->
<?= $form->field($model, 'kendaraan_id')->dropDownList(
ArrayHelper::map(Kendaraan::find()->select([
'kendaraan_id', 'kendaraan', 'plat_nomor'
])->where('deleted!=1')->orderBy(['kendaraan' => SORT_ASC])->all(), 'kendaraan_id', 'KeteranganKendaraan'),
'kendaraan_id', 'kendaraan', 'plat_nomor', 'status',
])->where(['deleted' => 0])->all(), 'kendaraan_id', 'KeteranganKendaraan'),
['prompt' => 'Pilih Kendaraan']
) ?>
......
<?php
use yii\helpers\Html;
//use yii\widgets\ActiveForm;
use dosamigos\datetimepicker\DateTimePicker;
use yii\helpers\ArrayHelper;
use backend\modules\ubux\models\Kendaraan;
use backend\modules\ubux\models\Supir;
use yii\bootstrap\ActiveForm;
use backend\modules\ubux\models\PemakaianKendaraan;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\LaporanPemakaianKendaraan */
/* @var $form yii\widgets\ActiveForm */
$this->title = 'Tambah Laporan Pemakaian Kendaraan';
$this->params['breadcrumbs'][] = ['label' => 'Laporan Pemakaian Kendaraan', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$id = Yii::$app->request->get('id');
if($id != null){
$pemakaian_kendaraan = PemakaianKendaraan::findOne($id);
$tujuan = $pemakaian_kendaraan->tujuan;
$jumlah_penumpang = $pemakaian_kendaraan->jumlah_penumpang_kendaraan;
$keperluan = $pemakaian_kendaraan->desc;
}
?>
<div class="ubux-laporan-pemakaian-kendaraan-form">
<h1><?= Html::encode($this->title) ?></h1>
<?php $form = ActiveForm::begin([
'layout' => 'horizontal',
'fieldConfig' => [
'template' => "{label}\n{beginWrapper}\n{input}\n{error}\n{endWrapper}\n{hint}",
'horizontalCssClasses' => [
'label' => 'col-sm-2',
'wrapper' => 'col-sm-8',
'error' => '',
'hint' => '',
],
],
]); ?>
<?= $form->field($model, 'tujuan')->textarea([
'value' => $tujuan,
]) ?>
<?= $form->field($model, 'desc')->textarea() ?>
<?= $form->field($model, 'jumlah_penumpang')->textInput([
'value' => $jumlah_penumpang,
]) ?>
<?= $form->field($model, 'keperluan')->textarea([
'value' => $keperluan,
]) ?>
<?= $form->field($model, 'waktu_keberangkatan')->widget(DateTimePicker::className(),[
'inline' => false,
'pickButtonIcon' => 'glyphicon glyphicon-time',
'size' => 'ms',
'clientOptions' => [
'autoClose' => true,
'format' => 'yyyy-mm-dd HH:ii:ss',
'todayBtn' => true,
],
]); ?>
<?= $form->field($model, 'waktu_tiba')->widget(DateTimePicker::className(),[
'inline' => false,
'pickButtonIcon' => 'glyphicon glyphicon-time',
'size' => 'ms',
'clientOptions' => [
'autoClose' => true,
'format' => 'yyyy-mm-dd HH:ii:ss',
'todayBtn' => true,
]
]); ?>
<!--
<?= $form->field($model, 'deleted')->textInput() ?>
<?= $form->field($model, 'deleted_at')->textInput() ?>
<?= $form->field($model, 'deleted_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'created_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?>
-->
<?= $form->field($model, 'kendaraan_id')->dropDownList(
ArrayHelper::map(Kendaraan::find()->select([
'kendaraan_id', 'kendaraan', 'plat_nomor', 'status',
])->where(['deleted' => 0])->all(), 'kendaraan_id', 'KeteranganKendaraan'),
['prompt' => 'Pilih Kendaraan']
) ?>
<?= $form->field($model, 'supir_id')->dropDownList(
ArrayHelper::map(Supir::find()->select([
'ubux_supir.supir_id', 'ubux_supir.pegawai_id',
])->where('ubux_supir.deleted!=1')->joinWith([
'pegawai' => function($query){
$query->where('hrdx_pegawai.deleted!=1')->orderBy(['hrdx_pegawai.nama' => SORT_ASC]);
}
])->all(), 'supir_id', 'NamaSupir'),
['prompt' => 'Pilih Supir']
) ?>
<?= $form->field($model, 'pemakaian_kendaraan_id')->textInput([
'value' => $id,
]) ?>
<div class="form-group">
<div class="col-md-1 col-md-offset-2">
<?= Html::submitButton($model->isNewRecord ? 'Buat' : 'Ubah', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div></div>
<?php ActiveForm::end(); ?>
</div>
......@@ -17,9 +17,9 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<p>
<!-- <p>
<?= Html::a('Tambah Laporan Pemakaian Kendaraan', ['add'], ['class' => 'btn btn-success']) ?>
</p>
</p> -->
<?= GridView::widget([
'dataProvider' => $dataProvider,
......
......@@ -18,6 +18,9 @@ $this->params['breadcrumbs'][] = $this->title;
.tengah{
text-align: center;
}
.kanan{
text-align: right;
}
table, th, td{
border-collapse: collapse;
}
......@@ -153,5 +156,5 @@ $this->params['breadcrumbs'][] = $this->title;
<td>www.del.ac.id</td>
</tr>
</table>
</div>
......@@ -54,7 +54,7 @@ use dosamigos\datetimepicker\DateTimePicker;
]
]); ?>
<?= $form->field($model, 'proposal')->fileInput() ?>
<?= $form->field($model, 'file')->fileInput()->hint('File Type : PDF / DOC/ DOCX') ?>
<?= $form->field($model, 'no_telepon')->textInput(['maxlength' => true]) ?>
<!--
......
......@@ -6,7 +6,7 @@ use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMhs */
$this->title = 'Buat Permohonan Pemakaian';
$this->title = 'Buat Permohonan Pemakaian Mahasiswa';
$this->params['breadcrumbs'][] = ['label' => 'Permohonan Pemakaian', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
......
......@@ -5,7 +5,7 @@ use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMhs */
$this->title = 'Ubah Permohonan Pemakaian';
$this->title = 'Ubah Permohonan Pemakaian Mahasiswa';
$this->params['breadcrumbs'][] = ['label' => 'Permohonan Pemakaian', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->pemakaian_kendaraan_mhs_id, 'url' => ['view', 'id' => $model->pemakaian_kendaraan_mhs_id]];
$this->params['breadcrumbs'][] = $this->title;
......
......@@ -8,7 +8,7 @@ use yii\helpers\Url;
/* @var $searchModel backend\modules\ubux\models\PemakaianKendaraanMahasiswaSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Permohonan Pemakaian';
$this->title = 'Permohonan Pemakaian Mahasiswa';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ubux-transaksi-kendaraan-mahasiswa-baru-index">
......@@ -23,6 +23,11 @@ $this->params['breadcrumbs'][] = $this->title;
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'rowOptions' => function($model){
if($model->status_req_sekretaris_rektorat == 3) return ['class' => 'danger'];
elseif($model->status_req_sekretaris_rektorat == 2) return ['class' => 'success'];
else return [];
},
'columns' => [
['class' => 'yii\grid\SerialColumn'],
......
......@@ -21,6 +21,11 @@ $this->params['breadcrumbs'][] = $this->title;
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'rowOptions' => function($model){
if($model->status_request_kemahasiswaan == 3) return ['class' => 'danger'];
elseif($model->status_request_kemahasiswaan == 2) return ['class' => 'success'];
else return [];
},
'columns' => [
['class' => 'yii\grid\SerialColumn'],
......
......@@ -106,7 +106,8 @@ $this->params['breadcrumbs'][] = $this->title;
[
'attribute' => 'proposal',
'format' => 'html',
'value' => isset($model->proposal) && $model->proposal!==''?LinkHelper::renderLink(['options'=>'target = _blank','label'=>$model->proposal, 'url'=>\Yii::$app->fileManager->generateUri($model->kode_proposal)]):'-',
'value' => $model->proposal,
// 'value' => isset($model->proposal) && $model->proposal!==''?LinkHelper::renderLink(['options'=>'target = _blank','label'=>$model->proposal, 'url'=>\Yii::$app->fileManager->generateUri($model->kode_proposal)]):'-',
],
],
]) ?>
......
......@@ -3,6 +3,7 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\base\Model;
use common\helpers\LinkHelper;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMhs */
......
......@@ -9,6 +9,8 @@ use backend\modules\ubux\models\Supir;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraan */
/* @var $form yii\widgets\ActiveForm */
$this->title = 'Persetujuan Permohonan Pemakaian';
?>
<div class="ubux-transaksi-kendaraan-mahasiswa-form">
......@@ -30,15 +32,15 @@ use backend\modules\ubux\models\Supir;
<?= $form->field($model, 'kendaraan_id')->dropDownList(
ArrayHelper::map(Kendaraan::find()->select([
'kendaraan_id', 'kendaraan', 'plat_nomor'
])->where(['deleted' => 0])->all(), 'kendaraan_id', 'KeteranganKendaraan'),
'kendaraan_id', 'kendaraan', 'plat_nomor', 'status',
])->where(['deleted' => 0, 'status' => 0])->all(), 'kendaraan_id', 'KeteranganKendaraan'),
['prompt' => 'Pilih Kendaraan']
) ?>
<?= $form->field($model, 'supir_id')->dropDownList(
ArrayHelper::map(Supir::find()->select([
'supir_id', 'pegawai_id',
])->where(['deleted' => 0])->all(), 'supir_id', 'NamaSupir'),
'supir_id', 'pegawai_id', 'status',
])->where(['deleted' => 0, 'status' => 0])->all(), 'supir_id', 'NamaSupir'),
['prompt' => 'Pilih Supir']
) ?>
<!--
......
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use common\helpers\ArrayHelper;
use backend\modules\ubux\models\Kendaraan;
use backend\modules\ubux\models\Supir;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraan */
/* @var $form yii\widgets\ActiveForm */
$this->title = 'Ubah Permohonan Pemakaian';
?>
<div class="ubux-transaksi-kendaraan-mahasiswa-form">
<h1>Catatan :</h1>
<?php $form = ActiveForm::begin([
'layout' => 'horizontal',
'fieldConfig' => [
'template' => "{label}\n{beginWrapper}\n{input}\n{error}\n{endWrapper}\n{hint}",
'horizontalCssClasses' => [
'label' => 'col-sm-2',
'wrapper' => 'col-sm-8',
'error' => '',
'hint' => '',
],
],
]); ?>
<?= $form->field($model, 'kendaraan_id')->dropDownList(
ArrayHelper::map(Kendaraan::find()->select([
'kendaraan_id', 'kendaraan', 'plat_nomor', 'status',
])->where(['deleted' => 0])->all(), 'kendaraan_id', 'KeteranganKendaraan'),
['prompt' => 'Pilih Kendaraan']
) ?>
<?= $form->field($model, 'supir_id')->dropDownList(
ArrayHelper::map(Supir::find()->select([
'supir_id', 'pegawai_id', 'status',
])->where(['deleted' => 0])->all(), 'supir_id', 'NamaSupir'),
['prompt' => 'Pilih Supir']
) ?>
<!--
<?= $form->field($model, 'no_hp_supir')->textInput() ?>
-->
<div class="form-group">
<div class="col-md-1 col-md-offset-2">
<?= Html::submitButton($model->isNewRecord ? 'Buat' : 'Tambah', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-success']) ?>
</div>
</div>
<?php ActiveForm::end(); ?>
</div>
......@@ -24,6 +24,10 @@ $this->params['breadcrumbs'][] = $this->title;
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'rowOptions' => function($model){
if($model->status_req_sekretaris_rektorat == 3) return ['class' => 'danger'];
else return ['class' => 'Pasif'];
},
'columns' => [
['class' => 'yii\grid\SerialColumn'],
......
......@@ -27,6 +27,10 @@ $this->params['breadcrumbs'][] = $this->title;
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'rowOptions' => function($model){
if($model->status_req_sekretaris_rektorat == 3) return ['class' => 'danger'];
else return ['class' => 'Pasif'];
},
'columns' => [
['class' => 'yii\grid\SerialColumn'],
......
......@@ -9,7 +9,7 @@ use yii\base\Model;
/* @var $searchModel backend\modules\ubux\models\PemakaianKendaraanSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Permohonan Pemakaian';
$this->title = 'Semua Permohonan Pemakaian';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ubux-transaksi-kendaraan-mahasiswa-index">
......@@ -24,6 +24,11 @@ $this->params['breadcrumbs'][] = $this->title;
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'rowOptions' => function($model){
if($model->status_req_sekretaris_rektorat == 3) return ['class' => 'danger'];
elseif($model->status_req_sekretaris_rektorat == 2) return ['class' => 'success'];
else return [];
},
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'pegawai_id',
......@@ -39,8 +44,8 @@ $this->params['breadcrumbs'][] = $this->title;
],
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
// 'jumlah_penumpang_kendaraan',
// 'rencana_waktu_keberangkatan',
// 'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'jenis_keperluan_id',
......@@ -73,8 +78,15 @@ $this->params['breadcrumbs'][] = $this->title;
'value' => 'statusRequestSekretarisRektorat.status'
],
[
'attribute' => 'Laporan Pemakaian',
'value' => function(Model $model){
if($model->laporan == 0) return 'Belum Ada';
else return 'Sudah Dibuat';
}
],
[
'class' => 'common\components\ToolsColumn',
'template' => '{view}{acc}{rej}',
'template' => '{view}{acc}{edit}{rej}{laporan}',
'urlCreator' => function($action, $model, $key, $index){
if($action === 'view'){
return Url::toRoute(['view-by-sekretaris-rektorat', 'id' => $key]);
......@@ -82,9 +94,15 @@ $this->params['breadcrumbs'][] = $this->title;
if($action === 'acc'){
return Url::toRoute(['accept-by-sekretaris-rektorat', 'id' => $key]);
}
if($action === 'edit'){
return Url::toRoute(['edit-by-sekretaris-rektorat', 'id' => $key]);
}
if($action === 'rej'){
return Url::toRoute(['reject-by-sekretaris-rektorat', 'id' => $key]);
}
if($action === 'laporan'){
return Url::toRoute(['laporan-pemakaian-kendaraan/add-laporan-pemakaian', 'id' => $key]);
}
}
],
],
......
......@@ -64,7 +64,17 @@ $this->params['breadcrumbs'][] = $this->title;
}
},
],
'no_hp_supir',
// 'no_hp_supir',
[
'attribute' => 'no_hp_supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->no_telepon_supir;
}else{
return '-';
}
},
],
[
'attribute' => 'Status Request Sekretaris Rektorat',
'value' => $model->statusRequestSekretarisRektorat->status,
......
......@@ -64,7 +64,17 @@ $this->params['breadcrumbs'][] = $this->title;
}
},
],
'no_hp_supir',
// 'no_hp_supir',
[
'attribute' => 'no_hp_supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->no_telepon_supir;
}else{
return '-';
}
},
],
[
'attribute' => 'Status Request Sekretaris Rektorat',
'value' => $model->statusRequestSekretarisRektorat->status,
......
......@@ -83,7 +83,17 @@ $this->params['breadcrumbs'][] = $this->title;
}
},
],
'no_hp_supir',
// 'no_hp_supir',
[
'attribute' => 'no_hp_supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->no_telepon_supir;
}else{
return '-';
}
},
],
],
]) ?>
......
......@@ -76,7 +76,17 @@ $this->params['breadcrumbs'][] = $this->title;
}
},
],
'no_hp_supir',
// 'no_hp_supir',
[
'attribute' => 'no_hp_supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->no_telepon_supir;
}else{
return '-';
}
},
],
[
'attribute' => 'Status Request Sekretaris Rektorat',
'value' => $model->statusRequestSekretarisRektorat->status,
......
......@@ -16,8 +16,12 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<?php
echo Html::a('Terima', ['accept-by-sekretaris-rektorat', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Tolak', ['reject-by-sekretaris-rektorat', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-danger']);
if($model->status_req_sekretaris_rektorat == 2){
echo Html::a('Ubah', ['edit-by-sekretaris-rektorat', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-warning']); echo '&nbsp';
echo Html::a('Buat Laporan Pemakaian', ['laporan-pemakaian-kendaraan/add-laporan-pemakaian', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-primary']);
}else
echo Html::a('Terima', ['accept-by-sekretaris-rektorat', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-success']); echo '&nbsp';
echo Html::a('Tolak', ['reject-by-sekretaris-rektorat', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-danger']); echo '&nbsp';
?>
<?= DetailView::widget([
......
......@@ -24,8 +24,8 @@ use yii\bootstrap\ActiveForm;
],
])
?>
<?= $form->field($model, 'name') ?>
<?= $form->field($model, 'name')->textInput() ?>
<div class="form-group">
<div class="col-md-1 col-md-offset-2">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
......
......@@ -3,6 +3,7 @@
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use yii\base\Model;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\ubux\models\SupirSearch */
......@@ -23,6 +24,11 @@ $this->params['breadcrumbs'][] = $this->title;
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'rowOptions' => function($model){
if($model->status == 0)
return ['class' => 'pasif'];
else return ['class' => 'danger'];
},
'columns' => [
['class' => 'yii\grid\SerialColumn'],
......@@ -33,6 +39,13 @@ $this->params['breadcrumbs'][] = $this->title;
'value' => 'pegawai.nama',
],
'no_telepon_supir',
[
'attribute' => 'Ketersediaan',
'value' => function(Model $model){
if($model->status == 0) return 'Tersedia';
else return 'Terpakai';
}
],
// 'deleted',
// 'deleted_at',
// 'deleted_by',
......
......@@ -2,6 +2,7 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\base\Model;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Supir */
......@@ -19,7 +20,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?= Html::a('Hapus', ['del', 'id' => $model->supir_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'confirm' => 'Apakan anda yakin ingin menghapus ?',
'method' => 'post',
],
]) ?>
......@@ -35,6 +36,13 @@ $this->params['breadcrumbs'][] = $this->title;
'value' => $model->pegawai->nama,
],
'no_telepon_supir',
[
'attribute' => 'Ketersediaan',
'value' => function(Model $model){
if($model->status == 0) return 'On';
else return 'Off';
}
],
// 'deleted',
// 'deleted_at',
// 'deleted_by',
......
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