cost center
This commit is contained in:
parent
40a5564b11
commit
c3e0195cf4
@ -104,6 +104,7 @@ class CostCenter extends BaseController
|
|||||||
$CostName = strtoupper(trim($this->input->post('CostName')));
|
$CostName = strtoupper(trim($this->input->post('CostName')));
|
||||||
$CreateBy = $this->session->userdata ( 'userId' );
|
$CreateBy = $this->session->userdata ( 'userId' );
|
||||||
$SelectedDepartment = $this->input->post('txtSelectedDepartment');
|
$SelectedDepartment = $this->input->post('txtSelectedDepartment');
|
||||||
|
//echo $SelectedDepartment;
|
||||||
$ApproverName = $this->input->post('ApprovedBy');
|
$ApproverName = $this->input->post('ApprovedBy');
|
||||||
$comma_separated = explode(':', $SelectedDepartment);
|
$comma_separated = explode(':', $SelectedDepartment);
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
@ -247,6 +248,8 @@ class CostCenter extends BaseController
|
|||||||
$CostName = strtoupper(trim($this->input->post('CostName')));
|
$CostName = strtoupper(trim($this->input->post('CostName')));
|
||||||
$updatedBy = $this->session->userdata ( 'userId' );
|
$updatedBy = $this->session->userdata ( 'userId' );
|
||||||
$SelectedDepartment = $this->input->post('txtSelectedDepartment');
|
$SelectedDepartment = $this->input->post('txtSelectedDepartment');
|
||||||
|
//echo $SelectedDepartment;
|
||||||
|
|
||||||
$ApproverName = $this->input->post('ApprovedBy');
|
$ApproverName = $this->input->post('ApprovedBy');
|
||||||
$comma_separated = "";
|
$comma_separated = "";
|
||||||
//print_r(strlen($SelectedDepartment));
|
//print_r(strlen($SelectedDepartment));
|
||||||
@ -254,6 +257,9 @@ class CostCenter extends BaseController
|
|||||||
{
|
{
|
||||||
$comma_separated = explode(':', $SelectedDepartment);
|
$comma_separated = explode(':', $SelectedDepartment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//print_r($comma_separated);
|
||||||
|
//echo count($comma_separated);
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
|
|
||||||
$updateddt = $dt->format('Y-m-d H:i:s');
|
$updateddt = $dt->format('Y-m-d H:i:s');
|
||||||
@ -267,8 +273,11 @@ class CostCenter extends BaseController
|
|||||||
}
|
}
|
||||||
//echo count($comma_separated);
|
//echo count($comma_separated);
|
||||||
|
|
||||||
if(count($comma_separated)> 1)
|
if(count($comma_separated)> 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//echo "scs";
|
||||||
|
//die();
|
||||||
for ($j = 0; $j < count($comma_separated); $j++)
|
for ($j = 0; $j < count($comma_separated); $j++)
|
||||||
{
|
{
|
||||||
$DeptCode = $comma_separated[$j];
|
$DeptCode = $comma_separated[$j];
|
||||||
@ -276,6 +285,8 @@ class CostCenter extends BaseController
|
|||||||
$this->costcenter_model->DeleteDepartment( $DeptCode,$CostCode);
|
$this->costcenter_model->DeleteDepartment( $DeptCode,$CostCode);
|
||||||
|
|
||||||
$Dept = array('CostCenterCode'=>$CostCode, 'DEPCode'=>$DeptCode,'CreatedBy'=>$updatedBy,'createdDate'=>$updateddt,'UpdatedBy'=>$updatedBy,'UpdatedDate'=>$updateddt);
|
$Dept = array('CostCenterCode'=>$CostCode, 'DEPCode'=>$DeptCode,'CreatedBy'=>$updatedBy,'createdDate'=>$updateddt,'UpdatedBy'=>$updatedBy,'UpdatedDate'=>$updateddt);
|
||||||
|
|
||||||
|
//print_r($Dept);
|
||||||
$this->costcenter_model->addCostCenterDepartment($Dept);
|
$this->costcenter_model->addCostCenterDepartment($Dept);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -294,7 +305,7 @@ class CostCenter extends BaseController
|
|||||||
|
|
||||||
$Budget = array('CostCenterCode'=>$CostCode, 'BudgetType'=>$BudgetType,'BudgetYear'=>$BudgetYear,'BudgetAmount'=>$BudgetAmount,'Remarks'=>$Remarks,'CreatedBy'=>$updatedBy,'createdDate'=>$updateddt,'UpdatedBy'=>$updatedBy,'UpdatedDate'=>$updateddt);
|
$Budget = array('CostCenterCode'=>$CostCode, 'BudgetType'=>$BudgetType,'BudgetYear'=>$BudgetYear,'BudgetAmount'=>$BudgetAmount,'Remarks'=>$Remarks,'CreatedBy'=>$updatedBy,'createdDate'=>$updateddt,'UpdatedBy'=>$updatedBy,'UpdatedDate'=>$updateddt);
|
||||||
$this->costcenter_model->addBudget($Budget);
|
$this->costcenter_model->addBudget($Budget);
|
||||||
print_r( $BudgetType );
|
//print_r( $BudgetType );
|
||||||
}
|
}
|
||||||
|
|
||||||
echo('Successfully Updated Cost details');
|
echo('Successfully Updated Cost details');
|
||||||
|
|||||||
@ -59,7 +59,7 @@ function addNewcost($Cost)
|
|||||||
$insert_id = $this->db->affected_rows();
|
$insert_id = $this->db->affected_rows();
|
||||||
|
|
||||||
$this->db->trans_complete();
|
$this->db->trans_complete();
|
||||||
// print_r( $this->db->last_query());
|
// print_r( $this->db->last_query());
|
||||||
return $insert_id;
|
return $insert_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -757,7 +757,7 @@ $('.tempClickEdit').click(function(){
|
|||||||
if ($('#distriList option:selected').val() != null) {
|
if ($('#distriList option:selected').val() != null) {
|
||||||
var tempSelect = $('#distriList option:selected').val();
|
var tempSelect = $('#distriList option:selected').val();
|
||||||
var tempText = $('#distriList option:selected').text();
|
var tempText = $('#distriList option:selected').text();
|
||||||
|
//alert(tempSelect);
|
||||||
var o = new Option(tempText,tempSelect);
|
var o = new Option(tempText,tempSelect);
|
||||||
var hidval = tempSelect;
|
var hidval = tempSelect;
|
||||||
var orgVal = $('#txtSelectedDepartment').val();
|
var orgVal = $('#txtSelectedDepartment').val();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user