cant login anymore on production server

I have an application I developed with yii2-basic. I used rbac for my user access. Initially I could log in on both dev server and prod server. The surprise is that since last week, when I enterEd the username and password on the login page it appears as if it wants to go to the next page but it remains on the login page. The same code and database on both dev and prod servers. It’s going on the dev server but not on the prod server.

Please help me.

It appears that the application is passing the login credentials successfully as an incorrect password will result in an ‘Incorrect username or password’ error.

Same code and database on both dev. server and prod. server

Site Controller




<?php


namespace app\controllers;


use Yii;

use yii\filters\AccessControl;

use yii\web\Controller;

use yii\filters\VerbFilter;

use app\models\LoginForm;

use app\models\ContactForm;

use app\models\User;

use app\modules\consumers\models\BuildingManager;

use app\modules\consumers\models\Building;

use app\modules\zonal\models\ZonalAdministrator;

use app\modules\contractors\models\Inspector;

use app\modules\inspection\models\InspectionPlan;

use app\models\City;

use app\models\State;

use app\models\Zone;

use yii\helpers\Json;

use app\models\AuthAssignment;

use yii\base\Exception;








class SiteController extends Controller

{

    public function behaviors()

    {

        return [

            'access' => [

                'class' => AccessControl::className(),

                'only' => ['logout'],

                'rules' => [

                    [

                        'actions' => ['logout'],

                        'allow' => true,

                        'roles' => ['@'],

                    ],

                ],

            ],

            'verbs' => [

                'class' => VerbFilter::className(),

                'actions' => [

                    'logout' => ['post'],

                ],

            ],

        ];

    }


    public function actions()

    {

        return [

            'error' => [

                'class' => 'yii\web\ErrorAction',

            ],

            'captcha' => [

                'class' => 'yii\captcha\CaptchaAction',

                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,

            ],

        ];

    }




    public function actionIndex()

    {

    $this->layout = 'homePage';

    if (\Yii::$app->user->isGuest)

        return $this->redirect(['site/login']);

        else 

        {

            $isManager = Yii::$app->session->get('building_id');

            $isContractor = Yii::$app->session->get('company_id');

            $isZonal = Yii::$app->session->get('zonal_id');

            if(isset($isManager)) 

            {

                return $this->render('manager-dashboard');

            }

          else if(isset($isContractor))

            return $this->render('contractor-dashboard');

          else if(isset($isZonal))

            return $this->render('zonal-dashboard');        

            else

                return $this->render('user-dashboard');

        }

    }




    public function actionLogin()

    {

        if (!\Yii::$app->user->isGuest) {

            return $this->goHome();

        }


    $model = new LoginForm();

    $login = new \app\models\LoginDetails();

    if ($model->load(Yii::$app->request->post())) {

        $log = \app\models\User::find()->where(['user_login_id' => $_POST['LoginForm']['username'], 'is_block' => 0])->one();

   //    die(var_dump($log));

        if(empty($log)) {

            \Yii::$app->session->setFlash('loginError', '<i class="fa fa-warning"></i><b> Incorrect username or password. !</b>');

                return $this->render('login', ['model' => $model]);

        }

        

        $login->login_user_id = $log['user_id'];

        $loginuser = $login->login_user_id;




        $contractorlogin = Inspector::find()->andWhere(['contractor_user_id'=>$loginuser])->one();

        $managerlogin = Building::find()->andWhere(['building_user_id'=>$loginuser])->one();

        $zonallogin = ZonalAdministrator::find()->andWhere(['zonal_administrator_user_id'=>$loginuser])->one();

        if($managerlogin)

        {

            \Yii::$app->session->set('building_id',$managerlogin->building_id);

        }

        else if($contractorlogin)

        {

            \Yii::$app->session->set('company_id',$contractorlogin->company_id);

        }

        else if($zonallogin)

        {

            \Yii::$app->session->set('zonal_id',$zonallogin->zonal_id);

        }        

        else if(!$contractorlogin && !$managerlogin&& !$zonallogin)

        {

            \Yii::$app->session->set('admin_user',$loginuser);

        }

        else {

              \Yii::$app->session->setFlash('loginError', '<i class="fa fa-warning"></i><b> These Login credentials are Blocked/Deactive by Admin</b>');

              return $this->render('login', ['model' => $model,]);  

        }


        $login->login_status = 1;

        $login->login_at = new \yii\db\Expression('NOW()');

        $login->user_ip_address=$_SERVER['REMOTE_ADDR'];

        $login->save(false);

   ///*     

        if($model->login()) {

    //        if(!isset(Yii::$app->request->cookies['language'])) {

    //            return $this->redirect(['language']);

     //       } else

                return $this->goBack(); 

        }

        else

            return $this->render('login', ['model' => $model,]);

     //   */

        } 

        else {

            return $this->render('login', [

                'model' => $model,

            ]);

        }

    }


    public function actionLogout()

    {

        if(isset(Yii::$app->user->id))

        \app\models\LoginDetails::updateAll(['login_status' => 0, 'logout_at'=> new \yii\db\Expression('NOW()')],'login_user_id='.Yii::$app->user->id.' AND login_status = 1'); 

                

        Yii::$app->user->logout();

        return $this->goHome();

    }


    public function actionForgotpassword()

    {

        $model = new LoginForm();

        return $this->render('forgotpassword', ['model'=>$model,]);

    }




    public function actionLoadimage()

    {

        $model = \app\models\Organization::find()->asArray()->all();


        header('Pragma: public');

        header('Expires: 0');

        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');

        header('Content-Transfer-Encoding: binary');

        header('Content-type: '.$model[0]['org_logo_type']);

        echo $model[0]['org_logo'];  

    

    }


    public function actionAbout()

    {

        return $this->render('about');

    }


}




Login View




<?php

use yii\helpers\Html;

use yii\widgets\ActiveForm;

$this->title = Yii::t('app', 'ESS | Login');

?>


<div class="title-box">

  <div class="title-box-body title-header">

    <h1> ELECTRICAL SAFETY STANDARD SOLUTION </h1>

  </div>

</div>


<div class="login-box">

      <div class="login-logo">

   <!-- &nbsp;  -->


      </div><!-- /.login-logo -->

      <div class="login-box-body login-header">

 <!--   <h1>USER LOGIN</h1>  -->

 <h1><?= Html::img(Yii::$app->request->baseUrl.'/images/product.png', ['width'=>'120px;']) ?></h1>

      </div>

      <div class="login-box-body">

    

        <p class="login-box-msg"><?php echo Yii::t('app', 'Please fill out the following fields to login') ?></p>

  <?php $form = ActiveForm::begin(['id' => 'login-form',

                                'options' => ['enctype' => 'multipart/form-data'],

                                //'enableAjaxValidation' => true,

                                'method'=>'post',

                                 ]); ?>

          <div class="form-group has-feedback">

       <?= $form->field($model, 'username')->textInput(['placeholder'=>Yii::t('app', 'Username'), 'class'=>'form-control'])->label(false) ?>

            <span class="glyphicon glyphicon-user form-control-feedback"></span>

          </div>

          <div class="form-group has-feedback">

      <?= $form->field($model, 'password')->passwordInput(['class'=>'form-control', 'placeholder'=>Yii::t('app', 'Password')])->label(false) ?>

            <span class="glyphicon glyphicon-lock form-control-feedback"></span>

          </div>

          <div class="row">

            <div class="col-xs-7">    

              <div class="checkbox icheck">

    <?= $form->field($model, 'rememberMe')->checkbox() ?>

              </div>                        

            </div><!-- /.col -->

            <div class="col-xs-5">

  <!--      <input type="submit" class="btn btn-primary btn-block btn-flat" name="login-button" id="submit_entry" value="Login" />-->

  <?= Html::submitButton(Yii::t('app', 'Login'), ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']) ?>

            </div><!-- /.col -->

          </div>


        <!--a href="#">I forgot my password</a--><br>

      </div><!-- /.login-box-body -->


<?php ActiveForm::end(); ?>


      <?php if(\Yii::$app->session->hasFlash('loginError')) : ?>

      <div class="alert alert-danger alert-dismissible" style="margin-top: 5%;">

    <button type="button" class="close" data-dismiss="alert" aria-label="Close">

    <span aria-hidden="true">&times;</span></button>

    <?php echo \Yii::$app->session->getFlash('loginError'); ?>

      </div>

       <?php endif; ?>


     

<div class="logmod__alter">

  <?php $form = ActiveForm::begin(['id' => 'manager-form',

                                'options' => ['enctype' => 'multipart/form-data'],

                                //'enableAjaxValidation' => true,

                                'method'=>'post',

                                 ]); ?>

      <div class="login-box-body login-manager">

        

        <!--<button type="button" class="btn btn-block btn-primary btn-lg"><span>New Manager? <strong>Create Building Manager</strong></span></button>-->

 <!--       <input type="submit" class="btn btn-block btn-primary btn-lg" name="manager-button" id="submit_entry" value="New Manager? Create Building Manager" />-->

<?= Html::SubmitButton(Yii::t('app', '<span>New Manager? <strong>Create Building Manager</strong></span>'), ['class' => 'btn btn-block btn-primary btn-lg', 'name' => 'manager-button']) ?>

      </div>

<?php ActiveForm::end(); ?>

  <?php $form = ActiveForm::begin(['id' => 'inspector-form',

                                'options' => ['enctype' => 'multipart/form-data'],

                                //'enableAjaxValidation' => true,

                                'method'=>'post',

                                 ]); ?>

      <div class="login-box-body login-contractor">

  <?= Html::SubmitButton(Yii::t('app', '<span>New Inspector? <strong>Create Inspector Account</strong></span>'), ['class' => 'btn btn-block btn-success btn-lg', 'name' => 'inspector-button']) ?>       


      </div>

<?php ActiveForm::end(); ?>

</div>


 

    </div><!-- /.login-box -->




View: user-dashboard




<?php 

use yii\helpers\Html;

use yii\helpers\Url;


$this->title = Yii::t('app', 'Admin Dashboard'); 

$this->params['breadcrumbs'][] = $this->title;

?>

<script>

$(document).ready(function(){

    $('.tab-content').slimScroll({

        height: '300px'

    });

});

$(document).ready(function(){

    $('#coursList').slimScroll({

        height: '250px'

    });

});

</script>

<style>

.tab-content {

   padding:15px;

}

.box .box-body .fc-widget-header {

    background: none;

}

.popover{

    max-width:450px;   

}

</style>


<?php

$this->registerJs(

"$(function() {

	$('.noticeModalLink').click(function() {

		$('#NoticeModal').modal('show')

		.find('#NoticeModalContent')

		.load($(this).attr('data-value'));

	});

});");


$this->registerJs(

"$('body').on('click', function (e) {

    $('[data-toggle=\"popover\"]').each(function () {

        if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {

            $(this).popover('hide'); 

        }

    });

});"

)

?>


<?php

	yii\bootstrap\Modal::begin([

	    'header' => '<h4><i class="fa fa-eye"></i> '.Yii::t('app', 'View Notice Details').'</h4>',

	    'id'=>'NoticeModal',

	]);

	echo '<div id="NoticeModalContent"></div>';

	yii\bootstrap\Modal::end();

?>


    <!-- Main content -->

    <section class="content">


                    <!-- Small boxes (Stat box) -->

		<?php $managerMsg= app\modules\dashboard\models\MsgOfDay::find()->where('is_status = 0  AND (msg_user_type = "M" OR msg_user_type = "0")')->one();

		if(!empty($managerMsg)) :

		?>

		<div class="callout callout-info msg-of-day">

			    <h4><i class="fa fa-bullhorn"></i> <?php echo Yii::t('app', 'Message of day box') ?></h4>

			    <p><marquee onmouseout="this.setAttribute('scrollamount', 6, 0);" onmouseover="this.setAttribute('scrollamount', 0, 0);" scrollamount="6" behavior="scroll" direction="left"><?= $managerMsg->msg_details; ?></marquee></p>

		</div>

		<?php endif; ?>


                    <div class="row">

                        <div class="col-lg-3 col-xs-6">

                            <!-- small box -->

                            <div class="small-box bg-aqua">

                                <div class="inner">

                                    <h3>

                                      <?= app\modules\consumers\models\BuildingManager::find()->count(); ?>

                                    </h3>

                                    <p>

                                        <?php echo Yii::t('app', 'Managers') ?>

                                    </p>

                                </div>

                                <div class="icon">

                                    <i class="ion ion-ios-people"></i>

                                </div>

								<?= Html::a(Yii::t('app', 'More info').' <i class="fa fa-arrow-circle-right"></i>', ['/consumers/building-manager/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>

                                       <?= app\modules\contractors\models\Inspector::find()->count(); ?>

                                    </h3>

                                    <p>

                                        <?php echo Yii::t('app', 'Contractors') ?>

                                    </p>

                                </div>

                                <div class="icon">

                                    <i class="ion ion-person"></i>

                                </div>

									<?= Html::a(Yii::t('app', 'More info').' <i class="fa fa-arrow-circle-right"></i>', ['/contractors/inspector/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-yellow">

                                <div class="inner">

                                    <h3>

                                        <?= app\modules\consumers\models\BuildingTariff::find()->count(); ?>

                                    </h3>

                                    <p>

                                        <?php echo Yii::t('app', 'Tariff Classes') ?>

                                    </p>

                                </div>

                                <div class="icon">

                                    <i class="fa fa-sitemap"></i>

                                </div>

										<?= Html::a(Yii::t('app', 'More info').' <i class="fa fa-arrow-circle-right"></i>', ['/consumers/building-tariff/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-red">

                                <div class="inner">

                                    <h3>

                                        <?= app\modules\inspection\models\InspectionPlan::find()->count(); ?>

                                    </h3>

                                    <p>

                                        <?php echo Yii::t('app', 'Inspection Plan') ?>

                                    </p>

                                </div>

                                <div class="icon">

                                    <i class="fa fa-book"></i>

                                </div>

                                <?= Html::a(Yii::t('app', 'More info').' <i class="fa fa-arrow-circle-right"></i>', ['/inspection/Inspection-plan/index'], ['target' => '_blank', 'class' => 'small-box-footer']); ?>

                            </div>

                        </div><!-- ./col -->


                    </div><!-- /.row -->


                    <!-- Main row -->

                    <div class="row">

                        <!-- Left col -->

                        <section class="col-lg-7 connectedSortable">


			   <div class="nav-tabs-custom"><!-- .nav-tabs-custom -->

                                <!-- Tabs within a box -->

                                <ul class="nav nav-tabs pull-right">

                                    <li><a href="#contractor-notice" data-toggle="tab"><?php echo Yii::t('app', 'Contractors') ?></a></li>

                                    <li><a href="#manager-notice" data-toggle="tab"><?php echo Yii::t('app', 'Managers') ?></a></li>

				    <li class="active"><a href="#all-notice" data-toggle="tab"><?php echo Yii::t('app', 'General') ?></a></li>

                                    <li class="pull-left header"><i class="fa fa-inbox"></i><?php echo Yii::t('app', 'Notice Board') ?></li>

                                </ul>

                                <div class="tab-content">

                                    <!-- Notice -->

                                    <div class="tab-pane active" id="all-notice">

					

					<?php $noticeList = app\modules\dashboard\models\Notice::find()->where("is_status = 0 AND notice_user_type = '0'")->all();


				    if(!empty($noticeList)) {

					foreach($noticeList as $nl) :

					?>

					<div class="notice-main bg-light-blue">

						<div class="notice-disp-date">				        		<small class="label label-success"><i class="fa fa-calendar"></i> <?= (!empty($nl->notice_date) ? Yii::$app->formatter->asDate($nl->notice_date) : "Not Set"); ?></small>	

						</div>

						<div class="notice-body">

							 <div class="notice-title"><?= Html::a($nl->notice_title, '#', ['style' => 'color:#FFF', 'class'=>'noticeModalLink', 'data-value'=>Url::to(['dashboard/notice/view-popup','id'=>$nl->notice_id])]); ?>&nbsp; </div>

							 <div class="notice-desc"><?= $nl->notice_description; ?> </div>

						</div>					          

					</div>

					<?php endforeach; 

				     } else {

						echo '<div class="box-header bg-warning"><div style="padding:5px">';

						echo Yii::t('app', 'No Notice....');

						echo '</div></div>';

				     }

					?>

				    </div>

                                    <div class="tab-pane" id="manager-notice">

					

					<?php $noticeList = app\modules\dashboard\models\Notice::find()->where("is_status = 0 AND notice_user_type = 'M'")->all();


				    if(!empty($noticeList)) {

					foreach($noticeList as $nl) :

					?>

					 <div class="notice-main bg-aqua">

						<div class="notice-disp-date">				        		<small class="label label-success"><i class="fa fa-calendar"></i> <?= (!empty($nl->notice_date) ? Yii::$app->formatter->asDate($nl->notice_date) : "Not Set"); ?></small>	

						</div>

						<div class="notice-body">

							 <div class="notice-title"><?= Html::a($nl->notice_title, '#', ['style' => 'color:#FFF', 'class'=>'noticeModalLink', 'data-value'=>Url::to(['dashboard/notice/view-popup','id'=>$nl->notice_id])]); ?>&nbsp; </div>

							 <div class="notice-desc"><?= $nl->notice_description; ?> </div>

						</div>					          

					</div>

					<?php endforeach;

				      } else {

						echo '<div class="box-header bg-warning"><div style="padding:5px">';

						echo Yii::t('app', 'No Notice....');

						echo '</div></div>';

				      }

					?>

				    </div>

				    <div class="tab-pane" id="contractor-notice">

					

					<?php $noticeList = app\modules\dashboard\models\Notice::find()->where("is_status = 0 AND notice_user_type = 'C'")->all();


				    if(!empty($noticeList)) {

					foreach($noticeList as $nl) :

					?>

					 <div class="notice-main bg-teal">

						<div class="notice-disp-date">	<small class="label label-success"><i class="fa fa-calendar"></i> <?= (!empty($nl->notice_date) ? Yii::$app->formatter->asDate($nl->notice_date) : "Not Set"); ?></small>	

						</div>

						<div class="notice-body">

							 <div class="notice-title"><?= Html::a($nl->notice_title, '#', ['style' => 'color:#FFF', 'class'=>'noticeModalLink', 'data-value'=>Url::to(['dashboard/notice/view-popup','id'=>$nl->notice_id])]); ?>&nbsp; </div>

							 <div class="notice-desc"><?= $nl->notice_description; ?> </div>

						</div>					          

					</div>

					<?php endforeach;

				      } else {

						echo '<div class="box-header bg-warning"><div style="padding:5px">';

						echo Yii::t('app', 'No Notice....');

						echo '</div></div>';

				      }

					?>

				    </div>

                                </div> <!--  /.tab-content -->

                            </div><!-- /.nav-tabs-custom -->


			    <!-- Calendar -->

                            <div class="box box-info">

                                <div class="box-header with-border">

                                    <h3 class="box-title <?= (Yii::$app->language == 'ar') ? 'pull-right' : '' ?>"><i class="fa fa-calendar"></i> <?php echo Yii::t('app', 'Calendar') ?></h3>

                                </div><!-- /.box-header -->

                                <div class="box-body">

                                    <!--The calendar -->

	<?php

	$JSEventClick = <<<EOF

		function(event, jsEvent, view) {

		    $('.fc-event').on('click', function (e) {

			$('.fc-event').not(this).popover('hide');

		    });

		}

EOF;

	$eDetail = Yii::t('app', 'Event Detail');

	$eType = Yii::t('app', 'Event Type');

	$eStart = Yii::t('app', 'Start Time');

	$eEnd = Yii::t('app', 'End Time');

	$JsF = <<<EOF

		function (event, element) {

			var start_time = moment(event.start).format("DD-MM-YYYY, h:mm:ss a");

		    	var end_time = moment(event.end).format("DD-MM-YYYY, h:mm:ss a");


			element.clickover({

		            title: event.title,

		            placement: 'top',

		            html: true,

			    global_close: true,

			    container: 'body',

		            content: "<table class='table'><tr><th> {$eDetail} : </th><td>" + event.description + " </td></tr><tr><th> {$eType} : </th><td>" + event.event_type + "</td></tr><tr><th> {$eStart} : </t><td>" + start_time + "</td></tr><tr><th> {$eEnd} : </th><td>" + end_time + "</td></tr></table>"

        		});

               }

EOF;

	?>

                            <?= \yii2fullcalendar\yii2fullcalendar::widget([

					'options' => ['language' => 'en',],

					'clientOptions' => [

						'fixedWeekCount' => false,

						'weekNumbers'=>true,

						'editable' => true,

						'eventLimit' => true,

						'eventLimitText' => 'more Events',

						'header' => [

							'left' => 'prev,next today',

							'center' => 'title',

							'right' => 'month,agendaWeek,agendaDay'

						],

						'eventClick' => new \yii\web\JsExpression($JSEventClick),

						'eventRender' => new \yii\web\JsExpression($JsF),

						'contentHeight' => 380,

						'timeFormat' => 'hh(:mm) A', 

					],

					'ajaxEvents' => yii\helpers\Url::toRoute(['/dashboard/events/view-events'])

				]);

			    ?>

				   <div class="row">

					<ul class="legend">

					    <li><span class="importantnotice"></span> <?php echo Yii::t('app', 'Important Notice') ?></li>

					</ul>

				   </div>

                                </div><!-- /.box-body -->

                            </div><!-- /.box -->


                        </section><!-- /.Left col -->

                        <!-- right col (We are only adding the ID to make the widgets sortable)-->

                        <section class="col-lg-5 connectedSortable">


			    <div class="nav-tabs-custom"><!-- .nav-tabs-custom -->

                                <!-- Tabs within a box -->

                                <ul class="nav nav-tabs pull-right">

                                    <li><a href="#birth-upcoming" data-toggle="tab"><?php echo Yii::t('app', 'Upcoming') ?></a></li>

				    <li class="active"><a href="#birth-taday" data-toggle="tab"><?php echo Yii::t('app', "Today's Inspection") ?></a></li>

                                    <li class="pull-left header" style="<?= (Yii::$app->language == 'ar') ? 'left:26%' : ''; ?>"><i class="fa fa-book"></i><?php echo Yii::t('app', 'Inspection Bookings') ?></li>

                                </ul>

                    <div class="tab-content">

                                    <!-- Birthdays -->

				    <div class="tab-pane active" id="birth-taday">

					<?php $inspectionList = app\modules\inspection\models\InspectionBooking::find()->where(["LIKE", "inspection_date", date('m-d')])->all();

					if(!empty($inspectionList)) {

						foreach($inspectionList as $el) :

						?>

						    <div class="box box-solid bg-aqua">

							<div class="box-header">

							    <div class="pull-left" style="padding:5px">

		                            <img src="<?= Yii::getAlias('@web').'/data/consumer_images/no-photo.png'; ?>" class="img-circle" alt="no image" width="40px" height="40px">

		                        </div>

							<h3 class="box-title"><?php echo $el->building->building_name; ?>&nbsp;

							<small class="label label-success"><i class="fa fa-calendar"></i> <?php echo date('d M',strtotime($el->inspection_date)); ?></small></h3>

							</div>

						    </div><!-- /.box -->

						<?php endforeach; 

					} else {

						echo '<div class="box-header bg-warning"><div style="padding:5px">';

						echo Yii::t('app', 'No Inspection Today');

						echo '</div></div>';

					}

					?>

				    </div>

                    <div class="tab-pane" id="birth-upcoming">

					<?php $inspLi = "SELECT * FROM  inspection_booking WHERE  DATE_ADD(inspection_date, INTERVAL YEAR(CURDATE())-YEAR(inspection_date) + IF(DAYOFYEAR(CURDATE()) > DAYOFYEAR(inspection_date),1,0) YEAR) BETWEEN CURDATE()+1 AND DATE_ADD(CURDATE(), INTERVAL 30 DAY)";

					$inspectionList = app\modules\inspection\models\InspectionBooking::findBySql($inspLi)->all(); 

					if(!empty($inspectionList)) {

						foreach($inspectionList as $el) :

						?>

						    <div class="box box-solid bg-aqua">

							<div class="box-header">

							    <div class="pull-left" style="padding:5px">

		                            <img src="<?= Yii::getAlias('@web').'/data/consumer_images/no-photo.png'; ?>" class="img-circle" alt="no image" width="40px" height="40px">

		                        </div>

							    <h3 class="box-title"><?php echo $el->building->building_name; ?>&nbsp;

							    <small class="label label-warning"><i class="fa fa-calendar"></i> <?php echo date('d M',strtotime($el->inspection_date)); ?></small></h3>

							</div>

						    </div><!-- /.box -->

						<?php endforeach; 

					} else {

						echo '<div class="box-header bg-warning"><div style="padding:5px">';

						echo Yii::t('app', 'No Birthday within 30 days duration');

						echo '</div></div>';

					}

					?>

				    </div>

                                </div> <!--  /.tab-content -->

                            </div><!-- /.nav-tabs-custom -->


			    <!-- TO DO List -->

                            <div class="box box-primary">

                                <div class="box-header with-border">

                                    <h3 class="box-title <?= (Yii::$app->language == 'ar') ? 'pull-right' : ''; ?>"><i class="fa fa-sitemap"></i> <?php echo Yii::t('app', 'Tariff Classes') ?></h3>

                                </div><!-- /.box-header -->

                                <div class="box-body">

                     <ul class="todo-list" id="coursList">

				     <?php 

					$categoryList = app\modules\consumers\models\BuildingTariff::find()->all(); 

					foreach($categoryList as $cl) :

				     ?>

                                        <li>

                                            <span class="handle">

                                                <i class="fa fa-ellipsis-v"></i>

                                                <i class="fa fa-ellipsis-v"></i>

                                            </span>

                                            <span class="text"><?php echo $cl->tariff_code;?></span>

                                            <?php $buildingCount = app\modules\consumers\models\Building::find()->where(['tariff_id' => $cl->tariff_id])->count();?>

					    <span class="notification-container <?= (Yii::$app->language == 'ar') ? 'pull-left' : 'pull-right'; ?> text-teal" title="<?= $buildingCount; ?> Buildings"><i class="fa fa-users"></i><span class="label label-info notification-counter"><?= $buildingCount; ?></span></span>

                                        </li>

				     <?php endforeach; ?>

                                    </ul>

                                </div><!-- /.box-body -->

                            </div><!-- /.box -->


                        </section><!-- right col -->

                    </div><!-- /.row (main row) -->


                </section><!-- /.content -->






Debug login action step by step, enable login maby it will give us more details.

I debugged the login and it’s okay.

I don’t understand what you mean by enable login

Site Controller




<?php


namespace app\controllers;


use Yii;

use yii\filters\AccessControl;

use yii\web\Controller;

use yii\filters\VerbFilter;

use app\models\LoginForm;

use app\models\ContactForm;

use app\models\User;

use app\modules\consumers\models\BuildingManager;

use app\modules\consumers\models\Building;

use app\modules\zonal\models\ZonalAdministrator;

use app\modules\contractors\models\Inspector;

use app\modules\inspection\models\InspectionPlan;

use app\models\City;

use app\models\State;

use app\models\Zone;

use yii\helpers\Json;

use app\models\AuthAssignment;

use yii\base\Exception;








class SiteController extends Controller

{

    public function behaviors()

    {

        return [

            'access' => [

                'class' => AccessControl::className(),

                'only' => ['logout'],

                'rules' => [

                    [

                        'actions' => ['logout'],

                        'allow' => true,

                        'roles' => ['@'],

                    ],

                ],

            ],

            'verbs' => [

                'class' => VerbFilter::className(),

                'actions' => [

                    'logout' => ['post'],

                ],

            ],

        ];

    }


    public function actions()

    {

        return [

            'error' => [

                'class' => 'yii\web\ErrorAction',

            ],

            'captcha' => [

                'class' => 'yii\captcha\CaptchaAction',

                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,

            ],

        ];

    }




    public function actionIndex()

    {

    $this->layout = 'homePage';

    if (\Yii::$app->user->isGuest)

        return $this->redirect(['site/login']);

        else 

        {

            $isManager = Yii::$app->session->get('building_id');

            $isContractor = Yii::$app->session->get('company_id');

            $isZonal = Yii::$app->session->get('zonal_id');

            if(isset($isManager)) 

            {

                return $this->render('manager-dashboard');

            }

          else if(isset($isContractor))

            return $this->render('contractor-dashboard');

          else if(isset($isZonal))

            return $this->render('zonal-dashboard');        

            else

                return $this->render('user-dashboard');

        }

    }




    public function actionLogin()

    {

        if (!\Yii::$app->user->isGuest) {

            return $this->goHome();

        }


    $model = new LoginForm();

    $login = new \app\models\LoginDetails();

    if ($model->load(Yii::$app->request->post())) {

        $log = \app\models\User::find()->where(['user_login_id' => $_POST['LoginForm']['username'], 'is_block' => 0])->one();

   //    die(var_dump($log));

        if(empty($log)) {

            \Yii::$app->session->setFlash('loginError', '<i class="fa fa-warning"></i><b> Incorrect username or password. !</b>');

                return $this->render('login', ['model' => $model]);

        }

        

        $login->login_user_id = $log['user_id'];

        $loginuser = $login->login_user_id;




        $contractorlogin = Inspector::find()->andWhere(['contractor_user_id'=>$loginuser])->one();

        $managerlogin = Building::find()->andWhere(['building_user_id'=>$loginuser])->one();

        $zonallogin = ZonalAdministrator::find()->andWhere(['zonal_administrator_user_id'=>$loginuser])->one();

        if($managerlogin)

        {

            \Yii::$app->session->set('building_id',$managerlogin->building_id);

        }

        else if($contractorlogin)

        {

            \Yii::$app->session->set('company_id',$contractorlogin->company_id);

        }

        else if($zonallogin)

        {

            \Yii::$app->session->set('zonal_id',$zonallogin->zonal_id);

        }        

        else if(!$contractorlogin && !$managerlogin&& !$zonallogin)

        {

            \Yii::$app->session->set('admin_user',$loginuser);

        }

        else {

              \Yii::$app->session->setFlash('loginError', '<i class="fa fa-warning"></i><b> These Login credentials are Blocked/Deactive by Admin</b>');

              return $this->render('login', ['model' => $model,]);  

        }


        $login->login_status = 1;

        $login->login_at = new \yii\db\Expression('NOW()');

        $login->user_ip_address=$_SERVER['REMOTE_ADDR'];

        $login->save(false);

   ///*     

        if($model->login()) {

    //        if(!isset(Yii::$app->request->cookies['language'])) {

    //            return $this->redirect(['language']);

     //       } else

                return $this->goBack(); 

        }

        else

            return $this->render('login', ['model' => $model,]);

     //   */

        } 

        else {

            return $this->render('login', [

                'model' => $model,

            ]);

        }

    }


    public function actionLogout()

    {

        if(isset(Yii::$app->user->id))

        \app\models\LoginDetails::updateAll(['login_status' => 0, 'logout_at'=> new \yii\db\Expression('NOW()')],'login_user_id='.Yii::$app->user->id.' AND login_status = 1'); 

                

        Yii::$app->user->logout();

        return $this->goHome();

    }


    public function actionForgotpassword()

    {

        $model = new LoginForm();

        return $this->render('forgotpassword', ['model'=>$model,]);

    }




    public function actionLoadimage()

    {

        $model = \app\models\Organization::find()->asArray()->all();


        header('Pragma: public');

        header('Expires: 0');

        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');

        header('Content-Transfer-Encoding: binary');

        header('Content-type: '.$model[0]['org_logo_type']);

        echo $model[0]['org_logo'];  

    

    }


    public function actionAbout()

    {

        return $this->render('about');

    }


}




Login View




<?php

use yii\helpers\Html;

use yii\widgets\ActiveForm;

$this->title = Yii::t('app', 'ESS | Login');

?>


<div class="title-box">

  <div class="title-box-body title-header">

    <h1> ELECTRICAL SAFETY STANDARD SOLUTION </h1>

  </div>

</div>


<div class="login-box">

      <div class="login-logo">

   <!-- &nbsp;  -->


      </div><!-- /.login-logo -->

      <div class="login-box-body login-header">

 <!--   <h1>USER LOGIN</h1>  -->

 <h1><?= Html::img(Yii::$app->request->baseUrl.'/images/product.png', ['width'=>'120px;']) ?></h1>

      </div>

      <div class="login-box-body">

    

        <p class="login-box-msg"><?php echo Yii::t('app', 'Please fill out the following fields to login') ?></p>

  <?php $form = ActiveForm::begin(['id' => 'login-form',

                                'options' => ['enctype' => 'multipart/form-data'],

                                //'enableAjaxValidation' => true,

                                'method'=>'post',

                                 ]); ?>

          <div class="form-group has-feedback">

       <?= $form->field($model, 'username')->textInput(['placeholder'=>Yii::t('app', 'Username'), 'class'=>'form-control'])->label(false) ?>

            <span class="glyphicon glyphicon-user form-control-feedback"></span>

          </div>

          <div class="form-group has-feedback">

      <?= $form->field($model, 'password')->passwordInput(['class'=>'form-control', 'placeholder'=>Yii::t('app', 'Password')])->label(false) ?>

            <span class="glyphicon glyphicon-lock form-control-feedback"></span>

          </div>

          <div class="row">

            <div class="col-xs-7">    

              <div class="checkbox icheck">

    <?= $form->field($model, 'rememberMe')->checkbox() ?>

              </div>                        

            </div><!-- /.col -->

            <div class="col-xs-5">

  <!--      <input type="submit" class="btn btn-primary btn-block btn-flat" name="login-button" id="submit_entry" value="Login" />-->

  <?= Html::submitButton(Yii::t('app', 'Login'), ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']) ?>

            </div><!-- /.col -->

          </div>


        <!--a href="#">I forgot my password</a--><br>

      </div><!-- /.login-box-body -->


<?php ActiveForm::end(); ?>


      <?php if(\Yii::$app->session->hasFlash('loginError')) : ?>

      <div class="alert alert-danger alert-dismissible" style="margin-top: 5%;">

    <button type="button" class="close" data-dismiss="alert" aria-label="Close">

    <span aria-hidden="true">&times;</span></button>

    <?php echo \Yii::$app->session->getFlash('loginError'); ?>

      </div>

       <?php endif; ?>


     

<div class="logmod__alter">

  <?php $form = ActiveForm::begin(['id' => 'manager-form',

                                'options' => ['enctype' => 'multipart/form-data'],

                                //'enableAjaxValidation' => true,

                                'method'=>'post',

                                 ]); ?>

      <div class="login-box-body login-manager">

        

        <!--<button type="button" class="btn btn-block btn-primary btn-lg"><span>New Manager? <strong>Create Building Manager</strong></span></button>-->

 <!--       <input type="submit" class="btn btn-block btn-primary btn-lg" name="manager-button" id="submit_entry" value="New Manager? Create Building Manager" />-->

<?= Html::SubmitButton(Yii::t('app', '<span>New Manager? <strong>Create Building Manager</strong></span>'), ['class' => 'btn btn-block btn-primary btn-lg', 'name' => 'manager-button']) ?>

      </div>

<?php ActiveForm::end(); ?>

  <?php $form = ActiveForm::begin(['id' => 'inspector-form',

                                'options' => ['enctype' => 'multipart/form-data'],

                                //'enableAjaxValidation' => true,

                                'method'=>'post',

                                 ]); ?>

      <div class="login-box-body login-contractor">

  <?= Html::SubmitButton(Yii::t('app', '<span>New Inspector? <strong>Create Inspector Account</strong></span>'), ['class' => 'btn btn-block btn-success btn-lg', 'name' => 'inspector-button']) ?>       


      </div>

<?php ActiveForm::end(); ?>

</div>


 

    </div><!-- /.login-box -->




View: user-dashboard




<?php 

use yii\helpers\Html;

use yii\helpers\Url;


$this->title = Yii::t('app', 'Admin Dashboard'); 

$this->params['breadcrumbs'][] = $this->title;

?>

<script>

$(document).ready(function(){

    $('.tab-content').slimScroll({

        height: '300px'

    });

});

$(document).ready(function(){

    $('#coursList').slimScroll({

        height: '250px'

    });

});

</script>

<style>

.tab-content {

   padding:15px;

}

.box .box-body .fc-widget-header {

    background: none;

}

.popover{

    max-width:450px;   

}

</style>


<?php

$this->registerJs(

"$(function() {

	$('.noticeModalLink').click(function() {

		$('#NoticeModal').modal('show')

		.find('#NoticeModalContent')

		.load($(this).attr('data-value'));

	});

});");


$this->registerJs(

"$('body').on('click', function (e) {

    $('[data-toggle=\"popover\"]').each(function () {

        if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {

            $(this).popover('hide'); 

        }

    });

});"

)

?>


<?php

	yii\bootstrap\Modal::begin([

	    'header' => '<h4><i class="fa fa-eye"></i> '.Yii::t('app', 'View Notice Details').'</h4>',

	    'id'=>'NoticeModal',

	]);

	echo '<div id="NoticeModalContent"></div>';

	yii\bootstrap\Modal::end();

?>


    <!-- Main content -->

    <section class="content">


                    <!-- Small boxes (Stat box) -->

		<?php $managerMsg= app\modules\dashboard\models\MsgOfDay::find()->where('is_status = 0  AND (msg_user_type = "M" OR msg_user_type = "0")')->one();

		if(!empty($managerMsg)) :

		?>

		<div class="callout callout-info msg-of-day">

			    <h4><i class="fa fa-bullhorn"></i> <?php echo Yii::t('app', 'Message of day box') ?></h4>

			    <p><marquee onmouseout="this.setAttribute('scrollamount', 6, 0);" onmouseover="this.setAttribute('scrollamount', 0, 0);" scrollamount="6" behavior="scroll" direction="left"><?= $managerMsg->msg_details; ?></marquee></p>

		</div>

		<?php endif; ?>


                    <div class="row">

                        <div class="col-lg-3 col-xs-6">

                            <!-- small box -->

                            <div class="small-box bg-aqua">

                                <div class="inner">

                                    <h3>

                                      <?= app\modules\consumers\models\BuildingManager::find()->count(); ?>

                                    </h3>

                                    <p>

                                        <?php echo Yii::t('app', 'Managers') ?>

                                    </p>

                                </div>

                                <div class="icon">

                                    <i class="ion ion-ios-people"></i>

                                </div>

								<?= Html::a(Yii::t('app', 'More info').' <i class="fa fa-arrow-circle-right"></i>', ['/consumers/building-manager/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>

                                       <?= app\modules\contractors\models\Inspector::find()->count(); ?>

                                    </h3>

                                    <p>

                                        <?php echo Yii::t('app', 'Contractors') ?>

                                    </p>

                                </div>

                                <div class="icon">

                                    <i class="ion ion-person"></i>

                                </div>

									<?= Html::a(Yii::t('app', 'More info').' <i class="fa fa-arrow-circle-right"></i>', ['/contractors/inspector/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-yellow">

                                <div class="inner">

                                    <h3>

                                        <?= app\modules\consumers\models\BuildingTariff::find()->count(); ?>

                                    </h3>

                                    <p>

                                        <?php echo Yii::t('app', 'Tariff Classes') ?>

                                    </p>

                                </div>

                                <div class="icon">

                                    <i class="fa fa-sitemap"></i>

                                </div>

										<?= Html::a(Yii::t('app', 'More info').' <i class="fa fa-arrow-circle-right"></i>', ['/consumers/building-tariff/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-red">

                                <div class="inner">

                                    <h3>

                                        <?= app\modules\inspection\models\InspectionPlan::find()->count(); ?>

                                    </h3>

                                    <p>

                                        <?php echo Yii::t('app', 'Inspection Plan') ?>

                                    </p>

                                </div>

                                <div class="icon">

                                    <i class="fa fa-book"></i>

                                </div>

                                <?= Html::a(Yii::t('app', 'More info').' <i class="fa fa-arrow-circle-right"></i>', ['/inspection/Inspection-plan/index'], ['target' => '_blank', 'class' => 'small-box-footer']); ?>

                            </div>

                        </div><!-- ./col -->


                    </div><!-- /.row -->


                    <!-- Main row -->

                    <div class="row">

                        <!-- Left col -->

                        <section class="col-lg-7 connectedSortable">


			   <div class="nav-tabs-custom"><!-- .nav-tabs-custom -->

                                <!-- Tabs within a box -->

                                <ul class="nav nav-tabs pull-right">

                                    <li><a href="#contractor-notice" data-toggle="tab"><?php echo Yii::t('app', 'Contractors') ?></a></li>

                                    <li><a href="#manager-notice" data-toggle="tab"><?php echo Yii::t('app', 'Managers') ?></a></li>

				    <li class="active"><a href="#all-notice" data-toggle="tab"><?php echo Yii::t('app', 'General') ?></a></li>

                                    <li class="pull-left header"><i class="fa fa-inbox"></i><?php echo Yii::t('app', 'Notice Board') ?></li>

                                </ul>

                                <div class="tab-content">

                                    <!-- Notice -->

                                    <div class="tab-pane active" id="all-notice">

					

					<?php $noticeList = app\modules\dashboard\models\Notice::find()->where("is_status = 0 AND notice_user_type = '0'")->all();


				    if(!empty($noticeList)) {

					foreach($noticeList as $nl) :

					?>

					<div class="notice-main bg-light-blue">

						<div class="notice-disp-date">				        		<small class="label label-success"><i class="fa fa-calendar"></i> <?= (!empty($nl->notice_date) ? Yii::$app->formatter->asDate($nl->notice_date) : "Not Set"); ?></small>	

						</div>

						<div class="notice-body">

							 <div class="notice-title"><?= Html::a($nl->notice_title, '#', ['style' => 'color:#FFF', 'class'=>'noticeModalLink', 'data-value'=>Url::to(['dashboard/notice/view-popup','id'=>$nl->notice_id])]); ?>&nbsp; </div>

							 <div class="notice-desc"><?= $nl->notice_description; ?> </div>

						</div>					          

					</div>

					<?php endforeach; 

				     } else {

						echo '<div class="box-header bg-warning"><div style="padding:5px">';

						echo Yii::t('app', 'No Notice....');

						echo '</div></div>';

				     }

					?>

				    </div>

                                    <div class="tab-pane" id="manager-notice">

					

					<?php $noticeList = app\modules\dashboard\models\Notice::find()->where("is_status = 0 AND notice_user_type = 'M'")->all();


				    if(!empty($noticeList)) {

					foreach($noticeList as $nl) :

					?>

					 <div class="notice-main bg-aqua">

						<div class="notice-disp-date">				        		<small class="label label-success"><i class="fa fa-calendar"></i> <?= (!empty($nl->notice_date) ? Yii::$app->formatter->asDate($nl->notice_date) : "Not Set"); ?></small>	

						</div>

						<div class="notice-body">

							 <div class="notice-title"><?= Html::a($nl->notice_title, '#', ['style' => 'color:#FFF', 'class'=>'noticeModalLink', 'data-value'=>Url::to(['dashboard/notice/view-popup','id'=>$nl->notice_id])]); ?>&nbsp; </div>

							 <div class="notice-desc"><?= $nl->notice_description; ?> </div>

						</div>					          

					</div>

					<?php endforeach;

				      } else {

						echo '<div class="box-header bg-warning"><div style="padding:5px">';

						echo Yii::t('app', 'No Notice....');

						echo '</div></div>';

				      }

					?>

				    </div>

				    <div class="tab-pane" id="contractor-notice">

					

					<?php $noticeList = app\modules\dashboard\models\Notice::find()->where("is_status = 0 AND notice_user_type = 'C'")->all();


				    if(!empty($noticeList)) {

					foreach($noticeList as $nl) :

					?>

					 <div class="notice-main bg-teal">

						<div class="notice-disp-date">	<small class="label label-success"><i class="fa fa-calendar"></i> <?= (!empty($nl->notice_date) ? Yii::$app->formatter->asDate($nl->notice_date) : "Not Set"); ?></small>	

						</div>

						<div class="notice-body">

							 <div class="notice-title"><?= Html::a($nl->notice_title, '#', ['style' => 'color:#FFF', 'class'=>'noticeModalLink', 'data-value'=>Url::to(['dashboard/notice/view-popup','id'=>$nl->notice_id])]); ?>&nbsp; </div>

							 <div class="notice-desc"><?= $nl->notice_description; ?> </div>

						</div>					          

					</div>

					<?php endforeach;

				      } else {

						echo '<div class="box-header bg-warning"><div style="padding:5px">';

						echo Yii::t('app', 'No Notice....');

						echo '</div></div>';

				      }

					?>

				    </div>

                                </div> <!--  /.tab-content -->

                            </div><!-- /.nav-tabs-custom -->


			    <!-- Calendar -->

                            <div class="box box-info">

                                <div class="box-header with-border">

                                    <h3 class="box-title <?= (Yii::$app->language == 'ar') ? 'pull-right' : '' ?>"><i class="fa fa-calendar"></i> <?php echo Yii::t('app', 'Calendar') ?></h3>

                                </div><!-- /.box-header -->

                                <div class="box-body">

                                    <!--The calendar -->

	<?php

	$JSEventClick = <<<EOF

		function(event, jsEvent, view) {

		    $('.fc-event').on('click', function (e) {

			$('.fc-event').not(this).popover('hide');

		    });

		}

EOF;

	$eDetail = Yii::t('app', 'Event Detail');

	$eType = Yii::t('app', 'Event Type');

	$eStart = Yii::t('app', 'Start Time');

	$eEnd = Yii::t('app', 'End Time');

	$JsF = <<<EOF

		function (event, element) {

			var start_time = moment(event.start).format("DD-MM-YYYY, h:mm:ss a");

		    	var end_time = moment(event.end).format("DD-MM-YYYY, h:mm:ss a");


			element.clickover({

		            title: event.title,

		            placement: 'top',

		            html: true,

			    global_close: true,

			    container: 'body',

		            content: "<table class='table'><tr><th> {$eDetail} : </th><td>" + event.description + " </td></tr><tr><th> {$eType} : </th><td>" + event.event_type + "</td></tr><tr><th> {$eStart} : </t><td>" + start_time + "</td></tr><tr><th> {$eEnd} : </th><td>" + end_time + "</td></tr></table>"

        		});

               }

EOF;

	?>

                            <?= \yii2fullcalendar\yii2fullcalendar::widget([

					'options' => ['language' => 'en',],

					'clientOptions' => [

						'fixedWeekCount' => false,

						'weekNumbers'=>true,

						'editable' => true,

						'eventLimit' => true,

						'eventLimitText' => 'more Events',

						'header' => [

							'left' => 'prev,next today',

							'center' => 'title',

							'right' => 'month,agendaWeek,agendaDay'

						],

						'eventClick' => new \yii\web\JsExpression($JSEventClick),

						'eventRender' => new \yii\web\JsExpression($JsF),

						'contentHeight' => 380,

						'timeFormat' => 'hh(:mm) A', 

					],

					'ajaxEvents' => yii\helpers\Url::toRoute(['/dashboard/events/view-events'])

				]);

			    ?>

				   <div class="row">

					<ul class="legend">

					    <li><span class="importantnotice"></span> <?php echo Yii::t('app', 'Important Notice') ?></li>

					</ul>

				   </div>

                                </div><!-- /.box-body -->

                            </div><!-- /.box -->


                        </section><!-- /.Left col -->

                        <!-- right col (We are only adding the ID to make the widgets sortable)-->

                        <section class="col-lg-5 connectedSortable">


			    <div class="nav-tabs-custom"><!-- .nav-tabs-custom -->

                                <!-- Tabs within a box -->

                                <ul class="nav nav-tabs pull-right">

                                    <li><a href="#birth-upcoming" data-toggle="tab"><?php echo Yii::t('app', 'Upcoming') ?></a></li>

				    <li class="active"><a href="#birth-taday" data-toggle="tab"><?php echo Yii::t('app', "Today's Inspection") ?></a></li>

                                    <li class="pull-left header" style="<?= (Yii::$app->language == 'ar') ? 'left:26%' : ''; ?>"><i class="fa fa-book"></i><?php echo Yii::t('app', 'Inspection Bookings') ?></li>

                                </ul>

                    <div class="tab-content">

                                    <!-- Birthdays -->

				    <div class="tab-pane active" id="birth-taday">

					<?php $inspectionList = app\modules\inspection\models\InspectionBooking::find()->where(["LIKE", "inspection_date", date('m-d')])->all();

					if(!empty($inspectionList)) {

						foreach($inspectionList as $el) :

						?>

						    <div class="box box-solid bg-aqua">

							<div class="box-header">

							    <div class="pull-left" style="padding:5px">

		                            <img src="<?= Yii::getAlias('@web').'/data/consumer_images/no-photo.png'; ?>" class="img-circle" alt="no image" width="40px" height="40px">

		                        </div>

							<h3 class="box-title"><?php echo $el->building->building_name; ?>&nbsp;

							<small class="label label-success"><i class="fa fa-calendar"></i> <?php echo date('d M',strtotime($el->inspection_date)); ?></small></h3>

							</div>

						    </div><!-- /.box -->

						<?php endforeach; 

					} else {

						echo '<div class="box-header bg-warning"><div style="padding:5px">';

						echo Yii::t('app', 'No Inspection Today');

						echo '</div></div>';

					}

					?>

				    </div>

                    <div class="tab-pane" id="birth-upcoming">

					<?php $inspLi = "SELECT * FROM  inspection_booking WHERE  DATE_ADD(inspection_date, INTERVAL YEAR(CURDATE())-YEAR(inspection_date) + IF(DAYOFYEAR(CURDATE()) > DAYOFYEAR(inspection_date),1,0) YEAR) BETWEEN CURDATE()+1 AND DATE_ADD(CURDATE(), INTERVAL 30 DAY)";

					$inspectionList = app\modules\inspection\models\InspectionBooking::findBySql($inspLi)->all(); 

					if(!empty($inspectionList)) {

						foreach($inspectionList as $el) :

						?>

						    <div class="box box-solid bg-aqua">

							<div class="box-header">

							    <div class="pull-left" style="padding:5px">

		                            <img src="<?= Yii::getAlias('@web').'/data/consumer_images/no-photo.png'; ?>" class="img-circle" alt="no image" width="40px" height="40px">

		                        </div>

							    <h3 class="box-title"><?php echo $el->building->building_name; ?>&nbsp;

							    <small class="label label-warning"><i class="fa fa-calendar"></i> <?php echo date('d M',strtotime($el->inspection_date)); ?></small></h3>

							</div>

						    </div><!-- /.box -->

						<?php endforeach; 

					} else {

						echo '<div class="box-header bg-warning"><div style="padding:5px">';

						echo Yii::t('app', 'No Birthday within 30 days duration');

						echo '</div></div>';

					}

					?>

				    </div>

                                </div> <!--  /.tab-content -->

                            </div><!-- /.nav-tabs-custom -->


			    <!-- TO DO List -->

                            <div class="box box-primary">

                                <div class="box-header with-border">

                                    <h3 class="box-title <?= (Yii::$app->language == 'ar') ? 'pull-right' : ''; ?>"><i class="fa fa-sitemap"></i> <?php echo Yii::t('app', 'Tariff Classes') ?></h3>

                                </div><!-- /.box-header -->

                                <div class="box-body">

                     <ul class="todo-list" id="coursList">

				     <?php 

					$categoryList = app\modules\consumers\models\BuildingTariff::find()->all(); 

					foreach($categoryList as $cl) :

				     ?>

                                        <li>

                                            <span class="handle">

                                                <i class="fa fa-ellipsis-v"></i>

                                                <i class="fa fa-ellipsis-v"></i>

                                            </span>

                                            <span class="text"><?php echo $cl->tariff_code;?></span>

                                            <?php $buildingCount = app\modules\consumers\models\Building::find()->where(['tariff_id' => $cl->tariff_id])->count();?>

					    <span class="notification-container <?= (Yii::$app->language == 'ar') ? 'pull-left' : 'pull-right'; ?> text-teal" title="<?= $buildingCount; ?> Buildings"><i class="fa fa-users"></i><span class="label label-info notification-counter"><?= $buildingCount; ?></span></span>

                                        </li>

				     <?php endforeach; ?>

                                    </ul>

                                </div><!-- /.box-body -->

                            </div><!-- /.box -->


                        </section><!-- right col -->

                    </div><!-- /.row (main row) -->


                </section><!-- /.content -->