<?php
$page_title = "出金処理";
include_once('template/base_head.php');
?>
			<!-- サイドバー -->
			<aside id="colLeft">
				<h1><a href=""><img src="img/logo.png" alt="iWallet"></a></h1>
				<div class="aside-heading">
					<div class="btns">
						<input type="button" id="btnSearchAll" value="すべて" class="btn bg-default px50 hi22">&nbsp;
						<input type="button" id="btnSearchToday" value="本日" class="btn bg-default px50 hi22">&nbsp;
						<input type="button" id="btnSearch" value="検索" class="btn bg-default px50 hi22">
					</div>
				</div>
				<form id="searchForm" action="" method="post">
					<table class="conditions fontS w100p">
						<colgroup>
							<col class="w50p">
							<col class="w50p">
						</colgroup>
						<tr>
							<th>取引番号</th>
							<td><input type="text" id="transaction_number" name="transaction_number" value="<?php $this -> echoSTransactionNumber(); ?>" class="w100p"></td>
						</tr>
						<tr>
							<th>口座番号</th>
							<td><input type="text" id="s_user_account" name="s_user_account" value="<?php $this -> echoSUserAccount(); ?>" class="w100p"></td>
						</tr>
						<tr>
							<th>銀行名</th>
							<td><input type="text" id="s_bank" name="s_bank" value="<?php $this -> echoSBank(); ?>" class="w100p"></td>
						</tr>
						<tr>
							<th>送金先口座</th>
							<td><input type="text" id="s_account" name="s_account" value="<?php $this -> echoSAccount(); ?>" class="w100p"></td>
						</tr>
						<tr>
							<th>銀行伝票番号</th>
							<td><input type="text" id="s_order_number" name="s_order_number" value="<?php $this -> echoSOrderNumber(); ?>" class="w100p"></td>
						</tr>
						<tr>
							<th>口座カテゴリー</th>
							<td>
								<select id="test_account_flg" name="test_account_flg" class="w100p">
									<option value="">--- All ---</option>
									<?php $this -> echoTestAccountFlg(); ?>
							</td>
						</tr>
						<tr>
							<td><?php $this -> dispWithdrawRadio(); ?></td>
						</tr>
                        <tr>
							<td>
								<select id="s_fee" name="s_fee" class="px60 searchSelect" style="display:none;">
                                    <?php
                                        $withdrawFee = $this -> getWithdrawFeeList();
                                        $selectedWithdrawFee = $this -> getSelectedWithdrawFee();
                                        $isSelectedFee = NO_STRING;
                                        //$feetype = array('F', 'M')
                                        foreach($withdrawFee as $fee => $feeValue){
                                            if(!empty($selectedWithdrawFee) && $selectedWithdrawFee == $feeValue){
                                                $isSelectedFee = "selected = 'selected'";
                                            } else{
                                                $isSelectedFee = '';
                                            }

                                    ?>
									<option value="<?php echo $feeValue; ?>"  <?php echo $isSelectedFee; ?> ><?php echo $fee; ?></option>
                                    <?php } ?>
								</select>
								<select id="s_solution" name="s_solution" class="px60 searchSelect" style="display:none;">
                                    <?php
                                        $withdrawSolutions = $this -> getWithdrawSolutionList();
                                        $selectedWithdrawSolution = $this -> getSelectedWithdrawSolution();
                                        $isSelected = NO_STRING;
                                        foreach($withdrawSolutions as $solution){
                                            if(!empty($selectedWithdrawSolution) && $selectedWithdrawSolution == $solution){
                                                $isSelected = "selected = 'selected'";
                                            } else{
                                                $isSelected = '';
                                            }
                                    ?>
									<option value="<?php echo $solution; ?>"  <?php echo $isSelected; ?> ><?php echo $solution; ?></option>
                                    <?php } ?>
								</select>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<span class="th">ステータス</span>
								<select id="s_status" name="s_status" class="px60">
									<option value="">すべて</option>
									<?php $this -> echoSStatus(); ?>
								</select>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<span class="th">ティア</span>
								<select id="s_tier" name="s_tier" class="px60">
									<option value="">すべて</option>
									<?php $this -> echoSTier(); ?>
								</select>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<span class="th">送金額</span>
								<select id="s_currency" name="s_currency" class="px60">
									<option value="">すべて</option>
									<?php $this -> echoCurrencyList(); ?>
								</select>
								<input type="text" id="s_min_amount" name="s_min_amount" value="<?php $this -> echoSMinAmount(); ?>" class="px80"> - <input type="text" id="s_max_amount" name="s_max_amount" value="<?php $this -> echoSMaxAmount(); ?>" class="px80">
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<span class="th">申請日時</span>
									<?php $this -> dispRegistFlg(); ?>
									<input type="text" id="s_from" name="s_from" value="<?php $this -> echoSFrom(); ?>" class="px110" placeholder="日付"> - <input type="text" id="s_to" name="s_to" value="<?php $this -> echoSTo(); ?>" class="px110" placeholder="日付">
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<span class="th">処理日時指定</span>
									<?php $this -> dispProcessFlg(); ?>
									<input type="text" id="s_process_from" name="s_process_from" value="<?php $this -> echoSProcessFrom(); ?>" class="px110" placeholder="日付"> - <input type="text" id="s_process_to" name="s_process_to" value="<?php $this -> echoSProcessTo(); ?>" class="px110" placeholder="日付">
							</td>
						</tr>
					</table>
					<input type="hidden" value="search" id="type_search" name="type" />
				</form>
			</aside>
			<!-- /サイドバー -->
			<!-- メインカラム -->
			<div id="colMain">
				<div class="mainIn">
<?php include_once('template/base_nav.php'); ?>
					<article>
						<div class="article-heading">
							<h2><?php echo $page_title; ?></h2>
							<?php $this -> dispPager(); ?>
						</div>
						<?php $this -> echoMessage(); ?>
						<form id="acForm" action="" method="post">
							<table class="table col bdr default odd w30p fontXS calign mb20">
								<tr>
									<th class="w20p">通貨</th>
									<th class="w30p">件数</th>
									<th class="w50p">件数</th>
								</tr>
								<?php $this -> echoTotalList(); ?>
							</table>
							<table class="table col bdr default odd w100p fontXS calign">
								<tr>
									<th class="w10p">申請日時</th>
									<th class="w10p">取引番号</th>
									<th class="w5p">口座番号</th>
									<th class="w5p">ティアレベル</th>
									<th class="w5p">通貨</th>
									<th class="w5p">金額</th>
									<th class="w10p">送金先銀行</th>
									<th class="w10p">中継銀行</th>
									<th class="w5p">手数料</th>
									<th class="w5p">差し戻し</th>
									<th class="w10p">銀行伝票番号</th>
									<th class="w5p">処理担当</th>
									<th class="w10p">処理日時</th>
									<th class="w5p">レート</th>
									<th class="w5p">ステータス</th>
								</tr>
								<?php $this -> echoList(); ?>
							</table>

							<input type="hidden" value="action" id="type" name="type" />
							<input type="hidden" value="withdraw" name="action" />
							<input type="hidden" id="w_id" name="w_id" />
							<input type="hidden" id="detail_account" name="detail_account" />
                            <?php
                                if($selectedWithdrawSolution == 'Flat3'){
                                    $flat3_result = htmlspecialchars(json_encode($this -> getResult()));
                            ?>
							<input type="hidden" id="flat3_result" name="flat3_result" value="<?php echo $flat3_result; ?>" />
                        <?php } ?>
						</form>
						<div class="article-bottom">
							<?php $this -> dispPager(); ?>
						</div>
					</article>
				</div>
			</div>
			<!-- /メインカラム -->
		</div>
<?php include_once('template/base_foot.php'); ?>
	</div>
	<script src="js/withdraw.js"></script>
</body>
</html>
