=== 相关文件: 12 个 === ### vendor/nikic/fast-route/.hhconfig kind=file checksum=$sha1$b16ee1611ff06453dee5f2dafe4f4ac8260857da pristine=C:\xampp\htdocs\rid_dc_slim_\.svn\pristine\b1\b16ee1611ff06453dee5f2dafe4f4ac8260857da.svn-base (17 bytes) ### config/db_connect.php kind=file checksum=$sha1$fafa40b9fc5fd6fa5abd46ab6972ca88587df3d3 pristine=C:\xampp\htdocs\rid_dc_slim_\.svn\pristine\fa\fafa40b9fc5fd6fa5abd46ab6972ca88587df3d3.svn-base (743 bytes) | $host = DB_HOST; | $db_name = DB_NAME; | $this->conn = new PDO("pgsql:host={$host};port=5432;dbname={$db_name}", DB_USERNAME, DB_PASSWORD); ### app_api/questionnaire.php kind=file checksum=$sha1$555f3f37d470b74283804293a67e179fabe800e3 pristine=C:\xampp\htdocs\rid_dc_slim_\.svn\pristine\55\555f3f37d470b74283804293a67e179fabe800e3.svn-base (3757 bytes) | require_once dirname(__DIR__) . '/config/db_connect.php'; | foreach($array as $key => &$value) { | // Adding current key to search path | array_push($temp_path, $key); ### app_api/apps_post_message.php kind=file checksum=$sha1$3581be0f825e62f013d272fe928096eb2623fd36 pristine=C:\xampp\htdocs\rid_dc_slim_\.svn\pristine\35\3581be0f825e62f013d272fe928096eb2623fd36.svn-base (1152 bytes) | require_once dirname(__DIR__) . '/config/db_connect.php'; | apm.user_id, ### app_api/lineNotify.php kind=file checksum=$sha1$b08ab70bba3ef487a4c31bdd6dde061327c14e33 pristine=C:\xampp\htdocs\rid_dc_slim_\.svn\pristine\b0\b08ab70bba3ef487a4c31bdd6dde061327c14e33.svn-base (3064 bytes) | require_once dirname(__DIR__) . '/config/db_connect.php'; | private $line_api = 'https://notify-api.line.me/api/notify'; | private $access_token = 'r3ri0WJvNdpA5m9pdduvWP8tzzGU74jQ1KiKXCAd7ZX'; | // private $message_data = ['message' => "LINE TOKEN ROOM => {$access_token}"]; | $userData = $res->fetchAll(PDO::FETCH_ASSOC)[0]; | return $userData; | $headers = ['Method: POST', 'Content-type: multipart/form-data', 'Authorization: Bearer '.$this->access_token]; | curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); ### config/config.php kind=file checksum=$sha1$cafba9005fbec35853a11b9f2cf7a7b42f9a5829 pristine=C:\xampp\htdocs\rid_dc_slim_\.svn\pristine\ca\cafba9005fbec35853a11b9f2cf7a7b42f9a5829.svn-base (398 bytes) | // define('DB_HOST', 'sssnet.dynu.com'); | // define('DB_USERNAME', 'postgres'); | // define('DB_PASSWORD', 'Pcd2016'); | // define('DB_NAME', 'rid_datacenter'); | // define('DB_HOST', 'sensorsoft.net'); | define('DB_HOST', '149.28.132.52'); | define('DB_USERNAME', 'admin'); | define('DB_PASSWORD', 'SensorsofT'); | define('DB_NAME', 'rid_datacenter'); ### config kind=dir checksum= ### app_api/apps_upload.php kind=file checksum=$sha1$9bdcd6da0ba9534e1f614155c3a6263ee5a2ba11 pristine=C:\xampp\htdocs\rid_dc_slim_\.svn\pristine\9b\9bdcd6da0ba9534e1f614155c3a6263ee5a2ba11.svn-base (4693 bytes) ### app_api/apps_hdlr.php kind=file checksum=$sha1$4a1c0a4d45acffd7d66ecd061d627776c8b4ca8f pristine=C:\xampp\htdocs\rid_dc_slim_\.svn\pristine\4a\4a1c0a4d45acffd7d66ecd061d627776c8b4ca8f.svn-base (101001 bytes) | require_once dirname(__DIR__) . '/config/db_connect.php'; | public function appLogin($user, $pass){ | $user = trim($user); | u.username, | u.name_user, | u.userimg, | public.user AS u | u.username = '{$user}' AND u.password = '{$pass}' | $userData = $res->fetchAll(PDO::FETCH_ASSOC)[0]; | return $userData; | public function appLoginDemo($user, $pass) { | $user = trim($user); | s.user_id AS id, | s.access_token, | public.user AS u | LEFT JOIN accounts_social AS s ON u.id = s.user_id | u.username = '{$user}' AND u.password = '{$pass}' | $userData = $res->fetchAll(PDO::FETCH_ASSOC)[0]; | return $userData; | $sql = "SELECT user_id AS id, | access_token, | public function MainMenu($user_id){ | $getCount = ($user_id)? ",(SELECT COUNT(*) FROM survey_walkthru WHERE user_id = {$user_id} AND survey_walkthru.status_survey <> 4 AND type_walkthru = type.id) AS count" : | public function AllQuestions($type, $user_id, $survey_id) { | if($user_id && $survey_id){ | $joinVal = "LEFT JOIN survey_walkthru_relations AS swr ON swr.user_id = {$user_id} AND swr.survey_id = {$survey_id} AND swr.code = detail "; | // $this->log_param_list_tasksurvey(array("type"=>$type,"user_id"=>$user_id,"survey_id"=>$survey_id), $sql, 'get AllQuestions'); | foreach($array as $key => &$value) { | // Adding current key to search path | array_push($temp_path, $key); | } else if($key === "code" && $value === $search_value) { | public function getGradeByCode($code, $user_id){ | user_id = {$user_id} AND score_data @> '[{$codeJson}]' AND score_attr->>'code' = '{$code}' | $user_id = $params['user_id'] ?? null; | if(!$user_id) { | $keysearch = ''; | $keysearch = explode(' ', $search); | $keysearch = array_map(function ($val) { | }, $keysearch); | $keysearch = join(' AND ', $keysearch); | $keysearch = "AND ({$keysearch})"; | sw.user_id, | ( SELECT u.name_user FROM public.user AS u WHERE u.id = sw.user_id ) AS user, | SELECT SUM(rank) FROM survey_walkthru_relations WHERE user_id = sw.user_id AND survey_id = sw.id | user_id = sw.user_id AND survey_id = sw.id AND files IS NOT NULL | (status_survey NOT IN (0, 3, 4) AND user_id = {$user_id}) AND | {$keysearch} | $sql = "SELECT score_data FROM survey_walkthru WHERE user_id = 1"; | public function surveySymptomValue($user_id, $survey_id, $code) { | id, survey_id, user_id, code,description,files,rank,created_at,updated_at | user_id = {$user_id} AND survey_id = {$survey_id} AND code = '{$code}'"; | public function getRankUser(){ | rank_user.\"id\", | rank_user.\"rank\" | rank_user | rank_user.\"id\" ASC"; | $user_id = $params['user_id'] ?? null; | $key = $params['key'] ?? null; | $keyActive = ""; | if(!$user_id) { | $this->log_param_list_tasksurvey($params, '', 'this not user id'); | $keysearch = ''; | $keysearch = explode(' ', $search); | $keysearch = array_map(function ($val) { | }, $keysearch); | $keysearch = join(' AND ', $keysearch); | $keysearch = "AND ({$keysearch})"; | $keyActive =" AND sw.id = ". $survey_id; | $keyfilter = ''; | $keyfilter .= " And type_id in (". implode(",", $filter['type_id']).")"; | $keyfilter .= " ORDER BY piority_survey {$filter['piority_survey']}"; | if($tablename == 'canal_struct' && $key){ | // $key = substr($key, 0, 11); | // $struct_search = " AND sw.struct_code = '{$key}%'"; | sss_search('graph_struct_link', '{$key}'))"; | if($tablename == 'struct_struct' && $key){ | sss_search('graph_struct_link', '{$key}',0))"; | // $exp = explode("-", $key); | // $key = substr($key, 0, 11); | // $struct_search = " AND substring(struct->>'key', 0, 12) LIKE '{$key}%'"; | // $key = substr($key, 0, 18); | // $struct_search = " AND substring(struct->>'key', 0, 19) LIKE '{$key}%'"; | sw.user_id, | ( SELECT u.name_user FROM public.user AS u WHERE u.id = sw.user_id ) AS user, | user_id = sw.user_id AND survey_id = sw.id AND files IS NOT NULL | ( {$statusSurvey} sw.user_id = :user_id {$filter_date} {$table_name} {$keyActive}) AND | {$keysearch} {$struct_search} | SELECT * FROM tb WHERE {$last_score} {$keyfilter} "; | ":user_id" => $user_id, | if($key != null){ | // if($user_id == 2531){ | $user_id = $param['user_id'] ?? null; | $sql = "INSERT INTO log_param_tasksurvey (user_id,json_param,dt,remark,sql,request_head) VALUES (:user_id, :json_param, :dt, :remark, :sql,:request_head)"; | ":user_id" => $user_id, | $user_id = $params['user_id'] ?? null; | if(!$user_id) { return false; } | $keysearch = ''; | $keysearch = explode(' ', $search); | $keysearch = array_map(function ($val) { | }, $keysearch); | $keysearch = join(' AND ', $keysearch); | $keysearch = "AND ({$keysearch})"; | sw.user_id, | ( SELECT u.name_user FROM public.user AS u WHERE u.id = sw.user_id ) AS user, | SELECT SUM(rank) FROM survey_walkthru_relations WHERE user_id = sw.user_id AND survey_id = sw.id | user_id = sw.user_id AND survey_id = sw.id AND files IS NOT NULL | (SELECT swr.rid_code FROM survey_walkthru_relations swr WHERE user_id = sw.user_id AND survey_id = sw.ID LIMIT 1) as rid_code, | LEFT JOIN rid_struct_view ON sw.struct_code = rid_struct_view.key | ((sw.status_survey = 1) AND sw.user_id = {$user_id} {$filter_date}) AND | {$keysearch} | public function surveySymptomValueV2($user_id, $survey_id, $code){ | // print_r($user_id); exit; | id, survey_id, user_id, code,description,files,rank,created_at,updated_at | user_id = {$user_id} AND survey_id = {$survey_id} AND code = '{$code}' ORDER BY updated_at DESC"; | public function getCanalKey($param){ | $key = $param['key'] ?? null; | if(empty($key)){ | return "Error: key Canal."; | survey_walkthru.user_id , | u.name_user, | INNER JOIN (SELECT \"user\".\"id\", \"user\".name_user FROM \"user\") AS u ON u.\"id\" = survey_walkthru.user_id | concat('canal_struct.',c0) = :key"; | ":key" => $key ?? null | "key" => $can['c4'], | $arr['user_id'] = $km_sw['user_id']; | if(isset($param['user_id'])){ | if($km_sw['user_id'] == $param['user_id'] ){ | $arr['user_id'] = $km_sw['user_id']; | $arr['name_user'] = $km_sw['name_user']; | if(isset($param['user_id'])){ | // echo $km_sw['user_id'] == $param['user_id']; | if($km_sw['user_id'] == $param['user_id'] ){ | $arr['user_id'] = $km_sw['user_id']; | $arr['name_user'] = $km_sw['name_user']; | if(isset($param['user_id'])){ | if($km_sw['user_id'] == $param['user_id'] ){ | $arr['user_id'] = $km_sw['user_id']; | $arr['name_user'] = $km_sw['name_user']; | if(isset($param['user_id'])){ | if($km_sw['user_id'] == $param['user_id'] ){ | "key" => $can['c4'], | "user_id" => $can['user_id'] ?? null, | "name_user" => $can['name_user'] ?? null, | $user_id = $param['user_id'] ?? null ; | if(empty($user_id) && empty($table_name) ){ return "Error: user id and table name."; } | rid_struct_view.\"key\", | key in ( | WHERE o_point2 like 'head_struct.%' )AS key | $sql .= " AND sw.user_id = '{$user_id}' | $user_id = $param['user_id'] ?? null ; | $key = $param['key'] ?? null ; | if(empty($user_id) && empty($table_name) ){ return "Error: user id and table name."; } | $key_struct = $key ?? null; | $key_where = ''; | if($key_struct){ | // $k = substr($key_struct, 0, 11); | $k =$key_struct; | $key_where = " AND sw.struct_code in (SELECT o_point2 from | if($key_struct == '0'){ | $key_struct = 1; | $key_struct = 1; | rid_struct_view.\"key\", | WHEN '$key_struct' = '1' THEN | WHEN str_view.\"key\" IS NULL THEN | sss_search_reverse ( 'graph_struct_link', rid_struct_view.\"key\" ) AS link_tb | LEFT JOIN rid_struct_view as str_view ON link_tb.o_point2 = str_view.\"key\" | sss_search('graph_struct_link', '$key_struct') | WHERE o_point2 like 'canal_struct.%' ) as link_canal on link_canal.o_point2 = rid_struct_view.\"key\" | key in ( | WHERE o_point1 like 'struct_struct.%' )AS key "; | WHERE o_point1 like 'canal_struct.%' )AS key "; | WHERE o_point1 like 'road_struct.%' )AS key "; | AND sw.user_id = '{$user_id}' | {$key_where} | $user_id = $param['user_id'] ?? null; | user_id = $user_id | $user_id = $param['user_id'] ?? null ; | $key = $param['key'] ?? null ; | if(empty($user_id) && empty($table_name) ){ return "Error: user id and table name."; } | $key_struct = $key ?? null; | $key_where = ''; | if($key_struct){ | // $k = substr($key_struct, 0, 11); | $k =$key_struct; | $key_where = " AND sw.struct_code in (SELECT o_point2 from | if($key_struct == '0'){ | $key_struct = 1; | $key_struct = 1; | rid_struct_view.\"key\", | WHEN '$key_struct' = '1' THEN | WHEN str_view.\"key\" IS NULL THEN | sss_search_reverse ( 'graph_struct_link', rid_struct_view.\"key\" ) AS link_tb | LEFT JOIN rid_struct_view as str_view ON link_tb.o_point2 = str_view.\"key\" | sss_search('graph_struct_link', '$key_struct') | WHERE o_point2 like 'road_struct.%' ) as link_canal on link_canal.o_point2 = rid_struct_view.\"key\" | key in ( | WHERE o_point1 like 'road_struct.%' )AS key | AND sw.user_id = '{$user_id}' | {$key_where} | public function getRoadKey($param){ | $key = $param['key'] ?? null; | if(empty($key)){ | return "Error: key Canal."; | $sql = "SELECT c0 , concat ( 'road_struct.', c0 ) AS KEY, c5 AS NAME, c6, c7, c8, c14, c15, c11, c12, c13,c21,c22, type_walkthru, rid_code, | survey_walkthru.user_id , | u.name_user, | INNER JOIN (SELECT \"user\".\"id\", \"user\".name_user FROM \"user\") AS u ON u.\"id\" = survey_walkthru.user_id | concat('road_struct.',c0) = :key"; | ":key" => $key ?? null | "key" => $can['c4'], | $arr['user_id'] = $km_sw['user_id']; | if(isset($param['user_id'])){ | if($km_sw['user_id'] == $param['user_id'] ){ | $arr['user_id'] = $km_sw['user_id']; | $arr['name_user'] = $km_sw['name_user']; | if(isset($param['user_id'])){ | if($km_sw['user_id'] == $param['user_id'] ){ | $arr['user_id'] = $km_sw['user_id']; | $arr['name_user'] = $km_sw['name_user']; | if(isset($param['user_id'])){ | if($km_sw['user_id'] == $param['user_id'] ){ | $arr['user_id'] = $km_sw['user_id']; | $arr['name_user'] = $km_sw['name_user']; | if(isset($param['user_id'])){ | if($km_sw['user_id'] == $param['user_id'] ){ | "key" => $can['key'], | "user_id" => $can['user_id'] ?? null, | "name_user" => $can['name_user'] ?? null, ### app_api/apps_adt.php kind=file checksum=$sha1$1557bf6aa306f27550185009648b16c3003d9024 pristine=C:\xampp\htdocs\rid_dc_slim_\.svn\pristine\15\1557bf6aa306f27550185009648b16c3003d9024.svn-base (22671 bytes) | require_once dirname(__DIR__) . '/config/db_connect.php'; | public function socialLogin($user = []) { | if(!$user){ return false; } | $social = isset($user['social'])? "'{$user['social']}'" : "NULL"; | $accID = isset($user['account_id'])? "'{$user['account_id']}'" : "NULL"; | $token = isset($user['access_token'])? "'{$user['access_token']}'" : "NULL"; | // $name = isset($user['fullname'])? "'{$user['fullname']}'" : "NULL"; | $thumb = isset($user['thumb'])? "'{$user['thumb']}'" : "NULL"; | $referId = isset($user['referId'])? "{$user['referId']}" : "NULL"; | // $resp = isset($user['resp_account'])? json_encode($user['resp_account']) : ''; | access_token, | {$social}, {$accID}, {$token}, {$thumb}, '{$created_at}', '{$updated_at}', '{$referId}' | access_token = {$token}, | RETURNING user_id AS id, | access_token, | $userRes = $res->fetchAll(PDO::FETCH_ASSOC)[0]; | return $userRes; | public function sendDataVerify($user = []) { | if(!$user) { return false; } | $account_id = isset($user['account_id'])? "'{$user['account_id']}'" : "NULL"; | $status_account = isset($user['status_account'])? "status_account = '{$user['status_account']}'," : ""; | $name = isset($user['name'])? "'{$user['name']}'" : "NULL"; | $phone = isset($user['phone'])? "'{$user['phone']}'" : "NULL"; | $department = isset($user['department_id'])? "'{$user['department_id']}'" : "NULL"; | $rio_code = isset($user['rio_code'])? "'{$user['rio_code']}'" : "NULL"; | $project_id = isset($user['project_id'])? "'{$user['project_id']}'" : "NULL"; | $opm_id = isset($user['opm_id'])? "'{$user['opm_id']}'" : "NULL"; | if( !isset($user['department_id']) ){ | if ($user["rio_code"] == '' || $user["rio_code"] ==null) { | } else if ($user["project_id"] == '' || $user["project_id"] == null) { | } else if ($user["opm_id"] == '' || $user["opm_id"] == null) { | RETURNING user_id AS id, | access_token, | $userRes = $res->fetchAll(PDO::FETCH_ASSOC)[0]; | return $userRes; // Check account is delete status | public function setGradeQuestionnaire($code, $grade, $user_id, $survey_id) { | id = {$survey_id} AND user_id = {$user_id} AND score_data @> '[{$codeJson}]' AND score_attr->>'code' = '{$code}' | id = {$survey_id} AND user_id = {$user_id} AND score_data @> '[{$codeJson}]' | $user_id = trim($params['user_id']); | (survey_id, user_id, code, description, files, rank, created_at, updated_at, rid_code, survey_group) | ({$survey_id}, {$user_id}, '{$code}', {$description}, {$filesJson}, $rank, '{$created_at}', '{$updated_at}', '{$ridCode}', '{$surveyGroup}') | $sql = "UPDATE survey_walkthru SET status_survey = 2 WHERE struct_code = '{$params['struct_code']}' and survey_group = '{$params['survey_group']}' and user_id = '{$params['user_ | public function socialRegister($user = []) { | if(!$user){ return false; } | $social = isset($user['provider'])? "'{$user['provider']}'" : "NULL"; | $accID = isset($user['id'])? "'{$user['id']}'" : "NULL"; | $token = isset($user['authToken'])? "'{$user['authToken']}'" : "NULL"; | $name = "'{$user['firstName']} {$user['lastName']}'"; | $thumb = isset($user['photoUrl'])? "'{$user['photoUrl']}'" : "NULL"; | $phone = isset($user['mobile'])? "'{$user['mobile']}'" : "NULL"; | $department_id = isset($user['department_id'])? "'{$user['department_id']}'" : "NULL"; | $rio_code = isset($user['rio_code'])? "'{$user['rio_code']}'" : "NULL"; | $project_id = isset($user['project_id'])? "'{$user['project_id']}'" : "NULL"; | $opm_id = isset($user['opm_id'])? "'{$user['opm_id']}'" : "NULL"; | $permission = isset($user['permission'])? "'{$user['permission']}'" : "NULL"; | access_token, | {$social}, {$accID}, {$token}, {$name}, {$name}, {$thumb}, {$phone}, | access_token = {$token}, | RETURNING user_id AS id, | access_token, | $userRes = $res->fetchAll(PDO::FETCH_ASSOC)[0]; | return $userRes; | $user_id = $params['user_id'] ?? null; | 'key', | WHEN str_view.\"key\" IS NULL THEN | LEFT JOIN rid_struct_view AS str_view ON link_tb.o_point2 = str_view.\"key\" | 'user_id', | survey_walkthru.user_id, | INNER JOIN \"user\" ON survey_walkthru.user_id = \"user\".\"id\" | AND CAST ( \"user\".permission_walkthru ->> 'opm_id' AS INT ) = $opm_id | foreach ($arrRange as $key => $value) { | "user_id"=> $user_id, | $user_id = isset($param['user_id']) ? $param['user_id'] : 'null'; | $sql = " select f_upsert_survey ({$user_id}, '{$datetime}'::TIMESTAMP, {$type_walkthru}, '{$table_name}' , {$table_id}, 0, 2, '{$table_id}', '{$survey_group}',{$assigner_id}, '{$ ### app_api/routes.php kind=file checksum=$sha1$aad573dd16f11bfae4e6f9bd460023cb16bb1126 pristine=C:\xampp\htdocs\rid_dc_slim_\.svn\pristine\aa\aad573dd16f11bfae4e6f9bd460023cb16bb1126.svn-base (15828 bytes) | $route->post('/send/newuser', function ($req, $res, $args) { | $link = "https://imd.rid.go.th/rid_dc"; | $user_id = $req->getParam('user_id'); | $set = self::$adt->setGradeQuestionnaire($code, $grade, $user_id, $survey_id); | $user = $req->getParam('username'); | $pass = $req->getParam('password'); | $login = self::$hdlr->appLogin($user, $pass); | $user = $req->getParam('username'); | $pass = $req->getParam('password'); | $login = self::$hdlr->appLoginDemo($user, $pass); | $user_id = $req->getParam('user_id'); | $menus = self::$hdlr->MainMenu($user_id); | 'user_id' => $req->getParam('user_id'), | 'search' => $req->getParam('keyword'), | 'user_id' => $req->getParam('user_id'), | 'search' => $req->getParam('keyword'), | 'key' => $req->getParam('key'), | 'user_id' => $req->getParam('user_id'), | 'search' => $req->getParam('keyword'), | $user_id = $req->getParam('user_id'); | $data = self::$hdlr->AllQuestions($type, $user_id, $survey_id); | $user_id = $req->getParam('user_id'); | $grade = self::$hdlr->getGradeByCode($code, $user_id); | $user_id = $req->getParam('user_id'); | $data = self::$hdlr->surveySymptomValue($user_id, $survey_id, $code); | $route->get('/getRankUser', function ($req, $res, $args) { | $data = self::$hdlr->getRankUser(); | $user_id = $req->getParam('user_id'); | $data = self::$hdlr->surveySymptomValueV2($user_id, $survey_id, $code); | $route->post('/canalKey', function ($req, $res, $args) { | $data = self::$hdlr->getCanalKey($param); | // $user_id = $req->getParam('user_id'); | // $user_id = $req->getParam('user_id'); | // $key = $req->getParam('key'); | // $user_id = $req->getParam('user_id'); | // $key = $req->getParam('key'); | $route->post('/roadKey', function ($req, $res, $args) { | $data = self::$hdlr->getRoadKey($param); ### app_api kind=dir checksum=