本文整理汇总了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;
}