/** * Lists all Sot2 models. * @return mixed */ public function actionIndex() { if (Helper::checkRoute('index')) { /** * PLSQL ! Array Data Provider * @author ptrnov [piter@lukison.com] * @since 2.1 */ $plsql_so_1 = new ArrayDataProvider(['key' => 'ID', 'allModels' => $this->getScripts(), 'pagination' => ['pageSize' => 20]]); /** * PLSQL ! Column Label * @author ptrnov [piter@lukison.com] * @since 2.1 */ $attributeField = $plsql_so_1->allModels[0]; //get label Array 0 //print_r($attributeField); $searchModel = new Sot2Search(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'dataProviderX' => $plsql_so_1, 'attributeField' => $attributeField]); } else { Yii::$app->user->logout(); $this->redirect(array('/site/login')); // } }
/** * @inheritdoc */ public function beforeAction($action) { $actionId = $action->getUniqueId(); $user = $this->getUser(); if (Helper::checkRoute('/' . $actionId, Yii::$app->getRequest()->get(), $user)) { return true; } $this->denyAccess($user); }
/** * Assign or remove items * @param array $routes * @return array */ public function remove($routes) { $manager = Yii::$app->getAuthManager(); foreach ($routes as $route) { try { $item = $manager->createPermission('/' . trim($route, '/')); $manager->remove($item); } catch (Exception $exc) { Yii::error($exc->getMessage(), __METHOD__); } } Helper::invalidate(); }
public function actionIndex() { if (Helper::checkRoute('index')) { $searchModel = new ProvinceSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); if (Yii::$app->request->post('hasEditable')) { $ID = \Yii::$app->request->post('editableKey'); $model = Customers::findOne($ID); $out = Json::encode(['output' => '', 'message' => '']); // fetch the first entry in posted data (there should // only be one entry anyway in this array for an // editable submission) // - $posted is the posted data for Book without any indexes // - $post is the converted array for single model validation $post = []; $posted = current($_POST['Customers']); $post['Customers'] = $posted; // load model like any single model validation if ($model->load($post)) { // can save model or do something before saving model $model->save(); // custom output to return to be displayed as the editable grid cell // data. Normally this is empty - whereby whatever value is edited by // in the input by user is updated automatically. $output = ''; // specific use case where you need to validate a specific // editable column posted when you have more than one // EditableColumn in the grid view. We evaluate here a // check to see if buy_amount was posted for the Book model if (isset($posted['CUST_KD_ALIAS'])) { // $output = Yii::$app->formatter->asDecimal($model->EMP_NM, 2); $output = $model->CUST_KD_ALIAS; } // similarly you can check if the name attribute was posted as well // if (isset($posted['name'])) { // $output = ''; // process as you need // } $out = Json::encode(['output' => $output, 'message' => '']); // return ajax json encoded response and exit echo $out; return; } } return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); } else { Yii::$app->user->logout(); $this->redirect(array('/site/login')); // } }
/** * Revokes a roles from a user. * @param array $items * @return integer number of successful revoke */ public function revoke($items) { $manager = Yii::$app->getAuthManager(); $success = 0; foreach ($items as $name) { try { $item = $manager->getRole($name); $item = $item ?: $manager->getPermission($name); $manager->revoke($item, $this->id); $success++; } catch (\Exception $exc) { Yii::error($exc->getMessage(), __METHOD__); } } Helper::invalidate(); return $success; }
/** * Lists all Schedulegroup models. * @return mixed */ public function actionIndex() { if (Helper::checkRoute('index')) { $searchModel = new SchedulegroupSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $searchModelCustGrp = new CustomersSearch(); $dpListCustGrp = $searchModelCustGrp->searchCustGrp(Yii::$app->request->queryParams); $aryStt = [['STATUS' => 0, 'STT_NM' => 'DISABLE'], ['STATUS' => 1, 'STT_NM' => 'ENABLE']]; $valStt = ArrayHelper::map($aryStt, 'STATUS', 'STT_NM'); //query for select2 in schedule-group = index $query = Yii::$app->db_esm->createCommand("SELECT * FROM `c0007` c7 WHERE NOT EXISTS (SELECT SCDL_GROUP FROM `c0001` `c1` WHERE c1.SCDL_GROUP = c7.ID)")->queryAll(); $data = ArrayHelper::map($query, 'ID', 'SCDL_GROUP_NM'); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'dpListCustGrp' => $dpListCustGrp, 'data' => $data, 'valStt' => $valStt]); } else { Yii::$app->user->logout(); $this->redirect(array('/site/login')); // } }
<?php use yii\helpers\Html; use yii\grid\GridView; use mdm\admin\components\Helper; /* @var $this yii\web\View */ /* @var $searchModel mdm\admin\models\searchs\User */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('rbac-admin', 'Users'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="user-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'username', 'email:email', 'created_at:date', ['attribute' => 'status', 'value' => function ($model) { return $model->status == 0 ? 'Inactive' : 'Active'; }, 'filter' => [0 => 'Inactive', 10 => 'Active']], ['class' => 'yii\\grid\\ActionColumn', 'template' => Helper::filterActionColumn(['view', 'activate', 'delete']), 'buttons' => ['activate' => function ($url, $model) { if ($model->status == 10) { return ''; } $options = ['title' => Yii::t('rbac-admin', 'Activate'), 'aria-label' => Yii::t('rbac-admin', 'Activate'), 'data-confirm' => Yii::t('rbac-admin', 'Are you sure you want to activate this user?'), 'data-method' => 'post', 'data-pjax' => '0']; return Html::a('<span class="glyphicon glyphicon-ok"></span>', $url, $options); }]]]]); ?> </div>
$this->title = $model->username; $this->params['breadcrumbs'][] = ['label' => Yii::t('rbac-admin', 'Users'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; $controllerId = $this->context->uniqueId . '/'; ?> <div class="user-view"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php if ($model->status == 0 && Helper::checkRoute($controllerId . 'activate')) { echo Html::a(Yii::t('rbac-admin', 'Activate'), ['activate', 'id' => $model->id], ['class' => 'btn btn-primary', 'data' => ['confirm' => Yii::t('rbac-admin', 'Are you sure you want to activate this user?'), 'method' => 'post']]); } ?> <?php if (Helper::checkRoute($controllerId . 'delete')) { echo Html::a(Yii::t('rbac-admin', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'method' => 'post']]); } ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['username', 'email:email', 'created_at:date', 'status']]); ?> </div>
return '<li>' . Html::a('<span class="fa fa-edit fa-dm"></span>' . Yii::t('app', 'Update'), ['/salesman/schedule-group-crm/update', 'id' => $model->ID], ['data-toggle' => "modal", 'data-target' => "#modal-create", 'data-title' => '']) . '</li>' . PHP_EOL; }], 'headerOptions' => ['style' => ['text-align' => 'center', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]]], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'gv-custgrp-id']], 'panel' => ['heading' => '<h3 class="panel-title">GROUPING CUSTOMER LOCALTIONS</h3>', 'type' => 'warning', 'before' => $button_add_group, 'showFooter' => false], 'toolbar' => [], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => false]); /* * GRIDVIEW CUSTOMER LIST * @author ptrnov <*****@*****.**> * @since 1.1 */ $gvCustGroupList = GridView::widget(['id' => 'gv-custgrp-list', 'dataProvider' => $dpListCustGrp, 'filterModel' => $searchModel, 'filterRowOptions' => ['style' => 'background-color:rgba(97, 211, 96, 0.3); align:center'], 'columns' => [['class' => 'kartik\\grid\\SerialColumn', 'width' => '10px', 'header' => 'No.', 'hAlign' => 'center', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['border-right' => '0px']]], ['attribute' => 'custgrp.SCDL_GROUP_NM', 'label' => 'Customer Groups', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '200px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '200px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']], 'group' => true], ['attribute' => 'CUST_NM', 'label' => 'Nama Customers', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '200px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '200px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'STATUS', 'filter' => $valStt, 'format' => 'raw', 'hAlign' => 'center', 'value' => function ($model) { if ($model->STATUS == 1) { return Html::a('<i class="fa fa-check"></i> Enable', '', ['class' => 'btn btn-success btn-xs', 'title' => 'Aktif']); } else { if ($model->STATUS == 0) { return Html::a('<i class="fa fa-close"></i> Disable', '', ['class' => 'btn btn-danger btn-xs', 'title' => 'Deactive']); } } }, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => true, 'template' => Helper::filterActionColumn('{view-group}{update-group}'), 'dropdownOptions' => ['class' => 'pull-right dropup'], 'dropdownButton' => ['class' => 'btn btn-default btn-xs'], 'buttons' => ['view-group' => function ($url, $model, $key) { return '<li>' . Html::a('<span class="fa fa-eye fa-dm"></span>' . Yii::t('app', 'View'), ['/salesman/schedule-group-crm/view-group', 'id' => $model->CUST_KD], ['data-toggle' => "modal", 'data-target' => "#modal-view", 'data-title' => '']) . '</li>' . PHP_EOL; }, 'update-group' => function ($url, $model, $key) { return '<li>' . Html::a('<span class="fa fa-edit fa-dm"></span>' . Yii::t('app', 'Update'), ['/salesman/schedule-group-crm/update-group', 'id' => $model->CUST_KD], ['data-toggle' => "modal", 'data-target' => "#modalmap", 'data-title' => '']) . '</li>' . PHP_EOL; }], 'headerOptions' => ['style' => ['text-align' => 'center', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]]], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'gv-custgrp-list']], 'panel' => ['heading' => '<h3 class="panel-title">LIST CUSTOMER GROUP</h3>', 'type' => 'warning', 'before' => $button_create, 'showFooter' => false], 'toolbar' => [], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => false]); ?> <div class="container-fluid" style="font-family: verdana, arial, sans-serif ;font-size: 8pt;"> <div class="row"> <!-- CUSTOMER MAP !--> <div class="col-md-12"> <?php $map = '<div id ="map" style="width:100%;height:400px"></div>'; echo $map; ?> </div>
use yii\helpers\Html; use yii\grid\GridView; use mdm\admin\components\Helper; /* @var $this yii\web\View */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Temas'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="tema-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <!--HELPER YII2-ADMIN--> <?php if (Helper::checkRoute('create')) { echo Html::a(Yii::t('app', 'Nuevo Tema'), ['create'], ['class' => 'btn btn-success']); } ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'nombre', ['class' => 'yii\\grid\\ActionColumn', 'template' => Helper::filterActionColumn('{view}{delete}{update}')]]]); ?> </div>
/** * Deletes an existing AuthItem model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param string $id * @return mixed */ public function actionDelete($id) { $model = $this->findModel($id); Yii::$app->getAuthManager()->remove($model->item); Helper::invalidate(); return $this->redirect(['index']); }
} else { $button_create = ""; } ?> <div class="row"> <div class="col-sm-12"> <?php $kategori = \kartik\grid\GridView::widget(['id' => 'gv-kat-crm', 'dataProvider' => $dataProviderkat, 'filterModel' => $searchModel1, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'CUST_KTG_PARENT', 'width' => '310px', 'value' => function ($model, $key, $index, $widget) { $kategori = Kategoricus::find()->where(['CUST_KTG' => $model->CUST_KTG_PARENT])->one(); return $kategori->CUST_KTG_NM; }, 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(Kategoricus::find()->where('CUST_KTG_PARENT = CUST_KTG')->asArray()->all(), 'CUST_KTG', 'CUST_KTG_NM'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Customers Group'], 'group' => true], ['attribute' => 'CUST_KTG_NM'], ['class' => 'kartik\\grid\\ActionColumn', 'template' => Helper::filterActionColumn('{create}{view}{update}'), 'dropdown' => true, 'dropdownOptions' => ['class' => 'pull-right dropup'], 'dropdownButton' => ['class' => 'btn btn-default btn-xs'], 'header' => 'Action', 'buttons' => ['create' => function ($url, $model, $key) { return '<li>' . Html::a('<span class="glyphicon glyphicon-plus"></span>' . Yii::t('app', 'Tambah'), ['create', 'id' => $model->CUST_KTG_PARENT], ['data-toggle' => "modal", 'data-target' => "#formparent", 'data-title' => $model->CUST_KTG_NM]) . '<li>'; }, 'view' => function ($url, $model, $key) { return '<li>' . Html::a('<span class="glyphicon glyphicon-eye-open"></span>' . Yii::t('app', 'View'), ['view', 'id' => $model->CUST_KTG], ['data-toggle' => "modal", 'data-target' => "#viewparent", 'data-title' => $model->CUST_KTG_PARENT]) . '</li>'; }, 'update' => function ($url, $model, $key) { return '<li>' . Html::a('<span class="glyphicon glyphicon-pencil"></span>' . Yii::t('app', 'Update'), ['update', 'id' => $model->CUST_KTG], ['data-toggle' => "modal", 'data-target' => "#formparent", 'data-title' => $model->CUST_KTG_PARENT]) . '</li>'; }]]], 'panel' => ['type' => GridView::TYPE_SUCCESS, 'before' => $button_create], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'gv-kat-crm']], 'hover' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => ['fontAwesome' => true, 'showConfirmAlert' => false, 'target' => GridView::TARGET_BLANK]]); ?> </div> </div> <?php $navmenu = NavX::widget(['options' => ['class' => 'nav nav-tabs'], 'encodeLabels' => false, 'items' => [['label' => 'MENU', 'active' => true, 'items' => [['label' => '<span class="fa fa-user fa-md"></span>Customers', 'url' => '/mastercrm/customers-crm/index'], ['label' => '<span class="fa fa-cogs fa-md"></span>Alias Customers', 'url' => '/mastercrm/customers-crm/login-alias', 'linkOptions' => ['id' => 'performance', 'data-toggle' => 'modal', 'data-target' => '#formlogin']], '<li class="divider"></li>', ['label' => 'Properties', 'items' => [['label' => '<span class="fa fa-flag fa-md"></span>Kota', 'url' => '/mastercrm/kota-customers-crm/index'], ['label' => '<span class="fa fa-flag-o fa-md"></span>Province', 'url' => '/mastercrm/provinsi-customers-crm/index'], ['label' => '<span class="fa fa-table fa-md"></span>Category', 'url' => '/mastercrm/kategori-customers-crm/index'], '<li class="divider"></li>', ['label' => '<span class="fa fa-map-marker fa-md"></span>Customers Map', 'url' => '/mastercrm/customers-crm/crm-map']]]]]]]); ?> <div class="content"> <div class="row" style="padding-left:3px">
/** * Remove an item as a child of another item. * @param array $items * @return int */ public function removeChildren($items) { $manager = Yii::$app->getAuthManager(); $success = 0; if ($this->_item !== null) { foreach ($items as $name) { $child = $manager->getPermission($name); if ($this->type == Item::TYPE_ROLE && $child === null) { $child = $manager->getRole($name); } try { $manager->removeChild($this->_item, $child); $success++; } catch (\Exception $exc) { Yii::error($exc->getMessage(), __METHOD__); } } } if ($success > 0) { Helper::invalidate(); } return $success; }
use kartik\detail\DetailView; /* @var $this yii\web\View */ /* @var $searchModel mdm\admin\models\searchs\User */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('rbac-admin', 'Users'); $this->params['breadcrumbs'][] = $this->title; ?> <!-- Content Header (Page header) --> <div class="user-index"> <?php echo \kartik\grid\GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'id' => 'userGrid', 'autoXlFormat' => true, 'columns' => [['class' => 'kartik\\grid\\SerialColumn', 'header' => "序号"], ['attribute' => 'username', 'label' => '用户名'], ['attribute' => 'email', 'label' => '邮箱'], ['attribute' => 'created_at', 'label' => '创建时间', 'value' => function ($model) { return date("Y-m-d", $model->created_at); }], ['attribute' => 'status', 'label' => '状态', 'value' => function ($model) { return $model->status == 0 ? '未启用' : '已启用'; }, 'filter' => [0 => '未启用', 10 => '已启用']], ['class' => 'kartik\\grid\\ActionColumn', 'deleteOptions' => ['label' => '<i class="glyphicon glyphicon-remove"></i>'], 'template' => Helper::filterActionColumn(['view', 'activate', 'inactivate', 'delete']), 'buttons' => ['view' => function ($url, $model) { $options = ['title' => Yii::t('rbac-admin', '查看'), 'aria-label' => Yii::t('rbac-admin', '查看'), 'data-method' => 'post', 'data-pjax' => '0', 'id' => 'view' . $model->id]; return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, $options); }, 'activate' => function ($url, $model) { if ($model->status == \common\models\User::STATUS_ACTIVE) { return ''; } $options = ['title' => Yii::t('rbac-admin', '启用'), 'aria-label' => Yii::t('rbac-admin', '启用'), 'data-confirm' => Yii::t('rbac-admin', '确定启用该用户吗?'), 'data-method' => 'post', 'data-pjax' => '0']; return Html::a('<span class="glyphicon glyphicon-ok"></span>', $url, $options); }, 'inactivate' => function ($url, $model) { if ($model->status == \common\models\User::STATUS_DELETED) { return ''; } $options = ['title' => Yii::t('rbac-admin', '禁用'), 'aria-label' => Yii::t('rbac-admin', '禁用'), 'data-confirm' => Yii::t('rbac-admin', '确定禁用该用户吗?'), 'data-method' => 'post', 'data-pjax' => '0']; return Html::a('<span class="glyphicon glyphicon-cog"></span>', $url, $options); }]]], 'containerOptions' => ['style' => 'overflow: auto'], 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'export' => false, 'bordered' => true, 'striped' => true, 'condensed' => true, 'responsive' => true, 'hover' => true, 'panel' => ['type' => \kartik\grid\GridView::TYPE_PRIMARY, 'heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-globe"></i>用户列表</h3>'], 'persistResize' => true, 'floatHeader' => true, 'toolbar' => ['{export}'], 'export' => ['fontAwesome' => true, 'encoding' => 'GBK']]);
/* @var $this yii\web\View */ /* @var $searchModel app\models\UserSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Users'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="user-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a(Yii::t('app', 'Create User'), ['create'], ['class' => 'btn btn-success']); ?> <?php echo Html::a('<i class="fa glyphicon glyphicon-print"></i> Imprimir', ['/user/print'], ['class' => 'btn btn-info', 'target' => '_blank', 'data-toggle' => 'tooltip', 'title' => ' Genera un archivo PDF en otra ventana.']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'username', 'firstName', 'lastName', 'email:email', ['class' => 'yii\\grid\\ActionColumn', 'template' => Helper::filterActionColumn('{view}{delete}{update}')]]]); ?> </div>
$title1 = Yii::t('app', 'Create'); $options1 = ['id' => 'modl', 'data-toggle' => "modal", 'data-target' => "#form2", 'class' => 'btn btn-success btn-sm']; $icon1 = '<i class="glyphicon glyphicon-plus"></i>'; $label1 = $icon1 . ' ' . $title1; $url1 = Url::toRoute(['/mastercrm/kota-customers-crm/createkota']); //,'kd'=>$kd]); $content = Html::a($label1, $url1, $options1); return $content; } if (Helper::checkRoute('createkota')) { $button_create = tombolCreate(); } else { $button_create = ""; } // grid kota $tabkota = \kartik\grid\GridView::widget(['id' => 'gv-kota', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], 'PROVINCE', 'TYPE', 'CITY_NAME', 'POSTAL_CODE', ['class' => 'kartik\\grid\\ActionColumn', 'template' => Helper::filterActionColumn('{viewkota}{updatekota}'), 'header' => 'Action', 'dropdown' => true, 'dropdownOptions' => ['class' => 'pull-right dropup'], 'dropdownButton' => ['class' => 'btn btn-default btn-xs'], 'buttons' => ['viewkota' => function ($url, $model, $key) { return '<li>' . Html::a('<span class="glyphicon glyphicon-eye-open"></span>' . Yii::t('app', 'View'), ['viewkota', 'id' => $model->CITY_ID], ['data-toggle' => "modal", 'data-target' => "#view2", 'data-title' => $model->PROVINCE]) . '<li>'; }, 'updatekota' => function ($url, $model, $key) { return '<li>' . Html::a('<span class="glyphicon glyphicon-pencil"></span>' . Yii::t('app', 'Update'), ['updatekota', 'id' => $model->CITY_ID], ['data-toggle' => "modal", 'data-target' => "#form2", 'data-title' => $model->PROVINCE]) . '</li>'; }]]], 'panel' => ['type' => GridView::TYPE_SUCCESS, 'before' => $button_create], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'gv-kota'], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => ['fontAwesome' => true, 'showConfirmAlert' => false, 'target' => GridView::TARGET_BLANK]]]); $navmenu = NavX::widget(['options' => ['class' => 'nav nav-tabs'], 'encodeLabels' => false, 'items' => [['label' => 'MENU', 'active' => true, 'items' => [['label' => '<span class="fa fa-user fa-md"></span>Customers', 'url' => '/mastercrm/customers-crm/index'], ['label' => '<span class="fa fa-cogs fa-md"></span>Alias Customers', 'url' => '/mastercrm/customers-crm/login-alias', 'linkOptions' => ['id' => 'performance', 'data-toggle' => 'modal', 'data-target' => '#formlogin']], '<li class="divider"></li>', ['label' => 'Properties', 'items' => [['label' => '<span class="fa fa-flag fa-md"></span>Kota', 'url' => '/mastercrm/kota-customers-crm/index'], ['label' => '<span class="fa fa-flag-o fa-md"></span>Province', 'url' => '/mastercrm/provinsi-customers-crm/index'], ['label' => '<span class="fa fa-table fa-md"></span>Category', 'url' => '/mastercrm/kategori-customers-crm/index'], '<li class="divider"></li>', ['label' => '<span class="fa fa-map-marker fa-md"></span>Customers Map', 'url' => '/mastercrm/customers-crm/crm-map']]]]]]]); ?> <div class="content"> <div class="row" style="padding-left:3px"> <div class="col-sm-12 col-md-12 col-lg-12" > <?php //echo $test; echo $navmenu; ?> <!-- CUTI !--> </div>
$this->title = Yii::t('app', 'Acervos'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="acervo-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php if (Helper::checkRoute('create')) { echo Html::a(Yii::t('app', 'Create Acervo'), ['create'], ['class' => 'btn btn-success']); } ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['label' => 'N.Orden', 'value' => 'id', 'attribute' => 'id'], ['label' => 'Nro Registro', 'attribute' => 'nroInventario'], ['label' => 'Designación', 'attribute' => 'nombre'], ['label' => 'Colecciones', 'attribute' => 'colecciontextos'], ['label' => 'Temas', 'attribute' => 'tematextos'], ['label' => 'Ubicación', 'attribute' => 'ubicaciontexto'], ['class' => 'yii\\grid\\ActionColumn', 'template' => Helper::filterActionColumn('{view}{delete}{update}{imagen}'), 'buttons' => ['imagen' => function ($url, $model) { // $url =Url::to('@web/'.'index.php?r=multimedia/subir&objeto_id='.$model->id); $url = Url::toRoute(['multimedia/create', 'objetos_id' => $model->id]); return Html::a('<span class="glyphicon glyphicon-picture"></span>', $url, ['title' => \Yii::t('yii', 'Agregar Imágenes'), 'data-pjax' => '0']); }]]]]); ?> </div>
/* @var $searchModel app\models\IngresoSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Listado de Ingresos'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="ingreso-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php if (Helper::checkRoute('create')) { echo Html::a(Yii::t('app', 'Crear Ingreso'), ['create'], ['class' => 'btn btn-success']); } ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'descripcion', 'personaName', ['attribute' => 'fechaEntrada', 'format' => ['date', 'php:d/m/Y']], 'observaciones', ['class' => 'yii\\grid\\ActionColumn', 'template' => Helper::filterActionColumn('{view}{delete}{update}{imagen}')]]]); ?> </div>
/** * Creates a new User Login. * If creation is successful, the browser will be redirected to the 'index' page. * quthor wawan */ public function actionCreateUser() { if (Helper::checkRoute('create-user')) { $model = new Userlogin(); $model->scenario = 'createuser'; if ($model->load(Yii::$app->request->post())) { $post = Yii::$app->request->post(); $datapostion = $post['Userlogin']['POSITION_LOGIN']; if ($datapostion == 1) { $auth = "SALESMAN"; // auth key untuk salesmen } else { $auth = "SALES PROMOTION"; // auth key untuk sales promotion } $model->POSITION_LOGIN = $datapostion; $model->POSITION_SITE = "CRM"; // untuk login crm $pass = $model->password_hash; $security = Yii::$app->security->generatePasswordHash($pass); $authkey = Yii::$app->security->generatePasswordHash($auth); $model->password_hash = $security; $model->auth_key = $authkey; $model->save(); return $this->redirect(['index']); } else { return $this->renderAjax('create', ['model' => $model]); } } else { return $this->renderAjax('_confirm_alert', []); } }
/** * Deletes an existing Menu 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(); Helper::invalidate(); return $this->redirect(['index']); }
<h1><?php echo Html::encode($this->title); ?> </h1> <p> <!--filter boton componet of yii2-admin--> <?php if (Helper::checkRoute('delete')) { echo Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']]); } ?> <!--filter boton componet of yii2-admin--> <?php if (Helper::checkRoute('delete')) { echo Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); } ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'username', 'auth_key', 'password', 'email:email', 'created_at', 'updated_at', 'firstName', 'lastName']]); ?> </div>
/** * IMPORT DATA EXCEL * @return mixed * @author piter [ptr.nov@gmail.com] */ public function actionIndex() { if (Helper::checkRoute('index')) { $paramFile = Yii::$app->getRequest()->getQueryParam('id'); //echo $paramCari; $model = new UserFile(); $username = Yii::$app->user->identity->username; $user_id = ['USER_ID' => $username]; /*IMPORT VALIDATION*/ $searchModel = new TempDataSearch($user_id); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); /*VIEW IMPORT*/ $searchModelViewImport = new ImportViewSearch(); $dataProviderViewImport = $searchModelViewImport->search(Yii::$app->request->queryParams); //echo $this->actionExport_format(); return $this->render('index', ['getArryFile' => $this->getArryFile($paramFile), 'fileName' => $paramFile, 'gvColumnAryFile' => $this->gvColumnAryFile(), 'gvValidateColumn' => $this->gvValidateColumn(), 'gvValidateArrayDataProvider' => $dataProvider, 'searchModelValidate' => $searchModel, 'modelFile' => $model, 'gvRows' => $this->gvRows(), 'searchModelViewImport' => $searchModelViewImport, 'dataProviderViewImport' => $dataProviderViewImport]); } else { Yii::$app->user->logout(); $this->redirect(array('/site/login')); // } }