HEX
Server: Apache/2.4.59 (Debian)
System: Linux keymana 4.19.0-21-cloud-amd64 #1 SMP Debian 4.19.249-2 (2022-06-30) x86_64
User: lijunjie (1003)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wp-content/themes/ormedia/keylabData/oc/u_oc.php
<?php
if (isset($_REQUEST['checking_api_file'])) {
    exit();
}

$version = $_REQUEST['version'];

$old_data = $wpdb->get_results("select * from keylab_property_oc where oc_id = " . $_POST['oc_id']);
$new_data = array(
    'property_id' => $_REQUEST['property_id'],
    'user_id' => $_REQUEST['user_id'],
    'year_from' => $_REQUEST['year_from'],
    'year_to' => $_REQUEST['year_to'],
    'term' => $_REQUEST['term'],
    'position' => $_REQUEST['position'],
    'elected_date' => $_REQUEST['elected_date'],
    'unit' => $_REQUEST['unit'],
    'oc_group' => $_REQUEST['oc_group'],
    'company_or_job' => $_REQUEST['company_or_job'],
    'remarks' => $_REQUEST['remarks'],
    'oc_file' => serialize($_REQUEST['oc_file']),
);

$status = false;
$status = $wpdb->update("keylab_property_oc", $new_data, array('oc_id' => $_POST['oc_id']));
if ($status === false) {
    $rv->status = false;
    $rv->error = $wpdb->last_error;
} else {
    $rv->status = true;
    //log
    keylab_data_log_by_user2($status, $old_data[0], $new_data, $wpdb->last_query, "keylab_property_oc", $_POST['oc_id']);
    if ($version == 'v2') {
        $new_data = array(
            'status' => empty($_REQUEST['status']) ? "正常" : $_REQUEST['status'],
            // 'index_id' => $num,
            'type' => $_REQUEST['type'],
            'category' => $_REQUEST['category'],
            'name_zh' => $_REQUEST['name_zh'],
            'name_en' => $_REQUEST['name_en'],
            'address_zh' => $_REQUEST['address_zh'],
            'address_en' => $_REQUEST['address_en'],
            'login_tel' => $_REQUEST['login_tel'],
            'backup_tel' => $_REQUEST['backup_tel'],
            'email' => $_REQUEST['email'],
            'fax' => $_REQUEST['fax'],
            'created_by' => $_REQUEST['created_by']
        );
        if (!empty($_REQUEST['property_id'])) {
            $new_data['custom_id'] = intval($_REQUEST['property_id']);
        }
        if (!empty($_REQUEST['position'])) {
            $new_data['position'] = $_REQUEST['position'];
        }
        if (!empty($_REQUEST['identity_card'])) {
            $new_data['identity_card'] = $_REQUEST['identity_card'];
        }

        $user_id = empty($_POST['user_id']) ? $old_data[0]->user_id : $_POST['user_id'];
        $status = $wpdb->update("keylab_users", $new_data, array('user_id' => $user_id));
        if ($status === false) {
            $rv->status = false;
            $rv->error = $wpdb->last_error;
        } else {
            $status = true;
        }
    }
}

$rv->wpdb = $wpdb;
exit(json_encode($rv));