질문드립니다. 도와주세요~
본문
여기 현재 예약리스트에서 예약자명으로만 검색들어가 있는데 예약일로도 검색할 수있게 넣으려는데 막혀서 잘 모르겠네요.. 혹시라도 도움을 받을 수 있을까 해서 이렇게 글 올려봅니다.
참고로 db서버에는 rr_start 이거는 테이블 : reserve_room 안에 들어있구요..
그리고 밑에는 리스트 소스입니다. 도와주세요~ㅠㅠ
----------------------------------------------------
<?php
require_once ('./_common.php');
$g5['title'] = $g5['title'].'예약목록';
$page = Request::both('page', 1);
$mth = Request::both('mth', false);
$sts = Request::both('sts', false);
$ph = Request::both('ph', false);
$cname = Request::both('cname', false);
$ReserveController = &Loader::instance()->loadController('reserve_ReserveManager');
$ReserveController->setUrl();
$Page = $ReserveController->doListPage($page, $mth, $sts, $ph, $cname);
$list = $Page->list;
$pay_arr = $ReserveController->pay_method;
$status_arr = $ReserveController->status_cd;
$page_query_string = "mth={$mth}&sts={$sts}&ph={$ph}&cname={$cname}";
?>
<?include_once $_SERVER['DOCUMENT_ROOT'].'/include/adm/admin.head.php';?>
<link rel="stylesheet" href="./css/style.css">
<div id="mng-reserve-list">
<div class="search-area tbl_frm01 tbl_wrap">
<form method="get" action="<?=$_SERVER['PHP_SELF']?>" >
<table class="" summary="검색 및 분류">
<caption>검색 및 분류 폼</caption>
<tbody>
<tr>
<th style="width:80px;">결제방식</th>
<td>
<select name="mth" title="결제방식 선택">
<option value="">전체</option>
<?foreach($pay_arr as $k => $row):?>
<option value="<?=$k?>" <?if($mth && $mth == $k):?>selected="selected"<?endif;?>><?=$row?></option>
<?endforeach;?>
</select>
</td>
<th style="width:60px;">
상태
</th>
<td>
<select name="sts" title="상태 선택">
<option value="">전체</option>
<?foreach($status_arr as $k => $row):?>
<option value="<?=$k?>" <?if($sts && $sts == $k):?>selected="selected"<?endif;?>><?=$row?></option>
<?endforeach;?>
</select>
</td>
<!--<th style="width:80px;">연락처</th>
<td>
<input type="text" name="ph" title="연락처검색" value="<?=$ph?>" class="frm_input"/>
<input type="submit" value="검색" class="btn btn_02"/>
</td>-->
<th style="width:80px;">예약자명</th>
<td>
<input type="text" name="cname" title="예약자명검색" value="<?=$cname?>" class="frm_input"/>
<input type="submit" value="검색" class="btn btn_02"/>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<div class="tbl_head01 tbl_wrap">
<table class="room-list-table reserve-list" summary="예약된 정보 목록">
<caption>예약목록</caption>
<colgroup>
<col width="120px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<col width="60px" />
<col width="100px" />
<col width="50px" />
<col width="150px" />
<col width="50px" />
<col width="100px" />
</colgroup>
<thead>
<tr>
<th>등록일</th>
<th>예약자명</th>
<th>연락처</th>
<th>총금액</th>
<th>결제금액</th>
<th>미결제금액</th>
<th>결제방식</th>
<th>상태</th>
<th>예약일</th>
<th>기간</th>
<th>객실유형</th>
<th>성인/소아</th>
<th>총액</th>
</tr>
</thead>
<tbody>
<?if(!is_array($list) || count($list) < 1):?>
<tr>
<td colspan="9">※ 검색된 예약정보가 없습니다.</td>
</tr>
<?else:?>
<?foreach($list as $k => $row):?>
<tr <?if(mktime(0,0,0, date('m'), date('d'), date('Y')) <= $row['r_ctime']):?>class="today"<?endif;?>>
<td class="center">
<a href="./form.php?seq=<?=$row['r_seq']?>">
<?=date('Y.m.d H:i', $row['r_ctime']);?>
</a>
</td>
<td class="center">
<?=$row['r_cname']?>
</td>
<td class="center">
<?=$row['r_ph']?>
</td>
<td class="center">
<?=number_format($row['r_total']);?>원
</td>
<td class="center">
<?=number_format($row['r_paied'])?>원
</td>
<td class="center <?if($row['left'] > 0):?>danger<?endif;?>">
<?=number_format($row['left'])?>원
</td>
<td class="center">
<?=$row['pay_type_kr']?>
</td>
<td class="center">
<?=$row['status_kr']?>
</td>
<td colspan="5" style="padding-left:5px; padding-right:5px;">
<table class="" summary="예약된 객실 정보">
<caption>객실정보 목록</caption>
<colgroup>
<col width="100px" />
<col width="50px" />
<col width="150px" />
<col width="50px" />
<col width="100px" />
</colgroup>
<tbody class="center">
<?if(is_array($row['rooms']) && count($row['rooms']) > 0):?>
<?foreach($row['rooms'] as $k => $detail):?>
<tr>
<td><?=date('Y.m.d', $detail['rr_start'])?></td>
<td><?=$detail['rr_range']?>박</td>
<td><?=$detail['ri_name']?></td>
<td>
<?=$detail['rr_adult']?> / <?=$detail['rr_child']?>
</td>
<td>
<?=number_format($detail['rr_total'])?>원
</td>
</tr>
<?endforeach;?>
<?else:?>
<tr>
<td colspan="5" class="danger">
※ 등록된 객실 정보가 없습니다.
</td>
</tr>
<?endif;?>
</tbody>
</table>
</td>
</tr>
<?endforeach;?>
<?endif;?>
</tbody>
</table>
<?if(is_array($Page->page_list) && count($Page->page_list) > 0):?>
<div class="btn-area-center">
<ul class="page-list">
<?if($Page->page_prev):?>
<li>
<a href="<?=$_SERVER['PHP_SELF']?>?page=<?=$Page->page_prev?>&<?=$page_query_string?>"><</a>
</li>
<?endif;?>
<?foreach($Page->page_list as $v):?>
<li <?if($page == $v):?>class="active"<?endif;?>>
<a href="<?=$_SERVER['PHP_SELF']?>?page=<?=$v?>&<?=$page_query_string?>"><?=$v?></a>
</li>
<?endforeach;?>
<?if($Page->page_next):?>
<li>
<a href="<?=$_SERVER['PHP_SELF']?>?page=<?=$Page->page_next?>&<?=$page_query_string?>">></a>
</li>
<?endif;?>
</ul>
</div>
<?endif;?>
</div>
</div>
<iframe name="formReceiver" id="formReceiver" style="border:1px solid red; width:100%; height:400px; display:none;"></iframe>
<style>
tr.hover > td{background-color:#9DCEF8;}
table table tr td{background-color:#fff;}
</style>
<script>
$(document).ready(function(){
var tr_list = $('.room-list-table > tbody > tr');
$.each(tr_list, function(i, e){
$(e).css('cursor', 'pointer');
var $a = $(e).find('a');
var href = $a.attr('href');
$(e).on('mouseenter', function(){
$(this).addClass('hover');
}).on('mouseleave', function(){
$(this).removeClass('hover');
}).on('click', function(){
document.location.href=href;
});
});
});
</script>
<?include_once $_SERVER['DOCUMENT_ROOT'].'/include/adm/admin.tail.php';;?>
답변 2
다음 부분에서 검색이 이루어지는 것으로 보이고
$Page = $ReserveController->doListPage($page, $mth, $sts, $ph, $cname);
doListPage 파라미터 추가, 내부 동작 추가 작업이 예상됩니다.
!-->이곳은 작업중 발생하는 오류나 문제의 조언을 요청하는곳이지
제작요청을 하는곳은 아닙니다.
제작의뢰로 가시면 5만원 미만으로 해결될 문제 같습니다.