Commit 1584aac4 by Edward Simarmata

rbac yang belum selesai

parent ba3de97c
......@@ -34,6 +34,13 @@ return [
],
],
],
'authManager'=>
[
'class' => 'yii\rbac\DbManager',
'defaultRoles' => ['guest'],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
......
<?php
namespace backend\controllers;
use Yii;
use app\models\Sekolah;
use app\models\SekolahSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* SekolahController implements the CRUD actions for Sekolah model.
*/
class SekolahController extends Controller
{
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all Sekolah models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new SekolahSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Sekolah model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new Sekolah model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new Sekolah();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing Sekolah model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Sekolah model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Sekolah model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Sekolah the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Sekolah::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
......@@ -95,4 +95,9 @@ class SiteController extends Controller
return $this->goHome();
}
public function actionTest()
{
return $this->render('test');
}
}
<?php
namespace backend\controllers;
use Yii;
use app\models\Users;
use app\models\UsersSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\web\ForbiddenHttpException;
/**
* UsersController implements the CRUD actions for Users model.
*/
class UsersController extends Controller
{
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all Users models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new UsersSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Users model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new Users model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
if(Yii::$app->user->can('sekpenTK')){
$model = new Users();
if ($model->load(Yii::$app->request->post()) && $model->save() ) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
else
{
throw new ForbiddenHttpException;
}
}
/**
* Updates an existing Users model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Users model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Users model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Users the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Users::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
public function actionTest(){
return $this->redirect(['index']);
}
}
<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "sekolah".
*
* @property integer $id
* @property string $nama_sekolah
* @property string $alamat_sekolah
* @property string $foto_sekolah
* @property string $visi
* @property string $misi
* @property string $created_at
* @property string $updated_at
* @property string $deleted_at
* @property integer $deleted
* @property string $created_by
* @property string $updated_by
* @property string $deleted_by
*/
class Sekolah extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'sekolah';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['nama_sekolah', 'alamat_sekolah', 'foto_sekolah', 'visi', 'misi', 'created_at', 'updated_at', 'deleted_at', 'deleted', 'created_by', 'updated_by', 'deleted_by'], 'required'],
[['created_at', 'updated_at', 'deleted_at'], 'safe'],
[['deleted'], 'integer'],
[['nama_sekolah', 'alamat_sekolah', 'foto_sekolah', 'visi', 'misi'], 'string', 'max' => 100],
[['created_by', 'updated_by', 'deleted_by'], 'string', 'max' => 32],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'nama_sekolah' => 'Nama Sekolah',
'alamat_sekolah' => 'Alamat Sekolah',
'foto_sekolah' => 'Foto Sekolah',
'visi' => 'Visi',
'misi' => 'Misi',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
'deleted_at' => 'Deleted At',
'deleted' => 'Deleted',
'created_by' => 'Created By',
'updated_by' => 'Updated By',
'deleted_by' => 'Deleted By',
];
}
}
<?php
namespace app\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\Sekolah;
/**
* SekolahSearch represents the model behind the search form about `app\models\Sekolah`.
*/
class SekolahSearch extends Sekolah
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id', 'deleted'], 'integer'],
[['nama_sekolah', 'alamat_sekolah', 'foto_sekolah', 'visi', 'misi', 'created_at', 'updated_at', 'deleted_at', 'created_by', 'updated_by', 'deleted_by'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Sekolah::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'deleted_at' => $this->deleted_at,
'deleted' => $this->deleted,
]);
$query->andFilterWhere(['like', 'nama_sekolah', $this->nama_sekolah])
->andFilterWhere(['like', 'alamat_sekolah', $this->alamat_sekolah])
->andFilterWhere(['like', 'foto_sekolah', $this->foto_sekolah])
->andFilterWhere(['like', 'visi', $this->visi])
->andFilterWhere(['like', 'misi', $this->misi])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by]);
return $dataProvider;
}
}
<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "user".
*
* @property integer $id
* @property string $username
* @property string $password
* @property string $email
* @property string $auth_key
* @property string $password_hash
* @property string $password_reset_token
* @property integer $status
* @property string $created_at
* @property string $updated_at
* @property string $deleted_at
* @property integer $deleted
* @property string $created_by
* @property string $updated_by
* @property string $deleted_by
*/
class Users extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'user';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['username', 'password', 'email'], 'required'],
[['status', 'deleted'], 'integer'],
[['created_at', 'updated_at', 'deleted_at'], 'safe'],
[['username', 'password', 'email'], 'string', 'max' => 100],
[['auth_key', 'created_by', 'updated_by', 'deleted_by'], 'string', 'max' => 32],
[['password_hash', 'password_reset_token'], 'string', 'max' => 255],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'username' => 'Username',
'password' => 'Password',
'email' => 'Email',
'auth_key' => 'Auth Key',
'password_hash' => 'Password Hash',
'password_reset_token' => 'Password Reset Token',
'status' => 'Status',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
'deleted_at' => 'Deleted At',
'deleted' => 'Deleted',
'created_by' => 'Created By',
'updated_by' => 'Updated By',
'deleted_by' => 'Deleted By',
];
}
}
<?php
namespace app\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\Users;
/**
* UsersSearch represents the model behind the search form about `app\models\Users`.
*/
class UsersSearch extends Users
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id', 'status', 'deleted'], 'integer'],
[['username', 'password', 'email', 'auth_key', 'password_hash', 'password_reset_token', 'created_at', 'updated_at', 'deleted_at', 'created_by', 'updated_by', 'deleted_by'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Users::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'status' => $this->status,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'deleted_at' => $this->deleted_at,
'deleted' => $this->deleted,
]);
$query->andFilterWhere(['like', 'username', $this->username])
->andFilterWhere(['like', 'password', $this->password])
->andFilterWhere(['like', 'email', $this->email])
->andFilterWhere(['like', 'auth_key', $this->auth_key])
->andFilterWhere(['like', 'password_hash', $this->password_hash])
->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])
->andFilterWhere(['like', 'created_by', $this->created_by])
->andFilterWhere(['like', 'updated_by', $this->updated_by])
->andFilterWhere(['like', 'deleted_by', $this->deleted_by]);
return $dataProvider;
}
}
......@@ -36,7 +36,11 @@ AppAsset::register($this);
]);
$menuItems = [
['label' => 'Home', 'url' => ['/site/index']],
['label' => 'User', 'url' => ['/users/index']],
['label' => 'Sekolah', 'url' => ['/sekolah/index']]
];
if (Yii::$app->user->isGuest) {
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
} else {
......
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\Sekolah */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="sekolah-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'nama_sekolah')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'alamat_sekolah')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'foto_sekolah')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'visi')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'misi')->textInput(['maxlength' => true]) ?>
<!-- <?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<?= $form->field($model, 'deleted_at')->textInput() ?>
<?= $form->field($model, 'deleted')->textInput() ?>
<?= $form->field($model, 'created_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'deleted_by')->textInput(['maxlength' => true]) ?> -->
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\SekolahSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="sekolah-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id') ?>
<?= $form->field($model, 'nama_sekolah') ?>
<?= $form->field($model, 'alamat_sekolah') ?>
<?= $form->field($model, 'foto_sekolah') ?>
<?= $form->field($model, 'visi') ?>
<?php // echo $form->field($model, 'misi') ?>
<?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<?php // echo $form->field($model, 'deleted_at') ?>
<?php // echo $form->field($model, 'deleted') ?>
<?php // echo $form->field($model, 'created_by') ?>
<?php // echo $form->field($model, 'updated_by') ?>
<?php // echo $form->field($model, 'deleted_by') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model app\models\Sekolah */
$this->title = 'Create Sekolah';
$this->params['breadcrumbs'][] = ['label' => 'Sekolahs', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="sekolah-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel app\models\SekolahSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Sekolahs';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="sekolah-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a('Create Sekolah', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'nama_sekolah',
'alamat_sekolah',
'foto_sekolah',
'visi',
// 'misi',
// 'created_at',
// 'updated_at',
// 'deleted_at',
// 'deleted',
// 'created_by',
// 'updated_by',
// 'deleted_by',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model app\models\Sekolah */
$this->title = 'Update Sekolah: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Sekolahs', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="sekolah-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\Sekolah */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Sekolahs', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="sekolah-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'nama_sekolah',
'alamat_sekolah',
'foto_sekolah',
'visi',
'misi',
'created_at',
'updated_at',
'deleted_at',
'deleted',
'created_by',
'updated_by',
'deleted_by',
],
]) ?>
</div>
<html>
<h1> Hello World </h1>
</html>
\ No newline at end of file
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\Users */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="users-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'username')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'password')->passwordInput(['maxlength' => true]) ?>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
<!-- <?= $form->field($model, 'auth_key')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'password_hash')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'password_reset_token')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'status')->textInput() ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<?= $form->field($model, 'deleted_at')->textInput() ?>
<?= $form->field($model, 'deleted')->textInput() ?>
<?= $form->field($model, 'created_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'updated_by')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'deleted_by')->textInput(['maxlength' => true]) ?> -->
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\UsersSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="users-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id') ?>
<?= $form->field($model, 'username') ?>
<?= $form->field($model, 'password') ?>
<?= $form->field($model, 'email') ?>
<?= $form->field($model, 'auth_key') ?>
<?php // echo $form->field($model, 'password_hash') ?>
<?php // echo $form->field($model, 'password_reset_token') ?>
<?php // echo $form->field($model, 'status') ?>
<?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<?php // echo $form->field($model, 'deleted_at') ?>
<?php // echo $form->field($model, 'deleted') ?>
<?php // echo $form->field($model, 'created_by') ?>
<?php // echo $form->field($model, 'updated_by') ?>
<?php // echo $form->field($model, 'deleted_by') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model app\models\Users */
$this->title = 'Create Users';
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="users-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel app\models\UsersSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Users';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="users-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a('Create Users', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'username',
'password',
'email:email',
'auth_key',
// 'password_hash',
// 'password_reset_token',
// 'status',
// 'created_at',
// 'updated_at',
// 'deleted_at',
// 'deleted',
// 'created_by',
// 'updated_by',
// 'deleted_by',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model app\models\Users */
$this->title = 'Update Users: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="users-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\Users */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="users-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'username',
'password',
'email:email',
// 'auth_key',
// 'password_hash',
// 'password_reset_token',
// 'status',
'created_at',
'updated_at',
// 'deleted_at',
// 'deleted',
// 'created_by',
// 'updated_by',
// 'deleted_by',
],
]) ?>
</div>
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 10, 2018 at 03:22 AM
-- Server version: 5.6.26
-- PHP Version: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `sadispen`
--
-- --------------------------------------------------------
--
-- Table structure for table `alumni`
--
CREATE TABLE IF NOT EXISTS `alumni` (
`id` int(100) NOT NULL,
`tahun_lulus` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `auth_assignment`
--
CREATE TABLE IF NOT EXISTS `auth_assignment` (
`item_name` varchar(64) NOT NULL,
`user_id` varchar(64) NOT NULL,
`created_at` int(11) DEFAULT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `auth_item`
--
CREATE TABLE IF NOT EXISTS `auth_item` (
`name` varchar(64) NOT NULL,
`type` int(11) NOT NULL,
`description` text,
`rule_name` varchar(64) DEFAULT NULL,
`data` text,
`created_at` int(11) DEFAULT NULL,
`updated_at` int(11) DEFAULT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `auth_item_child`
--
CREATE TABLE IF NOT EXISTS `auth_item_child` (
`parent` varchar(64) NOT NULL,
`child` varchar(64) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `auth_rule`
--
CREATE TABLE IF NOT EXISTS `auth_rule` (
`name` varchar(64) NOT NULL,
`data` text,
`created_at` int(11) DEFAULT NULL,
`updated_at` int(11) DEFAULT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `ekstrakulikuler`
--
CREATE TABLE IF NOT EXISTS `ekstrakulikuler` (
`id` int(100) NOT NULL,
`jenis_ekstrakulikuler` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `jenjang`
--
CREATE TABLE IF NOT EXISTS `jenjang` (
`id` int(100) NOT NULL,
`jenis_jenjang` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `kedinasan`
--
CREATE TABLE IF NOT EXISTS `kedinasan` (
`id` int(100) NOT NULL,
`nip` varchar(100) NOT NULL,
`nama` varchar(100) NOT NULL,
`jabatan` varchar(100) NOT NULL,
`alamat` varchar(100) NOT NULL,
`tanggal_lahir` varchar(100) NOT NULL,
`tempat_lahir` varchar(100) NOT NULL,
`pendidikan` varchar(100) NOT NULL,
`foto` varchar(100) NOT NULL,
`golongan` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `kelas`
--
CREATE TABLE IF NOT EXISTS `kelas` (
`id` int(100) NOT NULL,
`nama` varchar(100) NOT NULL,
`total_siswa` varchar(100) NOT NULL,
`tahun_ajaran` varchar(100) NOT NULL,
`jurusan` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `mapel`
--
CREATE TABLE IF NOT EXISTS `mapel` (
`id` int(100) NOT NULL,
`mapel` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `master_pegawai`
--
CREATE TABLE IF NOT EXISTS `master_pegawai` (
`id` int(100) NOT NULL,
`jabatan` varchar(100) NOT NULL,
`nip` varchar(100) NOT NULL,
`nama` varchar(100) NOT NULL,
`alamat` varchar(100) NOT NULL,
`tanggal_lahir` varchar(100) NOT NULL,
`tempat_lahir` varchar(100) NOT NULL,
`pendidikan` varchar(100) NOT NULL,
`foto` varchar(100) NOT NULL,
`golongan` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `nilai`
--
CREATE TABLE IF NOT EXISTS `nilai` (
`id` int(100) NOT NULL,
`nilai` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pendaftar`
--
CREATE TABLE IF NOT EXISTS `pendaftar` (
`id` int(100) NOT NULL,
`nama` varchar(100) NOT NULL,
`asal_sekolah` varchar(100) NOT NULL,
`foto_skhun` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `sekolah`
--
CREATE TABLE IF NOT EXISTS `sekolah` (
`id` int(100) NOT NULL,
`nama_sekolah` varchar(100) NOT NULL,
`alamat_sekolah` varchar(100) NOT NULL,
`foto_sekolah` varchar(100) NOT NULL,
`visi` varchar(100) NOT NULL,
`misi` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `siswa`
--
CREATE TABLE IF NOT EXISTS `siswa` (
`id` int(100) NOT NULL,
`nama` varchar(100) NOT NULL,
`nis` varchar(100) NOT NULL,
`nisn` varchar(100) NOT NULL,
`alamat` varchar(100) NOT NULL,
`foto` varchar(100) NOT NULL,
`nama_ayah` varchar(100) NOT NULL,
`nama_ibu` varchar(100) NOT NULL,
`pekerjaan_ayah` varchar(100) NOT NULL,
`pekerjaan_ibu` varchar(100) NOT NULL,
`penghasilan_ortu` varchar(100) NOT NULL,
`nama_wali` varchar(100) NOT NULL,
`pekerjaan_wali` varchar(100) NOT NULL,
`penghasilan_wali` varchar(100) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `tatausaha`
--
CREATE TABLE IF NOT EXISTS `tatausaha` (
`id` int(100) NOT NULL,
`nama` varchar(100) NOT NULL,
`nip` varchar(100) DEFAULT NULL,
`alamat` varchar(100) NOT NULL,
`tanggal_lahir` varchar(100) NOT NULL,
`tempat_lahir` varchar(100) NOT NULL,
`foto` varchar(100) NOT NULL,
`golongan` varchar(100) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(100) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`auth_key` varchar(32) NOT NULL,
`password_hash` varchar(255) NOT NULL,
`password_reset_token` varchar(255) NOT NULL,
`status` smallint(6) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL,
`deleted` tinyint(1) NOT NULL,
`created_by` varchar(32) NOT NULL,
`updated_by` varchar(32) NOT NULL,
`deleted_by` varchar(32) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `username`, `password`, `email`, `auth_key`, `password_hash`, `password_reset_token`, `status`, `created_at`, `updated_at`, `deleted_at`, `deleted`, `created_by`, `updated_by`, `deleted_by`) VALUES
(1, 'admin', '', 'edwardsaragih97@gmail.com', 'OfN9vrjcJVnZBpsOC3mpKmqy-k-Mxm3g', '$2y$13$FY5v0G5UzurTf8wpqdHUWOsQsAytiLWV.OE0xY/oUtGPlQ2z9vQqi', '', 10, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, '', '', '');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `alumni`
--
ALTER TABLE `alumni`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `auth_assignment`
--
ALTER TABLE `auth_assignment`
ADD PRIMARY KEY (`item_name`,`user_id`);
--
-- Indexes for table `auth_item`
--
ALTER TABLE `auth_item`
ADD PRIMARY KEY (`name`),
ADD KEY `rule_name` (`rule_name`),
ADD KEY `type` (`type`);
--
-- Indexes for table `auth_item_child`
--
ALTER TABLE `auth_item_child`
ADD PRIMARY KEY (`parent`,`child`),
ADD KEY `child` (`child`);
--
-- Indexes for table `auth_rule`
--
ALTER TABLE `auth_rule`
ADD PRIMARY KEY (`name`);
--
-- Indexes for table `ekstrakulikuler`
--
ALTER TABLE `ekstrakulikuler`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `jenjang`
--
ALTER TABLE `jenjang`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `kedinasan`
--
ALTER TABLE `kedinasan`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `kelas`
--
ALTER TABLE `kelas`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mapel`
--
ALTER TABLE `mapel`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `master_pegawai`
--
ALTER TABLE `master_pegawai`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `nilai`
--
ALTER TABLE `nilai`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pendaftar`
--
ALTER TABLE `pendaftar`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `sekolah`
--
ALTER TABLE `sekolah`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `siswa`
--
ALTER TABLE `siswa`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tatausaha`
--
ALTER TABLE `tatausaha`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `alumni`
--
ALTER TABLE `alumni`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `ekstrakulikuler`
--
ALTER TABLE `ekstrakulikuler`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `jenjang`
--
ALTER TABLE `jenjang`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `kedinasan`
--
ALTER TABLE `kedinasan`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `kelas`
--
ALTER TABLE `kelas`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `mapel`
--
ALTER TABLE `mapel`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `master_pegawai`
--
ALTER TABLE `master_pegawai`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `nilai`
--
ALTER TABLE `nilai`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pendaftar`
--
ALTER TABLE `pendaftar`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `sekolah`
--
ALTER TABLE `sekolah`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `siswa`
--
ALTER TABLE `siswa`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tatausaha`
--
ALTER TABLE `tatausaha`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(100) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `auth_assignment`
--
ALTER TABLE `auth_assignment`
ADD CONSTRAINT `auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `auth_item`
--
ALTER TABLE `auth_item`
ADD CONSTRAINT `auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE;
--
-- Constraints for table `auth_item_child`
--
ALTER TABLE `auth_item_child`
ADD CONSTRAINT `auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
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