216 lines
5.5 KiB
PHP
216 lines
5.5 KiB
PHP
<?php
|
|
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="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">×</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(getVipCatName() 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( isset($tqty1) && $tqty1 ) { // tgty1이 비어있지 않다면
|
|
$tqty1 = $tqty1 + $qty1;
|
|
$tgqty1 = $tgqty1 + $gr_qty1;
|
|
} else { // 비어있다면
|
|
$tqty1 = $qty1;
|
|
$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>
|
|
|
|
<?php
|
|
include_once FG_MANAGER_PATH."/tail.php";
|