本文整理汇总了PHP中Export::saveUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP Export::saveUsers方法的具体用法?PHP Export::saveUsers怎么用?PHP Export::saveUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Export
的用法示例。
在下文中一共展示了Export::saveUsers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
break;
case 'import-users':
$status = User::importFromPost($_FILES['import'] ?: $_POST['pasted']);
if (is_numeric($status))
$msg = "Successfully imported $status clients";
else
$errors['err'] = $status;
break;
default:
$errors['err'] = 'Unknown action/command';
break;
}
} elseif($_REQUEST['a'] == 'export') {
require_once(INCLUDE_DIR.'class.export.php');
$ts = strftime('%Y%m%d');
if (!($token=$_REQUEST['qh']))
$errors['err'] = 'Query token required';
elseif (!($query=$_SESSION['users_qs_'.$token]))
$errors['err'] = 'Query token not found';
elseif (!Export::saveUsers($query, "users-$ts.csv", 'csv'))
$errors['err'] = 'Internal error: Unable to dump query results';
}
$page = $user? 'user-view.inc.php' : 'users.inc.php';
$nav->setTabActive('users');
require(STAFFINC_DIR.'header.inc.php');
require(STAFFINC_DIR.$page);
include(STAFFINC_DIR.'footer.inc.php');
?>
示例2: elseif
$errors['err'] = "Coming soon!";
}
break;
case 'import-users':
$status = User::importFromPost($_FILES['import'] ?: $_POST['pasted']);
if (is_numeric($status)) {
$msg = "Successfully imported {$status} clients";
} else {
$errors['err'] = $status;
}
break;
default:
$errors['err'] = 'Unknown action/command';
break;
}
} elseif ($_REQUEST['a'] == 'export') {
require_once INCLUDE_DIR . 'class.export.php';
$ts = strftime('%Y%m%d');
if (!($token = $_REQUEST['qh'])) {
$errors['err'] = 'Query token required';
} elseif (!($query = $_SESSION['users_qs_' . $token])) {
$errors['err'] = 'Query token not found';
} elseif (!Export::saveUsers($query, "users-{$ts}.csv", 'csv')) {
$errors['err'] = 'Internal error: Unable to dump query results';
}
}
$page = $user ? 'user-view.inc.php' : 'users.inc.php';
$nav->setTabActive('users');
require STAFFINC_DIR . 'header.inc.php';
require STAFFINC_DIR . $page;
include STAFFINC_DIR . 'footer.inc.php';
示例3: sprintf
}
}
break;
case 'import-users':
$status = User::importFromPost($_FILES['import'] ?: $_POST['pasted']);
if (is_numeric($status)) {
$msg = sprintf(__('Successfully imported %1$d %2$s.'), $status, _N('end user', 'end users', $status));
} else {
$errors['err'] = $status;
}
break;
default:
$errors['err'] = __('Unknown action');
break;
}
} elseif ($_REQUEST['a'] == 'export') {
require_once INCLUDE_DIR . 'class.export.php';
$ts = strftime('%Y%m%d');
if (!($token = $_REQUEST['qh'])) {
$errors['err'] = __('Query token required');
} elseif (!($query = $_SESSION['users_qs_' . $token])) {
$errors['err'] = __('Query token not found');
} elseif (!Export::saveUsers($query, __("users") . "-{$ts}.csv", 'csv')) {
$errors['err'] = __('Internal error: Unable to dump query results');
}
}
$page = $user ? 'user-view.inc.php' : 'users.inc.php';
$nav->setTabActive('users');
require STAFFINC_DIR . 'header.inc.php';
require STAFFINC_DIR . $page;
include STAFFINC_DIR . 'footer.inc.php';