Files
firstgarden-web-gnu/manager/vip/ticketbox_main.php

235 lines
5.7 KiB
PHP

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once '_common.php';
if (!isset($_SESSION['user_id'])) header( 'Location: FG_MANAGER_URL' ); // 로그인 되어있지 않으면 로그인 페이지로 보냄
include_once FG_MANAGER_PATH."/head.php";
// 입고수량 가져오기
$iqty = get_qty('입고');
$oqty = get_qty('출고');
// $rqty = get_qty('재발급');
$dqty = get_qty('폐기');
?>
<div class="container text-center">
<div class="row">
<div class="col">
<i class="fa-solid fa-user"></i>
VIP 조회
</div>
<div class="col">
<i class="fa-solid fa-user"></i>
연간회원 조회
</div>
<div class="col">
Column
</div>
</div>
</div>
<div class="text-center">
<h3>전체재고</h3>
<table class="table table-striped">
<thead>
<tr>
<th class="text-center" style="width:20%">총 입고</th>
<th class="text-center" style="width:20%">정상</th>
<th class="text-center" style="width:20%">폐기</th>
<th class="text-center" style="width:20%">총 출고</th>
<th class="text-center" style="width:20%">출고가능수량</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">
<?=$iqty?>
</td>
<td class="text-center">
<?=$oqty-$dqty?>
</td>
<td class="text-center">
<?=$dqty?>
</td>
<td class="text-center">
<?=$oqty?>
</td>
<td class="text-center" style="font-weight:600">
<?=$iqty - $oqty?>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="7" class="text-right">
<?php if($_SESSION['user_lv'] == 4){ ?>
<button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#add_modal">재고추가</button>
<!-- 추가 버튼을 누르면 출력한다. -->
<div id="add_modal" class="modal fade text-center">
<div class="modal-dialog" style="width:800px;">
<div class="modal-content">
<form class="signup" > <!-- 폼 이름을 알려줌 -->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">재고 추가</h4>
</div>
<div class="modal-body text-left">
<table class="table table-striped" >
<thead>
<tr>
<th class="text-center" colspan="2">카드입고</th>
</tr>
</thead>
<tbody>
<tr>
<th class="text-center">수량입력</th>
<td class="text-left">
<div class="form-group">
<div class="input"><input type="text" name="input" id="input" value="" onkeydown='return onlyNumber(event)' onkeyup='removeChar(event)' checked></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">추가</button>
<button type="button" class="btn btn-default" data-dismiss="modal">닫기</button>
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<?php } ?>
</td>
</tr>
</tfoot>
</table>
</div>
<div class="text-center col-xs-6">
<h3>그룹별 출고수량</h3>
<table class="table table-striped">
<thead>
<tr>
<th class="text-center">구분</th>
<th class="text-center">정상</th>
<th class="text-center">사용불가</th>
<th class="text-center">합계</th>
</tr>
</thead>
<tbody>
<?php
foreach(get_gr_name() as $row) {
$qty1 = get_gr_qty($row['gr_id']);
$gr_qty1 = get_gr_qty($row['gr_id'],'정상');
$dqty1 = get_gr_qty($row['gr_id'],'폐기');
$gname = $row['gr_name'];
if($qty1 == 0) continue; // 합계수량이 0이면 출력안함
if(empty($tqty1)) {
$tqty1 = $qty1;
$tgqty1 = $gr_qty1;
} else {
$tqty1 = $tqty1 + $qty1;
$tgqty1 = $tgqty1 + $gr_qty1;
}
?>
<tr>
<td class="text-center">
<?=$gname?>
</td>
<td class="text-center">
<?=$gr_qty1?>
</td>
<td class="text-center">
<?=$dqty1?>
</td>
<td class="text-center">
<?=$qty1?>
</td>
</tr>
<?php } ?>
<tr>
<td class="text-center">
합계
</td>
<td class="text-center">
<?=$tgqty1?>
</td>
<td class="text-center">
<?=$tqty1-$tgqty1?>
</td>
<td class="text-center">
<?=$tqty1?>
</td>
</tr>
</tbody>
</table>
</div>
<div class="text-center col-xs-6">
<h3>부서별 출고수량</h3>
<table class="table table-striped">
<thead>
<tr>
<th class="text-center">부서명</th>
<th class="text-center">정상</th>
<th class="text-center">사용불가</th>
<th class="text-center">합계</th>
</tr>
</thead>
<tbody>
<?php
foreach(getTeamName() as $row) {
$qty2 = get_team_qty($row['tid']);
$t_qty2 = get_team_qty($row['tid'],'정상');
$tname = $row['tname'];
if($qty2 == 0) continue; // 합계수량이 0이면 출력안함
if(empty($tqty2)) {
$tqty2 = $qty2;
$tgqty2 = $t_qty2;
} else {
$tqty2 = $tqty2 + $qty2;
$tgqty2 = $tgqty2 + $t_qty2;
}
?>
<tr>
<td class="text-center">
<?=$tname?>
</td>
<td class="text-center">
<?=$t_qty2?>
</td>
<td class="text-center">
<?=$qty2-$t_qty2?>
</td>
<td class="text-center">
<?=$qty2?>
</td>
</tr>
<?php } ?>
<tr>
<td class="text-center">
합계
</td>
<td class="text-center">
<?=$tgqty2?>
</td>
<td class="text-center">
<?=$tqty2-$tgqty2?>
</td>
<td class="text-center">
<?=$tqty2?>
</td>
</tr>
</tbody>
</table>
</div>