if (!Yii::$app->user->isGuest) { $isStudent = Yii::$app->session->get('stu_id'); $isEmployee = Yii::$app->session->get('emp_id'); } if (isset($isStudent)) { $stuMaster = app\modules\student\models\StuMaster::find()->where(['stu_master_id' => $isStudent, 'is_status' => 0])->one(); if (!empty($stuMaster)) { $stuInfo = app\modules\student\models\StuInfo::findOne($stuMaster->stu_master_stu_info_id); } else { throw new NotFoundHttpException('The requested user login credentials does not exist.'); } $path = Yii::$app->homeUrl . 'data/stu_images/'; $Photo = $stuInfo->stu_photo ? $path . $stuInfo->stu_photo : $path . 'noStudent.png'; } else { if (isset($isEmployee)) { $empMaster = app\modules\employee\models\EmpMaster::find()->where(['emp_master_id' => $isEmployee, 'is_status' => 0])->one(); if (!empty($empMaster)) { $empInfo = app\modules\employee\models\EmpInfo::findOne($empMaster->emp_master_emp_info_id); } else { throw new NotFoundHttpException('The requested user login credentials does not exist.'); } $path = Yii::$app->homeUrl . 'data/emp_images/'; $Photo = $empInfo->emp_photo ? $path . $empInfo->emp_photo : $path . 'no-photo'; } else { $Photo = Yii::$app->homeUrl . 'data/emp_images/no-photo'; } } ?> <aside class="left-side sidebar-offcanvas"> <section class="sidebar">
</div> <div class="icon"> <i class="ion ion-ios-people"></i> </div> <?php echo Html::a('More info <i class="fa fa-arrow-circle-right"></i>', ['/student/stu-master/index'], ['target' => '_blank', 'class' => 'small-box-footer']); ?> </div> </div><!-- ./col --> <div class="col-lg-3 col-xs-6"> <!-- small box --> <div class="small-box bg-green"> <div class="inner"> <h3> <?php echo app\modules\employee\models\EmpMaster::find()->where(['is_status' => 0])->count(); ?> </h3> <p> Employees </p> </div> <div class="icon"> <i class="ion ion-person"></i> </div> <?php echo Html::a('More info <i class="fa fa-arrow-circle-right"></i>', ['/employee/emp-master/index'], ['target' => '_blank', 'class' => 'small-box-footer']); ?> </div> </div><!-- ./col --> <div class="col-lg-3 col-xs-6">
} else { $isStudent = $isEmployee = ''; if (!Yii::$app->user->isGuest) { $isStudent = Yii::$app->session->get('stu_id'); $isEmployee = Yii::$app->session->get('emp_id'); } if (isset($isStudent)) { $stuMaster = app\modules\student\models\StuMaster::find()->andWhere(['stu_master_id' => $isStudent])->one(); $stuInfo = app\modules\student\models\StuInfo::findOne($stuMaster->stu_master_stu_info_id); $Photo = $stuInfo->getStuPhoto($stuInfo->stu_photo); $ProfileLink = ['/student/stu-master/view', 'id' => $stuMaster->stu_master_id]; $linkStyle = 'display:block'; // for profile link class } else { if (isset($isEmployee)) { $empMaster = app\modules\employee\models\EmpMaster::find()->andWhere(['emp_master_id' => $isEmployee])->one(); $empInfo = app\modules\employee\models\EmpInfo::findOne($empMaster->emp_master_emp_info_id); $Photo = $empInfo->getEmpPhoto($empInfo->emp_photo); $ProfileLink = ['/employee/emp-master/view', 'id' => $empMaster->emp_master_id]; $linkStyle = 'display:block'; // for profile link class } else { $Photo = Yii::getAlias('@web') . '/data/emp_images/no-photo.png'; $linkStyle = 'display:none'; // for profile link class $ProfileLink = $userPullL = ''; } } ?> <li class="dropdown user user-menu"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
/* @var $searchModel mdm\admin\models\searchs\Assignment */ $this->title = Yii::t('rbac-admin', 'Assignments'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="col-xs-12"> <div class="col-lg-4 col-sm-4 col-xs-12 no-padding"><h3 class="box-title"><i class="fa fa-th-list"></i> <?php echo Html::encode($this->title); ?> </h3></div> </div> <div class="col-xs-12" style="padding-top: 10px;"> <div class="box"> <div class="box-body table-responsive"> <div class="assignment-index"> <?php Pjax::begin(['enablePushState' => false]); echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'summary' => '', 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => $usernameField, 'label' => Yii::t('rbac-admin', 'User ID'), 'value' => function ($model) { $stuInfo = app\modules\student\models\StuMaster::find()->where(['stu_master_user_id' => $model->user_id])->andWhere(['<>', 'is_status', '2'])->one(); $empInfo = app\modules\employee\models\EmpMaster::find()->where(['emp_master_user_id' => $model->user_id])->andWhere(['<>', 'is_status', '2'])->one(); return $stuInfo ? $model->user_login_id . " ( " . $stuInfo->stuMasterStuInfo->getName() . " )" : ($empInfo ? $model->user_login_id . " ( " . $empInfo->empMasterEmpInfo->getEmpName() . " )" : "Admin"); }], ['attribute' => 'user_type', 'value' => function ($model) { return $model->user_type == 'A' ? "Admin" : ($model->user_type == 'S' ? "Student" : "Employee"); }, 'filter' => ['A' => 'Admin', 'S' => 'Student', 'E' => 'Employee']], ['label' => Yii::t('rbac-admin', 'Role'), 'attribute' => 'item_name', 'value' => 'authuser.item_name'], ['class' => 'app\\components\\CustomActionColumn', 'template' => '{view}']]]); Pjax::end(); ?> </div> </div> </div> </div>