간편장부 날짜 표시 위치 수정
관련링크
https://sir.kr/g5_skin/10925
151회 연결
본문
관련 스킨 페이지: https://sir.kr/g5_skin/10925
물물님의 간편장부에 관한 질문입니다.
아래그림과 같이 간편장부의 list.skin.php 화면에서는
날짜별 검색에서 [시작날짜]에는 오늘날짜가 표시되고 [끝날짜]는 datepicker를 통해 선택하도록 비워져 있습니다.
실제 검색상황에서는 아무래도 시작날짜는 오늘보다 이전날짜라야 할 것이기 때문에, 차라리
[시작날짜 박스]는 datepicker를 통해 선택입력하도록 비워두고,
[끝날자]에는 현재날짜를 참고할수 있도록 오늘날짜를 보이도록 하는방법을 알고 싶습니다.
어떻게 하면 이 부분을 수정할 있는지 조언 부탁드립니다.
<?php
if(!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
///////////////////////////////////////////////////
//
// 그누보드 간편장부 스킨
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// Author: 이진문(물물)
// Site: http://www.fullwork.co.kr
// EMail: *** 개인정보보호를 위한 이메일주소 노출방지 ***
//
///////////////////////////////////////////////////
/****** 사용 여분필드 *********
wr_1 수입 금액
wr_2 수입 부가세
wr_3 비용 금액
wr_4 비용 부가세
wr_5 고정자산증감 금액
wr_6 고정자산증감 부가세
wr_7 세액구분
wr_8 비고
wr_9
wr_10 거래처
************************/
include_once("$board_skin_path/list_sort.skin.php");
include_once("$board_skin_path/lib.skin.php");
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 13;
if($is_checkbox) $colspan++;
//if($is_category) $colspan++;
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
?>
<h2 id="container_title"><?php echo $board['bo_subject'] ?><span class="sound_only"> 목록</span></h2>
<div class="fw_title_c" style="text-align:center; z-index:3000;">
<button class='btn2 m' onclick="location.href='<?php echo GML_BBS_URL?>/board.php?bo_table=<?php echo $bo_table?>&sca=<?php echo $sca?>&wr_10=<?php echo $wr_10?>&sdate=<?php echo $pre_href?>' "> < </button>
<?php echo $start_title?>
<button class='btn2 m' onclick="location.href='<?php echo GML_BBS_URL?>/board.php?bo_table=<?php echo $bo_table?>&sca=<?php echo $sca?>&wr_10=<?php echo $wr_10?>&sdate=<?php echo $next_href?>' "> > </button>
<!-- <button class='btn2 m' onclick="location.href='<?php// echo GML_BBS_URL?>/board.php?bo_table=<?php// echo $bo_table?>&sca=<?php// echo $sca?>&wr_10=<?php// echo $wr_10?>&sdate=<?php// echo date('Y-m-d')?>&edate=<?php// echo date('Y-m-d')?>' ">오늘</button> -->
<button class='btn2 m' onclick="location.href='<?php echo GML_BBS_URL?>/board.php?bo_table=<?php echo $bo_table?>&sca=<?php echo $sca?>&wr_10=<?php echo $wr_10?>&sdate=<?php echo substr(date('Y-m-d'), 0, 7)?>' ">이달</button>
</div>
<div>
<form name="fsearch" method="get">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sop" value="and">
<input type='hidden' name='bo_table' value="<?php echo $bo_table?>">
<input class='ed' type='input' id='sdate' name='sdate' size='11' maxlength='10' itemname='시작일' value='<?php echo $sdate?>'>
~
<input class='ed' type='input' id='edate' name='edate' size='11' maxlength='10' itemname='마지막일' value='<?php echo $edate?>'>
<button type="submit" class="btn2 s">날짜별 검색</button>
</form>
</div>
<!-- 게시판 목록 시작 { -->
<div id="bo_list" style="width:<?php echo $width; ?>">
<!-- 거래처 { -->
<nav id="bo_cate2">
<h2><?php echo $board['bo_subject'] ?> 거래처</h2>
<ul id="bo_cate_ul">
<?php if(AC_CATEGORY) echo get_ac_category($bo_table, $sca, $wr_10, $sdate, $edate);?>
<li><a id="ac_category_toogle">거래처등록</a></li>
</ul>
</nav>
<div id="ac_category_div" style="display:none; padding:0 0 20px 0; text-align:center;">
<textarea id="ac_category" class="tx" row='3' style="height:50px; width:99%;"><?php echo AC_CATEGORY?></textarea>
<input type='hidden' id='ac_category_name' value="<?php echo AC_CATEGORY_NAME?>">
<div style="font-size:12px; color:#999; text-align:left;">[Tip] 거래처와 거래처 사이는 | 로 구분하세요. 입력예) 거래처A|거래처B|거래처C </div>
<span class='btn s' id='ac_category_btn'>저장</span>
</div>
<!-- } 거래처 -->
<!-- 게시판 페이지 정보 및 버튼 시작 { -->
<div class="bo_fx">
<div id="bo_list_total">
<span>Total <?php echo number_format($total_count) ?></span>,
<?php echo $page ?>page
</div>
<?php if ($rss_href || $write_href) { ?>
<ul class="btn_bo_user">
<?php if ($rss_href) { ?><li><a href="<?php echo $rss_href ?>" class="btn m">RSS</a></li><?php } ?>
<?php if ($admin_href) { ?><li><a href="<?php echo $admin_href ?>" class="btn2 m">관리자</a></li><?php } ?>
<?php /* if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn m">글쓰기</a></li><?php }*/ ?>
</ul>
<?php } ?>
</div>
<!-- } 게시판 페이지 정보 및 버튼 끝 -->
<form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="sw" value="">
<div class="tbl_wrap">
<table id='bo_list'>
<thead>
<tr>
<th scope="col" rowspan="2">번호</th>
<?php if ($is_checkbox) { ?><th scope="col" rowspan="2"><input type="checkbox" id="chkall" onclick="if (this.checked) all_checked(true); else all_checked(false);"></th><?php } ?>
<th scope="col" rowspan="2"><a href='<?php echo GML_BBS_URL?>/board.php?bo_table=<?php echo $bo_table?>&sca=<?php echo $sca?>&sop=and&sst=wr_datetime&sod=desc'>날짜</a></th>
<th scope="col" rowspan="2">거래처</th>
<th scope="col" rowspan="2">거래내용</th>
<th scope="col" rowspan="2">세액<br>구분</th>
<th scope="col" colspan="2">수입(매출)</th>
<th scope="col" colspan="2">비용(매입)</th>
<th scope="col" colspan="2">고정자산증감(매매)</th>
<th scope="col" rowspan="2">비고</th>
<th scope="col" rowspan="2" style="min-width:40px;"></th>
</tr>
<tr>
<th scope="col">금액</th>
<th scope="col">부가세</th>
<th scope="col">금액</th>
<th scope="col">부가세</th>
<th scope="col">금액</th>
<th scope="col">부가세</th>
</tr>
</thead>
<?php include_once("$board_skin_path/list_add.skin.php");?>
<input type='hidden' name='chk' value='<?php echo count($list)?>'>
<tbody id='add_data'>
<?php
for ($i=0; $i<count($list); $i++)
{
//검색시 검색어 색상 변경되는 클래스 제거
if($sfl)
$list[$i]['subject'] = strip_tags($list[$i]['subject']);
?>
<input type='hidden' name='wr_id_up[<?php echo $i ?>]' value='<?php echo $list[$i]['wr_id'] ?>' id='wr_id_<?php echo $i ?>'>
<tr class="<?php if ($list[$i]['is_notice']) echo "bo_notice"; ?>">
<td align="center">
<?php
if ($list[$i]['is_notice']) // 공지사항
echo '<strong>공지</strong>';
else if ($wr_id == $list[$i]['wr_id'])
echo "<span class=\"bo_current\">열람중</span>";
else
echo "<a href='{$list[$i]['href']}'>{$list[$i]['num']}</a>";
?>
</td>
<?php if ($is_checkbox) { ?>
<td class="td_chk"><input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>"></td>
<?php } ?>
<td><input type='text' name='wr_datetime[<?php echo $i ?>]' value='<?php echo $list[$i]['datetime'] ?>' class="frm_input_datetime" readonly='readonly'></td>
<td><input type="text" name="wr_10[<?php echo $i ?>]" value="<?php echo $list[$i]['wr_10'];?>" class="frm_input_10"></td>
<td class="td_subject">
<?php echo $list[$i]['icon_reply'];?>
<input type="text" name="wr_subject[<?php echo $i ?>]" value="<?php echo $list[$i]['subject'] ?>" id="wr_subject" required class="frm_input_subject">
</td>
<td class="td_num">
<select name="wr_7[<?php echo $i ?>]" class='frm_input_2'>
<option value="1" <?php echo ($list[$i]['wr_7'] == "1")?"selected":"";?>>별도</option>
<option value="0" <?php echo ($list[$i]['wr_7'] == "0")?"selected":"";?>>없음</option>
</select>
</td>
<td class="td_num"><input type="text" name="wr_1[<?php echo $i ?>]" value="<?php if($list[$i]['wr_1']) echo number_format($list[$i]['wr_1']);?>" class="frm_input_1"></td>
<td class="td_num"><input type="text" name="wr_2[<?php echo $i ?>]" value="<?php if($list[$i]['wr_2']) echo number_format($list[$i]['wr_2']);?>" class="frm_input_2"></td>
<td class="td_num"><input type="text" name="wr_3[<?php echo $i ?>]" value="<?php if($list[$i]['wr_3']) echo number_format($list[$i]['wr_3']);?>" class="frm_input_1"></td>
<td class="td_num"><input type="text" name="wr_4[<?php echo $i ?>]" value="<?php if($list[$i]['wr_4']) echo number_format($list[$i]['wr_4']);?>" class="frm_input_2"></td>
<td class="td_num"><input type="text" name="wr_5[<?php echo $i ?>]" value="<?php if($list[$i]['wr_5']) echo number_format($list[$i]['wr_5']);?>" class="frm_input_1"></td>
<td class="td_num"><input type="text" name="wr_6[<?php echo $i ?>]" value="<?php if($list[$i]['wr_6']) echo number_format($list[$i]['wr_6']);?>" class="frm_input_2"></td>
<td class="td_num"><input type="text" name="wr_8[<?php echo $i ?>]" value="<?php if($list[$i]['wr_8']) echo $list[$i]['wr_8'];?>" id="wr_8" class="frm_input_8"></td>
<td align="center">
<?php if($is_admin || $member['mb_id'] == $list[$i]['mb_id']) { ?>
<span class='btn2 s ac_del' id='<?php echo $list[$i]['wr_id']?>'>삭제</span>
<?php } ?>
</td>
</tr>
<?php
//페이지 합계
for ($j=1; $j<=10; $j++)
{
if($j != 9)
{
$y = "wr_$j";
$page_add['$y'] = $list[$i]['$y'] + $page_add['$y'];
//if($list[$i][$y] != '') $list[$i][$y] = number_format($list[$i][$y]);
if($list[$i][$y] != '') $list[$i][$y] = $list[$i][$y];
}
}
}
//전체합계
$sca =$_GET['sca'];
$wr_10 = $_GET['wr_10'];
$all_add = " select sum(wr_1) as wr_1, sum(wr_2) as wr_2, sum(wr_3) as wr_3, sum(wr_4) as wr_4, sum(wr_5) as wr_5, sum(wr_6) as wr_6 from $write_table where wr_is_comment = 0 ";
if($sca) $all_add .= " and ca_name = '$sca' ";
if($wr_10) $all_add .= " and wr_10 = '$wr_10' ";
if($_GET['sdate']) $all_add .= " and wr_datetime between '$start_datetime' and '$end_datetime' ";
$all_add = sql_fetch($all_add);
?>
<?php if (count($list) == 0) { ?>
<input type='hidden' name='wr_id_up[0]' value='0' id='wr_id_0'> <!-- 데이타 없을 시 초기 wr_id 값 만들기 위해 -->
<tr><td colspan="<?php echo $colspan?>" class="empty_table">데이타가 없습니다.</td></tr>
<?php } ?>
<tr>
<td align="center" colspan='<?php echo $colspan-8;?>'><b>합계</b></td>
<td class="td_sum"><?php echo number_format($page_add['wr_1'])?></td>
<td class="td_sum"><?php echo number_format($page_add['wr_2'])?></td>
<td class="td_sum"><?php echo number_format($page_add['wr_3'])?></td>
<td class="td_sum"><?php echo number_format($page_add['wr_4'])?></td>
<td class="td_sum"><?php echo number_format($page_add['wr_5'])?></td>
<td class="td_sum"><?php echo number_format($page_add['wr_6'])?></td>
<td class="td_sum"></td>
<td class="td_sum"></td>
</tr>
<tr>
<td align="center" colspan='<?php echo $colspan-8;?>'><b>전체 합계</b></td>
<td class="td_sum"><?php echo number_format($all_add['wr_1'])?></td>
<td class="td_sum"><?php echo number_format($all_add['wr_2'])?></td>
<td class="td_sum"><?php echo number_format($all_add['wr_3'])?></td>
<td class="td_sum"><?php echo number_format($all_add['wr_4'])?></td>
<td class="td_sum"><?php echo number_format($all_add['wr_5'])?></td>
<td class="td_sum"><?php echo number_format($all_add['wr_6'])?></td>
<td class="td_sum"></td>
<td class="td_sum"></td>
</tr>
</tbody>
</table>
</div>
<?php if ($list_href || $is_checkbox || $write_href) { ?>
<div class="bo_fx" style="padding:10px 0;">
<?php if ($is_checkbox) { ?>
<input type="submit" name="btn_submit" value="선택삭제" onclick="document.pressed=this.value" class="btn2 m">
<input type="submit" name="btn_submit" value="선택복사" onclick="document.pressed=this.value" class="btn2 m">
<input type="submit" name="btn_submit" value="선택이동" onclick="document.pressed=this.value" class="btn2 m">
<?php } ?>
<?php if ($list_href || $write_href) { ?>
<ul class="btn_bo_user">
<?php if ($list_href) { ?><li><a href="<?php echo $list_href ?>" class="btn m">목록</a></li><?php } ?>
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn m">글쓰기</a></li><?php } ?><!--broad, /**/부분 해제-->
<?php if ($write_href) { ?><li><a href="javascript:select_update();" class="btn m">전체수정</a></li><?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</form>
</div>
<?php if($is_checkbox) { ?>
<noscript>
<p>자바스크립트를 사용하지 않는 경우<br>별도의 확인 절차 없이 바로 선택삭제 처리하므로 주의하시기 바랍니다.</p>
</noscript>
<?php } ?>
<!-- 페이지 -->
<div class="board_page">
<?php echo $write_pages; ?>
</div>
<fieldset id="bo_sch">
<legend>게시물 검색</legend>
<form name="fsearch" method="get">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sop" value="and">
<select name="sfl" id="sfl">
<!-- <option value="wr_subject"<?php// echo get_selected($sfl, 'wr_subject', true); ?>>거래내용</option> -->
<!-- <option value="wr_content"<?php// echo get_selected($sfl, 'wr_content'); ?>>내용</option> -->
<option value="wr_subject||wr_content"<?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>>거래내용+내용</option>
<option value="wr_10"<?php echo get_selected($sfl, 'wr_10'); ?>>거래처</option>
<option value="mb_id,1"<?php echo get_selected($sfl, 'mb_id,1'); ?>>회원아이디</option>
<option value="mb_id,0"<?php echo get_selected($sfl, 'mb_id,0'); ?>>회원아이디(코)</option>
<option value="wr_name,1"<?php echo get_selected($sfl, 'wr_name,1'); ?>>글쓴이</option>
<option value="wr_name,0"<?php echo get_selected($sfl, 'wr_name,0'); ?>>글쓴이(코)</option>
</select>
<input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required id="stx" class="ed required" size="15" maxlength="15">
<button type="submit" class="btn s">검색</button>
</form>
</fieldset>
<?php if ($is_checkbox) { ?>
<script>
function all_checked(sw) {
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function fboardlist_submit(f) {
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(document.pressed + "할 게시물을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택복사") {
select_copy("copy");
return;
}
if(document.pressed == "선택이동") {
select_copy("move");
return;
}
if(document.pressed == "선택삭제") {
if (!confirm("선택한 게시물을 정말 삭제하시겠습니까?\n\n한번 삭제한 자료는 복구할 수 없습니다\n\n답변글이 있는 게시글을 선택하신 경우\n답변글도 선택하셔야 게시글이 삭제됩니다."))
return false;
f.removeAttribute("target");
f.action = "./board_list_update.php";
}
return true;
}
// 선택한 게시물 복사 및 이동
function select_copy(sw) {
var f = document.fboardlist;
if (sw == "copy")
str = "복사";
else
str = "이동";
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
// 선택한 게시물 수정
function select_update() {
var f = document.fboardlist;
f.action = "<?php echo $board_skin_url ?>/list_update.skin.php";
f.submit();
}
</script>
<?php } ?>
<!-- } 게시판 목록 끝 -->
<!--날짜 달력입력-->
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script>
$(function() {
var $jQ = jQuery.noConflict(); //$ 충돌방지
$jQ("#sdate").datepicker({dateFormat:"yy-mm-dd", numberOfMonths: 2, showButtonPanel: true, showCurrentAtPos:1});
$jQ("#edate").datepicker({dateFormat:"yy-mm-dd", numberOfMonths: 2, showButtonPanel: true, showCurrentAtPos:1});
$jQ(".frm_input_datetime").datepicker({dateFormat:"yy-mm-dd", numberOfMonths: 2, showButtonPanel: true, showCurrentAtPos:1}); //날짜 수정
});
</script>
<!--//날짜 달력입력-->
답변 2
list_sort.skin.php 5번째 라인
$sdate = $_GET['sdate'] ? $_GET['sdate'] : date('Y-m-d');
위 코드를 아래와 같이 수정해주세요.
$edate = $_GET['edate'] ? $_GET['edate'] : date('Y-m-d');
감사합니다.
답변을 작성하시기 전에 로그인 해주세요.