Cost center
This commit is contained in:
parent
6d28fe12a5
commit
f75cbb9f87
@ -46,12 +46,13 @@ class CostCenter extends BaseController
|
|||||||
$data['searchText'] = $searchText;
|
$data['searchText'] = $searchText;
|
||||||
|
|
||||||
|
|
||||||
$count = $this->costcenter_model->costListingCount($searchText);
|
$count = $this->costcenter_model->CostListingCount($searchText);
|
||||||
|
|
||||||
$returns = $this->paginationCompress ( "costListing/", $count, 5 );
|
$returns = $this->paginationCompress ( "costListing/", $count, 5 );
|
||||||
|
|
||||||
$data['userRecords'] = $this->costcenter_model->costListing($searchText, $returns["page"], $returns["segment"]);
|
$data['userRecords'] = $this->costcenter_model->CostListing($searchText, $returns["page"], $returns["segment"]);
|
||||||
|
|
||||||
|
//print_r( $data) ;
|
||||||
$this->global['pageTitle'] = 'Siddharth : Test List';
|
$this->global['pageTitle'] = 'Siddharth : Test List';
|
||||||
|
|
||||||
$this->loadViews("costListing", $this->global, $data, NULL);
|
$this->loadViews("costListing", $this->global, $data, NULL);
|
||||||
@ -75,6 +76,20 @@ class CostCenter extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Dep_SelectedDepartment($selectValue)
|
||||||
|
{
|
||||||
|
//echo 'select_validate method called';
|
||||||
|
// 'none' is the first option and the text says something like "-Choose one-"
|
||||||
|
if(strlen($SelectedDepartment) <= 0 )
|
||||||
|
{
|
||||||
|
$this->form_validation->set_message('Dep_SelectedDepartment', 'Please Select Department.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else // user picked something
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is used to add new Cost to the system
|
* This function is used to add new Cost to the system
|
||||||
@ -85,31 +100,7 @@ class CostCenter extends BaseController
|
|||||||
|
|
||||||
$this->form_validation->set_rules('CostCode','CostCode','trim|required');
|
$this->form_validation->set_rules('CostCode','CostCode','trim|required');
|
||||||
$this->form_validation->set_rules('CostName','CostName','trim|required');
|
$this->form_validation->set_rules('CostName','CostName','trim|required');
|
||||||
|
|
||||||
$SelectedDepartment = $this->input->post('txtSelectedDepartment');
|
|
||||||
$ApproverName = $this->input->post('ApprovedBy');
|
|
||||||
//print_r($ApproverName);
|
|
||||||
$Deptlist = explode(':', $SelectedDepartment);
|
|
||||||
|
|
||||||
if(strlen($SelectedDepartment) <= 0 )
|
|
||||||
{
|
|
||||||
print_r('Please select Department');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$RowCount = $this->input->post('txtRowCount');
|
|
||||||
|
|
||||||
if($RowCount <= 0 )
|
|
||||||
{
|
|
||||||
print_r('Please Add Budget');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($ApproverName == "-1" )
|
|
||||||
{
|
|
||||||
print_r('Please Select Approver');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if($this->form_validation->run() == FALSE)
|
if($this->form_validation->run() == FALSE)
|
||||||
{
|
{
|
||||||
$this->addCostCenter();
|
$this->addCostCenter();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user