siddharth_application/application/views/dashboard.php
gandhimathi Bharathirajan dc18f55e6d Dashboard Report
2017-07-25 17:37:08 +05:30

1286 lines
41 KiB
PHP
Executable File

<?php
$Empcnt = '';
//echo $DEPCode;
//echo ROLE_MANAGER;
if(!empty($EmpCount))
{
foreach ($EmpCount as $Emp)
{
$Empcnt = $Emp->EmpCount;
}
}
?>
<div class="content-wrapper">
<section class="content">
<!-- Dashboard for Account department-->
<?php
if($DEPCode == FINANCE)
{
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<center><h1> Accounts Department Dashboard</h1> </center>
</section>
<!-- Main content -->
<section class="content">
<!-- Info boxes -->
<center>
<div class="row">
<!-- fix for small devices only -->
<div class="clearfix visible-sm-block"></div>
<div class="col-md-4 col-md-offset-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="ion ion-ios-people-outline"></i></span>
<div class="info-box-content">
<span class="info-box-text">Employees</span>
<span class="info-box-number"><?php echo $Empcnt ?></span>
</div>
</div>
</div>
</div>
</center>
<div>
<marquee direction="up" scrollamount="2" height="150px;"> <font color="Brown"> <h1><b>Guidelines:</b></h1><h3> # PaySlip menu in header has two sub menu ( 1.Upload Salary , 2.PaySlip Generator)<br/><br/>
# Upload salary menu is used to upload the Salary Excel file into the database<br/><br/>
# Payslip generator menu is to generate the salary slip for individual Employess or All Employees</h3>
</center> </font></marquee>
</div>
</section>
</div>
<?php
}
?>
<!-- Dashboard for admin-->
<?php
if($role == ROLE_ADMIN && $DEPCode != MANAGEMENT)
{
?>
<div class="content">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1> Admin Dashboard </h1>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<!-- ./col -->
<div class=" col-xs-12 col-md-4 col-md-offset-4">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>44</h3>
<p>User Registrations</p>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
<a href="<?php echo base_url(); ?>userListing" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
</div>
</section>
<!-- /.content -->
</div>
<?php
}
?>
<!-- Dashboard for Manager department-->
<?php
if($role == ROLE_MANAGER && $DEPCode != MANAGEMENT)
{
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<center><h1> Manager Department Dashboard</h1> </center>
</section>
<!-- Main content -->
<section class="content">
<!-- Info boxes -->
<center>
<div class="row">
<!-- fix for small devices only -->
<div class="clearfix visible-sm-block"></div>
<div class="col-md-4 col-md-offset-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="ion ion-ios-people-outline"></i></span>
<div class="info-box-content">
<span class="info-box-text">Employees</span>
<span class="info-box-number"><?php echo $Empcnt ?></span>
</div>
</div>
</div>
</div>
</center>
<div>
<marquee direction="up" scrollamount="2" height="150px;">Hi This Is Manager Login </marquee>
</div>
</section>
</div>
<?php
}
if($DEPCode == MANAGEMENT)
{
?>
<head>
<link href="<?php echo base_url();?>assets/plugins/morris/morris.css" rel="stylesheet" type="text/css" />
</head>
<script>
/*!
DataTables Bootstrap 3 integration
©2011-2014 SpryMedia Ltd - datatables.net/license
*/
(function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-9'l><'col-sm-3'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-9'i><'col-sm-3'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="&hellip;";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
</script>
<style>
table{
margin: 0 auto;
width: 100%;
clear: both;
border-collapse: collapse;
table-layout: fixed;
word-wrap:break-word;
}
th, td { white-space: nowrap; }
div.dataTables_wrapper {
margin: 0 auto;
}
div.container {
width: 100%;
}
.dataTables_paginate {
margin-top: -25px;
position: absolute;
text-align: right;
left: -20%;
}
</style>
<div class="content-wrapper">
<section class="content">
<!-- Info boxes -->
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box" style="min-height: 105px;">
<span class="info-box-icon bg-aqua" style="height: 105px;padding:25px;"><i<i class="fa fa-spinner"></span>
<?php
if(!empty($details))
{
foreach($details as $req)
{
?>
<div class="info-box-content">
<span class="info-box-text" style="color:#00c0ef;"><strong>TODAY'S REQUESTS</strong></span>
<span class="info-box-number"><?php echo $req->TODAY_REQUESTS;?></span>
</div>
<?php
}
}
?>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box" style="min-height: 105px;">
<span class="info-box-icon bg-red" style="height: 105px;padding:25px;"><i class="fa fa-hourglass-end"></i></span>
<?php if(!empty($pending_details))
{
foreach($pending_details as $req_p){
?>
<div class="info-box-content">
<span class="info-box-text"style="color:#dd4b39;"><strong>TOTAL PENDING REQUESTS</strong></span>
<span class="info-box-number"><?php echo $req_p->TOTAL_PENDING_REQUESTS;?></span>
</div>
<?php
}
}
?>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<!-- fix for small devices only -->
<div class="clearfix visible-sm-block"></div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box" style="min-height: 105px;">
<span class="info-box-icon bg-green" style="height: 105px;padding:25;"><i class="fa fa-industry" style="padding: 5px;"></i></span>
<?php if(!empty($totalpurchaseorder))
{
foreach($totalpurchaseorder as $po)
{
?>
<div class="info-box-content">
<span class="info-box-text" style="color:#00a65a;"><strong>TOTAL PURCHASE ORDER</strong></span>
<span class="info-box-number"><strong><?php echo $po->totalpurchaseorder;?></strong></span>
<?php
}
}
?>
<?php if(!empty($totalordervalue))
{
foreach($totalordervalue as $ordervalue)
{
?>
<span class="info-box-text" style="color:#00a65a;"><strong>TOTAL ORDER VALUE</strong></span>
<span class="info-box-number"><strong> <?php echo $ordervalue->totalordervalue;?></strong></span>
<?php
}
}
?>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box" style="min-height: 105px;">
<span class="info-box-icon bg-yellow" style="height: 105px;padding:25px;"><i class="fa fa-hourglass-1 " style="padding: 5px;"></i></span>
<?php if(!empty($pendingpo))
{
foreach($pendingpo as $pendingpolist){
?>
<div class="info-box-content">
<span class="info-box-text" style="color:#f39c12;"><strong>PENDING PURCHASE ORDER</strong></span>
<span class="info-box-number"><?php echo $pendingpolist->pending;?></span>
</div>
<?php
}
}
?>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Monthly Released Purchase Order</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 class="btn-group">
<button type="button" class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i></button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>-->
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="row">
<div class="col-md-8">
<p class="text-center">
<strong>1 Jan, 2017 - 31 Dec, 2017</strong>
</p>
<div class="chart">
<!-- Sales Chart Canvas -->
<canvas id="salesChart" style="height: 180px;"></canvas>
</div>
<!-- /.chart-responsive -->
</div>
<!-- /.col -->
<div class="col-md-offset-1 col-md-3">
<strong style="font-size:18px;">&nbsp; &nbsp;&nbsp; BUDGET AMOUNT</strong>
<br><br>
<div class="progress-group">
<?php if(!empty($totalserviceamount))
{
foreach($totalserviceamount as $service)
{
?>
<span class="description-text"><strong style="font-size:16px;">SERVICE &nbsp; :&nbsp;&nbsp;</strong><strong style="color:#00c0ef;font-size:18px;"><i class="fa fa-rupee " style="padding: 5px;"></i><?php echo $service->totalserviceamount;?></strong></span>
<h5 class="description-header" </h5>
<?php
}
}
?>
</div>
<br>
<!-- /.progress-group -->
<div class="progress-group">
<?php if(!empty($totalrevenueamount))
{
foreach($totalrevenueamount as $revenue)
{
?>
<span class="description-text"><strong style="font-size:16px;">REVENUE :&nbsp;&nbsp;</strong><strong style="color:#dd4b39;font-size:18px;"><i class="fa fa-rupee " style="padding: 5px;"></i><?php echo $revenue->totalrevenueamount;?></strong></span>
<?php
}
}
?>
</div>
<br>
<!-- /.progress-group -->
<div class="progress-group">
<?php if(!empty($totalimportamount))
{
foreach($totalimportamount as $import)
{
?>
<span class="description-text"><strong style="font-size:16px;">IMPORT &nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;</strong><strong style="color:#00a65a;font-size:18px;"><i class="fa fa-rupee " style="padding: 5px;"></i><?php echo $import->totalimportamount;?></strong></span>
<?php
}
}
?>
</div>
<br>
<!-- /.progress-group -->
<div class="progress-group">
<?php if(!empty($totalcapitalamount))
{
foreach($totalcapitalamount as $capital)
{
?>
<span class="description-text" ><strong style="font-size:16px;">CAPITAL &nbsp;&nbsp;&nbsp;:&nbsp;&nbsp</strong><strong style="color:#f39c12;font-size:18px;"><i class="fa fa-rupee " style="padding: 5px;"></i><?php echo $capital->totalcapitalamount;?></strong></span>
<?php
}
}
?>
</div>
<!-- /.progress-group -->
</div>
<!-- /.col -->
<!-- /.row -->
</div>
<!-- ./box-body -->
<!-- /.box -->
</div>
<!-- /.col -->
</div>
</div>
</div>
<!-- /.row -->
<div class="box-footer">
<div class="box-body">
<div class="row">
<div class="col-xs-6 col-md-3 text-center">
<div class="description-block border-right">
<?php foreach($totalservicepo as $servicepo)
if(!empty($serviceprogress))
{
foreach($serviceprogress as $serviceprog)
{
?>
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php echo $serviceprog->serviceprogress;?> data-min="0" data-max=<?php echo $servicepo->totalservicepo;?> data-width="90" data-height="90" data-fgColor="#00c0ef "> <br>
<div class="knob-label"><strong>TOTAL SERVICE PURCHASE ORDER : <?php echo $servicepo->totalservicepo;?></strong></div>
<div class="knob-label"><strong>PROGRESS PURCHASE ORDER : <?php echo $serviceprog->serviceprogress;?></strong></div>
</div>
<?php
}
}
?>
</div>
<!-- ./col -->
<div class="col-xs-6 col-md-3 text-center">
<div class="description-block border-right">
<?php // if(!empty($totalrevenuepo))
// {
foreach($totalrevenuepo as $revenuepo)
if(!empty($revenueprogress))
{
foreach($revenueprogress as $revenueprog)
{
?>
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php echo $revenueprog->revenueprogress;?> data-min="0" data-max=<?php echo $revenuepo->totalrevenuepo;?> data-width="90" data-height="90" data-fgColor="#dd4b39 "> <br>
<div class="knob-label"><strong>TOTAL REVENUE PURCHASE ORDER : <?php echo $revenuepo->totalrevenuepo;?>
<div class="knob-label"><strong>PROGRESS PURCHASE ORDER : <?php echo $revenueprog->revenueprogress;?>
</strong></div>
</div>
<?php
}
}
?>
</div>
</div>
<!-- ./col -->
<div class="col-xs-6 col-md-3 text-center">
<div class="description-block border-right">
<?php foreach($totalimportpo as $importpo)
if(!empty($importprogress)){
foreach($importprogress as $importprog)
{
?>
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php echo $importprog->importprogress;?> data-min="0" data-max=<?php echo $importpo->totalimportpo;?> data-width="90" data-height="90" data-fgColor="#00a65a "> <br>
<div class="knob-label"><strong>TOTAL IMPORT PURCHASE ORDER : <?php echo $importpo->totalimportpo;?> </strong></div>
<div class="knob-label"><strong>PROGRESS PURCHASE ORDER : <?php echo $importprog->importprogress;?> </strong></div>
</div>
<?php
}
}
?>
</div>
<!-- ./col -->
<div class="col-xs-6 col-md-3 text-center">
<div class="description-block border-right">
<?php foreach($totalcapitalpo as $capitalpo)
if(!empty($capitalprogress)){
foreach($capitalprogress as $capitalprog)
{
?>
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php echo $capitalprog->capitalprogress;?> data-min="0" data-max=<?php echo $capitalpo->totalcapitalpo;?> data-width="90" data-height="90" data-fgColor="#f39c12 "><br>
<div class="knob-label"><strong>TOTAL CAPITAL PURCHASE ORDER : <?php echo $capitalpo->totalcapitalpo;?></strong></div>
<div class="knob-label"><strong>PROGRESS PURCHASE ORDER : <?php echo $capitalprog->capitalprogress;?>
</div>
<?php
}
}
?>
</div>
<!-- ./col -->
</div>
<!-- /.box-footer -->
</div>
</div>
</div>
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">Bar Chart</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>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body chart-responsive">
<div class="chart" id="bar-chart" style="height: 300px;"></div>
</div>
<!-- /.box-body -->
</div>
<script>
$(function () {
"use strict";
//BAR CHART
var bar = new Morris.Bar({
element: 'bar-chart',
resize: true,
data: [
{y: 'January', a: <?php echo $revenuepo->totalrevenuepo;?> , b: 90, c: 50, d: 40},
{y: 'February', a: 50, b: 40, c: 50, d: 40},
{y: 'March', a: 50, b: 40, c: 50, d: 40},
{y: 'April', a: 75, b: 65, c: 50, d: 40},
{y: 'May', a: 50, b: 40, c: 50, d: 40},
{y: 'June', a: 75, b: 65, c: 50, d: 40},
{y: 'July', a: 100, b: 90 , c: 50, d: 40},
{y: 'August', a: 75, b: 65, c: 50, d: 40},
{y: 'September', a: 75, b: 65, c: 50, d: 40},
{y: 'October', a: 100, b: 90 , c: 50, d: 40},
{y: 'November', a: 50, b: 40, c: 50, d: 40},
{y: 'December', a: 75, b: 65, c: 50, d: 40}
],
barColors: ['#00c0ef ', '#dd4b39 ', '#00a65a ', '#f39c12 '],
xkey: 'y',
ykeys: ['a', 'b', 'c', 'd'],
labels: ['SERVICE', 'REVENUE', 'IMPORT', 'CAPITAL'],
hideHover: 'auto'
});
});
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="<?php echo base_url(); ?>assets/plugins/morris/morris.min.js"></script>
<script type="text/javascript">
$(function () {
/* jQueryKnob */ $(".knob").knob({
/*change : function (value) {
//console.log("change : " + value);
},
release : function (value) {
console.log("release : " + value);
},
cancel : function () {
console.log("cancel : " + this.value);
},*/
draw: function () { // "tron" case
if (this.$.data('skin') == 'tron') { var a = this.angle(this.cv) // Angle
, sa = this.startAngle // Previous start angle
, sat = this.startAngle // Start angle
, ea // Previous end angle
, eat = sat + a // End angle
, r = true; this.g.lineWidth = this.lineWidth; this.o.cursor
&& (sat = eat - 0.3)
&& (eat = eat + 0.3); if (this.o.displayPrevious) {
ea = this.startAngle + this.angle(this.value);
this.o.cursor
&& (sa = ea - 0.3)
&& (ea = ea + 0.3);
this.g.beginPath();
this.g.strokeStyle = this.previousColor;
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sa, ea, false);
this.g.stroke();
} this.g.beginPath();
this.g.strokeStyle = r ? this.o.fgColor : this.fgColor;
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sat, eat, false);
this.g.stroke(); this.g.lineWidth = 2;
this.g.beginPath();
this.g.strokeStyle = this.o.fgColor;
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false);
this.g.stroke(); return false;
}
}
});
/* END JQUERY KNOB */
})
</script>
<!-- Main row -->
<div class="row">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title"><p style="color:#3c8dbc"><b>Total Pending Requests</b></p></h3>
</div>
<!-- /.box-header -->
<div class="col-xs-12 text-right">
<div class="form-group">
<a class="btn btn-primary" href="<?php echo base_url(); ?>reqcontroller/export_pending">Export pending details <i class="fa fa-download"aira-hidden="true"></i></a>
</div>
</div>
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="req" >
<thead>
<tr>
<th>Request Date</th>
<th>Requested By</th>
<th>Department</th>
<th>Request Number</th>
<th>Request Type</th>
<th>Cost Centre Name</th>
<th>Aging</th>
</tr>
</thead>
<tbody>
<?php if(!empty($list)){
foreach($list as $lis)
{
?>
<tr>
<td align="right"><span><?php $date = new DateTime($lis->ReqDate);echo $date->format('Y-m-d'); ?></span></td>
<td><span><?php echo $lis->Requestedby?></span></td>
<td><span><?php echo $lis->DepartmentName?></span></td>
<td align="right"><span><?php echo $lis->ReqNo?></span></td>
<td><span><?php echo $lis->ReqType?></span></td>
<td><span><?php echo $lis->CostCenterName?></span></td>
<td align="right"><span><?php echo $lis->Aging?></span></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<div class="row" style="width:101%">
<!-- Left col -->
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title"><p style="color:#3c8dbc"><b>PO Details</b></p></h3>
</div>
<div class="row">
<div class="col-md-6">
<div class="input-group input-daterange input" >
<div class="input-group-addon"><b>Total Order Value From:</b></div>
<input type="number" id="min" class="form-control date-range-filter" placeholder="From:">
<div class="input-group-addon"><b>to</b></div>
<input type="number" id="max" class="form-control date-range-filter" placeholder="To:">
<div class="input-group-addon"> <a onclick="Reset()"><b>Clear</b></a></div>
</div>
</div>
<div class="col-md-6">
<div class="input-group input-daterange input">
<div class="input-group-addon"><b>Request Date From:</b></div>
<input type="text" id="min-date" class="form-control filter1" data-date-format="yyyy-mm-dd" placeholder="From:">
<div class="input-group-addon"><b>to</b></div>
<input type="text" id="max-date" class="form-control filter1" data-date-format="yyyy-mm-dd" placeholder="To:">
<div class="input-group-addon"> <a onclick="Reset()" ><b>Clear</b></a></div>
</div>
</div>
</div>
<div class="box-body">
<table class="table table-bordered table-hover" id="qdetails" style="font-size:11px;" width="100%">
<thead>
<tr>
<th>PONO</th>
<th>ReqNo</th>
<th>ReqDate</th>
<th>EmpName</th>
<th>DeptName</th>
<th>Total Order Val</th>
<th>Requested Qty</th>
<th>Ordered Qty</th>
<th>Amended Qty</th>
<th>Cost Code</th>
<th>Cost Name</th>
<th>Status</th>
<th>Aged Days</th>
</tr>
</thead>
<tfoot>
<tr>
<th>PONO</th>
<th>ReqNo</th>
<th>ReqDate</th>
<th>EmpName</th>
<th>DeptName</th>
<th>Total Order Val</th>
<th>Requested Qty</th>
<th>Ordered Qty</th>
<th>Amended Qty</th>
<th>Cost Code</th>
<th>Cost Name</th>
<th>Status</th>
<th>Aged Days</th>
</tr>
</tfoot>
<tbody>
<?php if(!empty($qdetails)){foreach($qdetails as $qd)
{
?>
<tr>
<td align="right"><span><?php echo $qd->PONO?></span></td>
<td align="right"><span><?php echo $qd->Req_No?></span></td>
<td align="right"><span><?php $date = new DateTime($qd->Req_Date);echo $date->format('Y-m-d');?></span></td>
<td><span><?php echo $qd->Emp_Name?></span></td>
<td><span><?php echo $qd->Dept_Name?></span></td>
<td align="right"><span><?php echo $qd->Tot_Ord_Value?></span></td>
<td align="right"><span><?php echo $qd->Requested_Qty?></span></td>
<td align="right"><span><?php echo $qd->Ordered_Qty?></span></td>
<td align="right"><span><?php echo $qd->Amended_Qty?></span></td>
<td align="right"><span><?php echo $qd->Cost_Code?></span></td>
<td><span><?php echo $qd->Cost_Name?></span></td>
<td><span><?php echo $qd->Status_Desc?></span></td>
<td align="right"><span><?php echo $qd->Aging?></span></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title"><p style="color:#3c8dbc"><b>Department wise PO details</b></p></h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="dept" >
<thead>
<tr>
<th>Department Name</th>
<th>PO Type</th>
<th>PO NO</th>
<th>PO Count</th>
<th>Total Order Value</th>
<th>Cost Centre Code</th>
<th>Cost Centre Name</th>
<th>Available Amount</th>
</tr>
</thead>
<tbody>
<?php if(!empty($dppo)){ foreach($dppo as $dp)
{
?>
<tr>
<td><span><?php echo $dp->Dept_Name?></span></td>
<td><span><?php echo $dp->PO_Type?></span></td>
<td align="right" style="overflow: auto; width: 280px; text-align: left; valign: top; whitespace: nowrap;"><span><?php echo $dp->PONO?></span></td>
<td align="right"><span><?php echo $dp->PONO_Cnt?></span></td>
<td align="right"><span><?php echo $dp->Tot_Ord_Value?></span></td>
<td align="right" style="overflow: auto; width: 280px; text-align: left; valign: top; whitespace: nowrap;"><span><?php echo $dp->Cost_Code?></span></td>
<td><span><?php echo $dp->Cost_Name?></span></td>
<td align="right"><span><?php echo $dp->Available_Amount?></span></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
</div>
<script src="<?php echo base_url();?>assets/plugins/chartjs/Chart.min.js"></script>
<script src="<?php echo base_url(); ?>assets/plugins/knob/jquery.knob.js"></script>
<script>
/* ChartJS
* -------
* Here we will create a few charts using ChartJS
*/
//-----------------------
//- MONTHLY SALES CHART -
//-----------------------
// Get context with jQuery - using jQuery's .get() method.
var salesChartCanvas = $("#salesChart").get(0).getContext("2d");
// This will get the first returned node in the jQuery collection.
var salesChart = new Chart(salesChartCanvas);
var insert =<?php echo $totalservicepojune[0]->totalservicepojune;?>;
var insert1 =<?php echo $totalrevenuepojune[0]->totalrevenuepojune;?>;
var insert2 =<?php echo $totalimportpojune[0]->totalimportpojune;?>;
var insert3 =<?php echo $totalcapitalpojune[0]->totalcapitalpojune;?>;
var insert4 =<?php echo $totalservicepojuly[0]->totalservicepojuly;?>;
var insert5 =<?php echo $totalrevenuepojuly[0]->totalrevenuepojuly;?>;
var insert6 =<?php echo $totalimportpojuly[0]->totalimportpojuly;?>;
var insert7 =<?php echo $totalcapitalpojuly[0]->totalcapitalpojuly;?>;
var salesChartData = {
labels: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
datasets: [
{
label: "Electronics",
fillColor: "rgba(0, 192, 239, 0.7)",
strokeColor: "rgb(0, 192, 239)",
pointColor: "#00c0ef ",
pointStrokeColor: "rgb(210, 214, 222)",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgb(220,220,220)",
data: [0,0,0,0,0,0,0,0,0,0,0,0]
},
{
label: "Digital Goods",
fillColor: "rgba(221, 75, 57,0.8)",
strokeColor: "rgba(221, 75, 57,0.8)",
pointColor: "#dd4b39 ",
pointStrokeColor: "rgba(60,141,188,1)",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(60,141,188,1)",
data: [0,0,0,0,0,0,0,0,0,0,0,0]
},
{
label: "Food",
fillColor: "rgba(0, 166, 90, 0.7)",
strokeColor: "rgba(0, 166, 90,0.8)",
pointColor: "#00a65a ",
pointStrokeColor: "rgba(60,141,188,1)",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(60,141,188,1",
data: [0,0,0,0,0,0,0,0,0,0,0,0]
},
{
label: "Food",
fillColor: "rgba(243, 156, 18, 0.9)",
strokeColor: "rgba(243, 156, 18,0.8)",
pointColor: "#f39c12 ",
pointStrokeColor: "rgba(60,141,188,1)",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(60,141,188,1",
data: [0,0,0,0,0,0,0,0,0,0,0,0]
}
]
};
salesChartData.datasets[0].data[5]=insert;
salesChartData.datasets[1].data[5]=insert1;
salesChartData.datasets[2].data[5]=insert2;
salesChartData.datasets[3].data[5]=insert3;
//7th month
salesChartData.datasets[0].data[6]=insert4;
salesChartData.datasets[1].data[6]=insert5;
salesChartData.datasets[2].data[6]=insert6;
salesChartData.datasets[3].data[6]=insert7;
var salesChartOptions = {
//Boolean - If we should show the scale at all
showScale: true,
//Boolean - Whether grid lines are shown across the chart
scaleShowGridLines: false,
//String - Colour of the grid lines
scaleGridLineColor: "rgba(0,0,0,.05)",
//Number - Width of the grid lines
scaleGridLineWidth: 1,
//Boolean - Whether to show horizontal lines (except X axis)
scaleShowHorizontalLines: true,
//Boolean - Whether to show vertical lines (except Y axis)
scaleShowVerticalLines: true,
//Boolean - Whether the line is curved between points
bezierCurve: true,
//Number - Tension of the bezier curve between points
bezierCurveTension: 0.3,
//Boolean - Whether to show a dot for each point
pointDot: true,
//Number - Radius of each point dot in pixels
pointDotRadius: 4,
//Number - Pixel width of point dot stroke
pointDotStrokeWidth: 1,
//Number - amount extra to add to the radius to cater for hit detection outside the drawn point
pointHitDetectionRadius: 20,
//Boolean - Whether to show a stroke for datasets
datasetStroke: true,
//Number - Pixel width of dataset stroke
datasetStrokeWidth: 5,
//Boolean - Whether to fill the dataset with a color
datasetFill: true,
//String - A legend template
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%=datasets[i].label%></li><%}%></ul>",
//Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio: false,
//Boolean - whether to make the chart responsive to window resizing
responsive: true
};
// alert(salesChartData);
//Create the line chart
salesChart.Line(salesChartData, salesChartOptions);
//---------------------------
//- END MONTHLY SALES CHART -
//---------------------------
//-------------
//- PIE CHART -
//-------------
// Get context with jQuery - using jQuery's .get() method.
var pieChartCanvas = $("#pieChart").get(0).getContext("2d");
var pieChart = new Chart(pieChartCanvas);
var PieData = [
{
value: 700,
color: "#f56954",
highlight: "#f56954",
label: "Chrome"
},
{
value: 500,
color: "#00a65a",
highlight: "#00a65a",
label: "IE"
},
{
value: 400,
color: "#f39c12",
highlight: "#f39c12",
label: "FireFox"
},
{
value: 600,
color: "#00c0ef",
highlight: "#00c0ef",
label: "Safari"
},
{
value: 300,
color: "#3c8dbc",
highlight: "#3c8dbc",
label: "Opera"
},
{
value: 100,
color: "#d2d6de",
highlight: "#d2d6de",
label: "Navigator"
}
];
var pieOptions = {
//Boolean - Whether we should show a stroke on each segment
segmentShowStroke: true,
//String - The colour of each segment stroke
segmentStrokeColor: "#fff",
//Number - The width of each segment stroke
segmentStrokeWidth: 1,
//Number - The percentage of the chart that we cut out of the middle
percentageInnerCutout: 50, // This is 0 for Pie charts
//Number - Amount of animation steps
animationSteps: 300,
//String - Animation easing effect
animationEasing: "easeOutBounce",
//Boolean - Whether we animate the rotation of the Doughnut
animateRotate: true,
//Boolean - Whether we animate scaling the Doughnut from the centre
animateScale: true,
//Boolean - whether to make the chart responsive to window resizing
responsive: true,
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio: true,
//String - A legend template
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>",
//String - A tooltip template
tooltipTemplate: "<%=value %> <%=label%> users"
};
//Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
pieChart.Doughnut(PieData, pieOptions);
//-----------------
//- END PIE CHART -
//-----------------
</script>
<script>
// Bootstrap datepicker
// Set up your table
table = $('#req').DataTable
({
paging: true,
info: true
});
</script>
<script>
// Bootstrap datepicker
// Set up your table
table = $('#qdetails').DataTable
({
paging: true,
info: true
});
$( function() {
var dateFormat = "mm/dd/yy",
from = $( "#min-date" )
.datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1
})
.on( "change", function() {
to.datepicker( "option", "minDate", getDate( this ) );
}),
to = $( "#max-date" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1
})
.on( "change", function() {
from.datepicker( "option", "maxDate", getDate( this ) );
});
function getDate( element ) {
var date;
try {
date = $.datepicker.parseDate( dateFormat, element.value );
} catch( error ) {
date = null;
}
return date;
}
} );
//$('.input-daterange').each(function() {
// $(this).datepicker('clearDates');
//});
// Extend dataTables search
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var min = $('#min-date').val();
var max = $('#max-date').val();
var Req_Date = data[2] || 0; // Our date column in the table
if (
(min == "" || max == "") ||
(moment(Req_Date).isSameOrAfter(min) && moment(Req_Date).isSameOrBefore(max))
) {
return true;
}
return false;
}
);
// Re-draw the table when the a date range filter changes
$('.filter1').change(function() {
table.draw();
});
$('#my-table_filter').hide();
//total order value range
$.fn.dataTable.ext.search.push(
function( settings, data, dataIndex ) {
var min = parseInt( $('#min').val(), 10 );
var max = parseInt( $('#max').val(), 10 );
var Tot_Ord_Value = parseFloat( data[5] ) || 0;
if ( ( isNaN( min ) && isNaN( max ) ) ||
( isNaN( min ) && Tot_Ord_Value <= max ) ||
( min <= Tot_Ord_Value && isNaN( max ) ) ||
( min <= Tot_Ord_Value && Tot_Ord_Value <= max ) )
{
return true;
}
return false;
}
);
$(document).ready(function() {
//var table = $('#qdetails').DataTable();
// Event listener to the two range filtering inputs to redraw on input
$('#min, #max').keyup( function() {
table.draw();
} );
} );
//for clear button
function Reset()
{
$('#min').val('');
$('#max').val('');
$('#min-date').val('');
$('#max-date').val('');
}
//search each column
$(document).ready(function() {
//var table = $('#qdetails').DataTable
(
{
columnDefs: [
{ width: '5%', targets: 0 }
],
fixedColumns: true
} );
// Setup - add a text input to each footer cell
$('tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" style="width: 88px;background-color:#c2ecf7;font-style: italic;" />' );
} );
// DataTable
//var table = $('#qdetails').DataTable();
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
} );
</script>
<script>
$(function () {
$('#dept').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
// "ordering": true,
"info": true,
"autoWidth": true
});
});
</script>
<?php
}
?>
</section>
</div>