Cost center
This commit is contained in:
parent
50659aa304
commit
0b73a68f1e
@ -1,8 +1,41 @@
|
||||
<script>
|
||||
$(function() {
|
||||
var d = new Date();
|
||||
|
||||
var month = d.getMonth();
|
||||
var day = d.getDate();
|
||||
var year = d.getFullYear() ;
|
||||
var SIAStartYear = year - 2015;
|
||||
var mindt = year-70;
|
||||
var maxdt = year-15;
|
||||
|
||||
|
||||
$("#AddYear").datepicker({
|
||||
minDate : new Date(year-SIAStartYear,1,1),
|
||||
maxDate :new Date(year+3,1,1),
|
||||
dateFormat: 'yy', changeYear: true,
|
||||
|
||||
|
||||
|
||||
});
|
||||
$("#EditYear").datepicker({
|
||||
minDate : new Date(year-SIAStartYear,1,1),
|
||||
maxDate :new Date(year+3,1,1),
|
||||
dateFormat: 'yy', changeYear: true,
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
//$('#selectDistriList').multiSelect();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Add Cost List</center>
|
||||
<center>Siddharth Industries - Add Cost List</center>
|
||||
|
||||
</h1>
|
||||
|
||||
@ -23,18 +56,21 @@
|
||||
<div class="box box-primary">
|
||||
|
||||
<!-- form start -->
|
||||
|
||||
<form role="form" id="addUser" action="<?php echo base_url() ?>addNewcost" method="post" role="form">
|
||||
<?php
|
||||
$attributes = array('class' => 'form-label-left addCost ','name' => 'addCost','id' => 'addCost');
|
||||
|
||||
echo form_open($this->config->base_url().'addNewcost/',$attributes); ?>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="CostName">Cost Center Code:</label>
|
||||
<label for="CostName">Cost Center Code:</label><font color="Red">*</font>
|
||||
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'CostCode','value' => set_value('CostCode'),'id'=>'CostCode', 'class' => 'form-control' ,'required' => 'true');
|
||||
$data = array('name' => 'CostCode','value' => set_value('CostCode'),'id'=>'CostCode', 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;','maxlength'=>'5' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -44,10 +80,10 @@
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="Description">Cost Center Name:</label>
|
||||
<label for="Description">Cost Center Name:</label><font color="Red">*</font>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'CostName','value' => set_value('CostName'),'id'=>'CostName', 'class' => 'form-control' ,'required' => 'true');
|
||||
$data = array('name' => 'CostName','value' => set_value('CostName'),'id'=>'CostName', 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;','maxlength'=>'20');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -58,9 +94,18 @@
|
||||
<div>
|
||||
<?php
|
||||
|
||||
$options["1"] = 'DEP01 | Production';
|
||||
$options["2"] = 'DEP02 | Quality';
|
||||
$options["3"] = 'DEP03 | Admin';
|
||||
$options = array("0"=>'Select Department');
|
||||
//print_r( $options);
|
||||
|
||||
if(!empty($Department))
|
||||
{
|
||||
foreach ($Department as $SID):
|
||||
|
||||
|
||||
$options[$SID->DEPCode] = $SID->DEPCode.' '.' - '.' '.$SID->DepartmentName;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
echo form_multiselect('distriList', $options,set_value('distriList'),'id="distriList"' ,'class="form-control required"','required="true"');
|
||||
|
||||
?>
|
||||
@ -74,21 +119,20 @@
|
||||
</center>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<b>Selected Department</b>
|
||||
<div style="margin-top: 5px;">
|
||||
<b> </b>
|
||||
|
||||
<?php
|
||||
$option["0"] = '';
|
||||
echo form_multiselect('selectDistriList', $option,set_value('selectDistriList'),'id="selectDistriList"' ,'class="form-control"','required="true"');
|
||||
$option["0"] = 'Selected Department';
|
||||
echo form_multiselect('selectDistriList[]', $option,set_value('selectDistriList[]'),'id="selectDistriList"','size="10"');
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div col="row">
|
||||
<div class="col-md-offset-8" style="text-align:right">
|
||||
|
||||
<button class="btn btn-info btn-md" data-toggle="modal" data-target="#addbudgetmodel"> Add Budget</button>
|
||||
<a data-toggle="modal" href="#addbudgetmodel" class="btn btn-info"><i class="fa fa-plus"></i> Add Budget</a>
|
||||
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="addbudgetmodel" tabindex="-1" role="dialog"
|
||||
@ -117,13 +161,24 @@
|
||||
Budget Type :
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<select class="form-control" id="exampleSelect1">
|
||||
<option>1</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>4</option>
|
||||
<option>5</option>
|
||||
</select>
|
||||
|
||||
<?php
|
||||
|
||||
$options = array("-1"=>'Select Budget Type');
|
||||
//print_r( $options);
|
||||
|
||||
if(!empty($BudgetType))
|
||||
{
|
||||
foreach ($BudgetType as $SID):
|
||||
|
||||
|
||||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
|
||||
echo form_dropdown('Addbudget',$options,set_value('Addbudget'),'id="Addbudget"', 'class = "form-control "'); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -134,7 +189,8 @@
|
||||
Budget Year :
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text">
|
||||
|
||||
<input class="form-control" name="AddYear" class="form-control datepicker" id="AddYear" onkeypress="return false;" type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -145,7 +201,8 @@
|
||||
Budget Amount :
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text">
|
||||
|
||||
<input class="form-control" onkeypress="return isNumberKey(event);" name="AddAmout" class="form-control" id="AddAmout" type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -156,8 +213,8 @@
|
||||
Remarks :
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text">
|
||||
|
||||
|
||||
<input class="form-control" name="AddRemarks" class="form-control" id="AddRemarks" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -166,8 +223,8 @@
|
||||
|
||||
<!-- Modal Footer -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" value="Add">Add</button>
|
||||
<button type="button" class="btn btn-info" data-dismiss="modal" value="Cancel">cancel</button>
|
||||
<a class="btn btn-info font tempClick" ID="tempClick" style="margin-top: -24px;"><i class="fa fa-plus"></i> <span class="bold">Add</span></a>
|
||||
<a class="btn btn-info" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -178,60 +235,18 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table id="mytable" class="table table-bordred table-striped editableTable">
|
||||
<thead style="background-color: #CFCFCF;">
|
||||
<table id="BudgetTable" class="table table-striped responsive-utilities jambo_table" style="display:none;">
|
||||
<thead style="background-color: #CFCFCF;">
|
||||
|
||||
<th>Budget Type</th>
|
||||
<th>Budget Year</th>
|
||||
<th>Budget Amount</th>
|
||||
<th>Remarks</th>
|
||||
<th>Action</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody id="tempAppend">
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
|
||||
<td>PO</td>
|
||||
<td>2017</td>
|
||||
<td>0.00</td>
|
||||
<td>Remarks</td>
|
||||
<td> <i class="fa fa-pencil" data-toggle="modal" data-target="#Edit"></i>
|
||||
<i><button class="btn btn-danger btn-xs" Onclick="ConfirmDelete()"><span class="glyphicon glyphicon-trash"></span></button></i>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td>SO</td>
|
||||
<td>2017</td>
|
||||
<td>0.00</td>
|
||||
<td>Remarks</td>
|
||||
<td> <i class="fa fa-pencil" data-toggle="modal" data-target="#Edit"></i>
|
||||
<i><button class="btn btn-danger btn-xs" Onclick="ConfirmDelete()"><span class="glyphicon glyphicon-trash"></span></button></i>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IO</td>
|
||||
<td>2017</td>
|
||||
<td>0.00</td>
|
||||
<td>Remarks</td>
|
||||
<td> <i class="fa fa-pencil" data-toggle="modal" data-target="#Edit"></i>
|
||||
<i><button class="btn btn-danger btn-xs" Onclick="ConfirmDelete()"><span class="glyphicon glyphicon-trash"></span></button></i>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td>CO</td>
|
||||
<td>2017</td>
|
||||
<td>0.00</td>
|
||||
<td>Remarks</td>
|
||||
<td> <i class="fa fa-pencil" data-toggle="modal" data-target="#Edit"></i>
|
||||
<i><button class="btn btn-danger btn-xs" Onclick="ConfirmDelete()"><span class="glyphicon glyphicon-trash"></span></button></i>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Modal For edit -->
|
||||
@ -255,27 +270,32 @@
|
||||
<form class="form-horizontal" role="form">
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-offset-2">
|
||||
<div class="col-md-3 col-md-offset-2">
|
||||
Budget Type :
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<select class="form-control" id="exampleSelect1">
|
||||
<option>SO</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>4</option>
|
||||
<option>5</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<?php
|
||||
$data = array('name' => 'Editbudget', 'value' => set_value('Editbudget'),'id'=>'Editbudget', 'class' => 'form-control','readonly'=>'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-offset-2">
|
||||
Budget Year :
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text">
|
||||
<?php
|
||||
$data = array('name' => 'EditYear', 'value' => set_value('EditYear'),'id'=>'EditYear', 'class' => 'form-control','onkeypress'=>'return isNumberKey(event);','onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -285,25 +305,35 @@
|
||||
Budget Amount :
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text">
|
||||
<?php
|
||||
$data = array('name' => 'EditAmout', 'value' => set_value('EditAmout'),'id'=>'EditAmout', 'class' => 'form-control','onkeypress'=>'return isNumberKey(event);');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-offset-2">
|
||||
Remarks :
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-info" value="Add">Update</button>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" value="Cancel">cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-offset-2">
|
||||
Remarks :
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<?php
|
||||
$data = array('name' => 'EditRemarks', 'value' => set_value('EditRemarks'),'id'=>'EditRemarks', 'class' => 'form-control');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- Modal Footer -->
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-info font tempClickEdit" ID="tempClickEdit" style="margin-top: -24px;"><i class="fa fa-plus"></i> <span class="bold">Edit</span></a>
|
||||
<a class="btn btn-info" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -311,7 +341,38 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-offset-9">
|
||||
<div class="form-group">
|
||||
<label for="CostName">Approved By:</label><font color="Red">*</font>
|
||||
|
||||
<div class="form-group">
|
||||
<?php
|
||||
|
||||
$options = array("-1"=>'Select Approver');
|
||||
//print_r( $options);
|
||||
|
||||
if(!empty($Approver))
|
||||
{
|
||||
foreach ($Approver as $SID):
|
||||
|
||||
|
||||
$options[$SID->EmpID] = $SID->EmpID . " - " . $SID->FirstName . " - " . $SID->Designation;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
|
||||
echo form_dropdown('ApprovedBy',$options,set_value('ApprovedBy'),'id="ApprovedBy"', 'class = "form-control "'); ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content"></div>
|
||||
<div class="box-footer" style="text-align:right">
|
||||
<input type="hidden" name="txtSelectedDepartment" id="txtSelectedDepartment" />
|
||||
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
||||
<input type="submit" class="btn btn-info" value="Submit" />
|
||||
<input type="reset" class="btn btn-info" value="Cancel" />
|
||||
</div>
|
||||
@ -354,7 +415,163 @@
|
||||
</section>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
<script type="text/html" id="tempList">
|
||||
<tr id="<%=index%>">
|
||||
|
||||
<?php
|
||||
$data = array('name' => '"Budget[<%=index%>][index]"', 'value' => set_value('<%=index%>'),'id'=>'"Budget[<%=index%>][index]"', 'class' => 'form-control','type'=>'hidden');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
<td align="left"><%=BudgetType%></td>
|
||||
|
||||
<td align="left"><%=BudgetYear%></td>
|
||||
|
||||
<td align="left"><%=BudgetAmount%></td>
|
||||
|
||||
<td align="left"><%=Remarks%></td>
|
||||
<td>
|
||||
<a data-target='#Edit' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#Edit"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=BudgetType%> Budget details"></i> </a>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</script>
|
||||
<script>
|
||||
var index = '1';
|
||||
var numbers = /^[0-9]+$/;
|
||||
var userid = '';
|
||||
|
||||
$("#Edit").on("shown.bs.modal", function(e) {
|
||||
userid = $(e.relatedTarget).data('userid');
|
||||
|
||||
$('#Editbudget').val($('#BudgetTable tr:eq('+ userid +') td:eq(0)').text());
|
||||
$('#EditYear').val($('#BudgetTable tr:eq('+ userid +') td:eq(1)').text());
|
||||
$('#EditAmout').val($('#BudgetTable tr:eq('+ userid +') td:eq(2)').text());
|
||||
$('#EditRemarks').val($('#BudgetTable tr:eq('+ userid +') td:eq(3)').text());
|
||||
});
|
||||
|
||||
|
||||
$('.tempClick').click(function(){
|
||||
|
||||
if ($("#Addbudget option:selected").val() =='-1' )
|
||||
{
|
||||
alert('Please Select the Budget Type ');
|
||||
//return;
|
||||
}
|
||||
|
||||
if(document.getElementById('AddYear').value == '' )
|
||||
{
|
||||
alert('Please Enter the Budget Year');
|
||||
//return;
|
||||
}
|
||||
if(document.getElementById('AddAmout').value == '' )
|
||||
{
|
||||
alert('Please Enter the Budget Amount');
|
||||
// return;
|
||||
}
|
||||
|
||||
|
||||
if ($("#Addbudget option:selected").val() !='-1' && $('#AddYear').val() && $('#AddAmout').val() )
|
||||
{
|
||||
|
||||
$('#BudgetTable').show();
|
||||
var temp = index;
|
||||
var BudType = $("#Addbudget option:selected").val();
|
||||
var BudYear = $("#AddYear").val();
|
||||
var BudAmount = $("#AddAmout").val();
|
||||
$('#Addbudget option[value='+BudType+']').remove();
|
||||
var BudRemarks = $('#AddRemarks').val();
|
||||
$('#AddYear').val('');
|
||||
$('#AddAmout').val('');
|
||||
$('#AddRemarks').val('');
|
||||
|
||||
|
||||
index = parseInt(index)+1;
|
||||
|
||||
|
||||
|
||||
var template = jQuery("#tempList").html();
|
||||
|
||||
|
||||
$('#tempAppend').append(_.template(template,{index:temp,BudgetType:BudType,BudgetYear:BudYear,BudgetAmount:BudAmount,Remarks:BudRemarks}));
|
||||
|
||||
|
||||
var theForm = $(".addCost");
|
||||
|
||||
addHidden(theForm,"BudgetType"+temp,BudType);
|
||||
addHidden(theForm,"BudgetYear"+temp,BudYear);
|
||||
addHidden(theForm,"BudgetAmount"+temp,BudAmount);
|
||||
addHidden(theForm,"Remarks"+temp,BudRemarks);
|
||||
|
||||
$('#txtRowCount').val(temp);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please enter all the values');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function addHidden(theForm, key, value) {
|
||||
// Create a hidden input element, and append it to the form:
|
||||
var input = document.createElement('input');
|
||||
input.type = 'hidden';
|
||||
input.name = key;'name-as-seen-at-the-server';
|
||||
input.value = value;
|
||||
theForm.append(input);
|
||||
}
|
||||
|
||||
|
||||
$('.tempClickEdit').click(function(){
|
||||
|
||||
|
||||
|
||||
if(document.getElementById('EditYear').value == '' )
|
||||
{
|
||||
alert('Please Enter the Budget Year');
|
||||
//return;
|
||||
}
|
||||
if(document.getElementById('EditAmout').value == '' )
|
||||
{
|
||||
alert('Please Enter the Budget Amount');
|
||||
// return;
|
||||
}
|
||||
|
||||
|
||||
if ( $('#EditAmout').val() != '' && $('#EditYear').val() != '' )
|
||||
{
|
||||
|
||||
var temp = index;
|
||||
var BudYear = $("#EditYear").val();
|
||||
var BudAmount = $("#EditAmout").val();
|
||||
|
||||
var BudRemarks = $('#EditRemarks').val();
|
||||
|
||||
|
||||
$('#BudgetTable tr:eq('+ userid +') td:eq(1)').text(BudYear);
|
||||
$('#BudgetTable tr:eq('+ userid +') td:eq(2)').text(BudAmount);
|
||||
$('#BudgetTable tr:eq('+ userid +') td:eq(3)').text(BudRemarks);
|
||||
|
||||
$('#BudgetYear'+userid).val(BudYear);
|
||||
$('#BudgetAmount'+userid).val(BudAmount);
|
||||
$('#Remarks'+userid).val(BudRemarks);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please enter all the values');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
function ConfirmDelete()
|
||||
{
|
||||
@ -364,17 +581,51 @@
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function isNumberKey(evt)
|
||||
{
|
||||
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
||||
if (charCode != 46 && charCode > 31
|
||||
&& (charCode < 48 || charCode > 57))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
$('#addPop').click(function () {
|
||||
if ($('#distriList option:selected').val() != null) {
|
||||
var tempSelect = $('#distriList option:selected').val();
|
||||
$('#distriList option:selected').remove().appendTo('#selectDistriList');
|
||||
var tempText = $('#distriList option:selected').text();
|
||||
|
||||
var o = new Option(tempText,tempSelect);
|
||||
var hidval = tempSelect;
|
||||
var orgVal = $('#txtSelectedDepartment').val();
|
||||
var Selectedval = ''
|
||||
|
||||
if(orgVal != '')
|
||||
{
|
||||
Selectedval = orgVal + ':' + hidval;
|
||||
}
|
||||
else
|
||||
{
|
||||
Selectedval = hidval
|
||||
}
|
||||
$('#txtSelectedDepartment').val(Selectedval);
|
||||
|
||||
$(o).html(tempText);
|
||||
$("#selectDistriList").append(o);
|
||||
|
||||
|
||||
$('#distriList option:selected').remove();
|
||||
$("#distriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected");
|
||||
$("#selectDistriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected");
|
||||
$("#selectDistriList").val(tempSelect);
|
||||
$("#selectDistriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected");
|
||||
|
||||
tempSelect = '';
|
||||
tempText = '';
|
||||
Selectedval = '';
|
||||
} else {
|
||||
alert("Before add please select any position.");
|
||||
}
|
||||
@ -393,25 +644,37 @@
|
||||
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>
|
||||
|
||||
var baseurl = "<?php print base_url(); ?>";
|
||||
$(".addCost").submit(function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:$('.addCost').serialize(),
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>CostCenter/addNewcost",
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
$('#txtSelectedDepartment').val('');
|
||||
$('#txtRowCount').val('');
|
||||
|
||||
window.location = baseurl + 'CostCenter/CostListing';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
alert("Error");
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user