Пример #1
0
?>
                <?php 
echo Html::a('<i class="fa fa-trash"></i>', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger btn-sm', 'title' => Employment::t('employment', 'Delete'), 'data-confirm' => Employment::t('employment', 'Are you sure to delete this item?'), 'data-method' => 'post']);
?>
            </div>
        </div>
        <div class="box-body">
                <?php 
$form = ActiveForm::begin(['id' => 'timetable-cansel-lessons', 'enableClientValidation' => true, 'validateOnChange' => false, 'validateOnBlur' => true]);
?>
                <div class="col-sm-12">
                    <?php 
echo $form->field($model, 'date')->widget(DatePicker::className(), ['type' => DatePicker::TYPE_INPUT, 'options' => ['placeholder' => Employment::t('employment', 'Set date'), 'id' => 'paid-employment-date'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd', 'todayHighlight' => true, 'todayBtn' => true]]);
?>
                </div>
                <div class="col-sm-12">
                    <?php 
echo $form->field($model, 'id')->widget(DepDrop::className(), ['typename' => 'dropdownList', 'options' => ['placeholder' => Employment::t('employment', 'Set date first')], 'pluginOptions' => ['depends' => ['paid-employment-date'], 'url' => Url::to(['timetable-list']), 'placeholder' => false]]);
?>
                </div>
                <div class="col-sm-12">
                    <?php 
echo Html::submitButton(Employment::t('employment', 'Transfer class'), ['class' => 'btn btn-primary btn-large']);
?>
                </div>
                <?php 
ActiveForm::end();
?>
        </div>
    </div>
</div>
use backend\modules\timetable\Module as Timetable;
use backend\modules\employment\Employment;
use backend\modules\pay\Pay;
use backend\modules\ticket\Ticket;
use backend\modules\statistics\Statistics;
if (!isset(Yii::$app->i18n->translations['rbac-admin'])) {
    Yii::$app->i18n->translations['rbac-admin'] = ['class' => 'yii\\i18n\\PhpMessageSource', 'sourceLanguage' => 'en', 'basePath' => '@mdm/admin/messages'];
}
$controllerPath = '';
$moduleId = '';
if (Yii::$app->controller->module->id) {
    $controllerPath = '/' . Yii::$app->controller->module->id;
    $moduleId = Yii::$app->controller->module->id;
}
$controllerPath .= '/' . Yii::$app->controller->id;
?>
<aside class="main-sidebar">

    <section class="sidebar">
        <?php 
echo Nav::widget(['id' => 'adminlte-sidebar-menu', 'encodeLabels' => false, 'options' => ['class' => 'sidebar-menu'], 'activateItems' => true, 'activateParents' => true, 'items' => [['label' => Config::t('configuration', 'Configuration'), 'url' => ['/config/default/index'], 'visible' => Yii::$app->user->can('/config/*'), 'icon' => Config::getIcon()], ['label' => User::t('user-admin', 'Users'), 'url' => ['/user/default/index'], 'visible' => Yii::$app->user->can('/user/*'), 'icon' => User::getIcon()], ['label' => Group::t('group-admin', 'Groups'), 'url' => ['/group/default/index'], 'visible' => Yii::$app->user->can('/group/*'), 'icon' => Group::getIcon()], ['label' => Timetable::t('timetable-admin', 'Timetable'), 'url' => ['/timetable/default/index'], 'visible' => Yii::$app->user->can('/timetable/*'), 'icon' => Timetable::getIcon()], ['label' => Ticket::t('ticket', 'Tickets'), 'url' => ['/ticket/default/index'], 'visible' => Yii::$app->user->can('/ticket/*'), 'icon' => Ticket::getIcon()], ['label' => Pay::t('pay-admin', 'Pays'), 'url' => ['/pay/default/index'], 'visible' => Yii::$app->user->can('/pay/*'), 'icon' => Pay::getIcon()], ['label' => Employment::t('employment', 'Paid employments'), 'url' => ['/employment/default/index'], 'visible' => Yii::$app->user->can('/employment/*'), 'icon' => Employment::getIcon()], ['label' => News::t('eugenekei-news', 'News'), 'url' => ['/news/admin/index'], 'visible' => Yii::$app->user->can('/news/admin/*'), 'icon' => News::getIcon(), 'active' => $moduleId === 'news'], ['label' => Statistics::t('statistics', 'Statistics'), 'url' => ['/statistics/default/index'], 'visible' => Yii::$app->user->can('/statistics/*'), 'icon' => Statistics::getIcon()], ['label' => Yii::t('rbac-admin', 'Assignments'), 'url' => ['/rbac'], 'icon' => 'fa-legal', 'visible' => Yii::$app->user->can('/rbac/*'), 'active' => $moduleId === 'rbac', 'items' => [['label' => Yii::t('rbac-admin', 'Assignments'), 'url' => ['/rbac/assignment/index'], 'active' => $controllerPath === '/rbac/assignment'], ['label' => Yii::t('rbac-admin', 'Permissions'), 'url' => ['/rbac/permission/index'], 'active' => $controllerPath === '/rbac/permission'], ['label' => Yii::t('rbac-admin', 'Roles'), 'url' => ['/rbac/role/index'], 'active' => $controllerPath === '/rbac/role'], ['label' => Yii::t('rbac-admin', 'Routes'), 'url' => ['/rbac/route/index'], 'active' => $controllerPath === '/rbac/route'], ['label' => Yii::t('rbac-admin', 'Rules'), 'url' => ['/rbac/rule/index'], 'active' => $controllerPath === '/rbac/rule']]]]]);
?>



    </section>

</aside>

<?php 
//print_r(Yii::$app->i18n->translations);
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => 'ID', 'date' => Employment::t('employment', 'Date'), 'max_date' => Employment::t('employment', 'Date'), 'pay_id' => Employment::t('employment', 'Pay'), 'userFullName;' => Employment::t('employment', 'User'), 'timetable_id' => 'Timetable ID'];
 }
Пример #4
0
        </div>
    <?php 
}
if (Yii::$app->user->can('/employment/*')) {
    ?>
        <div class="col-lg-3 col-md-4 col-xs-6">
            <a class="btn btn-default btn-square-200px"
               href="<?php 
    echo Url::toRoute('/employment/default/index');
    ?>
">
                <i class="fa fa-clock-o fa-10x text-info">
                </i>
                <br/>
                <h4><?php 
    echo Employment::t('employment', 'Paid employments');
    ?>
</h4>
            </a>
        </div>
    <?php 
}
if (Yii::$app->user->can('/user/*')) {
    ?>
        <div class="col-lg-3 col-md-4 col-xs-6">
            <a class="btn btn-default btn-square-200px"
               href="<?php 
    echo Url::toRoute('/user/default/debtor');
    ?>
">
                <i class="fa fa-money fa-10x text-danger">
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Employment::t('employment', 'Classes'), 'date' => Employment::t('employment', 'Date')];
 }
Пример #6
0
/* @var $this yii\web\View */
/* @var $model backend\modules\employment\models\PaidEmployment */
$this->title = Employment::t('employment', 'Paid employments');
$this->params['subtitle'] = Employment::t('employment', 'Class information');
$this->params['breadcrumbs'][] = ['label' => $this->title, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->params['subtitle'];
?>
<div class="paid-employment-view">
    <div class="box box-default">
        <div class="box-header">
            <div class="pull-right">
                <?php 
echo Html::a('<i class="fa fa-list"></i>', ['index'], ['class' => 'btn btn-default btn-sm', 'title' => Employment::t('employment', 'List')]);
?>
                <?php 
echo Html::a('<i class="fa fa-pencil"></i>', ['update', 'id' => $model->id], ['class' => 'btn btn-success btn-sm', 'title' => Employment::t('employment', 'Update')]);
?>
                <?php 
echo Html::a('<i class="fa fa-trash"></i>', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger btn-sm', 'title' => Employment::t('employment', 'Delete'), 'data-confirm' => Employment::t('employment', 'Are you sure to delete this item?'), 'data-method' => 'post']);
?>
            </div>
        </div>
        <div class="box-body">
            <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['pay.profile.fullName', 'timetable.group.name', 'date:date', 'timetable.start', 'timetable.end', 'pay.create_at']]);
?>

        </div>
    </div>
</div>
Пример #7
0
$this->params['subtitle'] = Employment::t('employment', 'List of classes');
$this->params['breadcrumbs'][] = ['label' => $this->title, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->params['subtitle'];
$gridId = 'paid-employment-grid';
$this->registerJs("jQuery(document).on('click', '#batch-delete', function (evt) {" . "evt.preventDefault();" . "var keys = jQuery('#" . $gridId . "').yiiGridView('getSelectedRows');" . "if (keys == '') {" . "alert('" . Employment::t('employment', 'You need to select at least one item.') . "');" . "} else {" . "if (confirm('" . Employment::t('employment', 'Are you sure you want to delete selected items?') . "')) {" . "jQuery.ajax({" . "type: 'POST'," . "url: jQuery(this).attr('href')," . "data: {ids: keys}" . "});" . "}" . "}" . "});");
?>
<div class="<?php 
echo $gridId;
?>
">
    <div class="box box-default">
        <div class="box-header">
            <div class="pull-right">
                <?php 
echo Html::a('<i class="fa fa-trash"></i>', ['batch-delete'], ['class' => 'btn btn-danger btn-sm', 'id' => 'batch-delete', 'title' => Employment::t('employment', 'Delete selected')]);
?>
            </div>
        </div>
        <div class="box-body">
            <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

            <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'id' => $gridId, 'filterModel' => $searchModel, 'columns' => [['class' => CheckboxColumn::classname()], ['attribute' => 'pay.profile.fullName', 'filterOptions' => ['style' => 'max-width: 200px;'], 'filter' => Select2::widget(['id' => 'user_affiliate_id', 'model' => $searchModel, 'attribute' => 'userFullName', 'options' => ['placeholder' => Employment::t('employment', 'Start typing the name or surname'), 'class' => 'form-control'], 'language' => 'ru', 'data' => $filterUserDataArray, 'pluginOptions' => ['allowClear' => true, 'minimumInputLength' => 2, 'ajax' => ['url' => \yii\helpers\Url::to(['/user/default/affiliate']), 'dely' => 250, 'type' => 'post', 'dataType' => 'json', 'data' => new JsExpression('function(term,page) { return {search:term}; }'), 'results' => new JsExpression('function(data,page) { return {results:data.results}; }')]]])], ['attribute' => 'date', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date', 'type' => DatePicker::TYPE_INPUT, 'language' => 'ru', 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']])], 'timetable.start', 'timetable.end', ['label' => Employment::t('employment', 'Group'), 'attribute' => 'timetable.group.name', 'filter' => Html::activeDropDownList($searchModel, 'timetableGroupId', $groupsArray, ['class' => 'form-control', 'prompt' => ''])], ['class' => 'yii\\grid\\ActionColumn', 'buttonOptions' => ['class' => 'btn btn-default btn-xs'], 'headerOptions' => ['style' => 'width:100px;'], 'header' => Employment::t('employment', 'Actions')]]]);
?>

        </div>
    </div>
</div>