HANYANG_REACT/lib/usrlib/sangseng_api.class.php

29 lines
862 B
PHP

<?php
class SangsengApi extends BaseCode {
function __construct() {
parent::__construct();
$this->DB->tableExists(TB_API_REC);
}
function pushApi($userid, $gubun = "접속", $datas = 0) {
return true;
$access_url = "https://log.smart-factory.kr/apisvc/sendLogData.json";
$params = array(
"crtfcKey" => '$5$API$7XWCxM/vX7QCI4WT940IExYHkNs7Nx9JtzwU0bOmGt2',
"logDt" => date("Y-m-d H:i:s.000"),
"useSe" => $gubun,
"sysUser" => $userid?:($GLOBALS['_Umem']['member_name']?:"giiest"),
"conectIp" => get_ip(),
"dataUsgqty" => $datas,
);
$ret = curl_request($access_url, $params, "POST");
$rparams = json_decode($ret);
$sum_params = array_merge($params, (Array) $rparams->result);
unset($sum_params['crtfcKey']);
$this->DB->insert(TB_API_REC, $sum_params);
}
}