소스 파일 : /reform/special.php (2020-05-21)     소스 설명 : (개선중) 비교/구분/원리/공식/법칙 등에 대한 용어 해설 항목들을 보여줌
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<?php // (2020.5.21, 차재복, Cha Jae Bok, cjbword@gmailcom) 

# 세션 설정
	// 세션 스타트 (매 웹페이지 마다 필요)
	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;

# 페이지 구분 관련 함수 라이브러리 호출
	include "../ex_run/paging_utils.php";

# db 접속
	include "{$test_home}/base_utils/db_conn.php";


# 선택 처리 함수(choice) 호출
	$arr = choice($ch);
	$title = $arr['title'];
	$query = $arr['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;	

    // 전체 레코드 수 계산
//	$query = "select korean from cjb_dict where korean like '자%' order by korean";
    $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>";
	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='/word/abbr_view.php?m_temp1={$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) ) {
		# footer section
		// 저작권
		include_once "../base_utils/copyright.php";

		# html 종료 선언
		echo "</body>";
		echo "</html>";
	}

# 접속 통계 처리
	include_once "{$test_home}/base_utils/stat_utils.php";
	html_access("special({$ch})",$dbi,$no);



# 선택 처리 함수
function choice ($ch) {

	// 선택
	switch ($ch) {
		case ('comp') :
		case ('1') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where a.word like '%비교' or a.word like '%차이' group by a.no order by a.word";
			$title = "비교 리스트";
			break;
		case ('type') :
		case ('2') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where a.word like '%구분' or a.word like '%종류'  group by a.no order by a.word";
			$title = "구분/종류 리스트";
			break;
		case ('formula') :
		case ('3') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where a.word like '% 공식' or a.word like '% 방정식'  group by a.no order by a.word";
			$title = "공식/방정식 리스트";
			break;
		case ('law') :
		case ('4') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where a.word like '% 법칙' group by a.no order by a.word";
			$title = "법칙 리스트";
			break;
		case ('theory') :
		case ('5') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where a.word like '% 이론' group by a.no order by a.word";
			$title = "이론 리스트";
			break;
		case ('principle') :
		case ('6') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where a.word like '% 원리' group by a.no order by a.word";
			$title = "원리 리스트";
			break;
		case ('theorem') :
		case ('7') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where a.word like '% 정리' group by a.no order by a.word";
			$title = "정리 리스트";
			break;
		case ('discipline') :
		case ('8') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where a.word like '%학' group by a.no order by a.word";
			$title = "학문 리스트";
			break;
		case ('mode') :
		case ('9') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where a.word like '%모드' group by a.no order by a.word";
			$title = "모드 리스트";
			break;
		case ('function') :
		case ('10') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where a.word like '%함수' group by a.no order by a.word";
			$title = "함수 리스트";
			break;
		case ('ratio') :
		case ('11') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where (a.word like '%율' or a.word like '%률' or a.word like '%비') and not (a.word like '%효율' or a.word like '%확률' or a.word like '%적률' or a.word like '%법률' or a.word like '%일률' or a.word like '%능률' or a.word like '%설비' or a.word like '%장비' or a.word like '%좀비' or a.word like '%유지비' or a.word like '%공사비' or a.word like '%상각비' or a.word like '%지그비') group by a.no order by a.word";
			$title = "율/률/비 리스트";
			break;
		case ('coef') :
		case ('12') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where (a.word like '%계수') group by a.no order by a.word";
			$title = "계수 리스트";
			break;
		case ('constant') :
		case ('13') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where (a.word like '%상수' or a.word like '%정수') group by a.no order by a.word";
			$title = "정수/상수 리스트";
			break;
		case ('factor') :
		case ('14') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where ((a.word like '%인수') or (a.word like '%인자') or (a.word like '%인수 분해') or (a.word like '% factor')) and not (a.word like '%라인수' or a.word like '%합병 인수' or a.word like '%품질 인자') group by a.no order by a.word";
			$title = "인수/인자,율/률 (factor) 리스트";
			break;
		case ('order') :
		case ('15') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where (a.word like '%order%') and (a.word like '%zero%' or a.word like '%first%' or a.word like '%second%' or a.word like '%tree%' or a.word like '%equation%') and not (a.word like '%byte%' or a.word like '%ordered%') group by a.no order by a.word";
			$title = "차수/계수(order) 리스트";
			break;
		case ('density') :
		case ('16') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where (a.word like '%밀도%') and not (a.word like '%정밀도%') group by a.no order by a.word";
			$title = "밀도(density) 리스트";
			break;
		case ('degree') :
		case ('17') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where (a.word like '%degree%') group by a.no order by a.word";
			$title = "차수/계수(degree) 리스트";
			break;
		case ('energy') :
		case ('18') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where (a.word like '%에너지%') group by a.no order by a.word";
			$title = "에너지 리스트";
			break;
		case ('power') :
		case ('19') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where (a.word like '%전력%') and not (a.word like '%회전력%') group by a.no order by a.word";
			$title = "전력 리스트";
			break;
		case ('velocity') :
		case ('20') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date from dict_word_list a join cjb_dict b on a.no=b.no where (a.word like '%속도' or a.word like '%속도 벡터' or a.word like '%속도장' or a.word like '%속도계' or a.word like '%광속 불변%') group by a.no order by a.word";
			$title = "속도 리스트";
			break;
		case ('field') :
		case ('21') :
			$query = "select a.*,b.*,date_format(b.sujung,'%Y-%m-%d') as date
						from dict_word_list a join cjb_dict b on a.no=b.no
						where concat(',',full_name,',',extra_keyword,',') like '%field,%'
							and concat(',',full_name,',',korean,',',extra_keyword,',') like '%장,%' 
						group by a.no order by a.word";
			$title = "장(場) 리스트";
			break;
		case ('reform') :
			$title = "개선 진행중";
			break;
		case ('coding') :
			$title = "작성중 (코딩이란?)";
			break;
		default :
			exit;
	}

	return array('title'=>$title, 'query'=>$query);
}

?>

PHP 키워드 : $_GET, $_REQUEST, $_SESSION, array, echo, empty, function, include, include_once, is_numeric, isset, mysqli_errno, mysqli_error, mysqli_fetch_assoc, mysqli_query, new, require_once, return, session_start, str_replace
Copyrightⓒ written by 차재복 (Cha Jae Bok)        「 소액후원 」

   소스 이력    소스 폴더    소스 언어