code Merge

This commit is contained in:
VE10-Sanjeev 2025-04-24 04:00:13 +00:00
commit 5c22d82c34
4 changed files with 303 additions and 314 deletions

View File

@ -1185,10 +1185,12 @@ class Report extends BaseController
$ab = $this->request->getPost('financialyear'); $ab = $this->request->getPost('financialyear');
$data['ab'] = $ab;
$fa = substr((string)$ab, 0, -5); $fa = substr((string)$ab, 0, -5);
$aa = substr((string)$ab, 5, 5); $aa = substr((string)$ab, 5, 5);
$m = $this->request->getPost('month'); $m = $this->request->getPost('month');
$data['m'] = $m;
//print_r($prod); //print_r($prod);

View File

@ -81,38 +81,32 @@ if (!function_exists('get_date_format')) {
if (!function_exists('format_date')) { if (!function_exists('format_date')) {
function format_date($dateString, $days = 0, $format = 'Y-m-d') function format_date($dateString, $days = 0, $format = 'Y-m-d')
{ {
// Check if the input is already a Unix timestamp // If already a DateTime object
if (is_numeric($dateString) && (string) (int) $dateString === $dateString) { if ($dateString instanceof DateTime) {
$date = strtotime($dateString); $date = $dateString;
} else { }
// Use date_create() to create a DateTime object // If Unix timestamp
elseif (is_numeric($dateString) && (string) (int) $dateString === (string) $dateString) {
$date = new DateTime();
$date->setTimestamp((int) $dateString);
}
// If string
else {
$date = date_create($dateString); $date = date_create($dateString);
} }
// If $date is false, meaning parsing failed, return null
if (!$date) { if (!$date) {
return null; return null;
} }
// Subtract the specified number of days from the date if $days is provided // Modify date
if ($days != 0) { if ($days != 0) {
// If $date is a Unix timestamp, modify it using strtotime() $date->modify("-{$days} days");
if (is_numeric($dateString) && (string) (int) $dateString === $dateString) {
$date = strtotime("-$days day", $date);
} else {
// If $date is a DateTime object, modify it using DateTime::modify()
date_modify($date, "-$days day");
}
} }
// If $date is a Unix timestamp, format it using date() return $date->format($format);
if (is_numeric($dateString) && (string) (int) $dateString === $dateString) {
return date($format, $date);
} else {
// If $date is a DateTime object, format it using DateTime::format()
return date_format($date, $format);
}
} }
} }
if (!function_exists('get_financial_year')) { if (!function_exists('get_financial_year')) {

View File

@ -1,71 +1,79 @@
<script>
$(document).ready(function() {
$("#client_name").select2();
$("#item_name").select2();
$("#purchaseorder_number").select2();
});
</script>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style> <style>
.dataTables_filter input {padding: 4px;}
table{
width:auto;
}
.dataTables_filter input {
padding: 4px;
}
.dataTables_filter { .dataTables_filter {
width: 50%; /* width: 50%; */
float: right; float: right;
text-align: right; text-align: right;
} }
.dataTables_paginate { .dataTables_paginate {
width: 50%; width: 50%;
float: right; float: right;
text-align: right; text-align: right;
} }
div.dt-buttons { div.dt-buttons {
position: relative; position: relative;
float: right; /* float: right; */
} }
.btn-success {
background-color: #00d976;;
border-color: #00d976;;
}
.col-md-offset-1 {
margin-left: 2.333333%;
padding-top: 5px;
}
</style> </style>
<div class="content-wrapper">
<section class="content">
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color: #00d976;"><b>Employee Performance</b><br>
<?php
if($this->input->post('financialyear')){ <div class="content-page">
$ab=$this->input->post('financialyear'); <div class="content">
echo '('.$ab.')'; <!-- Start Content-->
echo ' '; <div class="container-fluid">
<!-- start page title -->
} <div>
if($this->input->post('month')){ <div class="row">
$m=$this->input->post('month'); <div class="col-12">
echo '('.$m.')'; <div class="page-title-box page-title-box-alt">
echo ' '; <div class="page-title-right">
} <ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Reports</a></li>
?> <li class="breadcrumb-item"><a href="javascript: void(0);"></a> Attendance</li>
</p></h3></center> <li class="breadcrumb-item active">
<h4 class="page-title"><b> Employee Performance </b></h4>
</li>
</ol>
</div>
</div> </div>
<!-- /.box-header --> </div>
<div class="panel-body"> </div>
<div class="row">
<div class="col-12">
<div class="card">
<!-- <form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;"> -->
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>"> <div class="card-body">
<form method="post" action="<?php echo base_url('Empperform') ?>">
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="row">
<div class="col-md-2"> <div class="col-3">
<label for="to_date"> <label for="to_date">
<?php echo 'Year'; ?> <?php echo 'Year'; ?>
</label> </label>
@ -80,7 +88,11 @@
{?> {?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<option
<?php echo isset($ab) && $ab == $item->financial_year ? "selected" : ""?>
value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?> <?php } endforeach; ?>
@ -88,7 +100,8 @@
</select> </select>
</div> </div>
</div> </div>
<div class="col-md-2">
<div class="col-md-3">
<label for="to_date"> <label for="to_date">
<?php echo 'Month'; ?> <?php echo 'Month'; ?>
</label> </label>
@ -96,39 +109,57 @@
<select class="form-control" id="month" name="month" required> <select class="form-control" id="month" name="month" required>
<option value="">Select Month</option> <option value="">Select Month</option>
<option value="April">April</option> <?php
<option value="May">May</option> $months=[
<option value="June">June</option> "April",
<option value="July">July</option> "May",
<option value="August">August</option> "June",
<option value="September">September</option> "July",
<option value="October">October</option> "August",
<option value="November">November</option> "September",
<option value="December">December</option> "October",
<option value="January">January</option> "November",
<option value="February">February</option> "December",
<option value="March">March</option> "January",
"February",
"March",
]
?>
<?php
foreach($months as $month){ ?>
<option
<?php echo isset($m) && $m == $month ? "selected" : "" ?>
value="<?=$month?>">
<?=$month?>
</option>
<?php }
?>
</select> </select>
</div> </div>
</div> </div>
<div class="col-md-2 col-md-offset-1"><br>
<div class="col-md-6 text-right"><br>
<input type="button" class="btn btn-danger m-2" value="Reset" onclick="window.location.href='<?= base_url('Empperform') ?>';">
<input type="submit" class="btn btn-success" name="btn_submit" <input type="submit" class="btn btn-success" name="btn_submit"
value="View Report"> value="View Report">
</div> </div>
</div>
</form> </form>
<table id="cc" class="table table-bordered table-hover wrap" style="background-color:#fff;width: 100% !important;">
<!-- <table class="table table-bordered table-hover" id="asset_list_table" style="background-color:#fff;font-size:12px;"> -->
</div>
</div>
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="cc" style="font-size:14px;">
<thead> <thead>
<tr> <tr>
<th rowspan="2">EmpID</th> <th rowspan="2">EmpID</th>
@ -150,12 +181,13 @@
</tr> </tr>
</thead> </thead>
<tbody>
<tbody> <tbody>
<?php if(!empty($per)){ <?php if(!empty($per)){
$tr3=0; $tr3=0;
$tr4=0; $tr4=0;
$last = $this->uri->total_segments();
$ab=$this->uri->segment($last);
foreach($per as $index =>$rel) foreach($per as $index =>$rel)
{ {
//echo $index; //echo $index;
@ -185,26 +217,21 @@
</tr> </tr>
<?php <?php
} }
}
?> ?>
</tbody> </tbody>
<tfoot width="100%"> <tfoot width="100%">
</tfoot> </tfoot>
<?php
}
?>
</table> </table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div> </div>
</div> </div>
</div> </div> <!-- container -->
<!-- /.box --> </div> <!-- content -->
</div>
<!-- /.col -->
</div>
</section>
</div> </div>
@ -214,90 +241,57 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script> <script>
// Bootstrap datepicker // Bootstrap datepicker
// Set up your table // Set up your table
$(document).ready(function() { $(document).ready(function() {
table = $('#cc').DataTable( { // Initialize the DataTable with only pagination enabled
"language": { var table = $('#cc').DataTable({
"emptyTable": "<center> Data Not Found ! </center>" dom: 'Blfrtip',
},
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
buttons: [ buttons: [
{ {
extend: 'excelHtml5', extend: 'excel',
footer: 'true', text: 'Excel',
//messageTop: $('h3').text(),
title: $('h3').text(),
exportOptions: {
columns: ':visible'
} }
}, ],
paging: true, // Enable pagination
searching: true, // Disable search
ordering: false, // Disable column sorting
info: false, // Disable table information
lengthChange: false, // Disable page length options
pageLength: 10, // Default rows per page
responsive: true, // Keep responsive design
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
});
});
'colvis'
]
} );
} );
$('#mySelect').on('change',function(){ $('#mySelect').on('change',function(){
table table
.column(4) .column(4)
.search(this.value) .search(this.value)
.draw(); .draw();
}); });
$( function() {
//var dateFormat = "mm/dd/yy",
from = $( "#min-date" )
.datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on( "change", function() {
to.datepicker("option", "minDate", getDate( this ) );
}),
to = $( "#max-date" ).datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
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;
}
} );
function Reset() function Reset()
{ {
$('#mySelect').val(''); $('#mySelect').val('');
} }
</script> </script>

View File

@ -56,7 +56,7 @@
<div class="col-md-3"> <div class="col-md-3">
<h4><span class="fa fa-money-bill-alt">&nbsp; Finance Reports </span></h4> <h4><span class="fa fa-money-bill-alt">&nbsp; Finance Reports </span></h4>
<a href="<?php echo base_url(); ?>Report_costcenter" target="_blank"><p class="uk-text uk-margin-remove">Cost Center</p></a> <a href="<?php echo base_url(); ?>Report_costcenter" target="_blank"><p class="uk-text uk-margin-remove">Cost Center</p></a>
<p class="uk-text uk-margin-remove">Production Salary Cost</p> <!-- <p class="uk-text uk-margin-remove">Production Salary Cost</p> -->
</div> </div>
@ -88,8 +88,7 @@
<div class="col-md-3"> <div class="col-md-3">
<h4><span class="fa fa-calendar">&nbsp; Attendance </span></h4> <h4><span class="fa fa-calendar">&nbsp; Attendance </span></h4>
<p class="uk-text uk-margin-remove" target="_blank">Employee Attendance</p> <a href="<?php echo base_url(); ?>Empperform" target="_blank"><p class="uk-text uk-margin-remove">Employee Performance</p></a>
<p class="uk-text uk-margin-remove" target="_blank">Employee Performance</p>
<a href="<?php echo base_url(); ?>leavereports" target="_blank"><p class="uk-text uk-margin-remove">Leave Report</p></a> <a href="<?php echo base_url(); ?>leavereports" target="_blank"><p class="uk-text uk-margin-remove">Leave Report</p></a>
</div> </div>
</div> </div>