Hi,
It is working.
I have created 8 tabs on my view page as follows:
- Personal
- Contact
- Education
- Work Experience
- Dependents
- Job
- Bank
- Training
Here the content to be displayed in 8th tab doesn’t appears in the tab but get displayed on the view page and not in the tab. So whichever tab I open , the content gets displayed out of the tab area .
I have attached the images below, where in image file named image.png shows the content of tab 8 (Training) displayed outside the tab area.
And also the second image, file named image_view.png shows the content of tab 8 displayed at the bottom.
I want the content of tab 8 should be displayed only in tab 8. How to accomplish this?
Similarly in second image where Bank details are displayed, the header of the table is going outside of the tab? How to resolve this?
Below is the code of my view page:
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use app\models\Employee;
use yii\jui\Tabs;
/* @var $this yii\web\View */
/* @var $model app\models\Employee */
echo Html::a('<span class="glyphicon glyphicon-list"></span> List', ['index'], ['class' => 'btn btn-primary']);
$this->title = $model->EmpId;
$this->params['breadcrumbs'][] = ['label' => 'Employees', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<p>
<?php $this->beginBlock('personal'); ?>
<div class="row">
<div class="col-sm-8">
<b><?= (Html::img('@web/uploadedimages/'.$model->Photo, ['width'=>'100', 'height'=>'100'])) ?> </b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>Employee</b>
</div>
<div class="col-sm-3">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo Html::encode($emp->FirstName)." ".Html::encode($emp->MiddleName)." ".Html::encode($emp->LastName);
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b> Date of Birth</b>
</div>
<div class="col-sm-3">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->DOB;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b> Gender</b>
</div>
<div class="col-sm-3">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->Gender;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b> Marital Status</b>
</div>
<div class="col-sm-3">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->MaritalStatus;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>PAN Number</b>
</div>
<div class="col-sm-3">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->PANNumber;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b> Aadhar Card No</b>
</div>
<div class="col-sm-3">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->AadharCardNo;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>Username</b>
</div>
<div class="col-sm-3">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->username;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>Password</b>
</div>
<div class="col-sm-3">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->password;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>Login Status</b>
</div>
<div class="col-sm-3">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->LoginStatus;
?>
</b>
</div>
</div>
<br>
<?php $this->endBlock(); ?>
<?php $this->beginBlock('contact'); ?>
<div class="row">
<div class="col-sm-3">
<b>Address</b>
</div>
<div class="col-sm-5">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->AddressStreet1." ".$emp->AddressStreet2." ".$emp->City." - ".$emp->Pincode." , ".$emp->State." , ".$emp->Country;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>Work Telephone</b>
</div>
<div class="col-sm-5">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->HomeTelephone;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>Home Telephone</b>
</div>
<div class="col-sm-5">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->WorkTelephone
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>Mobile</b>
</div>
<div class="col-sm-5">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
$empmobile= $emp->employeemobiles;
foreach($empmobile as $empmobiles)
{
echo $empmobiles['Mobile']." , ";
}
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>Email</b>
</div>
<div class="col-sm-5">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->Email;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>Reference Person 1</b>
</div>
<div class="col-sm-5">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->ReferencePerson1." - ".$emp->ReferenceContact1;
?>
</b>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<b>Reference Person 2</b>
</div>
<div class="col-sm-5">
<b>
<?php
$emp = Employee::findOne($model->EmpId);
echo $emp->ReferencePerson2." - ".$emp->ReferenceContact2;
?>
</b>
</div>
</div>
<br>
<?php $this->endBlock(); ?>
<?php $this->beginBlock('education'); ?>
<div class="table-responsive">
<div class="container">
<table class="table table-bordered ">
<thead>
<tr bgcolor='#B8B8B8'>
<th>Institution</th>
<th>University</th>
<th>Year of Passing</th>
<th>Stream</th>
<th>Educational Level</th>
<th>Percentage</th>
</tr>
</thead>
<tbody>
<?php
$emp = Employee::findOne($model->EmpId);
$empeducation= $emp->employeeeducations;
foreach($empeducation as $empeducations)
{
echo "<tr>";
echo "<td><b>".$empeducations['Institution']."</b></td>";
echo "<td><b>".$empeducations['University']."</b></td>";
echo "<td><b>".$empeducations['YearOfPassing']."</b></td>";
echo "<td><b>".$empeducations['Stream']."</b></td>";
echo "<td><b>".$empeducations['EducationalLevel']."</b></td>";
echo "<td><b>".$empeducations['Percentage']."</b></td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
<?php $this->endBlock(); ?>
<?php $this->beginBlock('workexprience'); ?>
<div class="table-responsive">
<div class="container">
<table class="table table-bordered">
<thead>
<tr bgcolor='#B8B8B8'>
<th>Organization</th>
<th>Job Title</th>
<th>Job Description</th>
<th>From Date</th>
<th>To Date</th>
<th>Years of Experience</th>
</tr>
</thead>
<tbody>
<?php
$emp = Employee::findOne($model->EmpId);
$empworkexp= $emp->employeeworkexperiences;
foreach($empworkexp as $empworkexps)
{
echo "<tr>";
echo "<td><b>".$empworkexps['Organization']."</b></td>";
echo "<td><b>".$empworkexps['JobTitle']."</b></td>";
echo "<td><b>".$empworkexps['JobDescription']."</b></td>";
echo "<td><b>".$empworkexps['FromDate']."</b></td>";
echo "<td><b>".$empworkexps['ToDate']."</b></td>";
echo "<td><b>".$empworkexps['YearsOfExperience']."</b></td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
<?php $this->endBlock(); ?>
<?php $this->beginBlock('dependents'); ?>
<div class="table-responsive">
<div class="container">
<table class="table table-bordered">
<thead>
<tr bgcolor='#B8B8B8'>
<th>Name</th>
<th>Relationship</th>
<th>Date of Birth</th>
<th>Occupation</th>
</tr>
</thead>
<tbody>
<?php
$emp = Employee::findOne($model->EmpId);
$empdependents= $emp->employeedependents;
foreach($empdependents as $empdependents1)
{
echo "<tr>";
echo "<td><b>".$empdependents1['Name']."</b></td>";
echo "<td><b>".$empdependents1['Relationship']."</b></td>";
echo "<td><b>".$empdependents1['DateOfBirth']."</b></td>";
echo "<td><b>".$empdependents1['Occupation']."</b></td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
<?php $this->endBlock(); ?>
<?php $this->beginBlock('job'); ?>
<div class="table-responsive">
<div class="container">
<table class="table table-bordered">
<thead>
<tr bgcolor='#B8B8B8'>
<th>Designation</th>
<th>Employment Status</th>
<th>Joined Date</th>
<th>Department</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<?php
$emp = Employee::findOne($model->EmpId);
$empjob= $emp->employeejobs;
foreach($empjob as $empjobs)
{
echo "<tr>";
echo "<td><b>".$empjobs['Job_Title']."</b></td>";
echo "<td><b>".$empjobs['EmploymentStatus']."</b></td>";
echo "<td><b>".$empjobs['JoinedDate']."</b></td>";
echo "<td><b>".$empjobs['Department']."</b></td>";
echo "<td><b>".$empjobs['Salary']."</b></td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
<?php $this->endBlock(); ?>
<?php $this->beginBlock('bank'); ?>
<div class="container">
<table class="table table-bordered">
<thead>
<tr bgcolor='#B8B8B8'>
<th>Bank</th>
<th>Branch</th>
<th>IFSC Code</th>
<th>Account Number</th>
</tr>
</thead>
<tbody>
<?php
$emp = Employee::findOne($model->EmpId);
$empbank = $emp->employeebanks;
foreach($empbank as $empbanks)
{
echo "<tr>";
echo "<td><b>".$empbanks['BankName']."</b></td>";
echo "<td><b>".$empbanks['Branch']."</b></td>";
echo "<td><b>".$empbanks['IFSCCode']."</b></td>";
echo "<td><b>".$empbanks['AccountNumber']."</b></td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
<?php $this->endBlock(); ?>
<?php $this->beginBlock('training'); ?>
<b>hello</b>
<?php $this->endBlock(); ?>
<?php echo Tabs::Widget([
'items' => [
[
'label' => 'Personal',
'content' => $this->blocks['personal'],
'active' => true,
],
[
'label' => 'Contact',
'content' => $this->blocks['contact'],
],
[
'label' => 'Education',
'content' => $this->blocks['education'],
],
[
'label' => 'Work Experience',
'content' => $this->blocks['workexprience'],
],
[
'label' => 'Dependents',
'content' => $this->blocks['dependents'],
],
[
'label' => 'Job',
'content' => $this->blocks['job'],
],
[
'label' => 'Bank',
'content' => $this->blocks['bank'],
],
[
'label' => 'Training',
'content' => $this->blocks['training'],
],
]
]);
?>