Example #1
0
    $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">

        <?php 
Example #2
0
</small></h3>
					</div>
				    </div><!-- /.box -->
				<?php 
    }
} else {
    echo '<div class="box-header bg-warning"><div style="padding:5px">';
    echo "No Birthday Today";
    echo '</div></div>';
}
?>
		    </div>
                    <div class="tab-pane" id="birth-upcoming">
			<?php 
$empLi = "SELECT * FROM  emp_info WHERE  DATE_ADD(emp_dob, INTERVAL YEAR(CURDATE())-YEAR(emp_dob) + IF(DAYOFYEAR(CURDATE()) > DAYOFYEAR(emp_dob),1,0) YEAR) BETWEEN CURDATE()+1 AND DATE_ADD(CURDATE(), INTERVAL 30 DAY)";
$empList = app\modules\employee\models\EmpInfo::findBySql($empLi)->all();
if (!empty($empList)) {
    foreach ($empList as $el) {
        ?>
				    <div class="box box-solid bg-aqua">
					<div class="box-header">
					    <div class="pull-left" style="padding:5px">
                                               <img src="<?php 
        echo $el->getEmpPhoto($el->emp_photo);
        ?>
" class="img-circle" alt="no image" width="40px" height="40px">
                                            </div>
					    <h3 class="box-title"><?php 
        echo $el->getEmpName();
        ?>
&nbsp;