<style>
body{background:#EAEDED;}
.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-fluid mt-3 mb-3 bg-white">
    <div class="row">
        <div class="col-sm-12 pt-3 pb-3">
        <?php 
        $cdate =date('d/m/y,h:i:s');
        $acedemic_session_table='academic_session_details';
        $acedemic_session=$this->session->userdata('acedemic_session');
        $active_acedemic_session='';
        $acedemic_session_data=$this->NewFeeModel->get_data($acedemic_session_table);
        if($acedemic_session_data){
            foreach($acedemic_session_data as $session_data){
    
                if($session_data['status'] ==1){
                    $active_acedemic_session=$session_data['id'];

                }
            }
        }
        ?>

            <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 pt-3 pb-3">

        <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 
                $get_students_ac_session=$this->WelcomeModel->get_students_ac_session($acedemic_session);
                $student_count=0;
                if($get_students_ac_session){
                    foreach($get_students_ac_session as $students_ac_session){
                        $student_table='student';    
                        $get_student_data=$this->WelcomeModel->get_item_data($students_ac_session['sid'],$student_table);
                        if($get_student_data){
                            foreach($get_student_data as $student_data){
                                if($student_data['status']==1){
                                    $student_count=$student_count + 1;
                                }
                            }
                        }
                    }
                }


$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 (".$student_count.")"; 

$staff_table='school_staff';
$staff_count=$this->WelcomeModel->get_staff_count();
// $count_staff=$this->NewFeeModel->get_data($staff_table);
// if($count_staff){
//     foreach($count_staff as $data){
//         $staff_count=$staff_count + 1;
//     }
// }

$get_present_staff_data=$this->WelcomeModel->get_staff_attendance_count($today);
?>          
          
</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"><?php echo $staff_count; ?> / <?php echo $get_present_staff_data; ?></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');
$total_received_opening_fee=0;
$opening_count=0;
$get_today_opening_fee_invoices=$this->NewFeeModel->get_day_opening_fee_invoices($date);
if($get_today_opening_fee_invoices){
    foreach($get_today_opening_fee_invoices as $tofeei){
        $opening_count=$opening_count + 1;
        $total_received_opening_fee=$total_received_opening_fee + $tofeei['received_amount'];
    }
}



// $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['received_amount'];
}    

}

echo "( "; echo $count; echo" / "; echo $total_amount; echo " ) + "; 
echo "( "; echo $opening_count; echo "/"; echo $total_received_opening_fee; echo " ) = "; echo $total_amount + $total_received_opening_fee;
?>          
          
          
</span>
</li>

<li class="list-group-item ">
<!--<p>Fee Defaulters Will Updated in few hours 3.04 PM. Sorry For Inconvenience.  </p>-->
Monthly Fee ( <span class="font-weight-bolder"><a href="<?php echo base_url();?>FeeManagement" class="text-success">Collection</a></span> / <span class="text-danger font-weight-bolder"><a href="<?php echo base_url();?>Fee/defaulters" class="text-danger" >Fee Defaulters</a></span> / <span class="font-weight-bold"><a href="<?php echo base_url();?>Fee/invoices" class="text-success">Invoices</a></span> 
<!--/ <span class="text-danger font-weight-bold"> <a href="<?php echo base_url();?>Developer/hscourses" class="text-warning" style="text-decoration:none;">HSC Invoices</a></span> -->
<!--/ <span class="text-danger font-weight-bold"><a href="<?php echo base_url();?>OpeningFee/all_invoices" class="text-danger">Opening Fee Invoices</a></span>-->

)<br> <span></span>    
</li>
</ul> 
    
<?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_new($table,$acedemic_session);

if($all_fee_collection_report){
    foreach($all_fee_collection_report as $fee_report){
    
        $student_table="student";
        $sid=$fee_report['sid'];
        $student_status="";
        $get_student_data=$this->NewFeeModel->get_item_data($sid,$student_table);
        if($get_student_data){
            foreach($get_student_data as $student_data){
                $student_status=$student_data['status'];
            
        
                if($student_status == 1){
        
        
        
                    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'];
    }
}

$rte_students_count=$this->WelcomeModel->get_rte_students_count($acedemic_session);

?>  


    <div class="table-responsive">
<table class="table table-bordered table-striped">

<tr>
<th>Apr</th>
<th>May</th>
<th>Jun</th>
<th>Jul</th>
</tr>    

<tr>
<td>
    <span class="text-success "><?php echo $april_count; ?></span> / <span class="text-danger "><?php echo $student_count-$april_count-$rte_students_count;?></span>
    /<span class="text-warning"><?php echo $rte_students_count; ?></span>
</td>
<td><span class="text-success"><?php  echo $may_count;?></span> / <span class="text-danger"><?php echo $student_count-$may_count-$rte_students_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
<td><span class="text-success"><?php  echo $june_count;?></span> / <span class="text-danger"><?php echo $student_count-$june_count-$rte_students_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
<td><span class="text-success"><?php  echo $july_count;?></span> / <span class="text-danger"><?php echo $student_count-$july_count-$rte_students_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
</tr>    

<!--</table><br>-->
<!--<table class="table table-bordered table-striped">-->

<tr>
<th>Aug</th>
<th>Sep</th>
<th>Oct</th>
<th>Nov</th>
</tr>    
 

<tr>
<td><span class="text-success"><?php echo $august_count; ?></span> / <span class="text-danger"><?php echo $student_count-$august_count-$rte_students_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
<td><span class="text-success"><?php  echo $september_count;?></span> / <span class="text-danger"><?php echo $student_count-$september_count-$rte_students_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
<td><span class="text-success"><?php  echo $october_count;?></span> / <span class="text-danger"><?php echo $student_count-$october_count-$rte_students_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
<td><span class="text-success"><?php  echo $november_count;?></span> / <span class="text-danger"><?php echo $student_count-$november_count-$rte_students_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
</tr>    




<tr>
<th>Dec</th>
<th>Jan</th>
<th>Feb</th>
<th>Mar</th>
</tr>    
 

<tr>
<td><span class="text-success"><?php echo $december_count; ?></span> / <span class="text-danger"><?php echo $student_count-$december_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
<td><span class="text-success"><?php  echo $january_count;?></span> / <span class="text-danger"><?php echo $student_count-$january_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
<td><span class="text-success"><?php  echo $february_count;?></span> / <span class="text-danger"><?php echo $student_count-$february_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
<td><span class="text-success"><?php  echo $march_count;?></span> / <span class="text-danger"><?php echo $student_count-$march_count;?></span>/<span class="text-warning"><?php echo $rte_students_count; ?></span></td>
</tr>    

</table>   
</div>


</div>
<div class="col-sm-12 pt-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
}
?>


<!--<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>-->



<!--<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>-->

<!--<div class="dash-row">-->

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