Redirect::Page(URLBuilder::getURL(array('filter_user_id' => $data['user_id']), 'UserAccrualBalanceList.php')); break; } default: if (isset($id)) { BreadCrumb::setCrumb($title); $alf = new AccrualListFactory(); $alf->getById($id); foreach ($alf as $a_obj) { //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10); $data = array('id' => $a_obj->getId(), 'user_id' => $a_obj->getUser(), 'accrual_policy_id' => $a_obj->getAccrualPolicyID(), 'type_id' => $a_obj->getType(), 'amount' => $a_obj->getAmount(), 'time_stamp' => $a_obj->getTimeStamp(), 'user_date_total_id' => $a_obj->getUserDateTotalID(), 'created_date' => $a_obj->getCreatedDate(), 'created_by' => $a_obj->getCreatedBy(), 'updated_date' => $a_obj->getUpdatedDate(), 'updated_by' => $a_obj->getUpdatedBy(), 'deleted_date' => $a_obj->getDeletedDate(), 'deleted_by' => $a_obj->getDeletedBy()); } } elseif ($action != 'submit') { if ($user_id == '') { $user_id = $filter_user_id; } $data = array('user_id' => $user_id, 'accrual_policy_id' => $accrual_policy_id, 'amount' => 0, 'time_stamp' => TTDate::getTime()); } $aplf = new AccrualPolicyListFactory(); $accrual_options = $aplf->getByCompanyIDArray($current_company->getId(), TRUE); $ulf = new UserListFactory(); $user_options = $ulf->getByCompanyIDArray($current_company->getId(), TRUE); //Select box options; $data['type_options'] = $af->getOptions('type'); $data['user_options'] = $user_options; $data['accrual_policy_options'] = $accrual_options; $smarty->assign_by_ref('data', $data); break; } $smarty->assign_by_ref('af', $af); $smarty->display('accrual/EditUserAccrual.tpl');