<?php // (2021.8.4, 차재복, Cha Jae Bok, http://www.ktword.co.kr)
# 세션 설정
// 세션 스타트 (매 웹페이지 마다 필요)
session_start();
// (세션 변수 설정) => 세션 변수에 따른 사용자 타입 설정 ('일반사용자 0' or '테스트편집자 1' or '정식편집자 2' or '종합관리자 3')
$_SESSION['user_type'] = ( empty($_SESSION['user_name']) ? '일반사용자' : $_SESSION['user_name'] );
# test home directory
$test_home = '..';
# 전달변수
$ch = $_GET['ch']; // 선택 메뉴
$no = $_GET['no']; //
if ( isset($_REQUEST[no]) and !empty($no) and !is_numeric($no) or $no<0 ) exit; // 해킹방지 (수치>0)
$bare = $_GET['bare'];
// 페이지 파라미터 전달
$cur_page = $_GET['p']; // 요청 페이지 번호
if ( !empty($cur_page) and !is_numeric($cur_page) ) exit;
if ( empty($cur_page) ) $cur_page = 1;
# db 접속
include "{$test_home}/base_utils/db_conn.php";
# php 함수 include
// 페이지 구분 관련 함수
include "../paging/paging_utils.php";
// 특정 검색 선택 처리 관련 함수
include "../search/special_srch_utils.php";
# 선택 처리 함수(choice) 호출
/*
$arr = choice($ch);
$title = $arr['title'];
$query = $arr['query'];
*/
$arr = choice_v2();
$title = $arr[$ch]['title'];
$query = $arr[$ch]['query'];
# html, head section, top section 생략 여부
if ( empty($bare) ) {
# html 선언
echo "<!DOCTYPE html>";
echo "<html>";
# html 헤더부 선언
echo "<head>";
// 메타데이터
echo "<meta http-equiv='content-type' content='text/html; charset=utf-8'>"; // 문서 형식, 문자 코딩
echo "<meta name='author' content='차재복'>"; // 저작자
echo "<title>정보통신기술용어해설</title>";
/*
// mobile 체킹 및 적응 (모바일 디스플레이 셋팅 및 화면 폭 넓힘)
require_once "../{$test_home}/mobiledetect/Mobile_Detect.php";
$detect = new Mobile_Detect;
if ( $detect->isMobile() and !($detect->isTablet()) ) { // 순수 모바일 기기 (not tablet)
echo "<meta name='viewport' content='user-scalable=yes, width=device-width, initial-scale=1.0' />";
echo "<style type='text/css'> body { width : 190% ; } </style>";
}
*/
// styling
echo "<style type='text/css'> body { line-height: 180%; font-size: 13px; } </style>";
echo "</head>";
# html body 선언
echo "<body>";
# top section : 전달변수($test_home, $title)
// echo '$test_home : '.$test_home;
include "{$test_home}/base_utils/top_section.php";
// 수평선
echo "<hr>";
}
# body section
# 페이지 관련 상태 값 설정 및 요약
// 페이지 당 출력 레코드 수
$page_records = 10;
// 전체 레코드 수 계산
$total_records = total_records ($query, $dbi);
// 페이지 정보 함수 호출을 위한 매개변수 배열화
$page_info_vars = array (
// 'sh' => "자", // 검색어
'total_records' => $total_records, // 전체 레코드 수
'cur_page' => $cur_page, // 현재 페이지 번호
'page_records' => $page_records // 페이지 당 출력 레코드 수
);
// 페이지 정보 함수 호출 및 그 결과
$pages = page_info ( $page_info_vars );
$total_pages = $pages['total_pages'];
$start_record = $pages['start_record'];
// 페이지 이동 안내 (상단)
echo "<br>";
$cur_script = '?ch='.$ch.'&';
page_display ($cur_page, $total_pages, $cur_script);
echo "<br><br>";
// 만일, 쿼리 요청 있으면, 쿼리 결과 내용 출력
$query = $query . " limit $start_record, $page_records";
$result = mysqli_query($dbi, $query);
if (mysqli_errno($dbi)) { echo mysqli_errno($dbi)." : ".mysqli_error($dbi)."\n";}
$i = 1;
if (($tot = mysqli_num_rows($result)) > 0) {
echo "<table>";
while ($matched = mysqli_fetch_assoc($result)) {
echo "<tr>";
// 순번
// echo "<td>{$i})</td>";
echo "<td>".($start_record+$i).")</td>";
// a 태그 내 title
$title = $matched[yoyak].(empty($matched[yoyak]) ? '' : ',')
.$matched[full_name].(empty($matched[full_name]) ? '' : ',')
.$matched[korean]
.(empty($matched[extra_keyword]) ? '' : ',').$matched[extra_keyword];
$title = str_replace(',',', ',$title);
// a 태그 내용 출력
echo "<td><a href='/test/view/view.php?no={$matched[no]}' title='{$title}'>{$matched[word]}</a></td>";
// 날짜
echo "<td>(".$matched[date].")</td>";
echo "</tr>";
$i += 1;
}
echo "</table>";
}
echo "<br>";
# footer section, html 종료, 생략 여부
if ( empty($bare) ) {
echo "<hr>";
# footer section
// 저작권
include_once "../base_utils/copyright.php";
# html 종료 선언
echo "</body>";
echo "</html>";
}
# 접속 통계 처리
// include_once "../base_utils/stat_utils.php";
include_once "../../cjb/stat_utils.php";
html_access("special",$dbi,$no);
?>
"본 웹사이트 내 모든 저작물은 원출처를 밝히는 한 자유롭게 사용(상업화포함) 가능합니다"