salarycostforton
This commit is contained in:
parent
69b87bddf9
commit
213200e8cb
@ -278,5 +278,11 @@ $route['normalinprocess'] = "inprocess/addNewInprocessInspection";
|
||||
$route['nissaninprocess'] = "inprocess/addNewNissanInprocessInspection";
|
||||
|
||||
|
||||
|
||||
|
||||
//this route path productionsalary details
|
||||
$route['productionsalary']="monthlypay/productionsalary";
|
||||
|
||||
|
||||
/* End of file routes.php */
|
||||
/* Location: ./application/config/routes.php */
|
||||
|
||||
@ -497,6 +497,326 @@ class monthlypay extends BaseController
|
||||
|
||||
}
|
||||
|
||||
//this function used to Production salary Details
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function productionsalary(){
|
||||
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : ProductionSalary';
|
||||
|
||||
|
||||
|
||||
$data['productionsalary'] = $this->monthlypay_model->productionsalarycost();
|
||||
|
||||
|
||||
|
||||
$this->loadviews('salarycostforproduction',$this->global,$data,NULL);
|
||||
}
|
||||
|
||||
|
||||
function addnew()
|
||||
{
|
||||
|
||||
$date=$this->input->post('datepick');
|
||||
$date = date('Y-m-d',strtotime($date));
|
||||
|
||||
$prod = $this->input->post('pton');
|
||||
// echo $prod;
|
||||
$mper= $this->input->post('today_abs');
|
||||
// echo $mper;
|
||||
|
||||
$ttl = $this->input->post('today_salary');
|
||||
// echo $ttl;
|
||||
$salary= $this->input->post('calc');
|
||||
//echo $salary;
|
||||
|
||||
$Createdby = $this->session->userdata('userId');
|
||||
|
||||
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$acc_createddt = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
$productions = array('date'=>$date,
|
||||
'production'=>$prod,
|
||||
'emppresent'=>$mper,
|
||||
'totalsalary '=>$ttl,
|
||||
'salaryton'=>$salary,
|
||||
'createdon'=>$acc_createddt,
|
||||
'createdby'=>$Createdby );
|
||||
//print_r($productions);
|
||||
// die;
|
||||
$result = $this->monthlypay_model->productionsalarycosts($productions);
|
||||
if( $result >= 0){
|
||||
|
||||
|
||||
|
||||
echo "<script type='text/javascript'>alert('Successfully Saved!');
|
||||
|
||||
|
||||
</script>";
|
||||
|
||||
redirect('monthlypay/productionsalary','refresh');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function edited(){
|
||||
|
||||
$sno=$this->input->post('sno');
|
||||
// echo $sno;
|
||||
$date=$this->input->post('date');
|
||||
$date = date('Y-m-d',strtotime($date));
|
||||
// echo $date;
|
||||
$prod = $this->input->post('prod');
|
||||
// echo $prod;
|
||||
$mper= $this->input->post('pra');
|
||||
// echo $mper;
|
||||
|
||||
$ttl = $this->input->post('sal');
|
||||
// echo $ttl;
|
||||
$salary= $this->input->post('ast');
|
||||
// echo $salary;
|
||||
|
||||
$updatedby = $this->session->userdata('userId');
|
||||
|
||||
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$acc_createddt = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
$productions = array('date'=>$date,
|
||||
'production'=>$prod,
|
||||
'emppresent'=>$mper,
|
||||
'totalsalary '=>$ttl,
|
||||
'salaryton'=>$salary,
|
||||
'updatedon'=>$acc_createddt,
|
||||
'updatedby'=>$updatedby );
|
||||
|
||||
//print_r($productions);
|
||||
$result = $this->monthlypay_model->updateproduction($productions,$sno);
|
||||
if( $result >= 0){
|
||||
|
||||
|
||||
|
||||
echo "Updated Successfully Saved";
|
||||
|
||||
redirect('monthlypay/productionsalary','refresh');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*date click on day salary,absent name, total absent display*/
|
||||
|
||||
function dateFunctionChangeVales()
|
||||
{
|
||||
|
||||
|
||||
|
||||
$date = $this->input->post("id");
|
||||
// echo $date;
|
||||
$daydate = date('Y-m',strtotime($date));
|
||||
//echo $date; die;
|
||||
$daydate = $daydate . '-01';
|
||||
//$dat = date('d');
|
||||
// echo $daydate; echo "";
|
||||
$WH = 'WH' . date('j',strtotime($date));
|
||||
// echo $WH;
|
||||
|
||||
$yesterday = $this->monthlypay_model->attyesterday($WH,$daydate);
|
||||
// print_r($yesterday);die;
|
||||
|
||||
$values = 0;
|
||||
$absEmp = array();
|
||||
//echo $value; die;
|
||||
foreach ($yesterday as $weekda => $value) {
|
||||
|
||||
if ($value[$WH] != 0) {
|
||||
|
||||
$values++;
|
||||
$absendId = $value['EmpID'];
|
||||
$absendName = $value['FirstName'];
|
||||
|
||||
|
||||
$absEmp [] = $absendId . "-" . $absendName; //absend empid and name list
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//print_r($absentName);die;
|
||||
$data['today'] = $values;
|
||||
|
||||
$OT = 'OT' . date('j',strtotime($date));
|
||||
|
||||
$CUR_month = date('t');
|
||||
|
||||
$toDayEmployee = $this->monthlypay_model->dayAllPersentEmpSalary($WH, $OT, $daydate);
|
||||
|
||||
|
||||
$EmpID = 0;
|
||||
|
||||
$employeeSalary = 0;
|
||||
|
||||
foreach ($toDayEmployee as $value) {
|
||||
$values = 0;
|
||||
$totalothour = 0;
|
||||
|
||||
if ($value[$WH] != 0) {
|
||||
|
||||
$totalothour = $value[$OT];
|
||||
//echo $totalothour;die;
|
||||
$values = 1;
|
||||
|
||||
//print_r($values); die;
|
||||
$Empid = $value['EmpID'];
|
||||
//print_r($value['EmpID']);
|
||||
|
||||
$totalEmployeePersent = $this->monthlypay_model->persentEmployeeDetails($Empid);
|
||||
|
||||
|
||||
$HRA_Amount = $totalEmployeePersent[0]->HRA_Amount;
|
||||
$Basic_Pay = $totalEmployeePersent[0]->Basic_Pay;
|
||||
$totalsalary = $totalEmployeePersent[0]->TotalSalary;
|
||||
$dayFoodAmt = $totalEmployeePersent[0]->Food_Allowances;
|
||||
//$allowances =$totalEmployeePersent[0]->Allowances;
|
||||
//echo "hra amount";print_r(array($HRA_Amount,$Basic_Pay,$totalsalary));
|
||||
//$Allowances = $allowances * $values;
|
||||
$Food_Allowances = $dayFoodAmt * $values;
|
||||
|
||||
$daySalary = $Basic_Pay / $CUR_month;
|
||||
/**per day salary working hour**/
|
||||
//echo $daySalary.'<br/>';
|
||||
|
||||
$dayHra = $HRA_Amount / $CUR_month;
|
||||
/** per day hra amount **/
|
||||
//echo $dayHra.'<br/>';
|
||||
|
||||
$onehoursSalary = ($daySalary + $dayHra) / 8;
|
||||
/**one hour salay ot calculation**/
|
||||
if ($totalothour != 0) /** if ot not equal zero **/ {
|
||||
$totSalayOT = $totalothour * $onehoursSalary;
|
||||
} else {
|
||||
$totSalayOT = 0;
|
||||
}
|
||||
$currentDaySalary = $daySalary * $values;
|
||||
/** current day salary working days calculation**/
|
||||
|
||||
|
||||
$currentDayHra = $dayHra * $values;
|
||||
/** total working days hra calculations**/
|
||||
// echo $currentDayHra.'<br/>';
|
||||
$currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT;
|
||||
/** current date pf calculation**/
|
||||
if ($totalsalary <= 20000) {
|
||||
|
||||
$esiAmount = $currentDatePF * 1.75 / 100;
|
||||
/** esiamount not elgiable for 20000 **/
|
||||
} else {
|
||||
$esiAmount = 0;
|
||||
}
|
||||
$pfAmount = $currentDaySalary * 12 / 100;
|
||||
/** pf amount per day**/
|
||||
|
||||
//echo $totalothour;die;
|
||||
$salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances;
|
||||
$salaryInCurrentday = $salaryInCurrentdays - ($esiAmount + $pfAmount);
|
||||
$employeeSalary += round($salaryInCurrentday);
|
||||
// echo $employeeSalary;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//$salaryInCurrentday++;
|
||||
|
||||
|
||||
$data['employeeSalary'] = $employeeSalary;
|
||||
|
||||
//print_r($data);
|
||||
// }
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// function forreport()
|
||||
// {
|
||||
|
||||
|
||||
// $da =$this->input->post('term');
|
||||
// //$ab = date('Y-m-d',strtotime($da));
|
||||
// //echo strtotime($da);
|
||||
// $da = '01-'.$da;
|
||||
// //echo $da;
|
||||
|
||||
|
||||
// $ab = date('Y-m-d',strtotime($da));
|
||||
|
||||
// //strtotime(str_replace('/', '-', '27/05/1990')
|
||||
// //echo $ab; die;
|
||||
|
||||
|
||||
|
||||
// $result = $this->monthlypay_model->cost($ab);
|
||||
|
||||
// echo json_encode($result);
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
function salarycost()
|
||||
{
|
||||
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : ProductionSalary';
|
||||
// $da =$this->input->post('term');
|
||||
$da=$this->input->post('datepi');
|
||||
//$ab = date('Y-m-d',strtotime($da));
|
||||
//echo $da;
|
||||
$da= '01-'.$da;
|
||||
//echo $d;
|
||||
|
||||
|
||||
$ab = date('Y-m-d',strtotime($da));
|
||||
|
||||
//strtotime(str_replace('/', '-', '27/05/1990')
|
||||
//echo $ab; die;
|
||||
|
||||
|
||||
|
||||
$data['productionsalary'] = $this->monthlypay_model->cost($ab);
|
||||
|
||||
|
||||
|
||||
//print_r( $data['$productionsalary']); die;
|
||||
|
||||
|
||||
//echo json_encode($result);
|
||||
// $this->loadviews('salarycostforproduction',$this->$data,NULL);
|
||||
|
||||
$this->loadviews('salarycostforproduction',$this->global,$data,NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -394,6 +394,102 @@ join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsA
|
||||
|
||||
|
||||
|
||||
|
||||
//this function Production Salary cost details
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function productionsalarycosts($productions)
|
||||
{
|
||||
$this->db->insert('T_ProductionSalaryCost',$productions);
|
||||
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
}
|
||||
|
||||
function updateproduction($productions,$sno)
|
||||
{
|
||||
|
||||
|
||||
$this->db->where('sno',$sno);
|
||||
$this->db->update('T_ProductionSalaryCost',$productions);
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function productionsalarycost()
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_ProductionSalaryCost');
|
||||
$query =$this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function attyesterday($WH,$daydate)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$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($daydate));
|
||||
|
||||
return $query->result_array();
|
||||
}
|
||||
|
||||
|
||||
function dayAllPersentEmpSalary($WH,$OT,$date)
|
||||
{
|
||||
|
||||
$sql="select EmpID,".$WH.",".$OT." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)";
|
||||
$query = $this->db->query($sql,array($date));
|
||||
|
||||
return $query->result_array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function persentEmployeeDetails($EmpID){
|
||||
|
||||
$sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
|
||||
$query = $this->db->query($sql,array($EmpID));
|
||||
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function cost($ab)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$sql = "select * from T_ProductionSalaryCost where month(date)=month('".$ab."')";
|
||||
|
||||
//echo $sql;die;
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@ -54,6 +54,8 @@
|
||||
<div class="col-xs-3">
|
||||
<h4><span class="fa fa-money "> Finance Reports </span></h4>
|
||||
<a href="<?php echo base_url(); ?>Report_costcenter" target="_blank" > Cost Center <p class="uk-text uk-margin-remove"></p></a>
|
||||
|
||||
<a href="<?php echo base_url(); ?>productionsalary" target="_blank" > SalaryCostforTonProduction <p class="uk-text uk-margin-remove"></p></a>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<h4><span class="fa fa-inr"> Cashbook </span></h4>
|
||||
|
||||
527
application/views/salarycostforproduction.php
Normal file
527
application/views/salarycostforproduction.php
Normal file
@ -0,0 +1,527 @@
|
||||
<!-- <?php
|
||||
|
||||
$datatablesdate = '';
|
||||
if(!empty($productionsalary))
|
||||
{
|
||||
foreach ($productionsalary as $psc)
|
||||
{
|
||||
$datatablesdate = $psc->date;
|
||||
$date = date("d-m-Y",strtotime($datatablesdate));
|
||||
}
|
||||
//print_r($date);
|
||||
}
|
||||
|
||||
//print_r($date);
|
||||
|
||||
?> -->
|
||||
|
||||
|
||||
<!-- <script>
|
||||
$('#datepick').datepicker()
|
||||
if('#datepicker' = $datatablesdate){
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script> -->
|
||||
|
||||
|
||||
|
||||
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
|
||||
<script>
|
||||
// $( function()
|
||||
// {
|
||||
// $('#datepick').datepicker({maxDate: 'Date', dateFormat: 'dd-mm-yy' });
|
||||
// //$('#datepicker').datepicker({maxDate: 'Date', dateFormat: 'dd-mm-yy' });
|
||||
// // $('#todate').datepicker({maxDate: 'Date', dateFormat: 'dd-mm-yy' });
|
||||
// // .datepicker('setDate',new Date())
|
||||
|
||||
|
||||
|
||||
|
||||
// } );
|
||||
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
$('#datepick').datepicker({
|
||||
dateFormat: "dd-mm-yy",
|
||||
maxDate: +0,
|
||||
});
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$('#datepi').datepicker({
|
||||
maxDate: +0,
|
||||
dateFormat: "mm-yy",
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
showButtonPanel: false,
|
||||
// dateFormat: 'mm-yy',
|
||||
|
||||
// onClose: function(dateText, inst) {
|
||||
// $(this).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, 1));
|
||||
|
||||
|
||||
onClose: function(dateText, inst) {
|
||||
var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
|
||||
var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
|
||||
$(this).val($.datepicker.formatDate('mm-yy', new Date(year, month, 1)));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(".monthPicker").focus(function () {
|
||||
$(".ui-datepicker-calendar").hide();
|
||||
$("#ui-datepicker-div").position({
|
||||
my: "center top",
|
||||
at: "center bottom",
|
||||
of: $(this)
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
||||
<style>
|
||||
.dataTables_filter input {padding: 4px;}
|
||||
.dataTables_filter {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
.dataTables_paginate {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
div.dt-buttons {
|
||||
|
||||
position: relative;
|
||||
float: right;
|
||||
}
|
||||
.btn-success {
|
||||
background-color: #3c8dbc;
|
||||
border-color: #3c8dbc;
|
||||
}
|
||||
/*#datepick-datepicker-calendar {
|
||||
display: none;
|
||||
} */
|
||||
#datepi>.ui-datepi-calendar
|
||||
{
|
||||
display:none;
|
||||
}
|
||||
.edit{
|
||||
background-color:#eeffcc ! important;
|
||||
}
|
||||
th{
|
||||
text-align:center !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center> Siddharth Industries - Production Salary Cost</center>
|
||||
</h1>
|
||||
</section>
|
||||
</br>
|
||||
</br>
|
||||
<section class="content" id="loadingcontent">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<!--<center><h3 class="box-title">-->
|
||||
<div class="box-tools">
|
||||
|
||||
</div><!--</h3></center>-->
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
|
||||
<div class="box-body">
|
||||
<!-- <div class="row">
|
||||
</div>
|
||||
<hr> -->
|
||||
|
||||
|
||||
<div class="row">
|
||||
<form method="post" id="psc" action="<?php echo base_url() ?>monthlypay/addnew" enctype="multipart/form-data" onSubmit="return validate();" >
|
||||
<div class="col-md-2">
|
||||
<label>Date</label>
|
||||
<div class="form-group"><b>
|
||||
|
||||
<input type="text" class="form-control " style="z-index: 100" id="datepick" name="datepick" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Production/Ton</label>
|
||||
<input type="text" id="pton" name="pton" class="form-control" onkeyup="cal();">
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Employee Present</label>
|
||||
<input type="text" id="today_abs" name="today_abs" class="form-control" readonly
|
||||
value=<?php echo $today; ?> >
|
||||
<!-- <input type="hidden" id="customerid" name="customerid" readonly> -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Total Salary Cost</label>
|
||||
|
||||
<input type="text" class="form-control" name='today_salary' id="today_salary" style="font-size:bold" readonly value=<?php echo $employeeSalary;?> >
|
||||
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>Salary Cost Per Ton </label>
|
||||
<input type="text" id="calc" name="calc" class="form-control" readonly
|
||||
|
||||
>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label> </label>
|
||||
<div align="right">
|
||||
<input type="submit" class="btn btn-primary" value="ADD" />
|
||||
<!-- <input type="submit" onclick="validate();" class="btn btn-primary" value="EDIT" /> -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
|
||||
<form method="post" id="psc" action="<?php echo base_url() ?>monthlypay/salarycost" enctype="multipart/form-data">
|
||||
|
||||
|
||||
|
||||
<div class="col-md-2"><br>
|
||||
|
||||
|
||||
<input type="text" class="form-control monthPicker" style="z-index: 100" id="datepi" name="datepi" >
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-2"><br>
|
||||
<input type="submit" class="btn btn-success" name="btn_submit"
|
||||
value="View Report" id= "btn">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<center>
|
||||
<small>
|
||||
<?php
|
||||
|
||||
if($this->input->post('month')){
|
||||
$month = $this->input->post('month');
|
||||
echo '('.$month.')';
|
||||
|
||||
}
|
||||
?></small>
|
||||
|
||||
<!-- </h3> -->
|
||||
</center>
|
||||
<br/>
|
||||
<table id="testreport" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
|
||||
<thead style="background-color:#ddf;">
|
||||
<tr>
|
||||
|
||||
<th>SNo</th>
|
||||
<th>Date</th>
|
||||
<th>Production/Ton</th>
|
||||
<th>EmployeePresent</th>
|
||||
<th>TotalSalaryCost</th>
|
||||
<th>SalaryCostPerTon</th>
|
||||
<th id="act">Action</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="databaseAppend">
|
||||
<?php
|
||||
if(!empty($productionsalary))
|
||||
{
|
||||
//print_r($productionsalary);
|
||||
foreach($productionsalary as $key => $ps){
|
||||
?>
|
||||
<tr>
|
||||
<td id="sno<?php echo $key?>"><?php echo $ps->sno ?></td>
|
||||
|
||||
|
||||
<td id="datepick<?php echo $key?>"><?php
|
||||
if($ps->date !='0000-00-00'){
|
||||
$date = date("d-m-Y",strtotime($ps->date));
|
||||
}else{
|
||||
$date = '';
|
||||
}
|
||||
echo $date;
|
||||
?>
|
||||
</td>
|
||||
|
||||
<!-- <td id="datepick<?php echo $key?>"><?php echo $ps->date?></td> -->
|
||||
<td contenteditable='true' onkeyup="changeInput(<?php echo $key?>)" id="pton<?php echo $key?>"><?php echo $ps->production ?></td>
|
||||
<td id ="today_abs<?php echo $key?>"><?php echo $ps->emppresent ?></td>
|
||||
<td id="today_salary<?php echo $key?>"><?php
|
||||
echo number_format($ps->totalsalary , 0, '.', '');
|
||||
?></td>
|
||||
<td id="salary<?php echo $key?>"><?php echo number_format($ps->salaryton);?></td>
|
||||
<!-- <td ><i class ="glyphicon glyphicon-file id="edit<?php echo $key?>" onclick ="edit(<?php echo $key?>);"></i></td> -->
|
||||
|
||||
|
||||
|
||||
<td><button type="button" class="btn btn-default" aria-label="Left Align" id="edit<?php echo $key?>" onclick ="edit(<?php echo $key?>);" value=""><u>Save</u>
|
||||
|
||||
</button></td>
|
||||
<!-- class ="glyphicon glyphicon-file" -->
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<p> </p>
|
||||
<hr>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.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.colVis.min.js"></script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
table = $('#testreport').DataTable( {
|
||||
|
||||
"dom": "<'row'<'col-md-3'l><'col-md-9'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
buttons: [
|
||||
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
footer: 'true',
|
||||
//messageTop: $('h3').text(),
|
||||
title: $('h1').text(),
|
||||
exportOptions: {
|
||||
//columns: ':visible'
|
||||
columns: ':lt(6)', orthogonal: 'export'
|
||||
|
||||
}
|
||||
},
|
||||
'colvis'
|
||||
]
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
|
||||
function changeInput(id)
|
||||
{
|
||||
|
||||
//alert (id);
|
||||
var first =parseFloat(document.getElementById('pton'+id).textContent);
|
||||
//alert(first);
|
||||
var second =parseInt(document.getElementById('today_salary'+id).textContent);
|
||||
//alert(second);
|
||||
var cal =first/second;
|
||||
|
||||
var cals =(cal).toFixed(0);
|
||||
|
||||
document.getElementById("salary"+id).innerHTML = cals;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$('#datepick').change(function() {
|
||||
// var datepick = $('#emp').val();
|
||||
var lastChoose = localStorage.getItem("lastChoose");
|
||||
if(lastChoose === $(this).val() ) {
|
||||
alert('Already Choosen')
|
||||
}else {
|
||||
|
||||
|
||||
localStorage.setItem("lastChoose", $(this).val() );
|
||||
var id = $(this).val();
|
||||
//alert(id);
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
dataType: 'json',
|
||||
type:"POST",
|
||||
url:"<?php echo base_url();?>monthlypay/dateFunctionChangeVales",
|
||||
success:function(json) {
|
||||
|
||||
$("#today_abs").val(json.today);
|
||||
|
||||
$("#today_salary").val(json.employeeSalary);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
//var temparr=[];
|
||||
|
||||
|
||||
|
||||
// $('#btn').click(function() {
|
||||
|
||||
|
||||
// var da = $("#datepi").val();
|
||||
|
||||
// //alert(da);
|
||||
|
||||
// $.ajax({
|
||||
// data:{term:da},
|
||||
// dataType: 'json',
|
||||
// type:"POST",
|
||||
// url:"<?php echo base_url();?>monthlypay/forreport",
|
||||
// success:function(json) {
|
||||
|
||||
// console.log (json);
|
||||
|
||||
|
||||
|
||||
//$("#databaseAppend").html("");
|
||||
//$("#act").hide();
|
||||
|
||||
// json.forEach(function(obj) {
|
||||
// $('#databaseAppend').append('<tr>'+
|
||||
// '<td>'+obj.sno+'</td>'+
|
||||
|
||||
// // var date = date('Y-m-d',strtotime($date))+
|
||||
// '<td>'+obj.date+'</td>'+
|
||||
|
||||
|
||||
|
||||
// // '<td contenteditable="true" onkeyup="changeInput('+obj.sno+')" id="pton'+obj.sno+'">'+obj.production+'</td>'+
|
||||
// '<td>'+obj.production+'</td>'+
|
||||
// '<td>'+obj.emppresent+'</td>'+
|
||||
// '<td>'+obj.totalsalary+'</td>'+
|
||||
|
||||
// // '<td id="today_salary'+obj.sno+'">'+obj.totalsalary+'</td>'+
|
||||
|
||||
|
||||
// // '<td id="salary'+obj.sno+'">'+obj.salaryton+'</td>'+
|
||||
// '<td>'+obj.salaryton+'</td>'+
|
||||
// // '<td ><i class ="glyphicon glyphicon-file" id="edit'+obj.sno+'" onclick ="edit('+obj.sno+');"></i></td>'+
|
||||
// '</tr>');
|
||||
// }); -
|
||||
|
||||
// }
|
||||
|
||||
// //alert( da);
|
||||
|
||||
|
||||
// });
|
||||
// });
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// var index="1";
|
||||
function validate()
|
||||
{
|
||||
// if(!empty('#datepick'))
|
||||
// {
|
||||
if($('#datepick').val().length < 1)
|
||||
{
|
||||
alert('Please Enter the Date');
|
||||
$("#datepick").focus();
|
||||
return false;
|
||||
}
|
||||
// }
|
||||
if($('#pton').val().length < 1)
|
||||
{
|
||||
alert('Please Enter the Production');
|
||||
$("#pton").focus();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function cal(){
|
||||
var a= $("#pton").val();
|
||||
var b= $("#today_salary").val();
|
||||
var calc=Math.round(a/b);
|
||||
//alert(calc);
|
||||
$("#calc").val(calc) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function edit(id){
|
||||
|
||||
//alert (id);
|
||||
var sno =parseFloat(document.getElementById('sno'+id).textContent);
|
||||
|
||||
var date =document.getElementById('datepick'+id).innerText;
|
||||
var prod=parseFloat(document.getElementById('pton'+id).textContent);
|
||||
var pra =parseFloat(document.getElementById('today_abs'+id).textContent);
|
||||
var sal =parseFloat(document.getElementById('today_salary'+id).textContent);
|
||||
var ast =parseInt(document.getElementById('salary'+id).textContent);
|
||||
//alert(ast);
|
||||
$.ajax({
|
||||
data:{sno:sno,date:date,prod:prod,pra:pra,sal:sal,ast:ast},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>monthlypay/edited",
|
||||
|
||||
success:function(data){
|
||||
$('#loadingcontent').loader('hide');
|
||||
alert(data);
|
||||
// window.location.href="monthlypay/productionsalary";
|
||||
window.location.reload();
|
||||
|
||||
}//success function closed
|
||||
|
||||
});//ajax function closed
|
||||
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user