Commit ef1e1b0b by Hendro Prabowo

Revisi Integrasi 2

parent 0a7c2d1d
......@@ -2,7 +2,6 @@
namespace backend\modules\ubux\controllers;
use backend\modules\ubux\models\Pegawai;
use Yii;
use backend\modules\ubux\models\Supir;
use backend\modules\ubux\models\search\SupirSearch;
......@@ -23,7 +22,7 @@ class SupirController extends Controller
// 'class' => \Yii::$app->privilegeControl->getAppPrivilegeControlClass(),
// 'skipActions' => ['*'],
// ],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
......@@ -70,10 +69,7 @@ class SupirController extends Controller
$model = new Supir();
if ($model->load(Yii::$app->request->post())) {
$pegawai = Pegawai::findOne(['pegawai_id' => $model->pegawai_id]);
$model->name_supir = $pegawai->nama;
$model->no_telepon_supir = $pegawai->hp;
$model->pegawai_id = $pegawai->pegawai_id;
$model->no_telepon_supir = $model->pegawai->hp;
$model->save();
return $this->redirect(['view', 'id' => $model->supir_id]);
} else {
......@@ -96,7 +92,7 @@ class SupirController extends Controller
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->supir_id]);
} else {
return $this->render('update', [
return $this->render('edit', [
'model' => $model,
]);
}
......@@ -124,7 +120,7 @@ class SupirController extends Controller
*/
protected function findModel($id)
{
if ($model = Supir::findOne($id)) {
if (($model = Supir::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
......
......@@ -615,6 +615,6 @@ class Dim extends \yii\db\ActiveRecord
}
// public function getMahasiswa(){
// return $this->hasMany(PemakaianKendaraanMahasiswa::className(), ['dim_id' => 'dim_id']);
// return $this->hasMany(PemakaianKendaraanMhs::className(), ['dim_id' => 'dim_id']);
// }
}
......@@ -40,7 +40,7 @@ class JenisKeperluan extends \yii\db\ActiveRecord
*/
public static function tableName()
{
return 'ubux_jenis_keperluan';
return 'ubux_r_jenis_keperluan';
}
/**
......
......@@ -124,7 +124,7 @@ class Kendaraan extends \yii\db\ActiveRecord
public function getTransaksiKendaraanMahasiswaBarus()
{
return $this->hasMany(PemakaianKendaraanMahasiswa::className(), ['kendaraan_id' => 'kendaraan_id']);
return $this->hasMany(PemakaianKendaraanMhs::className(), ['kendaraan_id' => 'kendaraan_id']);
}
public function getKeteranganKendaraan(){
......
......@@ -13,7 +13,7 @@ use common\behaviors\DeleteBehavior;
*
* @property integer $laporan_pemakaian_kendaraan_id
* @property string $tujuan
* @property string $desc_penumpang
* @property string $desc
* @property integer $jumlah_penumpang
* @property string $keperluan
* @property string $waktu_keberangkatan
......@@ -66,10 +66,10 @@ class LaporanPemakaianKendaraan extends \yii\db\ActiveRecord
public function rules()
{
return [
[['tujuan', 'desc_penumpang', 'jumlah_penumpang', 'keperluan', 'waktu_keberangkatan', 'waktu_tiba'], 'required'],
[['tujuan', 'desc', 'jumlah_penumpang', 'keperluan', 'waktu_keberangkatan', 'waktu_tiba'], 'required'],
[['jumlah_penumpang', 'deleted', 'kendaraan_id', 'supir_id'], 'integer'],
[['waktu_keberangkatan', 'waktu_tiba', 'deleted_at', 'created_at', 'updated_at'], 'safe'],
[['tujuan', 'desc_penumpang', 'keperluan'], 'string'],
[['tujuan', 'desc', 'keperluan'], 'string'],
[['deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
[['kendaraan_id'], 'exist', 'skipOnError' => true, 'targetClass' => Kendaraan::className(), 'targetAttribute' => ['kendaraan_id' => 'kendaraan_id']],
[['supir_id'], 'exist', 'skipOnError' => true, 'targetClass' => Supir::className(), 'targetAttribute' => ['supir_id' => 'supir_id']]
......@@ -84,7 +84,7 @@ class LaporanPemakaianKendaraan extends \yii\db\ActiveRecord
return [
'laporan_pemakaian_kendaraan_id' => 'Laporan Pemakaian Kendaraan ID',
'tujuan' => 'Tujuan',
'desc_penumpang' => 'Deskripsi Penumpang',
'desc' => 'Deskripsi Penumpang',
'jumlah_penumpang' => 'Jumlah Penumpang',
'keperluan' => 'Keperluan',
'waktu_keberangkatan' => 'Waktu Keberangkatan',
......
......@@ -11,18 +11,17 @@ use common\behaviors\DeleteBehavior;
/**
* This is the model class for table "ubux_pemakaian_kendaraan".
*
* @property integer $transaksi_kendaraan_id
* @property integer $transaksi_kendaraan_mhs_id
* @property integer $pemakaian_kendaraan_id
* @property integer $pemakaian_kendaraan_mhs_id
* @property integer $pegawai_id
* @property string $nama_perequest_kendaraan
* @property string $desc_penggunaan_kendaraan
* @property string $desc
* @property string $tujuan
* @property integer $jumlah_penumpang_kendaraan
* @property string $rencana_waktu_keberangkatan
* @property string $rencana_waktu_kembali
* @property string $status_req_sekretaris_rektorat
* @property string $status_request_kemahasiswaan
* @property string $role
* @property string $jenis_keperluan_id
* @property string $no_telepon
* @property string $proposal
* @property integer $deleted
......@@ -49,7 +48,7 @@ use common\behaviors\DeleteBehavior;
* @property StatusRequest $statusRequestKeuangan
* @property StatusRequest $statusRequestWr2
* @property JenisKeperluan $jenisKeperluan
* @property HrdxPegawai $pegawai
* @property Pegawai $pegawai
*/
class PemakaianKendaraan extends \yii\db\ActiveRecord
{
......@@ -86,13 +85,12 @@ class PemakaianKendaraan extends \yii\db\ActiveRecord
public function rules()
{
return [
[['desc_penggunaan_kendaraan', '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', 'transaksi_kendaraan_mhs_id', 'status_request_kabiro_KSD', 'status_request_hrd', 'status_request_keuangan', 'status_request_wr2', 'role', 'pegawai_id'], 'integer'],
[['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'],
[['rencana_waktu_keberangkatan', 'rencana_waktu_kembali', 'deleted_at', 'created_at', 'updated_at'], 'safe'],
[['file'], 'file'],
[['nama_perequest_kendaraan',], 'string', 'max' => 45],
[['no_hp_supir'], 'string', 'max' => 300],
[['desc_penggunaan_kendaraan', 'tujuan'], 'string'],
[['desc', 'tujuan'], 'string'],
[['proposal'], 'string', 'max' => 100],
[['no_telepon', 'deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
[['no_hp_supir'], 'string', 'max' => 300],
......@@ -108,10 +106,9 @@ class PemakaianKendaraan extends \yii\db\ActiveRecord
public function attributeLabels()
{
return [
'transaksi_kendaraan_id' => 'Transaksi Kendaraan ID',
'pemakaian_kendaraan_id' => 'Transaksi Kendaraan ID',
'pegawai_id' => 'Pegawai ID',
'nama_perequest_kendaraan' => 'Nama',
'desc_penggunaan_kendaraan' => 'Keperluan',
'desc' => 'Keperluan',
'tujuan' => 'Tujuan',
'jumlah_penumpang_kendaraan' => 'Jumlah Penumpang',
'rencana_waktu_keberangkatan' => 'Waktu Keberangkatan',
......@@ -119,7 +116,7 @@ class PemakaianKendaraan extends \yii\db\ActiveRecord
'status_req_sekretaris_rektorat' => 'Status',
'status_request_kemahasiswaan' => 'Status Pemintaan Kemahasiswaan',
'no_telepon' => 'No Telepon',
'role' => 'Jenis Permintaan',
'jenis_keperluan_id' => 'Jenis Permintaan',
'proposal' => 'Proposal',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
......@@ -136,7 +133,7 @@ class PemakaianKendaraan extends \yii\db\ActiveRecord
'status_request_hrd' => 'Status Permintaan Hrd',
'status_request_keuangan' => 'Status Permintaan Keuangan',
'status_request_wr2' => 'Status Permintaan Wr2',
'transaksi_kendaraan_mhs_id' => 'Transaksi Kendaraan Mahasiswa ID'
'pemakaian_kendaraan_mhs_id' => 'Transaksi Kendaraan Mahasiswa ID'
];
}
......@@ -161,38 +158,38 @@ class PemakaianKendaraan extends \yii\db\ActiveRecord
*/
public function getStatusRequestSekretarisRektorat()
{
return $this->hasOne(StatusRequest::className(), ['id' => 'status_req_sekretaris_rektorat']);
return $this->hasOne(StatusRequest::className(), ['status_request_id' => 'status_req_sekretaris_rektorat']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getStatusRequestKemahasiswaan()
{
return $this->hasOne(StatusRequest::className(), ['id' => 'status_request_kemahasiswaan']);
return $this->hasOne(StatusRequest::className(), ['status_request_id' => 'status_request_kemahasiswaan']);
}
public function getStatusRequestKabiroKSD()
{
return $this->hasOne(StatusRequest::className(), ['id' => 'status_request_kabiro_KSD']);
return $this->hasOne(StatusRequest::className(), ['status_request_id' => 'status_request_kabiro_KSD']);
}
public function getStatusRequestHRD()
{
return $this->hasOne(StatusRequest::className(), ['id' => 'status_request_hrd']);
return $this->hasOne(StatusRequest::className(), ['status_request_id' => 'status_request_hrd']);
}
public function getStatusRequestKeuangan()
{
return $this->hasOne(StatusRequest::className(), ['id' => 'status_request_keuangan']);
return $this->hasOne(StatusRequest::className(), ['status_request_id' => 'status_request_keuangan']);
}
public function getStatusRequestWr2()
{
return $this->hasOne(StatusRequest::className(), ['id' => 'status_request_wr2']);
return $this->hasOne(StatusRequest::className(), ['status_request_id' => 'status_request_wr2']);
}
public function getJenisKeperluan(){
return $this->hasOne(JenisKeperluan::className(), ['id' => 'role']);
return $this->hasOne(JenisKeperluan::className(), ['jenis_keperluan_id' => 'jenis_keperluan_id']);
}
public function getPegawai(){
......
......@@ -11,9 +11,9 @@ use common\behaviors\DeleteBehavior;
/**
* This is the model class for table "ubux_pemakaian_kendaraan_mahasiswa".
*
* @property integer $transaksi_kendaraan_id
* @property integer $pemakaian_kendaraan_mhs_id
* @property integer $dim_id
* @property string $desc_penggunaan_kendaraan
* @property string $desc
* @property string $tujuan
* @property integer $jumlah_penumpang_kendaraan
* @property string $rencana_waktu_keberangkatan
......@@ -40,7 +40,7 @@ use common\behaviors\DeleteBehavior;
* @property StatusRequest $statusRequestSekretarisRektorat
* @property StatusRequest $statusRequestKemahasiswaan
*/
class PemakaianKendaraanMahasiswa extends \yii\db\ActiveRecord
class PemakaianKendaraanMhs extends \yii\db\ActiveRecord
{
public $file;
/**
......@@ -66,7 +66,7 @@ class PemakaianKendaraanMahasiswa extends \yii\db\ActiveRecord
*/
public static function tableName()
{
return 'ubux_pemakaian_kendaraan_mahasiswa';
return 'ubux_pemakaian_kendaraan_mhs';
}
/**
......@@ -75,11 +75,11 @@ class PemakaianKendaraanMahasiswa extends \yii\db\ActiveRecord
public function rules()
{
return [
[['desc_penggunaan_kendaraan', 'tujuan', 'rencana_waktu_keberangkatan', 'rencana_waktu_kembali', 'no_telepon'], 'required'],
[['desc', 'tujuan', 'rencana_waktu_keberangkatan', 'rencana_waktu_kembali', 'no_telepon'], 'required'],
[['dim_id', 'jumlah_penumpang_kendaraan', 'deleted', 'kendaraan_id', 'supir_id', 'status_req_sekretaris_rektorat', 'status_request_kemahasiswaan'], 'integer'],
[['rencana_waktu_keberangkatan', 'rencana_waktu_kembali', 'deleted_at', 'created_at', 'updated_at'], 'safe'],
[['file'],'file'],
[['desc_penggunaan_kendaraan', 'tujuan'], 'string'],
[['desc', 'tujuan'], 'string'],
[['no_hp_supir'], 'string', 'max' => 300],
[['proposal'], 'string', 'max' => 100],
[['no_telepon', 'deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32],
......@@ -93,9 +93,9 @@ class PemakaianKendaraanMahasiswa extends \yii\db\ActiveRecord
public function attributeLabels()
{
return [
'transaksi_kendaraan_id' => 'Transaksi Kendaraan ID',
'pemakaian_kendaraan_mhs_id' => 'Transaksi Kendaraan ID',
'dim_id' => 'Dim ID',
'desc_penggunaan_kendaraan' => 'Keperluan',
'desc' => 'Keperluan',
'tujuan' => 'Tujuan',
'jumlah_penumpang_kendaraan' => 'Jumlah Penumpang',
'rencana_waktu_keberangkatan' => 'Waktu Keberangkatan',
......@@ -137,13 +137,13 @@ class PemakaianKendaraanMahasiswa extends \yii\db\ActiveRecord
*/
public function getStatusRequestSekretarisRektorat()
{
return $this->hasOne(StatusRequest::className(), ['id' => 'status_req_sekretaris_rektorat']);
return $this->hasOne(StatusRequest::className(), ['status_request_id' => 'status_req_sekretaris_rektorat']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getStatusRequestKemahasiswaan()
{
return $this->hasOne(StatusRequest::className(), ['id' => 'status_request_kemahasiswaan']);
return $this->hasOne(StatusRequest::className(), ['status_request_id' => 'status_request_kemahasiswaan']);
}
}
......@@ -14,8 +14,8 @@ use common\behaviors\DeleteBehavior;
* @property integer $id
* @property string $status
*
* @property PemakaianKendaraanMahasiswa[] $pemakaianKendaraanMahasiswas
* @property PemakaianKendaraanMahasiswa[] $pemakaianKendaraanMahasiswas0
* @property PemakaianKendaraanMhs[] $pemakaianKendaraanMahasiswas
* @property PemakaianKendaraanMhs[] $pemakaianKendaraanMahasiswas0
*/
class StatusRequest extends \yii\db\ActiveRecord
{
......@@ -43,7 +43,7 @@ class StatusRequest extends \yii\db\ActiveRecord
*/
public static function tableName()
{
return 'ubux_status_request';
return 'ubux_r_status_request';
}
/**
......@@ -73,7 +73,7 @@ class StatusRequest extends \yii\db\ActiveRecord
*/
public function getPemakaianKendaraanMahasiswas()
{
return $this->hasMany(PemakaianKendaraanMahasiswa::className(), ['status_request_sekertaris_rektorat' => 'id']);
return $this->hasMany(PemakaianKendaraanMhs::className(), ['status_request_sekertaris_rektorat' => 'id']);
}
/**
......@@ -81,6 +81,6 @@ class StatusRequest extends \yii\db\ActiveRecord
*/
public function getPemakaianKendaraanMahasiswas0()
{
return $this->hasMany(PemakaianKendaraanMahasiswa::className(), ['status_request_kemahasiswaan' => 'id']);
return $this->hasMany(PemakaianKendaraanMhs::className(), ['status_request_kemahasiswaan' => 'id']);
}
}
......@@ -13,7 +13,6 @@ use common\behaviors\DeleteBehavior;
*
* @property integer $supir_id
* @property integer $pegawai_id
* @property string $name_supir
* @property string $no_telepon_supir
* @property integer $deleted
* @property string $deleted_at
......@@ -64,7 +63,6 @@ class Supir extends \yii\db\ActiveRecord
return [
[['pegawai_id', 'deleted'], 'integer'],
[['deleted_at', 'created_at', 'updated_at'], 'safe'],
[['name_supir'], 'string', 'max' => 45],
[['no_telepon_supir', 'deleted_by', 'created_by', 'updated_by'], 'string', 'max' => 32]
];
}
......@@ -76,8 +74,7 @@ class Supir extends \yii\db\ActiveRecord
{
return [
'supir_id' => 'Supir ID',
'pegawai_id' => 'Hrdx Pegawai ID',
'name_supir' => 'Nama Supir',
'pegawai_id' => 'Nama',
'no_telepon_supir' => 'No Telepon Supir',
'deleted' => 'Deleted',
'deleted_at' => 'Deleted At',
......@@ -86,7 +83,6 @@ class Supir extends \yii\db\ActiveRecord
'created_by' => 'Created By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By',
'pegawai_id' => 'Pegawai',
];
}
......@@ -108,7 +104,7 @@ class Supir extends \yii\db\ActiveRecord
public function getTransaksiKendaraanBarus()
{
return $this->hasMany(PemakaianKendaraanMahasiswa::className(), ['supir_id' => 'supir_id']);
return $this->hasMany(PemakaianKendaraanMhs::className(), ['supir_id' => 'supir_id']);
}
public function getPegawai()
......@@ -116,4 +112,7 @@ class Supir extends \yii\db\ActiveRecord
return $this->hasOne(Pegawai::className(), ['pegawai_id' => 'pegawai_id']);
}
public function getNamaSupir(){
return $this->pegawai->nama;
}
}
......@@ -19,7 +19,7 @@ class LaporanPemakaianKendaraanSearch extends LaporanPemakaianKendaraan
{
return [
[['laporan_pemakaian_kendaraan_id', 'jumlah_penumpang', 'deleted', 'kendaraan_id', 'supir_id'], 'integer'],
[['tujuan', 'desc_penumpang', 'keperluan', 'waktu_keberangkatan', 'waktu_tiba', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'],
[['tujuan', 'desc', 'keperluan', 'waktu_keberangkatan', 'waktu_tiba', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'],
];
}
......@@ -70,7 +70,7 @@ class LaporanPemakaianKendaraanSearch extends LaporanPemakaianKendaraan
]);
$query->andFilterWhere(['like', 'tujuan', $this->tujuan])
->andFilterWhere(['like', 'desc_penumpang', $this->desc_penumpang])
->andFilterWhere(['like', 'desc', $this->desc])
->andFilterWhere(['like', 'keperluan', $this->keperluan])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by])
......
......@@ -5,12 +5,12 @@ namespace backend\modules\ubux\models\search;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\ubux\models\PemakaianKendaraanMahasiswa;
use backend\modules\ubux\models\PemakaianKendaraanMhs;
/**
* PemakaianKendaraanMahasiswaSearch represents the model behind the search form about `backend\modules\ubux\models\PemakaianKendaraanMahasiswa`.
* PemakaianKendaraanMhsSearch represents the model behind the search form about `backend\modules\ubux\models\PemakaianKendaraanMhs`.
*/
class PemakaianKendaraanMahasiswaSearch extends PemakaianKendaraanMahasiswa
class PemakaianKendaraanMhsSearch extends PemakaianKendaraanMhs
{
/**
* @inheritdoc
......@@ -18,8 +18,8 @@ class PemakaianKendaraanMahasiswaSearch extends PemakaianKendaraanMahasiswa
public function rules()
{
return [
[['status_req_sekretaris_rektorat', 'status_request_kemahasiswaan','transaksi_kendaraan_id', 'dim_id', 'jumlah_penumpang_kendaraan', 'deleted', 'kendaraan_id', 'supir_id'], 'integer'],
[['desc_penggunaan_kendaraan', 'tujuan', 'rencana_waktu_keberangkatan', 'rencana_waktu_kembali', 'proposal', 'no_telepon', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by', 'no_hp_supir'], 'safe'],
[['status_req_sekretaris_rektorat', 'status_request_kemahasiswaan','pemakaian_kendaraan_mhs_id', 'dim_id', 'jumlah_penumpang_kendaraan', 'deleted', 'kendaraan_id', 'supir_id'], 'integer'],
[['desc', 'tujuan', 'rencana_waktu_keberangkatan', 'rencana_waktu_kembali', 'proposal', 'no_telepon', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by', 'no_hp_supir'], 'safe'],
];
}
......@@ -41,7 +41,7 @@ class PemakaianKendaraanMahasiswaSearch extends PemakaianKendaraanMahasiswa
*/
public function search($params)
{
$query = PemakaianKendaraanMahasiswa::find()->where(['deleted' => 0]);
$query = PemakaianKendaraanMhs::find()->where(['deleted' => 0]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
......@@ -57,7 +57,7 @@ class PemakaianKendaraanMahasiswaSearch extends PemakaianKendaraanMahasiswa
}
$query->andFilterWhere([
'transaksi_kendaraan_id' => $this->transaksi_kendaraan_id,
'pemakaian_kendaraan_mhs_id' => $this->pemakaian_kendaraan_mhs_id,
'dim_id' => $this->dim_id,
'jumlah_penumpang_kendaraan' => $this->jumlah_penumpang_kendaraan,
'rencana_waktu_keberangkatan' => $this->rencana_waktu_keberangkatan,
......@@ -70,7 +70,7 @@ class PemakaianKendaraanMahasiswaSearch extends PemakaianKendaraanMahasiswa
'supir_id' => $this->supir_id,
]);
$query->andFilterWhere(['like', 'desc_penggunaan_kendaraan', $this->desc_penggunaan_kendaraan])
$query->andFilterWhere(['like', 'desc', $this->desc])
->andFilterWhere(['like', 'tujuan', $this->tujuan])
->andFilterWhere(['like', 'status_req_sekretaris_rektorat', $this->status_req_sekretaris_rektorat])
->andFilterWhere(['like', 'status_request_kemahasiswaan', $this->status_request_kemahasiswaan])
......
......@@ -18,8 +18,8 @@ class PemakaianKendaraanSearch extends PemakaianKendaraan
public function rules()
{
return [
[['transaksi_kendaraan_id', 'jumlah_penumpang_kendaraan', 'deleted', 'kendaraan_id', 'supir_id', 'role', 'pegawai_id'], 'integer'],
[['nama_perequest_kendaraan', 'desc_penggunaan_kendaraan', 'rencana_waktu_keberangkatan', 'rencana_waktu_kembali', 'status_req_sekretaris_rektorat', 'status_request_kemahasiswaan', 'proposal', 'no_telepon', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by', 'no_hp_supir', 'status_request_kabiro_KSD', 'status_request_hrd', 'status_request_keuangan', 'status_request_wr2'], 'safe'],
[['pemakaian_kendaraan_id', 'jumlah_penumpang_kendaraan', 'deleted', 'kendaraan_id', 'supir_id', 'jenis_keperluan_id', 'pegawai_id'], 'integer'],
[['jenis_keperluan_id', 'rencana_waktu_keberangkatan', 'rencana_waktu_kembali', 'status_req_sekretaris_rektorat', 'status_request_kemahasiswaan', 'proposal', 'no_telepon', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by', 'no_hp_supir', 'status_request_kabiro_KSD', 'status_request_hrd', 'status_request_keuangan', 'status_request_wr2'], 'safe'],
];
}
......@@ -57,7 +57,7 @@ class PemakaianKendaraanSearch extends PemakaianKendaraan
}
$query->andFilterWhere([
'transaksi_kendaraan_id' => $this->transaksi_kendaraan_id,
'pemakaian_kendaraan_id' => $this->pemakaian_kendaraan_id,
'pegawai_id' => $this->pegawai_id,
'jumlah_penumpang_kendaraan' => $this->jumlah_penumpang_kendaraan,
'rencana_waktu_keberangkatan' => $this->rencana_waktu_keberangkatan,
......@@ -70,12 +70,11 @@ class PemakaianKendaraanSearch extends PemakaianKendaraan
'supir_id' => $this->supir_id,
]);
$query->andFilterWhere(['like', 'nama_perequest_kendaraan', $this->nama_perequest_kendaraan])
->andFilterWhere(['like', 'desc_penggunaan_kendaraan', $this->desc_penggunaan_kendaraan])
$query->andFilterWhere(['like', 'jenis_keperluan_id', $this->jenis_keperluan_id])
->andFilterWhere(['like', 'pegawai_id', $this->pegawai_id])
->andFilterWhere(['like', 'status_req_sekretaris_rektorat', $this->status_req_sekretaris_rektorat])
->andFilterWhere(['like', 'status_request_kemahasiswaan', $this->status_request_kemahasiswaan])
->andFilterWhere(['like', 'role', $this->role])
->andFilterWhere(['like', 'jenis_keperluan_id', $this->jenis_keperluan_id])
->andFilterWhere(['like', 'proposal', $this->proposal])
->andFilterWhere(['like', 'no_telepon', $this->no_telepon])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
......
......@@ -18,8 +18,8 @@ class SupirSearch extends Supir
public function rules()
{
return [
[['supir_id', 'deleted'], 'integer'],
[['name_supir', 'no_telepon_supir', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'],
[['supir_id', 'pegawai_id', 'deleted'], 'integer'],
[['no_telepon_supir', 'deleted_at', 'deleted_by', 'created_at', 'created_by', 'updated_at', 'updated_by'], 'safe'],
];
}
......@@ -45,6 +45,9 @@ class SupirSearch extends Supir
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSize' => 10,
],
'sort' => ['defaultOrder' => ['updated_at' => SORT_DESC, 'created_at' => SORT_DESC]],
]);
......@@ -58,14 +61,14 @@ class SupirSearch extends Supir
$query->andFilterWhere([
'supir_id' => $this->supir_id,
'pegawai_id' => $this->pegawai_id,
'deleted' => $this->deleted,
'deleted_at' => $this->deleted_at,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'name_supir', $this->name_supir])
->andFilterWhere(['like', 'no_telepon_supir', $this->no_telepon_supir])
$query->andFilterWhere(['like', 'no_telepon_supir', $this->no_telepon_supir])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by]);
......
......@@ -30,7 +30,7 @@ use yii\bootstrap\ActiveForm;
<?= $form->field($model, 'tujuan')->textarea() ?>
<?= $form->field($model, 'desc_penumpang')->textarea() ?>
<?= $form->field($model, 'desc')->textarea() ?>
<?= $form->field($model, 'jumlah_penumpang')->textInput() ?>
......@@ -74,15 +74,15 @@ use yii\bootstrap\ActiveForm;
-->
<?= $form->field($model, 'kendaraan_id')->dropDownList(
ArrayHelper::map(Kendaraan::find()->select([
'kendaraan_id', 'kendaraan'
])->all(), 'kendaraan_id', 'kendaraan'),
'kendaraan_id', 'kendaraan', 'plat_nomor'
])->where(['deleted' => 0])->all(), 'kendaraan_id', 'KeteranganKendaraan'),
['prompt' => 'Pilih Kendaraan']
) ?>
<?= $form->field($model, 'supir_id')->dropDownList(
ArrayHelper::map(Supir::find()->select([
'supir_id', 'name_supir'
])->all(), 'supir_id', 'name_supir'),
'supir_id', 'pegawai_id',
])->where(['deleted' => 0])->all(), 'supir_id', 'NamaSupir'),
['prompt' => 'Pilih Supir']
) ?>
......
......@@ -19,7 +19,7 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'tujuan') ?>
<?= $form->field($model, 'desc_penumpang') ?>
<?= $form->field($model, 'desc') ?>
<?= $form->field($model, 'jumlah_penumpang') ?>
......
......@@ -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\LaporanPemakaianKendaraanSearch */
......@@ -28,7 +29,7 @@ $this->params['breadcrumbs'][] = $this->title;
// 'laporan_pemakaian_kendaraan_id',
'tujuan',
'desc_penumpang',
'desc',
'jumlah_penumpang',
'keperluan',
'waktu_keberangkatan',
......@@ -42,13 +43,24 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_by',
// 'kendaraan_id',
[
'attribute' => 'Kendaraan',
'value' => 'kendaraan.kendaraan',
'attribute' => 'Supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
// 'supir_id',
[
'attribute' => 'Supir',
'value' => 'supir.name_supir'
'attribute' => 'Kendaraan',
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
} else {
return '-';
}
},
],
['class' => 'common\components\ToolsColumn',
......
......@@ -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\LaporanPemakaianKendaraan */
......@@ -31,7 +32,7 @@ $this->params['breadcrumbs'][] = $this->title;
'attributes' => [
// 'laporan_pemakaian_kendaraan_id',
'tujuan',
'desc_penumpang',
'desc',
'jumlah_penumpang',
'keperluan',
'waktu_keberangkatan',
......@@ -45,13 +46,24 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_by',
// 'kendaraan_id',
[
'attribute' => 'Kendaraan',
'value' => $model->kendaraan->kendaraan
'attribute' => 'Supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
// 'supir_id',
[
'attribute' => 'Supir',
'value' => $model->supir->name_supir,
'attribute' => 'Kendaraan',
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
} else {
return '-';
}
},
],
],
]) ?>
......
......@@ -49,7 +49,7 @@ $this->params['breadcrumbs'][] = $this->title;
<tr>
<td class="kolom">Deskripsi Penumpang</td>
<td class="kolom">:</td>
<td class="kolom"><?= $model->desc_penumpang ?></td>
<td class="kolom"><?= $model->desc ?></td>
</tr>
<tr>
<td class="kolom">Jumlah Penumpang</td>
......@@ -79,7 +79,7 @@ $this->params['breadcrumbs'][] = $this->title;
<tr>
<td class="kolom">Supir</td>
<td>:</td>
<td><?= $model->supir->name_supir ?></td>
<td><?= $model->supir->pegawai->nama ?></td>
</tr>
</table>
......@@ -89,7 +89,7 @@ $this->params['breadcrumbs'][] = $this->title;
// 'attributes' => [
// 'laporan_pemakaian_kendaraan_id',
// 'tujuan',
// 'desc_penumpang',
// 'desc',
// 'jumlah_penumpang',
// 'keperluan',
// 'waktu_keberangkatan',
......
......@@ -5,7 +5,7 @@ use yii\bootstrap\ActiveForm;
use dosamigos\datetimepicker\DateTimePicker;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMahasiswa */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMhs */
/* @var $form yii\widgets\ActiveForm */
?>
......@@ -26,7 +26,7 @@ use dosamigos\datetimepicker\DateTimePicker;
<!--
<?= $form->field($model, 'dim_id')->textInput() ?>
-->
<?= $form->field($model, 'desc_penggunaan_kendaraan')->textarea() ?>
<?= $form->field($model, 'desc')->textarea() ?>
<?= $form->field($model, 'tujuan')->textarea() ?>
......
......@@ -21,7 +21,7 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'nama_perequest_kendaraan') ?>
<?= $form->field($model, 'desc_penggunaan_kendaraan') ?>
<?= $form->field($model, 'desc') ?>
<?= $form->field($model, 'tujuan') ?>
......
......@@ -4,7 +4,7 @@ use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMahasiswa */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMhs */
$this->title = 'Buat Permintaan Kendaraan Mahasiswa';
$this->params['breadcrumbs'][] = ['label' => 'Buat Permintaan Kendaraan Mahasiswa', 'url' => ['index']];
......
......@@ -3,11 +3,11 @@
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMahasiswa */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMhs */
$this->title = 'Ubah Permintaan Kendaraan Mahasiswa';
$this->params['breadcrumbs'][] = ['label' => 'Ubah Permitaan Kendaraan Mahasiswa', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->transaksi_kendaraan_id, 'url' => ['view', 'id' => $model->transaksi_kendaraan_id]];
$this->params['breadcrumbs'][] = ['label' => $model->pemakaian_kendaraan_mhs_id, 'url' => ['view', 'id' => $model->pemakaian_kendaraan_mhs_id]];
$this->params['breadcrumbs'][] = 'Ubah';
?>
<div class="ubux-transaksi-kendaraan-mahasiswa-baru-update">
......
......@@ -31,7 +31,7 @@ $this->params['breadcrumbs'][] = $this->title;
// 'transaksi_kendaraan_id',
// 'dim_id',
// 'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
......
......@@ -26,7 +26,6 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'transaksi_kendaraan_id',
// 'dim_id',
[
'attribute' => 'NIM',
......@@ -36,7 +35,7 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'Nama',
'value' => 'mahasiswa.nama',
],
'desc_penggunaan_kendaraan',
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
// 'rencana_waktu_keberangkatan',
......
......@@ -2,9 +2,10 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\base\Model;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMahasiswa */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMhs */
$this->title = 'Rincian Permintaan Kendaraan';
$this->params['breadcrumbs'][] = ['label' => 'Permintaan Kendaraan Mahasiswa', 'url' => ['index']];
......@@ -17,9 +18,9 @@ $this->params['breadcrumbs'][] = $this->title;
<p>
<?php
if($model->status_request_kemahasiswaan == 1){
echo Html::a('Ubah', ['edit', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-primary']);
echo Html::a('Ubah', ['edit', 'id' => $model->pemakaian_kendaraan_mhs_id], ['class' => 'btn btn-primary']);
echo '&nbsp';
echo Html::a('Hapus', ['del', 'id' => $model->transaksi_kendaraan_id], [
echo Html::a('Hapus', ['del', 'id' => $model->pemakaian_kendaraan_mhs_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Apakah anda yakin ingin menhapus ?',
......@@ -27,7 +28,7 @@ $this->params['breadcrumbs'][] = $this->title;
],
]);
}else if($model->status_req_sekretaris_rektorat == 2){
echo Html::a('Cetak', ['cetak', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-warning']);
echo Html::a('Cetak', ['cetak', 'id' => $model->pemakaian_kendaraan_mhs_id], ['class' => 'btn btn-warning']);
}
?>
......@@ -36,7 +37,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?= DetailView::widget([
'model' => $model,
'attributes' => [
// 'transaksi_kendaraan_id',
// 'pemakaian_kendaraan_mhs_id',
// 'dim_id',
[
'attribute' => 'NIM',
......@@ -46,7 +47,7 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'Nama',
'value' => $model->mahasiswa->nama,
],
'desc_penggunaan_kendaraan',
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
......@@ -70,18 +71,41 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_by',
// 'kendaraan_id',
[
'attribute' => 'Kendaraan',
'value' => $model->kendaraan->kendaraan,
'attribute' => 'Kendaraan',
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
//or: return Html::encode($model->some_attribute)
} else {
return '-';
}
},
],
// 'supir_id',
// 'supir_id'
[
'attribute' => 'Supir',
'value' => $model->supir->name_supir,
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
// 'no_hp_supir',
[
'attribute' => 'no_hp_supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->no_telepon_supir;
}else{
return '-';
}
},
],
'no_hp_supir',
],
]) ?>
<?= Html::a('Download Proposal', ['pemakaian-kendaraan-mahasiswa/download', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-success']) ?>
<?= Html::a('Download Proposal', ['pemakaian-kendaraan-mhs/download', 'id' => $model->pemakaian_kendaraan_mhs_id], ['class' => 'btn btn-success']) ?>
</div>
......@@ -2,9 +2,10 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\base\Model;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMahasiswa */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMhs */
$this->title = 'Rincian Permintaan Kendaraan';
$this->params['breadcrumbs'][] = ['label' => 'Permintaan Kendaraan Mahasiswa', 'url' => ['index']];
......@@ -17,11 +18,11 @@ $this->params['breadcrumbs'][] = $this->title;
<p>
<?php
if($model->status_req_sekretaris_rektorat == 2){
echo Html::a('Cetak', ['cetak', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-warning']);
echo Html::a('Cetak', ['cetak', 'id' => $model->pemakaian_kendaraan_mhs_id], ['class' => 'btn btn-warning']);
}if($model->status_request_kemahasiswaan == 1){
echo Html::a('Terima', ['accept', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Terima', ['accept', 'id' => $model->pemakaian_kendaraan_mhs_id], ['class' => 'btn btn-success']);
echo '&nbsp';
echo Html::a('Tolak', ['reject', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-danger']);
echo Html::a('Tolak', ['reject', 'id' => $model->pemakaian_kendaraan_mhs_id], ['class' => 'btn btn-danger']);
}if($model->status_request_kemahasiswaan == 2 && $model->status_req_sekretaris_rektorat == 1){
echo '<p style="color:red;">Permintaan Telah disetuju. Menunggu persetujuan Sekretaris Rektorat</p>';
}
......@@ -32,7 +33,6 @@ $this->params['breadcrumbs'][] = $this->title;
<?= DetailView::widget([
'model' => $model,
'attributes' => [
// 'transaksi_kendaraan_id',
// 'dim_id',
[
'attribute' => 'NIM',
......@@ -42,7 +42,7 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'Nama',
'value' => $model->mahasiswa->nama,
],
'desc_penggunaan_kendaraan',
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
......@@ -64,20 +64,42 @@ $this->params['breadcrumbs'][] = $this->title;
// 'created_by',
// 'updated_at',
// 'updated_by',
// 'kendaraan_id',
[
'attribute' => 'Kendaraan',
'value' => $model->kendaraan->kendaraan,
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
//or: return Html::encode($model->some_attribute)
} else {
return '-';
}
},
],
// 'supir_id',
// 'supir_id'
[
'attribute' => 'Supir',
'value' => $model->supir->name_supir,
'attribute' => 'Supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
// 'no_hp_supir',
[
'attribute' => 'no_hp_supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->no_telepon_supir;
}else{
return '-';
}
},
],
'no_hp_supir',
],
]) ?>
<?= Html::a('Download Proposal', ['pemakaian-kendaraan-mahasiswa/download', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-success']) ?>
<?= Html::a('Download Proposal', ['pemakaian-kendaraan-mhs/download', 'id' => $model->pemakaian_kendaraan_mhs_id], ['class' => 'btn btn-success']) ?>
</div>
......@@ -4,7 +4,7 @@ use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMahasiswa */
/* @var $model backend\modules\ubux\models\PemakaianKendaraanMhs */
$this->title = 'Request Kendaraan Mahasiswa';
$this->params['breadcrumbs'][] = ['label' => 'Request Kendaraan Mahasiswa', 'url' => ['index']];
......@@ -54,7 +54,7 @@ $this->params['breadcrumbs'][] = $this->title;
<tr>
<td class="kolom">Keperluan</td>
<td>:</td>
<td><?= $model->desc_penggunaan_kendaraan ?></td>
<td><?= $model->desc ?></td>
</tr>
<tr>
<td class="kolom">Tujuan</td>
......@@ -79,7 +79,7 @@ $this->params['breadcrumbs'][] = $this->title;
<tr>
<td class="kolom">Status</td>
<td>:</td>
<td><?= $model->status_req_sekretaris_rektorat ?></td>
<td><?= $model->statusRequestSekretarisRektorat->status ?></td>
</tr>
<tr>
<td class="kolom">No Telepon</td>
......@@ -94,7 +94,7 @@ $this->params['breadcrumbs'][] = $this->title;
<tr>
<td class="kolom">Supir</td>
<td>:</td>
<td><?= $model->supir->name_supir ?></td>
<td><?= $model->supir->pegawai->nama ?></td>
</tr>
<tr>
<td class="kolom">No Hp Supir</td>
......@@ -109,7 +109,7 @@ $this->params['breadcrumbs'][] = $this->title;
// 'attributes' => [
// 'transaksi_kendaraan_id',
// 'nama_perequest_kendaraan',
// 'desc_penggunaan_kendaraan',
// 'desc',
// 'tujuan',
// 'jumlah_penumpang_kendaraan',
// 'rencana_waktu_keberangkatan',
......
......@@ -28,10 +28,8 @@ use backend\modules\ubux\models\Kendaraan;
],
],
]); ?>
<!--
<?= $form->field($model, 'nama_perequest_kendaraan')->textInput(['maxlength' => true]) ?>
-->
<?= $form->field($model, 'desc_penggunaan_kendaraan')->textarea() ?>
<?= $form->field($model, 'desc')->textarea() ?>
<?= $form->field($model, 'tujuan')->textarea() ?>
......@@ -64,7 +62,7 @@ use backend\modules\ubux\models\Kendaraan;
<?= $form->field($model, 'status_request_kemahasiswaan')->dropDownList([ 'Menunggu' => 'Menunggu', 'Diterima' => 'Diterima', 'Ditolak' => 'Ditolak', ], ['prompt' => '']) ?>
<?= $form->field($model, 'role')->dropDownList([ 'Mahasiswa' => 'Mahasiswa', 'Pegawai' => 'Pegawai', ], ['prompt' => '']) ?>
<?= $form->field($model, 'jenis_keperluan_id')->dropDownList([ 'Mahasiswa' => 'Mahasiswa', 'Pegawai' => 'Pegawai', ], ['prompt' => '']) ?>
<?= $form->field($model, 'proposal')->textInput(['maxlength' => true]) ?>
......
......@@ -29,9 +29,7 @@ use backend\modules\ubux\models\Kendaraan;
],
]); ?>
<?= $form->field($model, 'nama_perequest_kendaraan')->textInput() ?>
<?= $form->field($model, 'desc_penggunaan_kendaraan')->textarea() ?>
<?= $form->field($model, 'desc')->textarea() ?>
<?= $form->field($model, 'tujuan')->textarea() ?>
......@@ -64,7 +62,7 @@ use backend\modules\ubux\models\Kendaraan;
<?= $form->field($model, 'status_request_kemahasiswaan')->dropDownList([ 'Menunggu' => 'Menunggu', 'Diterima' => 'Diterima', 'Ditolak' => 'Ditolak', ], ['prompt' => '']) ?>
<?= $form->field($model, 'role')->dropDownList([ 'Mahasiswa' => 'Mahasiswa', 'Pegawai' => 'Pegawai', ], ['prompt' => '']) ?>
<?= $form->field($model, 'jenis_keperluan_id')->dropDownList([ 'Mahasiswa' => 'Mahasiswa', 'Pegawai' => 'Pegawai', ], ['prompt' => '']) ?>
<?= $form->field($model, 'proposal')->textInput() ?>
......@@ -89,7 +87,7 @@ use backend\modules\ubux\models\Kendaraan;
<?= $form->field($model, 'kendaraan_id')->dropDownList(
ArrayHelper::map(Kendaraan::find()->select([
'kendaraan_id', 'kendaraan'
])->all(), 'kendaraan_id', 'kendaraan'),
])->where(['deleted' => 0])->all(), 'kendaraan_id', 'kendaraan'),
['prompt' => 'Pilih Kendaraan']
) ?>
-->
......
......@@ -31,14 +31,14 @@ use backend\modules\ubux\models\Supir;
<?= $form->field($model, 'kendaraan_id')->dropDownList(
ArrayHelper::map(Kendaraan::find()->select([
'kendaraan_id', 'kendaraan', 'plat_nomor'
])->all(), 'kendaraan_id', 'KeteranganKendaraan'),
])->where(['deleted' => 0])->all(), 'kendaraan_id', 'KeteranganKendaraan'),
['prompt' => 'Pilih Kendaraan']
) ?>
<?= $form->field($model, 'supir_id')->dropDownList(
ArrayHelper::map(Supir::find()->select([
'supir_id', 'name_supir'
])->all(), 'supir_id', 'name_supir'),
'supir_id', 'pegawai_id',
])->where(['deleted' => 0])->all(), 'supir_id', 'NamaSupir'),
['prompt' => 'Pilih Supir']
) ?>
<!--
......
......@@ -15,11 +15,9 @@ use yii\widgets\ActiveForm;
'method' => 'get',
]); ?>
<?= $form->field($model, 'transaksi_kendaraan_id') ?>
<?= $form->field($model, 'pemakaian_kendaraan_id') ?>
<?= $form->field($model, 'nama_perequest_kendaraan') ?>
<?= $form->field($model, 'desc_penggunaan_kendaraan') ?>
<?= $form->field($model, 'desc') ?>
<?= $form->field($model, 'jumlah_penumpang_kendaraan') ?>
......@@ -31,7 +29,7 @@ use yii\widgets\ActiveForm;
<?php // echo $form->field($model, 'status_request_kemahasiswaan') ?>
<?php // echo $form->field($model, 'role') ?>
<?php // echo $form->field($model, 'jenis_keperluan_id') ?>
<?php // echo $form->field($model, 'proposal') ?>
......
......@@ -7,7 +7,7 @@ use yii\helpers\Html;
$this->title = 'Ubah Permintaan Kendaraan Mahasiswa';
$this->params['breadcrumbs'][] = ['label' => 'Permintaan Kendaraan Mahasiswa', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->transaksi_kendaraan_id, 'url' => ['view', 'id' => $model->transaksi_kendaraan_id]];
$this->params['breadcrumbs'][] = ['label' => $model->pemakaian_kendaraan_id, 'url' => ['view', 'id' => $model->pemakaian_kendaraan_id]];
$this->params['breadcrumbs'][] = 'Ubah';
?>
<div class="ubux-transaksi-kendaraan-mahasiswa-update">
......
......@@ -23,15 +23,14 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
'desc',
'tujuan',
// 'jumlah_penumpang_kendaraan',
// 'rencana_waktu_keberangkatan',
// 'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
// 'proposal',
// 'deleted',
// 'deleted_at',
......
......@@ -23,15 +23,14 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
'desc',
'tujuan',
// 'jumlah_penumpang_kendaraan',
// 'rencana_waktu_keberangkatan',
// 'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
// 'proposal',
// 'deleted',
// 'deleted_at',
......
......@@ -23,15 +23,14 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
'desc',
'tujuan',
// 'jumlah_penumpang_kendaraan',
// 'rencana_waktu_keberangkatan',
// 'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
// 'proposal',
// 'deleted',
// 'deleted_at',
......
......@@ -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\PemakaianKendaraanSearch */
......@@ -26,14 +27,23 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
[
'attribute' => 'Nama',
'value' => function(Model $model){
if($model->pegawai_id == null){
return 'Kemahasiswaan';
}else{
return $model->pegawai->nama;
}
}
],
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
'rencana_waktu_kembali',
// 'role',
// 'rencana_waktu_kembali',
// 'jenis_keperluan_id',
// 'proposal',
// 'deleted',
// 'deleted_at',
......@@ -43,13 +53,19 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_at',
// 'updated_by',
// 'kendaraan_id',
[
[
'attribute' => 'Kendaraan',
'value' => 'kendaraan.kendaraan',
],
'value' => function(Model $model){
if($model->kendaraan_id != null){
return $model->kendaraan->kendaraan;
}else{
return '-';
}
}
],
// 'status_req_sekretaris_rektorat',
[
'attribute' => 'Status Request Sekretaris Rektorat',
'attribute' => 'Status Request',
'value' => 'statusRequestSekretarisRektorat.status',
],
[
......
......@@ -30,15 +30,14 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
'desc',
'tujuan',
// 'jumlah_penumpang_kendaraan',
// 'rencana_waktu_keberangkatan',
// 'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
// 'proposal',
// 'deleted',
// 'deleted_at',
......
......@@ -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\PemakaianKendaraanSearch */
......@@ -25,19 +26,27 @@ $this->params['breadcrumbs'][] = $this->title;
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pegawai_id',
[
'attribute' => 'Nama',
'value' => function(Model $model){
if($model->pegawai_id == null){
return 'Kemahasiswaan';
}else{
return $model->pegawai->nama;
}
}
],
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
'rencana_waktu_kembali',
// 'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
[
'attribute' => 'Jenis Permintaan',
'value' => 'jenisKeperluan.jenis_keperluan'
'value' => 'jenisKeperluan.jenis_keperluan',
],
// 'proposal',
// 'deleted',
......@@ -47,13 +56,21 @@ $this->params['breadcrumbs'][] = $this->title;
// 'created_by',
// 'updated_at',
// 'updated_by',
// 'kendaraan_id',
[
'attribute' => 'Kendaraan',
'value' => 'kendaraan.kendaraan',
'attribute' => 'Kendaraan',
'value' => function(Model $model){
if($model->kendaraan_id != null){
return $model->kendaraan->kendaraan;
}else{
return '-';
}
}
],
// 'status_req_sekretaris_rektorat',
[
'attribute' => 'status_req_sekretaris_rektorat',
'value' => 'statusRequestSekretarisRektorat.status',
'attribute' => 'Status',
'value' => 'statusRequestSekretarisRektorat.status'
],
[
'class' => 'common\components\ToolsColumn',
......
......@@ -23,15 +23,14 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
'desc',
'tujuan',
// 'jumlah_penumpang_kendaraan',
// 'rencana_waktu_keberangkatan',
// 'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
// 'proposal',
// 'deleted',
// 'deleted_at',
......
......@@ -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\PemakaianKendaraan */
......@@ -14,22 +15,25 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<?php
echo Html::a('Setuju', ['accept-by-hrd', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Tolak', ['reject-by-hrd', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-danger']);
echo Html::a('Setuju', ['accept-by-hrd', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Tolak', ['reject-by-hrd', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-danger']);
?>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
[
'attribute' => 'Nama',
'value' => $model->pegawai->nama,
],
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
'no_telepon',
// 'proposal',
// 'deleted',
......@@ -41,12 +45,24 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_by',
// 'kendaraan_id',
[
'attribute' => 'Jenis Mobil',
'value' => $model->kendaraan->kendaraan,
'attribute' => 'Kendaraan',
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
} else {
return '-';
}
},
],
[
'attribute' => 'Supir',
'value' => $model->supir->name_supir,
'attribute' => 'Supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
'no_hp_supir',
// 'status_request_kabiro_KSD',
......
......@@ -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\PemakaianKendaraan */
......@@ -14,22 +15,25 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<?php
echo Html::a('Setuju', ['accept-by-kabiro-ksd', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Tolak', ['reject-by-kabiro-ksd', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-danger']);
echo Html::a('Setuju', ['accept-by-kabiro-ksd', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Tolak', ['reject-by-kabiro-ksd', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-danger']);
?>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
[
'attribute' => 'Nama',
'value' => $model->pegawai->nama,
],
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
'no_telepon',
// 'proposal',
// 'deleted',
......@@ -41,12 +45,24 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_by',
// 'kendaraan_id',
[
'attribute' => 'Jenis Mobil',
'value' => $model->kendaraan->kendaraan,
'attribute' => 'Kendaraan',
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
} else {
return '-';
}
},
],
[
'attribute' => 'Supir',
'value' => $model->supir->name_supir,
'attribute' => 'Supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
'no_hp_supir',
[
......
......@@ -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\PemakaianKendaraan */
......@@ -14,22 +15,25 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<?php
echo Html::a('Setuju', ['accept-by-keuangan', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Tolak', ['reject-by-keuangan', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-danger']);
echo Html::a('Setuju', ['accept-by-keuangan', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Tolak', ['reject-by-keuangan', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-danger']);
?>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
[
'attribute' => 'Nama',
'value' => $model->pegawai->nama,
],
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
'no_telepon',
// 'proposal',
// 'deleted',
......@@ -41,12 +45,24 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_by',
// 'kendaraan_id',
[
'attribute' => 'Jenis Mobil',
'value' => $model->kendaraan->kendaraan,
'attribute' => 'Kendaraan',
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
} else {
return '-';
}
},
],
[
'attribute' => 'Supir',
'value' => $model->supir->name_supir,
'attribute' => 'Supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
'no_hp_supir',
[
......
......@@ -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\PemakaianKendaraan */
......@@ -16,8 +17,8 @@ $this->params['breadcrumbs'][] = $this->title;
<?php
if($model->status_req_sekretaris_rektorat == 1) {
echo Html::a('Ubah', ['edit-by-pegawai', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-primary']);
echo Html::a('Hapus', ['del', 'id' => $model->transaksi_kendaraan_id], [
echo Html::a('Ubah', ['edit-by-pegawai', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-primary']);
echo Html::a('Hapus', ['del', 'id' => $model->pemakaian_kendaraan_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
......@@ -25,16 +26,19 @@ $this->params['breadcrumbs'][] = $this->title;
],
]);
}else if($model->status_req_sekretaris_rektorat == 2){
echo Html::a('Cetak', ['pegawai-pdf', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-warning']);
echo Html::a('Cetak', ['pegawai-pdf', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-warning']);
}
?>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
[
'attribute' => 'Nama',
'value' => $model->pegawai->nama,
],
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
......@@ -46,7 +50,7 @@ $this->params['breadcrumbs'][] = $this->title;
],
// 'status_request_kemahasiswaan',
'no_telepon',
// 'role',
// 'jenis_keperluan_id',
[
'attribute' => 'Jenis Permintaan',
'value' => $model->jenisKeperluan->jenis_keperluan,
......@@ -60,12 +64,24 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_at',
// 'updated_by',
[
'attribute' => 'Jenis Mobil',
'value' => $model->kendaraan->kendaraan,
'attribute' => 'Kendaraan',
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
} else {
return '-';
}
},
],
[
'attribute' => 'Supir',
'value' => $model->supir->name_supir,
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
'no_hp_supir',
],
......
......@@ -44,12 +44,12 @@ $this->params['breadcrumbs'][] = $this->title;
<tr>
<td class="kolom">Nama</td>
<td class="kolom">:</td>
<td class="kolom"><?= $model->nama_perequest_kendaraan ?></td>
<td class="kolom"><?= $model->pegawai->nama ?></td>
</tr>
<tr>
<td class="kolom">Deskripsi Penggunaan</td>
<td class="kolom">:</td>
<td class="kolom"><?= $model->desc_penggunaan_kendaraan ?></td>
<td class="kolom"><?= $model->desc ?></td>
</tr>
<tr>
<td class="kolom">Tujuan</td>
......@@ -89,7 +89,7 @@ $this->params['breadcrumbs'][] = $this->title;
<tr>
<td class="kolom">Supir</td>
<td class="kolom">:</td>
<td class="kolom"><?= $model->supir->name_supir ?></td>
<td class="kolom"><?= $model->supir->pegawai->nama ?></td>
</tr>
<tr>
<td class="kolom">No Hp Supir</td>
......
......@@ -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\PemakaianKendaraan */
......@@ -16,8 +17,8 @@ $this->params['breadcrumbs'][] = $this->title;
<p>
<?php
if($model->status_req_sekretaris_rektorat == 1 && $model->status_request_kemahasiswaan == 1 && $model->status_request_hrd == 1 && $model->status_request_kabiro_KSD == 1 && $model->status_request_keuangan == 1 && $model->status_request_wr2 == 1) {
echo Html::a('Ubah', ['edit-by-pribadi', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-primary']);
echo Html::a('Hapus', ['del', 'id' => $model->transaksi_kendaraan_id], [
echo Html::a('Ubah', ['edit-by-pribadi', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-primary']);
echo Html::a('Hapus', ['del', 'id' => $model->pemakaian_kendaraan_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
......@@ -25,7 +26,7 @@ $this->params['breadcrumbs'][] = $this->title;
],
]);
}else if($model->status_req_sekretaris_rektorat == 2 && $model->status_request_kemahasiswaan == 2 && $model->status_request_hrd == 2 && $model->status_request_kabiro_KSD == 2 && $model->status_request_keuangan == 2 && $model->status_request_wr2 == 2) {
echo Html::a('Cetak', ['pribadi-pdf', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-warning']);
echo Html::a('Cetak', ['pribadi-pdf', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-warning']);
}
?>
</p>
......@@ -33,15 +34,18 @@ $this->params['breadcrumbs'][] = $this->title;
<?= DetailView::widget([
'model' => $model,
'attributes' => [
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
[
'attribute' => 'Nama',
'value' => $model->pegawai->nama,
],
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
'no_telepon',
// 'proposal',
// 'deleted',
......@@ -53,12 +57,24 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_by',
// 'kendaraan_id',
[
'attribute' => 'Jenis Mobil',
'value' => $model->kendaraan->kendaraan,
'attribute' => 'Kendaraan',
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
} else {
return '-';
}
},
],
[
'attribute' => 'Supir',
'value' => $model->supir->name_supir,
'attribute' => 'Supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
'no_hp_supir',
[
......
......@@ -43,12 +43,12 @@ $this->params['breadcrumbs'][] = $this->title;
<tr>
<td class="kolom">Nama</td>
<td class="kolom">:</td>
<td class="kolom"><?= $model->nama_perequest_kendaraan ?></td>
<td class="kolom"><?= $model->pegawai->nama ?></td>
</tr>
<tr>
<td class="kolom">Keperluan</td>
<td class="kolom">:</td>
<td class="kolom"><?= $model->desc_penggunaan_kendaraan ?></td>
<td class="kolom"><?= $model->desc ?></td>
</tr>
<tr>
<td class="kolom">Tujuan</td>
......
......@@ -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\PemakaianKendaraan */
......@@ -15,30 +16,33 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<?php
echo Html::a('Terima', ['accept-by-sekretaris-rektorat', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Tolak', ['reject-by-sekretaris-rektorat', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-danger']);
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']);
?>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
'rencana_waktu_kembali',
// 'status_req_sekretaris_rektorat',
// 'status_request_kemahasiswaan',
[
'attribute' => 'status_req_sekretaris_rektorat',
'value' => $model->statusRequestSekretarisRektorat->status,
],
// 'status_request_kemahasiswaan',
[
'attribute' => 'status_request_kemahasiswaan',
'value' => $model->statusRequestKemahasiswaan->status,
],
'no_telepon',
// 'role',
// 'jenis_keperluan_id',
[
'attribute' => 'role',
'attribute' => 'Jenis Permintaan',
'value' => $model->jenisKeperluan->jenis_keperluan,
],
// 'proposal',
......@@ -50,14 +54,36 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_at',
// 'updated_by',
[
'attribute' => 'Jenis Mobil',
'value' => $model->kendaraan->kendaraan,
'attribute' => 'Kendaraan',
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
} else {
return '-';
}
},
],
[
'attribute' => 'Supir',
'value' => $model->supir->name_supir,
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
// 'no_hp_supir',
[
'attribute' => 'no_hp_supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->no_telepon_supir;
}else{
return '-';
}
},
],
'no_hp_supir',
],
]) ?>
......
......@@ -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\PemakaianKendaraan */
......@@ -14,22 +15,25 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<?php
echo Html::a('Ubah', ['accept-by-wr2', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Tolak', ['reject-by-wr2', 'id' => $model->transaksi_kendaraan_id], ['class' => 'btn btn-danger']);
echo Html::a('Setuju', ['accept-by-wr2', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-success']);
echo Html::a('Tolak', ['reject-by-wr2', 'id' => $model->pemakaian_kendaraan_id], ['class' => 'btn btn-danger']);
?>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
// 'transaksi_kendaraan_id',
'nama_perequest_kendaraan',
'desc_penggunaan_kendaraan',
// 'pemakaian_kendaraan_id',
[
'attribute' => 'Nama',
'value' => $model->pegawai->nama,
],
'desc',
'tujuan',
'jumlah_penumpang_kendaraan',
'rencana_waktu_keberangkatan',
'rencana_waktu_kembali',
// 'status_request_kemahasiswaan',
// 'role',
// 'jenis_keperluan_id',
'no_telepon',
// 'proposal',
// 'deleted',
......@@ -42,11 +46,23 @@ $this->params['breadcrumbs'][] = $this->title;
// 'kendaraan_id',
[
'attribute' => 'Kendaraan',
'value' => $model->kendaraan->kendaraan,
'value' => function(Model $model){
if ($model->kendaraan_id != null) {
return $model->kendaraan->kendaraan;
} else {
return '-';
}
},
],
[
'attribute' => 'Supir',
'value' => $model->supir->name_supir,
'attribute' => 'Supir',
'value' => function(Model $model){
if($model->supir_id != null){
return $model->supir->pegawai->nama;
}else{
return '-';
}
},
],
'no_hp_supir',
[
......
......@@ -2,16 +2,15 @@
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
use backend\modules\ubux\models\Pegawai;
use common\widgets\Redactor;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Supir */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="ubux-supir-form">
<div class="supir-form">
<?php $form = ActiveForm::begin([
'layout' => 'horizontal',
......@@ -28,15 +27,12 @@ use common\widgets\Redactor;
<?= $form->field($model, 'pegawai_id')->dropDownList(
ArrayHelper::map(Pegawai::find()->select([
'pegawai_id', 'nama'
'pegawai_id', 'nama',
])->all(), 'pegawai_id', 'nama'),
['prompt' => 'Pilih Pegawai']
) ?>
<!--
<?= $form->field($model, 'name_supir')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'no_telepon_supir')->textInput() ?>
<?= $form->field($model, 'no_telepon_supir')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'deleted')->textInput() ?>
......@@ -54,7 +50,7 @@ use common\widgets\Redactor;
-->
<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']) ?>
<?= Html::submitButton($model->isNewRecord ? 'Buat' : 'Edit', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
</div>
......
......@@ -8,7 +8,7 @@ use yii\widgets\ActiveForm;
/* @var $form yii\widgets\ActiveForm */
?>
<div class="ubux-supir-search">
<div class="supir-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
......@@ -17,7 +17,7 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'supir_id') ?>
<?= $form->field($model, 'name_supir') ?>
<?= $form->field($model, 'pegawai_id') ?>
<?= $form->field($model, 'no_telepon_supir') ?>
......@@ -35,8 +35,6 @@ use yii\widgets\ActiveForm;
<?php // echo $form->field($model, 'updated_by') ?>
<?php // echo $form->field($model, 'pegawai_id') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
......
......@@ -7,10 +7,10 @@ use yii\helpers\Html;
/* @var $model backend\modules\ubux\models\Supir */
$this->title = 'Tambah Supir';
$this->params['breadcrumbs'][] = ['label' => 'Tambah Supir', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => 'Supir', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ubux-supir-create">
<div class="supir-create">
<h1><?= Html::encode($this->title) ?></h1>
......
......@@ -5,12 +5,12 @@ use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Supir */
$this->title = 'Ubah Supir : ' . ' ' . $model->name_supir;
$this->params['breadcrumbs'][] = ['label' => 'Ubah Supir', 'url' => ['index']];
$this->title = 'Ubah Supir : ' . ' ' . $model->pegawai->nama;
$this->params['breadcrumbs'][] = ['label' => 'Supir', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->supir_id, 'url' => ['view', 'id' => $model->supir_id]];
$this->params['breadcrumbs'][] = 'Ubah';
$this->params['breadcrumbs'][] = 'Edit';
?>
<div class="ubux-supir-update">
<div class="supir-update">
<h1><?= Html::encode($this->title) ?></h1>
......
......@@ -3,17 +3,15 @@
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\SupirSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Data Semua Supir';
$this->title = 'Supir';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ubux-supir-index">
<div class="supir-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
......@@ -29,7 +27,11 @@ $this->params['breadcrumbs'][] = $this->title;
['class' => 'yii\grid\SerialColumn'],
// 'supir_id',
'name_supir',
// 'pegawai_id',
[
'attribute' => 'Nama',
'value' => 'pegawai.nama',
],
'no_telepon_supir',
// 'deleted',
// 'deleted_at',
......@@ -39,36 +41,23 @@ $this->params['breadcrumbs'][] = $this->title;
// 'updated_at',
// 'updated_by',
['class' => 'common\components\ToolsColumn',
'template' => '{view} {update} {delete}',// {edit} {cancel}',
'header' => 'Aksi',
'buttons' => [
'view' => function ($url, $model){
return ToolsColumn::renderCustomButton($url, $model, 'Lihat Rincian', 'fa fa-eye');
},
'update' => function ($url, $model){
return ToolsColumn::renderCustomButton($url, $model, 'Ubah', 'fa fa-pencil');
},
'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', 'Apakah anda yakin ingin menghapus ?'),
'data-method' => 'post',
'data-pjax' => '0',
])."</li>";
},
],
'urlCreator' => function ($action, $model, $key, $index){
if ($action === 'view') {
[
'class' => 'common\components\ToolsColumn',
'template' => '{view}{edit}{del}',
'urlCreator' => function($action, $model, $key, $index){
if($action === 'view'){
return Url::toRoute(['view', 'id' => $key]);
}else if ($action === 'edit') {
return Url::toRoute(['update', 'id' => $key]);
}else if ($action === 'del') {
return Url::toRoute(['delete', 'id' => $key]);
}
if($action == 'edit'){
return Url::toRoute(['edit', 'id' => $key]);
}
if($action == 'del'){
return Url::toRoute(['del', 'id' => $key]);
}
else{
return Url::toRoute(['pop-up', 'id' => $key]);
}
}
],
],
]); ?>
......
......@@ -6,11 +6,11 @@ use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\ubux\models\Supir */
$this->title = 'Data Supir';
$this->params['breadcrumbs'][] = ['label' => 'Data Supir', 'url' => ['index']];
$this->title = $model->pegawai->nama;
$this->params['breadcrumbs'][] = ['label' => 'Supir', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ubux-supir-view">
<div class="supir-view">
<h1><?= Html::encode($this->title) ?></h1>
......@@ -19,7 +19,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?= Html::a('Hapus', ['del', 'id' => $model->supir_id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Apakah anda yakin ?',
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
......@@ -29,7 +29,11 @@ $this->params['breadcrumbs'][] = $this->title;
'model' => $model,
'attributes' => [
// 'supir_id',
'name_supir',
// 'pegawai_id',
[
'attribute' => 'Nama',
'value' => $model->pegawai->nama,
],
'no_telepon_supir',
// 'deleted',
// 'deleted_at',
......
......@@ -163,7 +163,7 @@ $this->beginPage();
[
'label' => 'Lihat Permintaan Mahasiswa',
'icon' => 'fa fa-star',
'url' => '/ubux/pemakaian-kendaraan-mahasiswa/index-by-kemahasiswaan',
'url' => '/ubux/pemakaian-kendaraan-mhs/index-by-kemahasiswaan',
],
]
],
......@@ -179,7 +179,7 @@ $this->beginPage();
[
'label' => 'Permintaan Kendaraan Pegawai',
'icon' => 'fa fa-star',
'url' => '/ubux/pemakaian-kendaraan/create-by-pegawai',
'url' => '/ubux/pemakaian-kendaraan/add-by-pegawai',
],
]
],
......@@ -190,12 +190,12 @@ $this->beginPage();
[
'label' => 'Data Permintaan Kendaraan',
'icon' => 'fa fa-star',
'url' => '/ubux/pemakaian-kendaraan-mahasiswa/index',
'url' => '/ubux/pemakaian-kendaraan-mhs/index',
],
[
'label' => 'Permintaan Kendaraan',
'icon' => 'fa fa-star',
'url' => '/ubux/pemakaian-kendaraan-mahasiswa/create',
'url' => '/ubux/pemakaian-kendaraan-mhs/add',
],
]
],
......@@ -211,7 +211,7 @@ $this->beginPage();
[
'label' => 'Permintaan Kendaraan Pribadi',
'icon' => 'fa fa-star',
'url' => '/ubux/pemakaian-kendaraan/create-by-pribadi',
'url' => '/ubux/pemakaian-kendaraan/add-by-pribadi',
],
]
],
......
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