월별로 데이터 불러오기
본문
리스트 ticket.php
----------------------------------------------------------------------------
<?php
$steparr = array('','예약가능','예약완료','예약대기');
$steparr = array('','예약가능','예약완료','예약대기');
?>
<style>
.ui-datepicker-trigger {
position:relative;
top : 5px;
cursor:pointer;
}
.style1 {color: #FF0000}
</style>
<div id="ticketlist">
<div class="main">
<div class="ticket">
<table width="100%" summary="배표 입니다.">
<caption>배표</caption>
<colgroup>
<col width="120">
<col width="120">
<col width="80">
<col width="80">
<col width="80">
<col width="60">
<col width="80">
<col width="">
<caption>배표</caption>
<colgroup>
<col width="120">
<col width="120">
<col width="80">
<col width="80">
<col width="80">
<col width="60">
<col width="80">
<col width="">
</colgroup>
<thead>
<th scope="col">일정</th>
<th scope="col">상품명</th>
<th scope="col">2인1실</th>
<th scope="col">3인1실</th>
<th scope="col">4/5인실</th>
<th scope="col">합숙</th>
<th scope="col">소아</th>
<th scope="col">잔여석</th>
<th scope="col">선택</th>
</thead>
<tbody id="start_schedule">
<th scope="col">일정</th>
<th scope="col">상품명</th>
<th scope="col">2인1실</th>
<th scope="col">3인1실</th>
<th scope="col">4/5인실</th>
<th scope="col">합숙</th>
<th scope="col">소아</th>
<th scope="col">잔여석</th>
<th scope="col">선택</th>
</thead>
<tbody id="start_schedule">
<?php $RCD = getDbArray($table[$m.'ticket'],$sqlque,'*','sdate','asc',0,1);?>
<?php $i=0; while($R = db_fetch_array($RCD)):?>
<tr>
<td><?php echo getDateFormat($R['sdate'],'y,m,d')?>
<?php
$week = date ("w", strtotime($R['sdate']));
switch ($week) {
case ("0") : $nm_week = "<span style='color:red;'>[일]</span>"; break;
case ("1") : $nm_week = "[월]"; break;
case ("2") : $nm_week = "[화]"; break;
case ("3") : $nm_week = "[수]"; break;
case ("4") : $nm_week = "[목]"; break;
case ("5") : $nm_week = "<span style='color:#006600;'>[금]</span>"; break;
case ("6") : $nm_week = "<span style='color:red;'>[토]</span>"; break;
default :
};
echo $nm_week;
?>
<td><?php echo getDateFormat($R['sdate'],'y,m,d')?>
<?php
$week = date ("w", strtotime($R['sdate']));
switch ($week) {
case ("0") : $nm_week = "<span style='color:red;'>[일]</span>"; break;
case ("1") : $nm_week = "[월]"; break;
case ("2") : $nm_week = "[화]"; break;
case ("3") : $nm_week = "[수]"; break;
case ("4") : $nm_week = "[목]"; break;
case ("5") : $nm_week = "<span style='color:#006600;'>[금]</span>"; break;
case ("6") : $nm_week = "<span style='color:red;'>[토]</span>"; break;
default :
};
echo $nm_week;
?>
</td>
<td><?php echo $R['startname']?></td>
<td><?php echo $R['class']?></td>
<td><?php echo $R['price']?></td>
<td><?php echo $R['sprice']?></td>
<td><?php echo $R['food']?></td>
<td><?php echo $R['start_time']?></td>
<td><?php echo $R['seat']?></td>
<td><?php if($R['step']==1):?>예약가능<?php else:?><?php echo $steparr[$R['step']]?><?php endif?></td>
</tr>
<?php $i++; endwhile?>
</tbody>
</table>
</div>
<?php include $g['dir_module'].'/var/code/guide'.$startcode.'.php';?>
</table>
</div>
<?php include $g['dir_module'].'/var/code/guide'.$startcode.'.php';?>
</div>
</div>
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
관리자페이지 ticket.php
-------------------------------------------------------------------------------
<?php
//날짜선택
$yy = $_REQUEST['yy'];
$mm = $_REQUEST['mm'];
$dd = $_REQUEST['dd'];
if($yy == '') $yy = date('Y');
if($mm == '') $mm = date('m');
if($dd == '') $dd = date('d');
$yy = $_REQUEST['yy'];
$mm = $_REQUEST['mm'];
$dd = $_REQUEST['dd'];
if($yy == '') $yy = date('Y');
if($mm == '') $mm = date('m');
if($dd == '') $dd = date('d');
function sel_yy($yy, $func) {
if($yy == '') $yy = date('Y');
if($yy == '') $yy = date('Y');
if($func=='') {
$str = "<select name='yy' class='c1'>\n<option value=''></option>\n";
} else {
$str = "<select name='yy' class='c1' onChange='$func'>\n<option value=''></option>\n";
}
$gijun = date('Y');
for($i=$gijun;$i<$gijun+5;$i++) {
if($yy == $i) $str .= "<option value='$i' selected>$i</option>";
else $str .= "<option value='$i'>$i</option>";
}
$str .= "</select>";
return $str;
}
$str = "<select name='yy' class='c1'>\n<option value=''></option>\n";
} else {
$str = "<select name='yy' class='c1' onChange='$func'>\n<option value=''></option>\n";
}
$gijun = date('Y');
for($i=$gijun;$i<$gijun+5;$i++) {
if($yy == $i) $str .= "<option value='$i' selected>$i</option>";
else $str .= "<option value='$i'>$i</option>";
}
$str .= "</select>";
return $str;
}
function sel_mm($mm, $func) {
if($func=='') {
$str = "<select name='mm' class='c2'>\n";
} else {
$str = "<select name='mm' class='c2' onChange='$func'>\n";
}
for($i=1;$i<13;$i++) {
$i = sprintf('%02d',$i);
if($mm == $i) $str .= "<option value='$i' selected>{$i}</option>";
else $str .= "<option value='$i'>{$i}</option>";
}
$str .= "</select>";
return $str;
}
if($func=='') {
$str = "<select name='mm' class='c2'>\n";
} else {
$str = "<select name='mm' class='c2' onChange='$func'>\n";
}
for($i=1;$i<13;$i++) {
$i = sprintf('%02d',$i);
if($mm == $i) $str .= "<option value='$i' selected>{$i}</option>";
else $str .= "<option value='$i'>{$i}</option>";
}
$str .= "</select>";
return $str;
}
function sel_dd($dd, $func) {
//$daynum = date('t',mktime(0,0,0,$mm,0,$yy));
//$lastday = date('t',mktime(0,0,1,$mm,1,$yy));
$daynum = date('t',mktime(0,0,1,$mm,1,$yy));
if($func=='') {
$str = "<select name='dd' class='c2'>\n";
} else {
$str = "<select name='dd' class='c2' onChange='$func'>\n";
}
$str = "<select name='dd' class='c2'>\n";
} else {
$str = "<select name='dd' class='c2' onChange='$func'>\n";
}
for($i=1; $i<=$daynum; $i++){
$i = sprintf('%02d',$i);
if($dd == $i) $str .= "<option value='$i' selected>{$i}</option>";
else $str .= "<option value='$i'>{$i}</option>";
}
$str .= "</select>";
return $str;
}
//티켓
$sdate = $yy.$mm.$dd;
$sort = $sort ? $sort : 'sdate';
$orderby = $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 301 ? $recnum : 20;
$sqlque = 'display=1';
$sqlque .= ' and category='.$cat;
//if ($yy && $mm && $dd) $sqlque .= ' and sdate='.$sdate;
$sdate = $yy.$mm.$dd;
$sort = $sort ? $sort : 'sdate';
$orderby = $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 301 ? $recnum : 20;
$sqlque = 'display=1';
$sqlque .= ' and category='.$cat;
//if ($yy && $mm && $dd) $sqlque .= ' and sdate='.$sdate;
$sd=$_REQUEST['startday'];
$ed=$_REQUEST['endday'];
if($sd && $ed){
$sqlque .= " and ( sdate >= '{$sd}' and sdate <= '{$ed}' ) ";
//die($sqlque);
} else {
$tod=date('Ymd');
$sqlque .= " and sdate = '{$tod}' ";
}
$p=$_REQUEST['p']?$_REQUEST['p']:1;
$RCD = getDbArray($table[$module.'ticket'],$sqlque,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table[$module.'ticket'],$sqlque);
$TPG = getTotalPage($NUM,$recnum);
$ed=$_REQUEST['endday'];
if($sd && $ed){
$sqlque .= " and ( sdate >= '{$sd}' and sdate <= '{$ed}' ) ";
//die($sqlque);
} else {
$tod=date('Ymd');
$sqlque .= " and sdate = '{$tod}' ";
}
$p=$_REQUEST['p']?$_REQUEST['p']:1;
$RCD = getDbArray($table[$module.'ticket'],$sqlque,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table[$module.'ticket'],$sqlque);
$TPG = getTotalPage($NUM,$recnum);
if ($uid)
{
{
}
$steparr = array('','예약신청','결제완료','처리완료','예약대기');
?>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
<div id="catebody">
<div id="category">
<div class="title">
운행스케쥴
</div>
<div class="tree">
<ul>
<?php $_i=0; $SCD = getDbArray($table[$module.'schedule'],'display=1 and category='.$cat,'*','gid','asc',0,1);?>
<?php while($S = db_fetch_array($SCD)):?>
</div>
<div class="tree">
<ul>
<?php $_i=0; $SCD = getDbArray($table[$module.'schedule'],'display=1 and category='.$cat,'*','gid','asc',0,1);?>
<?php while($S = db_fetch_array($SCD)):?>
<?php $_X = getDbRows($table[$module.'ticket'],'schedule='.$S['uid']);?>
<li <?php if($S['category']):?> class="usecat" title="<?php echo $S['category']?>"<?php endif?>>
<?php if($yy && $mm && $dd):?>
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&uid=<?php echo $S['uid']?>&yy=<?php echo $yy?>&mm=<?php echo $mm?>&dd=<?php echo $dd?>&a=addticket" target="_orderframe_" onclick="return confirm('정말로 추가하시겠습니까? ')" title="티켓추가">
<?php else:?>
<a href="#." onclick="javascript:alert('날짜를 먼저 선택하세요!');" title="티켓추가">
<?php endif?>
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&uid=<?php echo $S['uid']?>&yy=<?php echo $yy?>&mm=<?php echo $mm?>&dd=<?php echo $dd?>&a=addticket" target="_orderframe_" onclick="return confirm('정말로 추가하시겠습니까? ')" title="티켓추가">
<?php else:?>
<a href="#." onclick="javascript:alert('날짜를 먼저 선택하세요!');" title="티켓추가">
<?php endif?>
<span class="name<?php if($S['uid']==$uid):?> on<?php endif?><?php if($_X['uid']):?> add<?php endif?>" title="<?php echo number_format($S['class'])?>"><?php echo $S['startname']?>(<?php echo $S['class']?>)</span></a>
</li>
<?php $_i++; endwhile?>
</ul>
</div>
<?php if(!$_i):?>
<div class="none">등록된 스케쥴이 없습니다.</div>
<?php endif?>
</li>
<?php $_i++; endwhile?>
</ul>
</div>
<?php if(!$_i):?>
<div class="none">등록된 스케쥴이 없습니다.</div>
<?php endif?>
</div>
<div id="catinfo">
<div class="title">
<div class="xleft">
티켓관리
</div>
</div>
티켓관리
</div>
</div>
<div class="notice">
</div>
</div>
<div class="regis">
<form name="ticketForm" action="<?php echo $g['s']?>/" method="post" enctype="multipart/form-data" target="_action_frame_<?php echo $m?>" onsubmit="return ticketCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $module?>" />
<input type="hidden" name="a" value="ticket_regis" />
<input type="hidden" name="cat" value="<?php echo $cat?>" />
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $module?>" />
<input type="hidden" name="a" value="ticket_regis" />
<input type="hidden" name="cat" value="<?php echo $cat?>" />
<div class="str">
<?php
//티켓등록
$syear = substr($date['today'],0,4);
$smonth = substr($date['today'],4,2);
$emonth = substr($date['today'],4,2);
?>
<input type="text" class="datepicker dp1" name="dstart" value="<?php echo date('Ymd')?>" size="8" /> ~
<input type="text" class="datepicker dp1" name="dend" value="<?php echo date('Ymd')?>" size="8" />
<!--
<select name="syear" class="c1">
<option value="">-년-</option>
<?php for($i=$syear;$i<$syear+3;$i++):?>
<option value="<?php echo $i?>"><?php echo $i?></option>
<?php endfor?>
</select> 년
<select name="smonth" class="c1">
<option value="">-월-</option>
<?php for($i=1;$i<13;$i++):?>
<option value="<?php echo $i?>"><?php echo $i?></option>
<?php endfor?>
</select> 월
<select name="sday" class="c1">
<option>-일-</option>
<?php for($i=1;$i<=31;$i++):?>
<option value="<?php echo $i?>"><?php echo $i?></option>
<?php endfor?>
</select>일부터
//티켓등록
$syear = substr($date['today'],0,4);
$smonth = substr($date['today'],4,2);
$emonth = substr($date['today'],4,2);
?>
<input type="text" class="datepicker dp1" name="dstart" value="<?php echo date('Ymd')?>" size="8" /> ~
<input type="text" class="datepicker dp1" name="dend" value="<?php echo date('Ymd')?>" size="8" />
<!--
<select name="syear" class="c1">
<option value="">-년-</option>
<?php for($i=$syear;$i<$syear+3;$i++):?>
<option value="<?php echo $i?>"><?php echo $i?></option>
<?php endfor?>
</select> 년
<select name="smonth" class="c1">
<option value="">-월-</option>
<?php for($i=1;$i<13;$i++):?>
<option value="<?php echo $i?>"><?php echo $i?></option>
<?php endfor?>
</select> 월
<select name="sday" class="c1">
<option>-일-</option>
<?php for($i=1;$i<=31;$i++):?>
<option value="<?php echo $i?>"><?php echo $i?></option>
<?php endfor?>
</select>일부터
<select name="emonth" class="c1">
<option value="">-월-</option>
<?php for($i=1;$i<13;$i++):?>
<option value="<?php echo $i?>"><?php echo $i?></option>
<?php endfor?>
</select> 월
<select name="eday" class="c1">
<option>-일-</option>
<?php for($i=1;$i<=31;$i++):?>
<option value="<?php echo $i?>"><?php echo $i?></option>
<?php endfor?>
-->
</div>
<option value="">-월-</option>
<?php for($i=1;$i<13;$i++):?>
<option value="<?php echo $i?>"><?php echo $i?></option>
<?php endfor?>
</select> 월
<select name="eday" class="c1">
<option>-일-</option>
<?php for($i=1;$i<=31;$i++):?>
<option value="<?php echo $i?>"><?php echo $i?></option>
<?php endfor?>
-->
</div>
<table summary="티켓 입니다.">
<caption>티켓일괄등록</caption>
<colgroup>
<col width="30">
<col width="60">
<col width="120">
<col width="80">
<col width="60">
<col width="80">
<col width="80">
<col width="80">
<col width="60">
<col width="60">
</colgroup>
<thead>
<th scope="col" class="side1"><img src="<?php echo $g['img_core']?>/_public/ico_check_01.gif" alt="선택/반전" class="hand" onclick="chkFlag('xticket_members[]');" /></th>
<th scope="col">일정</th>
<th scope="col">상품명</th>
<th scope="col">2인1실</th>
<th scope="col">3인1실</th>
<th scope="col">4/5인실</th>
<th scope="col">합숙</th>
<th scope="col">소아</th>
<th scope="col">잔여석</th>
<th scope="col">상태</th>
</thead>
<tbody>
<caption>티켓일괄등록</caption>
<colgroup>
<col width="30">
<col width="60">
<col width="120">
<col width="80">
<col width="60">
<col width="80">
<col width="80">
<col width="80">
<col width="60">
<col width="60">
</colgroup>
<thead>
<th scope="col" class="side1"><img src="<?php echo $g['img_core']?>/_public/ico_check_01.gif" alt="선택/반전" class="hand" onclick="chkFlag('xticket_members[]');" /></th>
<th scope="col">일정</th>
<th scope="col">상품명</th>
<th scope="col">2인1실</th>
<th scope="col">3인1실</th>
<th scope="col">4/5인실</th>
<th scope="col">합숙</th>
<th scope="col">소아</th>
<th scope="col">잔여석</th>
<th scope="col">상태</th>
</thead>
<tbody>
<?php $_SCD = getDbArray($table[$module.'schedule'],'category='.$cat,'*','gid','asc',0,1);?>
<?php $i=0; while($_S=db_fetch_array($_SCD)):?>
<tr>
<td><input type="checkbox" name="xticket_members[]" value="<?php echo $_S['uid']?>"></td>
<td><a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&a=ticket_sdelete&cat=<?php echo $cat?>&uid=<?php echo $_S['uid']?>" target="_action_frame_<?php echo $m?>" onclick="return confirm('정말로 일괄삭제하시겠습니까? ')">선택삭제</a></td>
<td><input type="text" name="xstartname_<?php echo $_S['uid']?>" value="<?php echo $_S['startname']?>" size="25" readonly class="input" /></td>
<td><input type="text" name="xclass_<?php echo $_S['uid']?>" value="<?php echo $_S['class']?>" size="10" readonly class="input" /></td>
<td><input type="text" name="xprice_<?php echo $_S['uid']?>" value="<?php echo $_S['price']?>" size="10" readonly onkeyup="numformat(this);" class="input" id="xprice_<?php echo $i?>" /></td>
<td><input type="text" name="xsprice_<?php echo $_S['uid']?>" value="<?php echo $_S['sprice']?>" size="10" readonly class="input" id="xsprice_<?php echo $i?>" />원</td>
<td><input type="text" name="xfood_<?php echo $_S['uid']?>" value="<?php echo $_S['food']?>" size="10" readonly onkeyup="numformat(this);" class="input" id="xfood_<?php echo $i?>" />원</td>
<td><input type="text" name="xstart_time_<?php echo $_S['uid']?>" value="<?php echo $_S['start_time']?>" size="10" class="input" />원</td>
<td><input type="text" name="xseat_<?php echo $_S['uid']?>" value="" size="10" onkeyup="numformat(this);" class="input" />석</td>
<td><input type="text" name="xticked_<?php echo $_S['uid']?>"value="" size="10" onkeyup="numformat(this);" class="input" /></td>
</tr>
<?php $i++; endwhile?>
<?php $i=0; while($_S=db_fetch_array($_SCD)):?>
<tr>
<td><input type="checkbox" name="xticket_members[]" value="<?php echo $_S['uid']?>"></td>
<td><a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&a=ticket_sdelete&cat=<?php echo $cat?>&uid=<?php echo $_S['uid']?>" target="_action_frame_<?php echo $m?>" onclick="return confirm('정말로 일괄삭제하시겠습니까? ')">선택삭제</a></td>
<td><input type="text" name="xstartname_<?php echo $_S['uid']?>" value="<?php echo $_S['startname']?>" size="25" readonly class="input" /></td>
<td><input type="text" name="xclass_<?php echo $_S['uid']?>" value="<?php echo $_S['class']?>" size="10" readonly class="input" /></td>
<td><input type="text" name="xprice_<?php echo $_S['uid']?>" value="<?php echo $_S['price']?>" size="10" readonly onkeyup="numformat(this);" class="input" id="xprice_<?php echo $i?>" /></td>
<td><input type="text" name="xsprice_<?php echo $_S['uid']?>" value="<?php echo $_S['sprice']?>" size="10" readonly class="input" id="xsprice_<?php echo $i?>" />원</td>
<td><input type="text" name="xfood_<?php echo $_S['uid']?>" value="<?php echo $_S['food']?>" size="10" readonly onkeyup="numformat(this);" class="input" id="xfood_<?php echo $i?>" />원</td>
<td><input type="text" name="xstart_time_<?php echo $_S['uid']?>" value="<?php echo $_S['start_time']?>" size="10" class="input" />원</td>
<td><input type="text" name="xseat_<?php echo $_S['uid']?>" value="" size="10" onkeyup="numformat(this);" class="input" />석</td>
<td><input type="text" name="xticked_<?php echo $_S['uid']?>"value="" size="10" onkeyup="numformat(this);" class="input" /></td>
</tr>
<?php $i++; endwhile?>
</tbody>
</table>
</table>
<div class="submitbox">
<input type="submit" class="btnblue topm" value="티켓일괄등록" />
<input type="button" class="btnblue topm" value="전체삭제" onclick="ticketAdelete();return confirm('정말로 전체삭제하시겠습니까? ');" />
<input type="submit" class="btnblue topm" value="티켓일괄등록" />
<input type="button" class="btnblue topm" value="전체삭제" onclick="ticketAdelete();return confirm('정말로 전체삭제하시겠습니까? ');" />
<div class="clear"></div>
</div>
</div>
</form>
</div>
</div>
<div class="str">
<form name="selForm" action="<?php echo $g['s']?>/" method="get">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $m?>" />
<input type="hidden" name="p" id="ma" value="<?php echo $p?$p:1?>" />
<input type="hidden" name="module" value="<?php echo $module?>" />
<input type="hidden" name="front" value="<?php echo $front?>" />
<input type="hidden" name="iframe" value="<?php echo $iframe?>" />
<input type="hidden" name="cat" value="<?php echo $cat?>" />
<!-- 상단부분 pw-->
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script>
$(function(){
$.datepicker.regional['ko'] = {
closeText: '닫기',
prevText: '이전달',
nextText: '다음달',
currentText: '오늘',
monthNames: ['1월','2월','3월','4월','5월','6월',
'7월','8월','9월','10월','11월','12월'],
monthNamesShort: ['1월','2월','3월','4월','5월','6월',
'7월','8월','9월','10월','11월','12월'],
dayNames: ['일','월','화','수','목','금','토'],
dayNamesShort: ['일','월','화','수','목','금','토'],
dayNamesMin: ['일','월','화','수','목','금','토'],
weekHeader: 'Wk',
dateFormat: 'yy-mm-dd',
firstDay: 0,
isRTL: false,
duration:200,
showAnim:'show',
showMonthAfterYear: false,
yearSuffix: '년'};
$.datepicker.setDefaults($.datepicker.regional['ko']);
$(".datepicker").datepicker().datepicker("option","dateFormat","yymmdd");
$("#sd,.dp1").val("<?=$_REQUEST['startday']?$_REQUEST['startday']:date('Ymd')?>");
$("#ed").val("<?=$_REQUEST['endday']?$_REQUEST['endday']:date('Ymd')?>");
$(".dp2").change(function(){ $("form[name=selForm]").submit(); });
});
</script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/blitzer/jquery-ui.css" />
<div class="search">
<input type="text" class="datepicker dp2" id="sd" name="startday" value="<?=$_REQUEST['startday']?$_REQUEST['startday']:date('Ymd')?>" size="8" /> <span class="style1">~</span>
<input type="text" class="datepicker dp2" id="ed" name="endday" value="<?=$_REQUEST['endday']?$_REQUEST['endday']:date('Ymd')?>" size="8" />
</div>
<!-- 상단 부분pw -->
<form name="selForm" action="<?php echo $g['s']?>/" method="get">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $m?>" />
<input type="hidden" name="p" id="ma" value="<?php echo $p?$p:1?>" />
<input type="hidden" name="module" value="<?php echo $module?>" />
<input type="hidden" name="front" value="<?php echo $front?>" />
<input type="hidden" name="iframe" value="<?php echo $iframe?>" />
<input type="hidden" name="cat" value="<?php echo $cat?>" />
<!-- 상단부분 pw-->
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script>
$(function(){
$.datepicker.regional['ko'] = {
closeText: '닫기',
prevText: '이전달',
nextText: '다음달',
currentText: '오늘',
monthNames: ['1월','2월','3월','4월','5월','6월',
'7월','8월','9월','10월','11월','12월'],
monthNamesShort: ['1월','2월','3월','4월','5월','6월',
'7월','8월','9월','10월','11월','12월'],
dayNames: ['일','월','화','수','목','금','토'],
dayNamesShort: ['일','월','화','수','목','금','토'],
dayNamesMin: ['일','월','화','수','목','금','토'],
weekHeader: 'Wk',
dateFormat: 'yy-mm-dd',
firstDay: 0,
isRTL: false,
duration:200,
showAnim:'show',
showMonthAfterYear: false,
yearSuffix: '년'};
$.datepicker.setDefaults($.datepicker.regional['ko']);
$(".datepicker").datepicker().datepicker("option","dateFormat","yymmdd");
$("#sd,.dp1").val("<?=$_REQUEST['startday']?$_REQUEST['startday']:date('Ymd')?>");
$("#ed").val("<?=$_REQUEST['endday']?$_REQUEST['endday']:date('Ymd')?>");
$(".dp2").change(function(){ $("form[name=selForm]").submit(); });
});
</script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/blitzer/jquery-ui.css" />
<div class="search">
<input type="text" class="datepicker dp2" id="sd" name="startday" value="<?=$_REQUEST['startday']?$_REQUEST['startday']:date('Ymd')?>" size="8" /> <span class="style1">~</span>
<input type="text" class="datepicker dp2" id="ed" name="endday" value="<?=$_REQUEST['endday']?$_REQUEST['endday']:date('Ymd')?>" size="8" />
</div>
<!-- 상단 부분pw -->
<!--
<?php echo sel_yy($yy,'selForm.submit();')?> 년 <?php echo sel_mm($mm,'selForm.submit();')?> 월 <?php echo sel_dd($dd,'selForm.submit();')?> 일
-->
</form>
<?php echo sel_yy($yy,'selForm.submit();')?> 년 <?php echo sel_mm($mm,'selForm.submit();')?> 월 <?php echo sel_dd($dd,'selForm.submit();')?> 일
-->
</form>
</div>
<form name="procForm" action="<?php echo $g['s']?>/" method="post" enctype="multipart/form-data" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $module?>" />
<input type="hidden" name="a" value="ticket" id="ak" />
<form name="procForm" action="<?php echo $g['s']?>/" method="post" enctype="multipart/form-data" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $module?>" />
<input type="hidden" name="a" value="ticket" id="ak" />
<table summary="티켓 입니다.">
<caption>티켓</caption>
<colgroup>
<col width="30">
<col width="60">
<col width="120">
<col width="80">
<col width="60">
<col width="80">
<col width="80">
<col width="80">
<col width="60">
<col width="60">
</colgroup>
<thead>
<th scope="col" class="side1"><img src="<?php echo $g['img_core']?>/_public/ico_check_01.gif" alt="선택/반전" class="hand" onclick="chkFlag('ticket_members[]');" /></th>
<th scope="col">일정</th>
<th scope="col">상품명</th>
<th scope="col">2인1실</th>
<th scope="col">3인1실</th>
<th scope="col">4/5인실</th>
<th scope="col">합숙</th>
<th scope="col">소아</th>
<th scope="col">잔여석</th>
<th scope="col">상태</th>
</thead>
<tbody>
<caption>티켓</caption>
<colgroup>
<col width="30">
<col width="60">
<col width="120">
<col width="80">
<col width="60">
<col width="80">
<col width="80">
<col width="80">
<col width="60">
<col width="60">
</colgroup>
<thead>
<th scope="col" class="side1"><img src="<?php echo $g['img_core']?>/_public/ico_check_01.gif" alt="선택/반전" class="hand" onclick="chkFlag('ticket_members[]');" /></th>
<th scope="col">일정</th>
<th scope="col">상품명</th>
<th scope="col">2인1실</th>
<th scope="col">3인1실</th>
<th scope="col">4/5인실</th>
<th scope="col">합숙</th>
<th scope="col">소아</th>
<th scope="col">잔여석</th>
<th scope="col">상태</th>
</thead>
<tbody>
<?php $i=0; while($R = db_fetch_array($RCD)):?>
<tr>
<td><input type="hidden" name="ticket_members[]" value="<?php echo $R['uid']?>" />
<input type="checkbox" name="ticket_members2[]" value="<?php echo $R['uid']?>" />
<a style="display:none" href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&uid=<?php echo $R['uid']?>&a=ticket_delete" target="_orderframe_" onclick="return confirm('정말로 삭제하시겠습니까? ')" title="배표삭제">삭제</a></td>
<td><?php echo getDateFormat($R['sdate'],'y,m,d')?>
<?php
$week = date ("w", strtotime($R['sdate']));
switch ($week) {
case ("0") : $nm_week = "<span style='color:red;'>[일]</span>"; break;
case ("1") : $nm_week = "[월]"; break;
case ("2") : $nm_week = "[화]"; break;
case ("3") : $nm_week = "[수]"; break;
case ("4") : $nm_week = "[목]"; break;
case ("5") : $nm_week = "<span style='color:#006600;'>[금]</span>"; break;
case ("6") : $nm_week = "<span style='color:red;'>[토]</span>"; break;
default :
};
echo $nm_week;
?></td>
<td><input type="text" name="startname[]" value="<?php echo $R['startname']?>" size="25" readonly class="input" /></td>
<td><input type="text" name="class[]" value="<?php echo $R['class']?>" size="10" readonly class="input" /></td>
<td><input type="text" name="price[]" value="<?php echo $R['price']?>" size="10" readonly onkeyup="numformat(this);" class="input" id="price_<?php echo $i?>" /></td>
<td><input type="text" name="sprice[]" value="<?php echo $R['sprice']?>" size="10" readonly class="input" id="sprice_<?php echo $i?>" />원</td>
<td><input type="text" name="food[]" value="<?php echo $R['food']?>" size="10" readonly onkeyup="numformat(this);" class="input" id="food_<?php echo $i?>" />원</td>
<td><input type="text" name="start_time[]" value="<?php echo $R['start_time']?>" size="10" class="input" />원</td>
<td><input type="text" name="seat[]" value="<?php echo $R['seat']?>" size="10" onkeyup="numformat(this);" class="input" />석</td>
<td><?php if($R['step']==1):?>예약가능<?php else:?><?php echo $ticked[$R['step']]?><?php endif?></td>
</tr>
<?php $i++; endwhile?>
<tr>
<td><input type="hidden" name="ticket_members[]" value="<?php echo $R['uid']?>" />
<input type="checkbox" name="ticket_members2[]" value="<?php echo $R['uid']?>" />
<a style="display:none" href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&uid=<?php echo $R['uid']?>&a=ticket_delete" target="_orderframe_" onclick="return confirm('정말로 삭제하시겠습니까? ')" title="배표삭제">삭제</a></td>
<td><?php echo getDateFormat($R['sdate'],'y,m,d')?>
<?php
$week = date ("w", strtotime($R['sdate']));
switch ($week) {
case ("0") : $nm_week = "<span style='color:red;'>[일]</span>"; break;
case ("1") : $nm_week = "[월]"; break;
case ("2") : $nm_week = "[화]"; break;
case ("3") : $nm_week = "[수]"; break;
case ("4") : $nm_week = "[목]"; break;
case ("5") : $nm_week = "<span style='color:#006600;'>[금]</span>"; break;
case ("6") : $nm_week = "<span style='color:red;'>[토]</span>"; break;
default :
};
echo $nm_week;
?></td>
<td><input type="text" name="startname[]" value="<?php echo $R['startname']?>" size="25" readonly class="input" /></td>
<td><input type="text" name="class[]" value="<?php echo $R['class']?>" size="10" readonly class="input" /></td>
<td><input type="text" name="price[]" value="<?php echo $R['price']?>" size="10" readonly onkeyup="numformat(this);" class="input" id="price_<?php echo $i?>" /></td>
<td><input type="text" name="sprice[]" value="<?php echo $R['sprice']?>" size="10" readonly class="input" id="sprice_<?php echo $i?>" />원</td>
<td><input type="text" name="food[]" value="<?php echo $R['food']?>" size="10" readonly onkeyup="numformat(this);" class="input" id="food_<?php echo $i?>" />원</td>
<td><input type="text" name="start_time[]" value="<?php echo $R['start_time']?>" size="10" class="input" />원</td>
<td><input type="text" name="seat[]" value="<?php echo $R['seat']?>" size="10" onkeyup="numformat(this);" class="input" />석</td>
<td><?php if($R['step']==1):?>예약가능<?php else:?><?php echo $ticked[$R['step']]?><?php endif?></td>
</tr>
<?php $i++; endwhile?>
</tbody>
<tfoot style="text-align:center">
<tr>
<td colspan="15">
<?php for($i=1;$i<=$TPG;$i++):?>
<?php if($i!==1):?>|<?php endif?> <a href="javascript:void(0)" onclick="$('form[name=selForm]').children('#ma').val(<?php echo $i?>);$('form[name=selForm]').get(0).submit();"<?php if($p==$i):?> style="font-weight:bold"<?php endif?>><?php echo $i?></a>
<?php endfor?>
</td>
</tr>
</tfoot>
</table>
<div class="submitbox">
<select name="step" />
<option value="">예약선택</option>
<option value="1"><?php echo $steparr[1]?></option>
<option value="2"><?php echo $steparr[2]?></option>
<option value="3"><?php echo $steparr[3]?></option>
<option value="4"><?php echo $steparr[4]?></option>
</select>
<input type="submit" class="btnblue" value="설정변경" />
<input type="button" class="btnblue" value="선택삭제" onclick="$('#ak').val('ticket_delete');$('form[name=procForm]').get(0).submit();"/>
<div class="clear"></div>
</div>
<div class="clear"></div>
<iframe name="_orderframe_" class="hide"></iframe>
<tfoot style="text-align:center">
<tr>
<td colspan="15">
<?php for($i=1;$i<=$TPG;$i++):?>
<?php if($i!==1):?>|<?php endif?> <a href="javascript:void(0)" onclick="$('form[name=selForm]').children('#ma').val(<?php echo $i?>);$('form[name=selForm]').get(0).submit();"<?php if($p==$i):?> style="font-weight:bold"<?php endif?>><?php echo $i?></a>
<?php endfor?>
</td>
</tr>
</tfoot>
</table>
<div class="submitbox">
<select name="step" />
<option value="">예약선택</option>
<option value="1"><?php echo $steparr[1]?></option>
<option value="2"><?php echo $steparr[2]?></option>
<option value="3"><?php echo $steparr[3]?></option>
<option value="4"><?php echo $steparr[4]?></option>
</select>
<input type="submit" class="btnblue" value="설정변경" />
<input type="button" class="btnblue" value="선택삭제" onclick="$('#ak').val('ticket_delete');$('form[name=procForm]').get(0).submit();"/>
<div class="clear"></div>
</div>
<div class="clear"></div>
<iframe name="_orderframe_" class="hide"></iframe>
<script type="text/javascript">
//<![CDATA[
//<![CDATA[
function editWindow(url)
{
window.open(url,'','left=0,top=0,width=800px,height=750px,statusbar=no,scrollbars=no,toolbar=no,resizable=yes');
}
function codShowHide(layer,show,hide,img)
{
if(getId(layer).style.display != show)
{
getId(layer).style.display = show;
img.src = img.src.replace('ico_under','ico_over');
setCookie('ck_'+layer,show,1);
}
else
{
getId(layer).style.display = hide;
img.src = img.src.replace('ico_over','ico_under');
setCookie('ck_'+layer,hide,1);
}
}
function saveCheck(f)
{
{
window.open(url,'','left=0,top=0,width=800px,height=750px,statusbar=no,scrollbars=no,toolbar=no,resizable=yes');
}
function codShowHide(layer,show,hide,img)
{
if(getId(layer).style.display != show)
{
getId(layer).style.display = show;
img.src = img.src.replace('ico_under','ico_over');
setCookie('ck_'+layer,show,1);
}
else
{
getId(layer).style.display = hide;
img.src = img.src.replace('ico_over','ico_under');
setCookie('ck_'+layer,hide,1);
}
}
function saveCheck(f)
{
return confirm('정말로 실행하시겠습니까? ');
}
function slideshowOpen()
{
var cc = getCookie('ck_menu_config');
var ch = getCookie('ck_menu_header');
var cf = getCookie('ck_menu_footer');
var ca = getCookie('ck_menu_addinfo');
if (cc == 'block')
{
getId('menu_config').style.display = cc;
getId('dm_img_config').src = getId('dm_img_config').src.replace('ico_under','ico_over');
}
if (ch == 'block')
{
getId('menu_header').style.display = ch;
getId('dm_img_header').src = getId('dm_img_header').src.replace('ico_under','ico_over');
}
if (cf == 'block')
{
getId('menu_footer').style.display = cf;
getId('dm_img_footer').src = getId('dm_img_footer').src.replace('ico_under','ico_over');
}
if (ca == 'block')
{
getId('menu_addinfo').style.display = ca;
getId('dm_img_addinfo').src = getId('dm_img_addinfo').src.replace('ico_under','ico_over');
}
}
function slideshowOpen()
{
var cc = getCookie('ck_menu_config');
var ch = getCookie('ck_menu_header');
var cf = getCookie('ck_menu_footer');
var ca = getCookie('ck_menu_addinfo');
if (cc == 'block')
{
getId('menu_config').style.display = cc;
getId('dm_img_config').src = getId('dm_img_config').src.replace('ico_under','ico_over');
}
if (ch == 'block')
{
getId('menu_header').style.display = ch;
getId('dm_img_header').src = getId('dm_img_header').src.replace('ico_under','ico_over');
}
if (cf == 'block')
{
getId('menu_footer').style.display = cf;
getId('dm_img_footer').src = getId('dm_img_footer').src.replace('ico_under','ico_over');
}
if (ca == 'block')
{
getId('menu_addinfo').style.display = ca;
getId('dm_img_addinfo').src = getId('dm_img_addinfo').src.replace('ico_under','ico_over');
}
}
//티켓 전체삭제
function ticketAdelete() {
function ticketAdelete() {
//frames.location.href = "<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&a=ticket_adelete";
frames._action_frame_<?php echo $m?>.location.href = "<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&a=ticket_adelete&cat=<?php echo $cat?>";
}
//저장
function ticketCheck(f)
{
function ticketCheck(f)
{
var f = document.ticketForm;
var l = document.getElementsByName('xticket_members[]');
var n = l.length;
var i;
var j=0;
var s='';
for (i = 0; i < n; i++)
{
if (l[i].checked == true)
{
j++;
s += l[i].value +',';
}
}
if (!j)
{
alert('선택된 스케쥴이 없습니다. ');
return false;
}
{
if (l[i].checked == true)
{
j++;
s += l[i].value +',';
}
}
if (!j)
{
alert('선택된 스케쥴이 없습니다. ');
return false;
}
if (f.syear.value == '')
{
alert('년도를 선택해 주세요. ');
f.syear.focus();
return false;
}
if (f.smonth.value == '')
{
alert('월을 선택해 주세요. ');
f.smonth.focus();
return false;
}
{
alert('월을 선택해 주세요. ');
f.smonth.focus();
return false;
}
if (f.emonth.value == '')
{
alert('월을 선택해 주세요. ');
f.emonth.focus();
return false;
}
{
alert('월을 선택해 주세요. ');
f.emonth.focus();
return false;
}
return confirm('정말로 실행하시겠습니까? ');
}
window.onload = function()
{
<?php if($NUM):?>
dragsort.makeListSortable(getId("scheduleorder"));
<?php endif?>
parent.getId('_modal_on_').style.height = '90%';
var xy = getOfs(parent.getId('_modal_on_'));
parent.getId('_modal_on_').children[1].children[0].style.height = (xy.height-39) + 'px';
document.procForm.name.focus();
var xy = getOfs(parent.getId('_modal_on_'));
parent.getId('_modal_on_').children[1].children[0].style.height = (xy.height-39) + 'px';
document.procForm.name.focus();
slideshowOpen();
}
//]]>
</script>
------------------------------------------------------------------------------------------------
a.ticket}
//]]>
</script>
------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
<?php
if(!defined('__KIMS__')) exit;
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$acnt = count($ticket_members);
for ( $i = 0; $i < $acnt; $i++){
for ( $i = 0; $i < $acnt; $i++){
$R = getUidData($table[$m.'ticket'],$ticket_members[$i]);//스케쥴 받아옴
//추가정보
$xstart_time = $start_time[$i];
$xarrive_time = $arrive_time[$i];
$xprice = $price[$i];
$xsprice = $sprice[$i];
$xfood = $food[$i];
$xseat = $seat[$i];
$xstart_time = $start_time[$i];
$xarrive_time = $arrive_time[$i];
$xprice = $price[$i];
$xsprice = $sprice[$i];
$xfood = $food[$i];
$xseat = $seat[$i];
$QVAL = "start_time='$xstart_time',price='$xprice',sprice='$xsprice',food='$xfood',seat='$xseat,";
getDbUpdate($table[$m.'ticket'],$QVAL,'uid='.$R['uid']);
}
getDbUpdate($table[$m.'ticket'],$QVAL,'uid='.$R['uid']);
}
getLink('reload','parent.','수정되었습니다.','');
?>
?>
------------------------------------------------------------------------------------------------
a.ticket_regis.php
------------------------------------------------------------------------------------------------
<?php
if(!defined('__KIMS__')) exit;
if(!defined('__KIMS__')) exit;
checkAdmin(0);
//if ($syear && $smonth && $emonth) (
//$xday = 제외할 요일
$x = 0;
//$emonth = $emonth+1;
$x = 0;
//$emonth = $emonth+1;
//$sday=strtotime($syear."-".$smonth."-".$_POST['sday']);
//$eday=strtotime($syear."-".$emonth."-".$_POST['eday']);
$sday=strtotime($_POST['dstart']);
$eday=strtotime($_POST['dend']);
for($i=$sday;$i<=$eday;$i=$i+86400){
if (isset($xday) && in_array($j, $xday)) { //선택요일은 입력 안함
//티켓 입력 안함
}else{
//$eday=strtotime($syear."-".$emonth."-".$_POST['eday']);
$sday=strtotime($_POST['dstart']);
$eday=strtotime($_POST['dend']);
for($i=$sday;$i<=$eday;$i=$i+86400){
if (isset($xday) && in_array($j, $xday)) { //선택요일은 입력 안함
//티켓 입력 안함
}else{
//스케쥴 받아옴
for($v=0; $v < count($xticket_members); $v++){
for($v=0; $v < count($xticket_members); $v++){
$xuid = $xticket_members[$v];
//getLink('reload','parent.',$xuid,'');
$R = getUidData($table[$m.'schedule'],$xuid);
$s_time = trim($xstart_time[$v]);
$mingid = getDbCnt($table[$m.'schedule'],'min(gid)','');
$gid = $mingid ? $mingid-1 : 100000000;
$display = 1;
$category = $R['category'];
$parent = $R['uid'];
$schedule = $R['uid'];
$startname = $R['startname'];
$class = $R['class'];
$price = $R['price'];
$ticked = $R['ticked'];
//추가정보
$sdate = date('Ymd',$i);
$start_time = ${'xstart_time_'.$xuid};
$sprice = ${'xsprice_'.$xuid};
$food = ${'xfood_'.$xuid};
$seat = ${'xseat_'.$xuid};
$ticked = ${'xticked_'.$xuid};
$d_regis = $date['totime'];
$gid = $mingid ? $mingid-1 : 100000000;
$display = 1;
$category = $R['category'];
$parent = $R['uid'];
$schedule = $R['uid'];
$startname = $R['startname'];
$class = $R['class'];
$price = $R['price'];
$ticked = $R['ticked'];
//추가정보
$sdate = date('Ymd',$i);
$start_time = ${'xstart_time_'.$xuid};
$sprice = ${'xsprice_'.$xuid};
$food = ${'xfood_'.$xuid};
$seat = ${'xseat_'.$xuid};
$ticked = ${'xticked_'.$xuid};
$d_regis = $date['totime'];
$QKEY = "gid,display,category,parent,schedule,startname,class,price,sdate,start_time,sprice,food,seat,ticked,d_regis";
$QVAL = "'$gid','$display','$category','$parent','$schedule','$startname','$class','$price','$sdate','$start_time','$sprice','$food','$seat','$ticked','$d_regis'";
getDbInsert($table[$m.'ticket'],$QKEY,$QVAL);
}
}
}
$QVAL = "'$gid','$display','$category','$parent','$schedule','$startname','$class','$price','$sdate','$start_time','$sprice','$food','$seat','$ticked','$d_regis'";
getDbInsert($table[$m.'ticket'],$QKEY,$QVAL);
}
}
}
getLink('reload','parent.','추가되었습니다.','');
//}
?>
-----------------------------------------------------------------------------------------------
티켓을 당월[2015-04] [2015-05] [2015-06] [2015-07] [2015-08]
이런식으로 보여줄라고 하려거든요 월별로 추출
그러고[2015-07] <option value="">예약선택</option> 코드 적용할라면 a.ticket 어떻게 수정해야 하나요
*** 개인정보보호를 위한 이메일주소 노출방지 ***
답변을 작성하시기 전에 로그인 해주세요.