예제 #1
0
 /**
  * Lists all Company models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new CompanySearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->pagination->pageSize = 20;
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
예제 #2
0
 /**
  * Updates an existing Group 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);
     $employeeSearch = new EmployeeSearch();
     $employeeData = $employeeSearch->searchByGroup(Yii::$app->request->getQueryParams());
     $employeeData->pagination->pageSize = 20;
     $companySearch = new CompanySearch();
     $companyData = $companySearch->searchByGroup(Yii::$app->request->getQueryParams());
     $companyData->pagination->pageSize = 20;
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('update', ['model' => $model, 'employeeData' => $employeeData, 'employeeSearch' => $employeeSearch, 'companyData' => $companyData, 'companySearch' => $companySearch]);
     }
 }
예제 #3
0
 /**
  * Updates an existing User 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);
     $searchModel = new CompanySearch();
     $dataProvider = $searchModel->searchByAdmin(Yii::$app->request->queryParams);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         //Change Pass
         $userpost = Yii::$app->request->post('User');
         if (strlen($userpost['new_password']) > 0) {
             $model->password = sha1($userpost['new_password']);
             //sha1($userpost['new_password']);
             $model->save();
             //Change Pass
         }
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('update', ['model' => $model, 'dataProvider' => $dataProvider, 'searchModel' => $searchModel]);
     }
 }
예제 #4
0
        .box-menu {
            height: 190px;
            background: #000;
        }
        .box-menu-first{
            height: 400px;
            background: #6ba610;
        }
    }
</style>

<?php 
/* @var $this yii\web\View */
use yii\helpers\Url;
use app\models\CompanySearch;
$co = CompanySearch::find()->one();
$this->title = $co->companyname;
$config = new \app\models\Config_system();
?>

<div class="row" id="text-color">
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div style="position: absolute; top: 5px; right: 5px;">
            <div class="dropdown">

                <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                    <i class="fa fa-cog faa-spin animated-hover"></i>
                </button>
                <ul class="dropdown-menu pull-right" aria-labelledby="dropdownMenu1">
                    <li><a href="Javascript:set_bg('gray')">Gray <div class="btn pull-right" id="content-bg-gray"></div></a></li>
                    <li><a href="Javascript:set_bg('red')">Red <div class="btn pull-right" id="content-bg-red"></div></a></li>