editable payslip added

This commit is contained in:
saravanakumar_kandasami 2017-05-04 18:27:54 +05:30
parent 206238b673
commit 50659aa304
8 changed files with 333 additions and 6 deletions

View File

@ -324,6 +324,7 @@ echo "<script>alert('Record Not Saved!');</script>";
print_r($query);
}
function pageNotFound()
{
$this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found';

View File

@ -326,6 +326,12 @@ function getEmployee()
}
function updatepayroll()
{
$this->global['pageTitle'] = 'Update Payroll';
$this->loadViews("payslipeditable", $this->global, NULL , NULL);
}
function pageNotFound()
{

View File

@ -0,0 +1,23 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
ERROR - 2017-05-04 12:39:43 --> Severity: Warning --> mysqli_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
C:\xampp\htdocs\siddharth_application\system\database\drivers\mysqli\mysqli_driver.php 77
ERROR - 2017-05-04 12:39:43 --> Unable to connect to the database
ERROR - 2017-05-04 12:40:17 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:40:17 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:40:17 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:41:09 --> Severity: Warning --> mysqli_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
C:\xampp\htdocs\siddharth_application\system\database\drivers\mysqli\mysqli_driver.php 77
ERROR - 2017-05-04 12:41:09 --> Unable to connect to the database
ERROR - 2017-05-04 12:42:33 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:42:33 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:42:33 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:42:37 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:42:37 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:42:37 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:42:50 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:42:50 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:42:50 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:49:04 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:49:04 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86
ERROR - 2017-05-04 12:49:04 --> Severity: Notice --> Undefined index: PayOn C:\xampp\htdocs\siddharth_application\application\views\payslipgenerate.php 86

View File

@ -1,5 +1,3 @@
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
@ -77,12 +75,13 @@
</div>
<div class="col-md-2">
<b>Selected Department</b>
<div style="margin-top: 5px;">
<?php
$option["0"] = '';
echo form_multiselect('selectDistriList', $option,set_value('selectDistriList'),'id="selectDistriList"' ,'class="form-control"','required="true"');
?>
</div>
</div>
</div>
<br>
@ -179,7 +178,7 @@
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table id="mytable" class="table table-bordred table-striped">
<table id="mytable" class="table table-bordred table-striped editableTable">
<thead style="background-color: #CFCFCF;">
<th>Budget Type</th>
<th>Budget Year</th>
@ -394,5 +393,25 @@
alert("Before remove please select any position.");
}
});
$(function () {
$("td").dblclick(function () {
var OriginalContent = $(this).text();
$(this).addClass("cellEditing");
$(this).html("<input type='text' value='" + OriginalContent + "' />");
$(this).children().first().focus();
$(this).children().first().keypress(function (e) {
if (e.which == 13) {
var newContent = $(this).val();
$(this).parent().text(newContent);
$(this).parent().removeClass("cellEditing");
} });
$(this).children().first().blur(function(){
$(this).parent().text(OriginalContent);
$(this).parent().removeClass("cellEditing");
});
});
});
</script>

View File

@ -18,7 +18,7 @@
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<center><h3 class="box-title">Cost List</h3></center>
<div class="box-tools">
<form action="<?php echo base_url() ?>CostCenter/costListing" method="POST" id="searchList">
<div class="input-group">

View File

@ -137,6 +137,7 @@
</a>
</li>
<li class="treeview">
<span id="menu" data-toggle="dropdown"><i class="fa fa-database" aria-hidden="true"></i> Master Details<span class="caret"></span></span>
<ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
@ -277,6 +278,11 @@
<span>PaySlip Generator</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>payslip/updatepayroll" >
<i class="fa fa-dashboard"></i> <span>Payslip</span>
</a>
</li>
</ul>
</li>
<?php

View File

@ -0,0 +1,271 @@
<script>
$(function() {
//Initialize Select2 Elements
$(".select2").select2();
//$('#content').html('<img id="loader-img" alt="" src="<?php echo base_url();?>assets/dist/loader.gif" align="center" />');
$('#All').click(function(){
//alert('clicked');
if ($('#All').prop('checked'))
{
$('#Employee').attr('disabled', 'true');
}
else
{
$('#Employee').removeAttr('disabled');
}
});
$('#PayOn').change(function() {
var id = $('#PayOn').val();
if(id != '-1')
{
$('#content').loader('show');
$.ajax({
data:{id:id},
type:"POST",
url:"<?php echo base_url();?>payslip/getEmployee",
success:function(result) {
if(result)
{
$("#Employee").empty();
$('#content').loader('hide');
$("#Employee").append(result);
}
}
});
}
else
{
alert('Please select the PayOn');
return false;
}
});
});
<!-- Editable table-->
$(function () {
$("td").dblclick(function () {
var OriginalContent = $(this).text();
$(this).addClass("cellEditing");
$(this).html("<input type='text' value='" + OriginalContent + "' />");
$(this).children().first().focus();
$(this).children().first().keypress(function (e) {
if (e.which == 13) {
var newContent = $(this).val();
$(this).parent().text(newContent);
$(this).parent().removeClass("cellEditing");
} });
$(this).children().first().blur(function(){
$(this).parent().text(OriginalContent);
$(this).parent().removeClass("cellEditing");
});
});
});
</script>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Siddharth Industries - PaySlip Create and Update</center>
</h1>
</section>
<section class="content">
<div class="row" style="border:2px dotted; padding:5%">
<form id="PayslipGenerator" action="<?php echo base_url() ?>PrintPdf" method="post" role="form" >
<div class="row" >
<div class="col-md-4">
<span for="selectmonth">Select Month</span>
<select id="PayOn" name="PayOn" class="form-control select2" style="width: 100%;">
<option value="-1">Select Payon Month</option>
<?php
if(!empty($Payon))
{
foreach ($Payon as $rl)
{
$Pay =$rl->PayOn;
if ($_POST['PayOn'] == $Pay)
{
echo "<option value=\"".$Pay."\" selected=\"selected\">".$Pay."</option>";
}
else
{
echo "<option value=\"".$Pay."\">".$Pay."</option>";
}
}
}
?>
</select>
</div>
<div id="content"></div>
<div class="col-md-4 ">
<span>Employee ID</span>
<select id="Employee" name="Employee" class="form-control select2" type="text" class="form-control">
<option value="-1">Select Employee ID</option>
</select>
<br/>
<input class="my-check" type="checkbox" name="All" id="All" > Select All<br>
</div>
<div class="col-md-4 my-box">
<span>Employee Name</span>
<div class="form-group">
<?php
$data = array('name' => 'emp_name','value' => set_value('emp_name'),'id'=>'emp_name', 'class' => 'form-control' ,'required' => 'true' , 'readonly' => 'true');
echo form_input($data);
?>
<br/>
</div>
</div>
</div>
<script>
<!-- To hide the Employee name if select all employee id-->
$(".my-check").change(function() {
if ( $(this).is(':checked') ) {
$(".my-box").hide();
} else {
$(".my-box").show();
}
});
</script>
<div class="row" >
<table id="mytable" class="table table-bordred table-striped editableTable">
<thead style="background-color: #CFCFCF;">
<th>Employee ID</th>
<th>OT in Hours</th>
<th>Incentive</th>
<th>Loan recoveries</th>
<th>Mode Of Payment</th>
<th>Remarks</th>
<th>Action</th>
</thead>
<tbody>
<tr>
<td>Emp001</td>
<td>40</td>
<td>2000</td>
<td>5000</td>
<td>Cheque</td>
<td>Pending Loan amount 25000 </td>
<td>
<i><button class="btn btn-danger btn-xs" Onclick="ConfirmDelete()"><span class="fa fa-eye"></span></button></i>
</td>
</tr>
<tr>
<td>Emp002</td>
<td>20</td>
<td>1500</td>
<td>0.00</td>
<td>Account</td>
<td>Good</td>
<td>
<i><button class="btn btn-danger btn-xs" Onclick="ConfirmDelete()"><span class="fa fa-eye"></span></button></i>
</td>
</tr>
<tr>
<td>Emp003</td>
<td>0</td>
<td>1900</td>
<td>0.00</td>
<td>Account</td>
<td>Good</td>
<td>
<i><button class="btn btn-danger btn-xs" Onclick="ConfirmDelete()"><span class="fa fa-eye"></span></button></i>
</td>
</tr>
<tr>
<td>Emp004</td>
<td>25</td>
<td>1549</td>
<td>0.00</td>
<td>On Hold</td>
<td>Good</td>
<td>
<i><button class="btn btn-danger btn-xs" Onclick="ConfirmDelete()"><span class="fa fa-eye"></span></button></i>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-4 col-md-offset-6" align = "right">
<input type="submit" class="btn btn-info" value="Generate" />
</div>
<div class="row" >
<?php
$this->load->helper('form');
$error = $this->session->flashdata('error');
if($error)
{
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('error'); ?>
</div>
<?php } ?>
<?php
$success = $this->session->flashdata('success');
if($success)
{
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('success'); ?>
</div>
<?php } ?>
<div class="row">
<div class="col-md-4">
<?php echo validation_errors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?>
</div>
</div>
</div>
</div>
</section>
</div>

View File

@ -115,6 +115,7 @@ $("#Employee").empty();
<div class="col-md-4 col-md-offset-6" align = "right">
<input type="submit" class="btn btn-info" value="Generate" />
<a href="<?php echo base_url(); ?>payslip/updatepayroll" ><input type="submit" class="btn btn-info" value="Update" /></a>
</div>
</div>