Files
firstgarden-web-gnu/manager/ticket/index.php

282 lines
8.9 KiB
PHP

<?php
// 베이커리 재고관리
include_once "_common.php";
// 배포 시 아래 주석 해제
// if (!isset($_SESSION['user_id'])) header( 'Location: FG_MANAGER_URL' ); // 로그인 되어있지 않으면 로그인 페이지로 보냄
include_once "head.php";
// 검색 변수 초기화
!isset($search) ?? "";
!isset($where) ?? "";
!isset($search_count) ?? "";
$is_debug = false; // 디버깅 시 true로 변경
$is_member = true;
// ord_by 로 넘어온 값이 있으면 반영
$ord_by = isset($_REQUEST["ord_by"]) ? $_REQUEST["ord_by"] : "product_name ASC";
// 날짜로 검색한 경우 해당 날짜를 사용하고, 아닌 경우 오늘 날짜를 사용함
$searchDate = isset($_REQUEST["searchDate"]) ? $_REQUEST["searchDate"] : date("Y-m-d"); // 검색일
$prevDate = date("Y-m-d", strtotime("-1 day", strtotime($searchDate))); // 검색 전일
$edit_datetime = date('Y-m-d H:i:s'); // 최종 수정 시간 업데이트
// 합계 변수 선언
$t_prev_stock = $t_production = $t_inhouse_use = $t_recycling = $t_disposal = $t_sales = $t_sales_amount = $t_menu_discount = $t_payment_amount = $t_current_stock = 0;
bakeryPreUpdate($searchDate, $edit_datetime);
$authInfo = getAuthorInfo($searchDate);
if (!$authInfo) {
$authInfo = ['worker' => '', 'author' => ''];
}
?>
<style>
.bakery tfoot {
font-weight: 600;
}
.sort-icon {
margin-left: 5px;
font-size: 12px;
vertical-align: middle;
}
</style>
<h2 class="mb-3">매표소 근무일지</h2>
<div class="d-flex justify-content-between">
<div class="row align-items-start flex-nowrap">
<div class="col-auto input-group">
<span class="input-group-text">날짜선택</span>
<input type="date" class="form-control" id="searchDateInput" name="searchDate" max="9999-12-31" value="<?= $searchDate ?>">
</div>
<div class="col-auto">
<form>
<input type="hidden" id="hiddenSearchDate" name="searchDate" value="<?= date("Y-m-d") ?>">
<button type="submit" class="btn btn-primary mb-3">오늘</button>
</form>
</div>
</div>
<div>
<input type="file" id="inventoryFileInput" style="display:none;" accept=".xls,.xlsx" />
<div class="btn-group" role="group" aria-label="bakery-button">
<?php if(!bakeryChkDate($searchDate, $_SESSION['user_id'])) {?>
<button type="button" class="btn btn-primary" id="editButton" onclick="toggleEditMode()" >수정</button>
<button type="button" class="btn btn-primary d-none" id="confirmButton" onclick="confirmEditMode()">확인</button>
<?php } ?>
<button type="button" class="btn btn-secondary" id="uploadInventoryButton">파일첨부</button>
<button type="button" class="btn btn-success" id="exportExcelButton">엑셀변환</button>
<?php if ($is_member || $is_admin) { ?>
<button type="button" class="btn btn-success" id="print">출력</button>
<?php } ?>
</div>
</div>
</div>
<div class="mb-3" style="max-width:800px;">
<form class="form-group" id="author" name="author" >
<input type="hidden" name="searchDate" id="searchDate" value="<?=$searchDate?>">
<div class="input-group">
<span class="input-group-text" id="weather">날씨</span>
<input style="width: 100px;" type="text" class="form-control" name="weather" id="weather" value="" required>
<span class="input-group-text" id="author">작성자</span>
<input style="width: 100px;" type="text" class="form-control" name="author" id="author" value="<?=$authInfo['author']?>" required>
<span class="input-group-text" id="worker">근무자</span>
<input style="width: 250px;" type="text" class="form-control" name="worker" id="worker" value="<?=$authInfo['worker']?>" required>
</div>
</form>
</div>
<div class="ticketbox mb-3">
<div class="row justify-content-md-start">
<div class="col-12">
<table class="table align-middle ">
<colgroup>
<col width="100">
<col width="100">
<col width="100">
</colgroup>
<thead>
<tr>
<th class="text-center">총입장객</th>
<th class="text-center">금월누계</th>
<th class="text-center">매출합계</th>
</tr>
</thead>
<tr>
<td class="text-center">116</td>
<td class="text-center">9130</td>
<td class="text-center"><?=number_format(1090000)?> 원</td>
</tr>
</table>
</div>
</div>
<div class="row justify-content-md-start">
<div class="col-6 mb-3">
<div class="d-flex justify-content-between">
<h4>일반</h4>
<button class="btn btn-sm btn-outline-primary">항목추가</button>
</div>
<table class="table table-striped align-middle table-hover ticketbox">
<thead class="align-middle">
<tr>
<th class="text-center">구분</th>
<th class="text-center">입장객 수</th>
<th class="text-center">금월누계</th>
<th class="text-center">금액</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">입장권(주간)</td>
<td class="text-end">26</td>
<td class="text-end">3797</td>
<td class="text-end">245000</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="text-center">소계</td>
<td class="text-end">104</td>
<td class="text-end">8371</td>
<td class="text-end">1090000</td>
</tr>
</tfoot>
</table>
</div>
<div class="col-6 mb-3">
<div class="d-flex justify-content-between">
<h4>온라인</h4>
<button class="btn btn-sm btn-outline-primary">항목추가</button>
</div>
<table class="table table-striped align-middle table-hover ticketbox">
<thead class="align-middle">
<tr>
<th class="text-center">구분</th>
<th class="text-center">입장객 수</th>
<th class="text-center">금월누계</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">삐아또PKG</td>
<td class="text-end">26</td>
<td class="text-end">3797</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="text-center">소계</td>
<td class="text-end">104</td>
<td class="text-end">8371</td>
</tr>
</tfoot>
</table>
</div>
<div class="col-6 mb-3">
<div class="d-flex justify-content-between">
<h4>할인</h4>
<button class="btn btn-sm btn-outline-primary">항목추가</button>
</div>
<table class="table table-striped align-middle table-hover ticketbox">
<thead class="align-middle">
<tr>
<th class="text-center">구분</th>
<th class="text-center">입장객 수</th>
<th class="text-center">금월누계</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">삐아또PKG</td>
<td class="text-end">26</td>
<td class="text-end">3797</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="text-center">소계</td>
<td class="text-end">104</td>
<td class="text-end">8371</td>
</tr>
</tfoot>
</table>
</div>
<div class="col-6 mb-3">
<div class="d-flex justify-content-between">
<h4>무료</h4>
<button class="btn btn-sm btn-outline-primary">항목추가</button>
</div>
<table class="table table-striped align-middle table-hover ticketbox">
<thead class="align-middle">
<tr>
<th class="text-center">구분</th>
<th class="text-center">입장객 수</th>
<th class="text-center">금월누계</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">삐아또PKG</td>
<td class="text-end">26</td>
<td class="text-end">3797</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="text-center">소계</td>
<td class="text-end">104</td>
<td class="text-end">8371</td>
</tr>
</tfoot>
</table>
</div>
</div>
<div class="row justify-content-md-start">
<div class="col-6 mb-3">
<div class="d-flex justify-content-between">
<h4>기타판매</h4>
<button class="btn btn-sm btn-outline-primary">항목추가</button>
</div>
<table class="table table-striped align-middle table-hover ticketbox">
<thead class="align-middle">
<tr>
<th class="text-center">구분</th>
<th class="text-center">수량</th>
<th class="text-center">금월누계</th>
<th class="text-center">금액</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">삐아또PKG</td>
<td class="text-end">26</td>
<td class="text-end">3797</td>
<td class="text-end">3797</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="text-center">소계</td>
<td class="text-end">104</td>
<td class="text-end">8371</td>
<td class="text-end">8371</td>
</tr>
</tfoot>
</table>
</div>
<div class="col-6 mb-3">
<div class="d-flex justify-content-between">
<h4>비고 및 특이사항</h4>
</div>
<textarea class="form-control" rows="10"></textarea>
</div>
</div>
</div>
<?php include_once FG_MANAGER_PATH."/tail.php";