本文整理汇总了PHP中BuckysUser::getUserEmploymentHistory方法的典型用法代码示例。如果您正苦于以下问题:PHP BuckysUser::getUserEmploymentHistory方法的具体用法?PHP BuckysUser::getUserEmploymentHistory怎么用?PHP BuckysUser::getUserEmploymentHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BuckysUser
的用法示例。
在下文中一共展示了BuckysUser::getUserEmploymentHistory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
require dirname(__FILE__) . '/includes/bootstrap.php';
//If the user is not logged in, redirect to the index page
if (!($userID = buckys_is_logged_in())) {
buckys_redirect('/index.php');
}
//Getting UserData from Id
$userData = BuckysUser::getUserEmploymentHistory($userID);
if (isset($_POST['action'])) {
//Check the user id is same with the current logged user id
if ($_POST['userID'] != $userID) {
echo 'Invalid Request!';
exit;
}
//Save Address
if ($_POST['action'] == 'save_employment') {
$data = [];
for ($i = 0; $i < count($_POST['employer']); $i++) {
$data[] = ['employer' => $_POST['employer'][$i], 'start' => $_POST['from'][$i], 'end' => $_POST['to'][$i], 'visibility' => $_POST['visibility'][$i]];
}
//Update User Phone numbers
if (BuckysUser::updateUserEmploymentHistory($userID, $data)) {
echo 'Success';
} else {
echo $db->getLastError();
}
exit;
}
}
buckys_enqueue_stylesheet('account.css');
示例2: getEmployeeInfoAction
public function getEmployeeInfoAction()
{
$request = $_GET;
$token = isset($request['TOKEN']) ? trim($request['TOKEN']) : null;
if (!$token) {
return ['STATUS_CODE' => STATUS_CODE_BAD_REQUEST, 'DATA' => buckys_api_get_error_result('Api token should not be blank')];
}
if (!($userID = BuckysUsersToken::checkTokenValidity($token, "api"))) {
return ['STATUS_CODE' => STATUS_CODE_UNAUTHORIZED, 'DATA' => buckys_api_get_error_result('Api token is not valid.')];
}
$employeeInfo = BuckysUser::getUserEmploymentHistory($userID);
return ['STATUS_CODE' => STATUS_CODE_OK, 'DATA' => ['STATUS' => 'SUCCESS', 'RESULT' => $employeeInfo]];
}