本文整理匯總了PHP中Application_Model_User::importEmployee方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application_Model_User::importEmployee方法的具體用法?PHP Application_Model_User::importEmployee怎麽用?PHP Application_Model_User::importEmployee使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Application_Model_User
的用法示例。
在下文中一共展示了Application_Model_User::importEmployee方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: importEmployeeSheetAction
public function importEmployeeSheetAction()
{
$request = $this->getRequest();
$form = new Application_Form_EmployeeImport();
if ($request->isPost()) {
$options = $request->getPost();
if ($form->isValid($options)) {
$user = new Application_Model_User();
$targetPath = $user->uploadEmployeeSheet();
if (file_exists($targetPath)) {
$rows = $user->importEmployee($options, $targetPath);
$this->_flashMessenger->addMessage(array('success' => $rows . ' records imported!'));
$this->_helper->_redirector->gotoUrl($this->view->seoUrl('/hr/import-employee-sheet'));
} else {
$this->_flashMessenger->addMessage(array('error' => 'Import failed'));
$this->_helper->_redirector->gotoUrl($this->view->seoUrl('/hr/import-employee-sheet'));
}
$form->reset();
} else {
$form->reset();
$form->populate($options);
}
}
$this->view->form = $form;
}