<style>
.glance1{
font-weight:900 !important;font-size:18px;background-color:#28A745; 
}    
table {font-size:13px !important;}

.dash-item{width:50%;float:left;padding:5px;}

tr td a{text-decoration:none;color:green;}

/*.dash-item-section h5{}*/


.dash-div{
box-shadow: 0 0 8px #EAEDED;
border-left:5px solid #F05A59;
border-radius:15px;
/*min-height:100px;*/
height:auto !important;
width:100%;
}

.dash-row{
min-height:45px;
padding:2px;
}
.dash-item a{
text-decoration:none;color:#000;font-style:italic;font-weight:400 !important;
}
.dash-row .dash-item{
float:left;width:49%;
margin-right:1%;
box-shadow:0 0 5px silver;
color:#ccc;
}

.dash-item:hover{background:silver;}
</style>
<div class="container mt-3 mb-3">
<div class="row">
<div class="col-sm-12"><?php $cdate =date('d/m/y,h:i:s'); ?>    

<p style="text-align:right">Welcome <b>&nbsp; <?php if($this->session->userdata('teacher_name')){
$teacher_name=$this->session->userdata('teacher_name');
echo $teacher_name; }?></b> | <?php echo "Your Last Login at :&nbsp;"; echo $cdate; ?></p>
<p style="text-align:right"><a href="<?php echo base_url();?>school/profile">Profile</a> | <a href="<?php echo base_url();?>login/change_password">Change Password</a> | <a href="<?php echo base_url();?>Logout">Logout</a></p>
</div>    
<div class="col-sm-12">

<p class="text-center  text-center p-2 glance1">
 <span class="text-white">Executive Information Panel </span>
</p>
<ul class="list-group">
    <li class="list-group-item  list-group-item-success d-flex justify-content-between align-items-center">
     School Strength
      <span class="badge badge-warning badge-pill text-blue">
<?php 
$table='student';
$all_student=$this->FeeModel->fetch_all_student($table);
$count1=0;
if($all_student){
foreach($all_student as $student){
$count1++;    
}   

}
$today=date('y-m-d');
$today_attendance=$this->AttendenceModel->school_strength($today);
$present_today=0;
$absent_today=0;
if($today_attendance){
foreach ($today_attendance as $attendance){
if($attendance['status']=='p'){
$present_today= $present_today + 1;    
}else if($attendance['status']=='a'){
$absent_today = $absent_today + 1;    
}

}    
}
echo "P(".$present_today.") / A(".$absent_today.") /"; echo "Total (".$count1.")"; 
?>          
          
</span>
</li>
<li class="list-group-item  d-flex justify-content-between align-items-center list-group-item-success">
Teacher's  Strength
<span class="badge badge-warning badge-pill text-blue"># / 23</span>
</li>
<li class="list-group-item list-group-item-success d-flex justify-content-between align-items-center">
Today's Fee Collection
<span class="badge badge-warning badge-pill text-blue">
<?php

$date=date('y-m-d');
// $date=date('2020-06-30');
$table='student_fee';
$today_fee_collection_report=$this->FeeModel->today_fee_collection_report($date,$table);
$count=0;
$total_amount=0;

if($today_fee_collection_report){
foreach($today_fee_collection_report as $fee){
$count++;  
$total_amount=$total_amount+$fee['total_amount'];
}    
echo $count; echo" / "; echo $total_amount;
}
else{
echo "0 / ";echo $count;    
}
?>          
          
          
</span>
</li>

<li class="list-group-item ">
Monthly Fee ( <span class="text-success font-weight-bolder">Collection</span> / <span class="text-danger font-weight-bolder">Defaulters</span>)  <br>  
    
<?php 
$april_count=0; $may_count=0; $june_count=0;$july_count=0;$august_count=0;$september_count=0;$october_count=0;$november_count=0;$december_count=0;$january_count=0;$february_count=0;$march_count=0;
$all_fee_collection_report=$this->FeeModel->all_fee_collection_report($table);

if($all_fee_collection_report){
foreach($all_fee_collection_report as $fee_report){
if($fee_report['april']==1){
$april_count++;    
} if($fee_report['may']==1){
$may_count++;
} if($fee_report['june']==1){
$june_count++;
} if($fee_report['july']==1){
$july_count++;
}
if($fee_report['august']==1){
$august_count++;
}
if($fee_report['september']==1){
$september_count++;
}
if($fee_report['october']==1){
$october_count++;
}
if($fee_report['november']==1){
$november_count++;
}
if($fee_report['december']==1){
$december_count++;
}
if($fee_report['january']==1){
$january_count++;
}
if($fee_report['february']==1){
$february_count++;
}
if($fee_report['march']==1){
$march_count++;
}
// $total_amount=$total_amount+$fee['total_amount'];
}
}

?>  


    
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Apr</th>
<th>May</th>
<th>Jun</th>
<th>Jul</th>
</tr>    
</thead>    
<tbody>
<tr>
<td><span class="text-success "><?php echo $april_count; ?></span> / <span class="text-danger "><?php echo $count1-$april_count;?></span></td>
<td><span class="text-success"><?php  echo $may_count;?></span> / <span class="text-danger"><?php echo $count1-$may_count;?></span></td>
<td><span class="text-success"><?php  echo $june_count;?></span> / <span class="text-danger"><?php echo $count1-$june_count;?></span></td>
<td><span class="text-success"><?php  echo $july_count;?></span> / <span class="text-danger"><?php echo $count1-$july_count;?></span></td>
</tr>    
</tbody>
<!--</table><br>-->
<!--<table class="table table-bordered table-striped">-->
<thead>
<tr>
<th>Aug</th>
<th>Sep</th>
<th>Oct</th>
<th>Nov</th>
</tr>    
</thead>    
<tbody>
<tr>
<td><span class="text-success"><?php echo $august_count; ?></span> / <span class="text-danger"><?php echo $count1-$august_count;?></span></td>
<td><span class="text-success"><?php  echo $september_count;?></span> / <span class="text-danger"><?php echo $count1-$september_count;?></span></td>
<td><span class="text-success"><?php  echo $october_count;?></span> / <span class="text-danger"><?php echo $count1-$october_count;?></span></td>
<td><span class="text-success"><?php  echo $november_count;?></span> / <span class="text-danger"><?php echo $count1-$november_count;?></span></td>
</tr>    
</tbody>


<thead>
<tr>
<th>Dec</th>
<th>Jan</th>
<th>Feb</th>
<th>Mar</th>
</tr>    
</thead>    
<tbody>
<tr>
<td><span class="text-success"><?php echo $december_count; ?></span> / <span class="text-danger"><?php echo $count1-$december_count;?></span></td>
<td><span class="text-success"><?php  echo $january_count;?></span> / <span class="text-danger"><?php echo $count1-$january_count;?></span></td>
<td><span class="text-success"><?php  echo $february_count;?></span> / <span class="text-danger"><?php echo $count1-$february_count;?></span></td>
<td><span class="text-success"><?php  echo $march_count;?></span> / <span class="text-danger"><?php echo $count1-$march_count;?></span></td>
</tr>    
</tbody>
</table>    
<span></span>    
</li>
</ul>


<!--<div class="list-group mt-3">-->
<!--<a href="#" class="list-group-item list-group-item-action">Actions</a>-->
<!--<a href="#" class="list-group-item list-group-item-action list-group-item-success">Online Education</a>-->
<!--<a href="#" class="list-group-item list-group-item-action list-group-item-success">Staff Management</a>-->
<!--<a href="#" class="list-group-item list-group-item-action list-group-item-success">Documentation</a>-->
<!--  </div>-->

</div>
<div class="col-sm-12 mt-3">
    
    
<?php
$tid=$this->session->userdata('tid');
$get_staff_data=$this->LoginModel->get_item_data($tid);
if($get_staff_data){
foreach($get_staff_data as $data){
?>

<div class="dash-div mt-3 mb-3">
<div class="p-2" style="border-bottom:1px solid;font-weight:600;"><b>Attendance</b></div>

<div class="dash-row">
<div class="dash-item ">
<a href="<?php echo base_url();?>Management/attendance">Today Attendance</a>
</div>
<div class="dash-item ">
<a href="<?php echo base_url(); ?>Management/attendance_history">Attendance History</a>
</div>
</div>

</div>



<div class="dash-div mt-3 mb-3">
<div class="p-2" style="border-bottom:1px solid;font-weight:600;"><b>Fee</b></div>

<?php 
if($data['school_management'] == 1){
?>

<div class="dash-row">
<div class="dash-item ">
<a href="<?php echo base_url();?>FeeManagement">Fee Dashboard</a>
</div>
<div class="dash-item " >
<a href="<?php echo base_url(); ?>FeeManagement/detail_Portal">Fee Panel</a>
</div>
</div>
<?php
}
?>

<!--<hr>-->
<div class="dash-row">
<div class="dash-item ">
<a href="<?php echo base_url(); ?>StudentFee/dashboard">Pay Fee</a>
</div>
<div class="dash-item " >
<a href="<?php echo base_url(); ?>FeeManagement/defaulter">Fee Defaulter</a>
</div>
</div>

<!--<hr>-->

<div class="dash-row">
<div class="dash-item">
<a href="StudentFee">Fee Invoices</a>
</div>
<div class="dash-item">
<a href="<?php echo base_url(); ?>FeeManagement/fee_structure">Fee Structure</a>
</div>
</div>
<!--<hr>-->
<div class="dash-row">

<div class="dash-item">
<a href="<?php echo base_url(); ?>FeeManagement/daily_collection_panel">Today Fee Invoices</a>
</div>
<!--<div class="dash-item"></div>-->


</div>


</div>





<div class="dash-div mt-3 mb-3">
<div class="p-2" style="border-bottom:1px solid;font-weight:600;"><b>Staff</b></div>
<div class="dash-row">
<div class="dash-item">
<a href="<?php echo base_url();?>FeeManagement/add_teacher">New Staff</a>
</div>
<div class="dash-item">
<a href="<?php echo base_url(); ?>Management/view_staff">View Staff</a>
</div>
</div>

<div class="dash-row">
<div class="dash-item">
<a href="<?php echo base_url(); ?>Management/add_class_teacher">Class Teacher</a>
</div>
<div class="dash-item">
<a href="<?php echo base_url(); ?>Management/official_permissions">Assign Permission</a>
</div>
</div>

</div>


<div class="dash-div mt-3 mb-3">
<div class="p-2" style="border-bottom:1px solid;font-weight:600;"><b>Exam & Result</b></div>
<div class="dash-row">
<div class="dash-item">
<a href="<?php echo base_url(); ?>Exam/add_exam_subject">Add Exam Subject</a>
</div>
<div class="dash-item">
<a href="<?php echo base_url(); ?>Exam/add_exam_head">Add Exam Head</a>
</div>
</div>


<div class="dash-row">
<div class="dash-item">
<a href="<?php echo base_url(); ?>Exam/all_exams">Exam Marks Data</a>
</div>
<div class="dash-item">
<a href="#">Result</a>
</div>
</div>

</div>



<?php
}
}
?>
</div>    
</div>
</div>