当前位置: 首页>>代码示例>>PHP>>正文


PHP BuckysUser::updateUserEmploymentHistory方法代码示例

本文整理汇总了PHP中BuckysUser::updateUserEmploymentHistory方法的典型用法代码示例。如果您正苦于以下问题:PHP BuckysUser::updateUserEmploymentHistory方法的具体用法?PHP BuckysUser::updateUserEmploymentHistory怎么用?PHP BuckysUser::updateUserEmploymentHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BuckysUser的用法示例。


在下文中一共展示了BuckysUser::updateUserEmploymentHistory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buckys_redirect

    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');
buckys_enqueue_stylesheet('info.css');
buckys_enqueue_javascript('info.js');
$TNB_GLOBALS['content'] = 'info_employment';
$TNB_GLOBALS['title'] = "Employment History - " . TNB_SITE_NAME;
require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
开发者ID:HAPwebsite,项目名称:Social-Network-Website,代码行数:31,代码来源:info_employment.php

示例2: saveEmployeeInfoAction

 public function saveEmployeeInfoAction()
 {
     $data = $_POST;
     $token = isset($data['TOKEN']) ? trim($data['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.')];
     }
     $count = isset($data['COUNT']) ? $data['COUNT'] : 0;
     $info = [];
     for ($i = 0; $i < $count; $i++) {
         $row = [];
         $row['employer'] = $data['NAME' . $i];
         $row['start'] = $data['START' . $i];
         $row['end'] = $data['END' . $i];
         $row['visibility'] = $data['VISIBILITY' . $i];
         $info[] = $row;
     }
     if (BuckysUser::updateUserEmploymentHistory($userID, $info)) {
         return ['STATUS_CODE' => STATUS_CODE_OK, 'DATA' => ['STATUS' => 'SUCCESS']];
     } else {
         return ['STATUS_CODE' => STATUS_CODE_UNAUTHORIZED, 'DATA' => buckys_api_get_error_result('There was an error to saving your information.')];
     }
     exit;
 }
开发者ID:HAPwebsite,项目名称:Social-Network-Website,代码行数:27,代码来源:accountApi.php


注:本文中的BuckysUser::updateUserEmploymentHistory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。