Esempio n. 1
0
<?php

$params = (require __DIR__ . '/params.php');
$config = ['name' => 'KERJA', 'id' => 'basic', 'basePath' => dirname(__DIR__), 'defaultRoute' => 'kerja/kerja', 'controllerMap' => ['elfinder' => ['class' => 'mihaildev\\elfinder\\Controller', 'access' => ['@'], 'disabledCommands' => ['netmount'], 'roots' => [['baseUrl' => '@web', 'basePath' => '@webroot', 'path' => 'uploads/content', 'name' => 'Home']]]], 'components' => ['devicedetect' => ['class' => '\\alexandernst\\devicedetect\\DeviceDetect'], 'urlManager' => ['class' => 'yii\\web\\UrlManager', 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [['class' => 'yii\\rest\\UrlRule', 'controller' => ['service/dokter', 'service/chat']]]], 'assetManager' => ['bundles' => ['dmstr\\web\\AdminLteAsset' => ['skin' => 'skin-purple']]], 'mailer' => ['class' => 'yii\\swiftmailer\\Mailer', 'useFileTransport' => true, 'messageConfig' => ['from' => [$params['adminEmail'] => 'PT SIMA'], 'charset' => 'UTF-8']], 'authClientCollection' => ['class' => yii\authclient\Collection::className(), 'clients' => []], 'request' => ['cookieValidationKey' => 'neo'], 'errorHandler' => ['errorAction' => 'site/error'], 'log' => ['traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [['class' => 'yii\\log\\FileTarget', 'levels' => ['error', 'warning']]]], 'db' => require __DIR__ . '/db.php', 'authManager' => ['class' => 'yii\\rbac\\DbManager'], 'view' => ['theme' => ['pathMap' => ['@dektrium/user/views' => '@app/views/user']]]], 'modules' => ['dynagrid' => ['class' => '\\kartik\\dynagrid\\Module', 'defaultPageSize' => 30, 'dynaGridOptions' => ['theme' => 'panel-default', 'toggleButtonGrid' => ['label' => '<i class="fa fa-gear"></i> <span class=" hidden-xs">Custom Tabel</span>'], 'toggleButtonFilter' => ['label' => '<i class="fa fa-filter"></i> <span class=" hidden-xs">Filter</span>'], 'toggleButtonSort' => ['label' => '<i class="fa fa-sort"></i> <span class=" hidden-xs">Urutan</span>'], 'gridOptions' => ['floatHeader' => false, 'pjax' => true, 'hover' => true, 'responsive' => true, 'responsiveWrap' => false, 'resizableColumns' => true, 'striped' => false, 'export' => ['label' => '<span class=" hidden-xs">Export</span>'], 'toggleDataOptions' => ['all' => ['icon' => 'resize-full', 'label' => Yii::t('app', '<span class=" hidden-xs"> Tampilkan Semua </span>'), 'class' => 'btn btn-default', 'title' => 'Tampilkan Semua'], 'page' => ['icon' => 'resize-small', 'label' => Yii::t('app', '<span class=" hidden-xs">  Tampilkan Perhalaman </span>'), 'class' => 'btn btn-default', 'title' => 'Tampilkan Perhalaman']], 'panel' => ['heading' => '<b>Kelola Data</b>', 'before' => '{dynagrid} {dynagridFilter} {dynagridSort}'], 'rowOptions' => function ($model, $key, $index, $gird) {
    $contextMenuId = $gird->columns[0]->contextMenuId;
    return ['data' => ['toggle' => 'context', 'target' => "#" . $contextMenuId]];
}], 'storage' => \kartik\dynagrid\DynaGrid::TYPE_DB, 'columns' => [['class' => \liyunfang\contextmenu\KartikSerialColumn::className(), 'order' => \kartik\dynagrid\DynaGrid::ORDER_FIX_LEFT, 'contextMenu' => true, 'contentOptions' => ['class' => 'kartik-sheet-style'], 'headerOptions' => ['class' => 'kartik-sheet-style']]]]], 'gridview' => ['class' => '\\kartik\\grid\\Module'], 'datecontrol' => ['class' => 'kartik\\datecontrol\\Module', 'displaySettings' => ['date' => 'd-m-Y', 'time' => 'H:i:s A', 'datetime' => 'd-m-Y H:i:s A'], 'saveSettings' => ['date' => 'Y-m-d', 'time' => 'H:i:s', 'datetime' => 'Y-m-d H:i:s'], 'autoWidget' => true], 'rbac' => ['class' => 'dektrium\\rbac\\Module'], 'user' => ['class' => 'dektrium\\user\\Module', 'enableUnconfirmedLogin' => false, 'enableConfirmation' => false, 'enableRegistration' => false, 'enablePasswordRecovery' => false, 'confirmWithin' => 21600, 'cost' => 12, 'admins' => ['aldi'], 'mailer' => ['sender' => '*****@*****.**', 'welcomeSubject' => 'Welcome subject', 'confirmationSubject' => 'Confirmation subject', 'reconfirmationSubject' => 'Email change subject', 'recoverySubject' => 'Recovery subject'], 'controllerMap' => ['login' => ['class' => 'dektrium\\user\\controllers\\LoginController', 'layout' => '@app/views/layouts/main-login'], 'registration' => ['class' => 'dektrium\\user\\controllers\\RegistrationController', 'layout' => '@app/views/layouts/main-login']]], 'dynamicrelations' => ['class' => '\\synatree\\dynamicrelations\\Module'], 'kerja' => ['class' => 'app\\modules\\kerja\\Module']], 'params' => $params];
if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yii\\debug\\Module';
    // GII KRAJEE
    $config['modules']['gii']['class'] = 'yii\\gii\\Module';
    $config['modules']['gii']['generators'] = ['kartikgii-crud' => ['class' => 'warrence\\kartikgii\\crud\\Generator'], 'crud' => ['class' => 'yii\\gii\\generators\\crud\\Generator', 'templates' => ['mycrud' => '@app/templates/crud']], 'mongoDbModel' => ['class' => 'yii\\mongodb\\gii\\model\\Generator']];
    ## MONGODB GII
    // $config['bootstrap'][] = 'gii';
    // $config['modules']['gii'] =  ['class' => 'yii\gii\Module',
    //                                 'generators' => [
    //                                     'mongoDbModel' => [
    //                                         'class' => 'yii\mongodb\gii\model\Generator'
    //                                      ],
    //                                      'crud'   => [
    //                                         'class'     => 'yii\gii\generators\crud\Generator',
    //                                         'templates' => ['mycrud' => '@app/templates/crud']
    //                                     ]
    //                                 ],
    //                             ];
}
return $config;
Esempio n. 2
0
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="log-index">
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
/* echo Html::a('Create Log', ['create'], ['class' => 'btn btn-success'])*/
?>
    </p>

    <?php 
Pjax::begin();
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'resizableColumns' => true, 'resizeStorageKey' => Yii::$app->user->id . '-' . date("m"), 'columns' => [['class' => \liyunfang\contextmenu\KartikSerialColumn::className(), 'contextMenu' => true, 'contentOptions' => ['class' => 'kartik-sheet-style'], 'headerOptions' => ['class' => 'kartik-sheet-style'], 'urlCreator' => function ($action, $model, $key, $index) {
    if ('update' == $action) {
        return Yii::$app->getUrlManager()->createUrl(['/log/update', 'id' => $model->id]);
    }
    if ('view' == $action) {
        return Yii::$app->getUrlManager()->createUrl(['/log/view', 'id' => $model->id]);
    }
    return '#';
}], ['class' => '\\kartik\\grid\\CheckboxColumn', 'headerOptions' => ['class' => 'text-info text-center'], 'contentOptions' => ['class' => 'text-center', 'width' => '5%'], 'checkboxOptions' => function ($model, $key, $index, $column) {
    return ['value' => $model->id];
}], ['attribute' => 'user_name', 'contentOptions' => ['width' => '15%'], 'filter' => \kartik\widgets\Select2::widget(['model' => $searchModel, 'attribute' => 'user_name', 'data' => \yii\helpers\ArrayHelper::map(\dektrium\user\models\User::find()->all(), 'email', 'email'), 'pluginOptions' => ['allowClear' => true], 'options' => ['prompt' => '---请选择需要筛选的用户---']])], ['attribute' => 'user_ip', 'contentOptions' => ['width' => '10%']], ['attribute' => 'controller', 'contentOptions' => ['width' => '10%']], ['attribute' => 'action', 'contentOptions' => ['width' => '10%']], ['attribute' => 'result', 'contentOptions' => ['width' => '20%'], 'content' => function ($model, $key, $index, $column) {
    $result = \yii\helpers\Json::decode($model->result);
    //$classname = ucfirst($model->controller);
    $classname = $model->model;
    $dirtyAttributes = $result['dirtyAttrs'];
    $contents = '';