dashboard issues

This commit is contained in:
venbatechnologies 2017-12-21 09:44:55 +05:30
parent 35d4bb7117
commit e0f1eee2fb
3 changed files with 549 additions and 822 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@ class dahsboard_Model extends CI_Model
{
/* HR DASHBOART Model START*/
/* HR DASHBOART Model START*/
function totemp()
{
@ -55,10 +55,15 @@ $sql="select EmpID,CONCAT(FirstName,' ',LastName) as name FROM T_Employee_Detai
}
function attyesterday($WH,$date)
function attyesterday($WH,$date)
{
//echo 'model' . $WH.'-'.$date;
$sql="select EmpID,".$WH." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)" ;
// $sql="select EmpID,".$WH." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)" ;
$sql="select att.EmpID,".$WH.",a.FirstName from T_Attendance as att
join T_Employee_Details as a on a.EmpID= att.EmpID
where Month_Year = ? and att.EmpID in (select EmpID from T_Attendance)";
$query = $this->db->query($sql,array($date));
// print_r($query->result());
//echo count($query->result());
@ -89,10 +94,30 @@ function attendance($EmpID,$dates)
function getAllAttendance($EmpID,$CURMONTH)
{
$sql="select * from T_Attendance where EmpID =? and month(Month_Year)=?";
// $sql=" select T_Attendance.*,emp.FirstName from T_Attendance
// join T_Employee_Details emp on T_Attendance.EmpID = emp.EmpID
// where T_Attendance.EmpID = ? and month(Month_Year)= ? ";
$query = $this->db->query($sql,array($EmpID,$CURMONTH));
return $query->result();
}
function getAllAttendances($EmpID,$JoinedMonth)
{
//$sql="select * from T_Attendance where EmpID =? and month(Month_Year)=?";
$sql=" select T_Attendance.*,emp.FirstName from T_Attendance
join T_Employee_Details emp on T_Attendance.EmpID = emp.EmpID
where T_Attendance.EmpID = ? and month(Month_Year)= ? ";
$query = $this->db->query($sql,array($EmpID,$JoinedMonth));
return $query->result();
}
function joindate($EmpID)
{
$sql="select DateofJoining from T_Employee_Details where EmpID =? ";

View File

@ -72,118 +72,131 @@ if(!empty($EmpCount))
<!-- Main content -->
<section class="content">
<!-- Info boxes -->
<center>
<center>
<!-- Small boxes (Stat box) -->
<div class="row">
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-aqua">
<a href="#" class="small-box-footer"><p> <strong>TOTAL NO OF EMPLOYEES</strong> </p> </a>
<div class="inner">
<?php
if(!empty($totemp))
{
foreach($totemp as $req)
{
<div class="small-box bg-aqua">
<a href="#" class="small-box-footer"><p> <strong>TOTAL NO OF EMPLOYEES</strong> </p> </a>
<div class="inner">
<?php
if(!empty($totemp))
{
foreach($totemp as $req)
{
?>
<h3><?php echo $req->totemp;?></h3>
<p>&nbsp;</p>
<h3><?php echo $req->totemp;?></h3>
<p>&nbsp;</p>
<?php
}
}
}
}
?>
</div>
<div class="icon">
<i class="ion ion-android-contacts"></i>
</div>
<a href="#" class="small-box-footer"><br> </a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<a target= "_blank" href="<?php echo base_url(); ?>loanreports"" class="small-box-footer"> <p> <strong>TOTAL LOAN</strong></p> </a>
<div class="inner">
<?php if(!empty($totloan))
{
foreach($totloan as $req_p){
?>
<h3> <i class="fa fa-rupee"></i><?php echo $req_p->totloan;?> </h3>
<p>&nbsp;</p>
<?php
}
}
?>
</div>
<div class="icon">
<i class="ion ion-cash"></i>
</div>
<a href="#" class="small-box-footer"><br> </a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<a target="_blank" href="<?php echo base_url(); ?>loanreports" class="small-box-footer"> <p> <strong>LOAN TO BE RECOVERED</strong> </p> </a>
<div class="inner">
<?php if(!empty($totrec))
{
foreach($totrec as $ordervalue)
{
?>
<h3> <i class="fa fa-rupee"></i><?php echo $ordervalue->totrec;?> </h3>
<p>&nbsp;</p>
<?php
}
}
?>
</div>
<div class="icon">
<i class="ion ion-calculator"></i>
</div>
<a class="small-box-footer"><br> </a>
</div>
<div class="icon">
<i class="ion ion-android-contacts"></i>
</div>
<a href="#" class="small-box-footer"><br> </a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<a href="#" class="small-box-footer"> <p> <strong>TOTAL EMPLOYEES ABSENT</strong> </p></a>
<div class="inner">
<h3> <?php echo $today;?></h3>
<p>TODAY</p>
</div>
<div class="small-box bg-red">
<a target= "_blank" href="<?php echo base_url(); ?>loanreports" class="small-box-footer"> <p> <strong>TOTAL LOAN</strong> </p></a>
<div class="inner">
<?php if(!empty($totloan))
{
foreach($totloan as $req_p){
?>
<h3> <i class="fa fa-rupee"></i><?php echo $req_p->totloan;?> </h3>
<p>&nbsp;</p>
<?php
}
}
?>
</div>
<div class="icon">
<i class="ion ion-cash"></i>
</div>
<a target= "_blank" href="<?php echo base_url(); ?>loanreports" class="small-box-footer">
LOAN TO BE RECOVERED : <?php if(!empty($totrec))
{
foreach($totrec as $ordervalue)
{
?>
<i class="fa fa-rupee"></i><?php echo $ordervalue->totrec;?>
<?php
}
}
?> </a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<a target="_blank" href="<?php echo base_url(); ?>loanreports" class="small-box-footer"> <p> <strong>SALARY COST</strong> </p> </a>
<div class="inner">
<h3 id=""><i class="fa fa-rupee"></i><?php echo $employeeSalary;?></h3>
<p>TODAY</p>
</div>
<div class="icon">
<i class="ion ion-calculator"></i>
</div>
<a class="small-box-footer"> THIS MONTH : <i class="fa fa-rupee"></i> <?php echo $totalSalary;?>
</a>
</div>
</div>
<!-- /col next -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<a href="#" class="small-box-footer"> <p> <strong>TOTAL EMPLOYEES ABSENT</strong> </p></a>
<div class="inner">
<h3> <?php echo $today;?></h3>
<p>TODAY</p>
</div>
<div class="icon">
<i class="ion ion-android-calendar"></i>
</div>
<a href="#" class="small-box-footer">YESTERDAY :<?php echo $values;?> </a>
</div>
</div>
<!-- ./col -->
</div>
</div>
<!-- ./col -->
</div>
<!-- /.row -->
</center>
<div class="col-md-9" style="padding:0px;">
@ -218,6 +231,9 @@ if(!empty($EmpCount))
?>
</h3>
<!-- <a target="_blank" href="<?php echo base_url(); ?>employeeperform" class="btn btn-info">
View All </a> -->
</div>
<div class="box-body">
<div class="row">
@ -288,7 +304,7 @@ if(!empty($EmpCount))
url:"<?php echo base_url();?>user/attendanceyear",
success:function(json) {
console.log(json);
//alert(json);
// alert(json.workeds);
$('#content').loader('hide');
$('#totaldays').text(json.totaldays);
$('#worked').text(json.workeds)
@ -297,6 +313,9 @@ if(!empty($EmpCount))
data.setValue(0, 1, json.yeardata);
chart.draw(data, options);
},
error:function(){
alert('error');
}
});
@ -357,60 +376,68 @@ if(!empty($EmpCount))
<!-- /.info-box -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.box-body-->
<div class="col-md-3" style="padding-right: 0px;">
<!-- Emp performance box -->
<div class="box box-info">
<div class="box-header">
<!-- tools box -->
<div class="pull-right box-tools">
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse" data-toggle="tooltip" title="Collapse" style="margin-right: 5px;">
<i class="fa fa-minus"></i></button>
</div>
<!-- /. tools -->
<h3 class="box-title">
Salary Cost
</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="col-md-12 col-sm-12">
<br>
<div class="pad box-pane-right bg-yellow">
<div class="description-block margin-bottom">
<h3 id=""><i class="fa fa-rupee"></i><b><?php echo $employeeSalary;?></b></h3>
<h5 class="description-header">Today</h5>
</div>
<!-- /.description-block -->
<div class="description-block margin-bottom">
<h3 id=""><i class="fa fa-rupee"></i><b><?php echo $totalSalary;?></b></h3>
<h5 class="description-header">This Month</h5>
</div>
<!-- /.description-block -->
</div>
</div>
</div>
<!-- /.info-box -->
</div>
</div>
<!-- /.box-body-->
</div>
<!-- /.End Of performance box -->
</div>
</div>
<!-- Start of List of employees absent-->
<div class="col-md-3">
<!-- DIRECT CHAT -->
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">NAME OF ABSENTEES</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
</div>
</div>
<!-- /.box-header -->
<div class="box-body">
<!-- Conversations are loaded here -->
<div class="direct-chat-messages">
<!-- Message. Default to the left -->
<?php
if(!empty($absname)){
foreach ($absname as $abs) {
echo $abs.'<br/>';
?>
<?php }
}?>
</div>
<!--/.direct-chat-messages-->
</div>
<!-- /.box-body -->
<!-- /.box-footer-->
</div>
<!--/.direct-chat -->
</div>
<!-- /.col -->
<!-- End Of list of employees absent-->
</div>
<!-- /.box -->
@ -426,7 +453,8 @@ if(!empty($EmpCount))
google.charts.load('current', {'packages':['gauge']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
function drawChart()
{
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
@ -443,6 +471,9 @@ if(!empty($EmpCount))
};
var chart = new google.visualization.Gauge(document.getElementById('chart_divs'));
chart.draw(data, options);
$('#emp').change(function() {
// alert();
var id = $('#emp').val();
@ -456,7 +487,7 @@ $("#monthabs").val('');
data:{id:id},
dataType: 'json',
type:"POST",
url:"<?php echo base_url();?>user/attendanceyear",
url:"<?php echo base_url();?>user/monthattendance",
success:function(json) {
console.log(json);
@ -499,7 +530,6 @@ $("#monthabs").val('');
<!-- \\\\\\\\\\\\\\\ HR END of the part ////////////////////////-->
<!-- Dashboard for admin-->
<?php
if($role == ROLE_ADMIN && $DEPCode != MANAGEMENT && $DEPCode != HR)