<?php require view('theme/header'); ?>


<main class="app-main">
    <div class="page-content">
        <div class="container-fluid">
		
			<div class="hp-bbox mt-5 mb-5">
                <div class="row">
                    <div class="col-lg-6">
                        <div class="hpbb-body">
                            <h2 class="hp-title">Hesabınıza Bakiye Yükleyin</h2>
                            <p class="hpbb-text">
								Para yatırmadan önce hüküm ve koşullarımızı okuduğunuzdan emin olun.<br /> 
								Bonusları olan ödeme yöntemlerini kullanmayı öneririz.
							</p>
                        </div>
                    </div>
                </div>
            </div>
			
            <div class="row mt-2">
				<?php if ($payments) : ?>
                <div class="col-lg-6">
                    <div class="card mb-5">
                        <div class="py-4 px-lg-3 px-4">
						
									<div class="t-head th-3">
										<div class="d-flex align-items-center">
											<div class="col-lg-2">
												<div class="t-icon">
													<i class="fal fa-credit-card-front"></i>
												</div>
											</div>
											<div class="col-lg-10 col-12">
												<h2>Ödeme Yöntemini Seçiniz</h2>
												<p>Ödeme işleminizi aşağıdan yapabilirsiniz.</p>
											</div>
										</div>
									</div>
									
                                    <form  method="post" action="<?= $siteLinks['add-funds']['url'] ?>">
										 <?php if (@$success) : ?>
										  <div class="alert alert-dismissible alert-success">
											<button type="button" class="close" data-dismiss="alert">&times;</button>
											  <?= $successText ?>
										  </div>
										<?php endif; ?>
										
										<?php if (@$error) : ?>
										  <div class="alert alert-dismissible alert-danger {% if site['rtl'] %} rtl-alert {% endif %}">
											<button type="button" class="close" data-dismiss="alert">&times;</button>
											<?= $errorText ?>
										  </div>
										<?php endif; ?>
										
                                        <div class="fga form-group mb-4">
                                            <label class="fla" for="orderCategory">{ADD_FUNDS_METHOD}</label>
                                            <div class="fg">
                                                <div class="fg-icon"><i class="far fa-list"></i></div>
                                                <select id="method" name="method" id="order_type" class="fg-control" data-toggle="ssp-selectbox" data-class="fg-control">
                                                    <?php
                                                foreach ($payments as $payment) : ?>
                                                    <option value="<?= $payment['method_id'] ?>"><?= $payment['name'] ?></option>
                                                <?php
                                                endforeach;
                                                ?>
                                                </select>
                                            </div>
                                        </div>
                                        
                                        <div class="fga mb-4">
                                            <label class="fla" for="phone">{ADD_FUNDS_PHONE}</label>
                                            <div class="fg">
                                                <div class="fg-icon"><i class="far fa-mobile-android-alt"></i></div>
                                                <input type="number" class="fg-control" name="phone" id="phone">
                                            </div>
                                        </div>

                                        <div class="fga mb-4">
                                            <label class="fla" for="amount">{ADD_FUNDS_AMOUNT}</label>
                                            <div class="fg">
                                                <div class="fg-icon"><i class="far fa-coin"></i></div>
                                                <input type="number" class="fg-control" name="amount" id="amount">
                                            </div>
                                        </div>
        
                                        <div class="row">
                                            <div class="col-md-6 col-12 mb-4 mb-mb-0">
												<!--<input type="hidden" name="_csrf" value="{{ csrftoken }}">-->
                                                <button type="submit" class="btn btn-primary btn-block">
                                                    Güvenli Ödeme Yap
                                                </button>
                                            </div>
                                            <div class="col-md-6 col-12 mb-4 mb-mb-0">
                                                <a href="/tickets" class="btn btn-dark btn-block">
                                                    Destek Merkezi
                                                </a>
                                            </div>
                                        </div>
                                    </form>
                        </div>
                    </div><!-- card -->
                </div><!-- col -->
				<?php
                endif;
                ?>
				
	<?php
                if ($bankpayment['status'] == 1) : ?>
                <div class="col-lg-6">
                    <div class="card">
                        <div class="py-4 px-lg-3 px-4">
						
									<div class="t-head th-3">
										<div class="d-flex align-items-center">
											<div class="col-lg-2">
												<div class="t-icon">
													<i class="fas fa-wallet"></i>
												</div>
											</div>
											<div class="col-lg-10 col-12">
												<h2>Ödeme Bildirimi</h2>
												<p>Banka Hesabımız ile ödeme yaptıysanız ödeme bildirimi yapabilirsiniz.</p>
											</div>
										</div>
									</div>
                       
                       
                                    <form  id="add_bank_funds" onsubmit="return false;">
										 
										
                                        <div class="fga form-group mb-4">
                                            <label class="fla" for="orderCategory">{ADD_FUNDS_ACCOUNT_TITLE}</label>
                                            <div class="fg">
                                                <div class="fg-icon"><i class="far fa-list"></i></div>
                                                <select id="bank_account" name="bank_account"  class="fg-control" data-toggle="ssp-selectbox" data-class="fg-control">
                                                    <?php  foreach ($accounts as $row) : ?>
                                                    <option value="<?= $row['id'] ?>"><?= $row['account_title'] ?></option>
                                                <?php endforeach; ?>
                                                </select>
                                            </div>
                                        </div>
                                        
                                        <div class="fga mb-4">
                                            <label class="fla" for="namesss">Ödeme Yapanın Adı</label>
                                            <div class="fg">
                                                <div class="fg-icon"><i class="fas fa-user-circle"></i></div>
                                                <input type="text" class="fg-control" name="namesss" required id="namesss">
                                            </div>
                                        </div>

                                        <div class="fga mb-4">
                                            <label class="fla" for="amount">{ADD_FUNDS_AMOUNT}</label>
                                            <div class="fg">
                                                <div class="fg-icon"><i class="far fa-coin"></i></div>
                                                <input type="number" class="fg-control" name="amount" required id="amount">
                                            </div>
                                        </div>
        
                                        <div class="row">
                                            <div class="col-md-12 col-12 mb-4 mb-mb-0">
												<!--<input type="hidden" name="_csrf" value="{{ csrftoken }}">-->
                                                <button type="submit" class="btn btn-primary btn-block">
                                                   Ödeme Bildirimi Yap
                                                </button>
                                            </div>
                                        </div>
                                    </form>

                        </div>
                    </div>
                </div>
                <?php endif; ?>
                
                
                
                <?php if ($bankpayment['status'] == 1) : ?>
                <div class="col-lg-12">
                    <div class="card">
                        <div class="py-4 px-lg-3 px-4">
						
									<div class="t-head th-3">
										<div class="d-flex align-items-center">
											<div class="col-lg-2">
												<div class="t-icon">
													<i class="fal fa-receipt"></i>
												</div>
											</div>
											<div class="col-lg-10 col-12">
												<h2>Banka Hesaplarımız</h2>
												<p>Banka hesaplarımızı buradan görebilirsiniz.</p>
											</div>
										</div>
									</div>
                       
                                    <div class="old-payments">
										<?php foreach ($accounts as $row) : ?>
										<div class="card mb-3">
											<div class="py-4 px-lg-3 px-4">
												<div class="row">
													<div class="col-lg-2 col-6">
														<h4 class="op-title">{ADD_FUNDS_ACCOUNT_NAME}</h4>
														<div class="op-id"><?= $row['account_name'] ?></div>
													</div>
													<div class="col-lg-2 col-6">
														<h4 class="op-title">
															<span>Banka Adı</span>
														</h4>
														<div class="op-date"><?= $row['account_title'] ?></div>
													</div>
													<div class="col-lg-2 col-6">
														<h4 class="op-title">
															<span>{ADD_FUNDS_ACCOUNT_NUMBER}</span>
														</h4>
														<div class="op-date"><?= $row['account_number'] ?></div>
													</div>
													<div class="col-lg-2 col-6">
														<h4 class="op-title">
															<span>{ADD_FUNDS_ACCOUNT_BRANCH}</span>
														</h4>
														<div class="op-date"><?= $row['account_branch'] ?></div>
													</div>
													<div class="col-lg-4 col-12">
													    <h4 class="op-title">
															<span>{ADD_FUNDS_ACCOUNT_IBAN}</span>
														</h4>
														<div class="op-status">
															<span data-toggle="tooltip" data-placement="left"><?= $row['account_iban'] ?></span>
														</div>
													</div>
												</div>
											</div>
										</div>
										<?php endforeach; ?>
                                    </div>

                        </div>
                    </div>
                </div>
                <?php endif; ?>
                
                
                <div class="col-lg-12">
                    <div class="card">
                        <div class="py-4 px-lg-3 px-4">
						
									<div class="t-head th-3">
										<div class="d-flex align-items-center">
											<div class="col-lg-2">
												<div class="t-icon">
													<i class="fal fa-receipt"></i>
												</div>
											</div>
											<div class="col-lg-10 col-12">
												<h2>Geçmiş Ödemeler</h2>
												<p>Yaptığınız ödemeleri buradan görebilirsiniz.</p>
											</div>
										</div>
									</div>
                       
                                    <div class="old-payments">
										<?php foreach ($deposits as $deposit) : $methods = $db->from('payment_methods')
                                			->where('method_id', $deposit['deposit_method'])->first();
                                		if ($methods) {
                                			$deposit['method_title'] = $methods['method_title'];
                                		} ?>
										
										<div class="card mb-3">
											<div class="py-4 px-lg-3 px-4">
												<div class="row">
													<div class="col-lg-2 col-6">
														<h4 class="op-title">ID</h4>
														<div class="op-date"><?=$deposit["deposit_id"]?></div>
													</div>
													<div class="col-lg-2 col-6">
														<h4 class="op-title">
															<span>Tarih</span>
														</h4>
														<div class="op-date">
														<?=date("d.m.y H:i:s", $deposit["deposit_date"])?>
														</div>
													</div>
													<div class="col-lg-2 col-6">
														<h4 class="op-title">
															<span>Durum</span>
														</h4>
														<div class="op-date">
														<?=$deposit["deposit_status"]?>
														</div>
													</div>
													<div class="col-lg-3 col-12">
													    <h4 class="op-title">
															<span>Ödeme Yöntemi</span>
														</h4>
														<div class="op-date">
															<span data-toggle="tooltip" data-placement="left"><?php if ($deposit['deposit_method'] == 158) : ?>
														Manuel Bakiye Ekleme
														<?php elseif ($deposit['deposit_method'] == 159) : ?>
														Manuel Bakiye Eksiltme
														<?php else : ?>
														<?=$deposit["method_title"]?>
														<?php endif; ?></span>
														</div>
													</div>
													<div class="col-lg-3 col-12">
													    <h4 class="op-title">
															<span>Miktar</span>
														</h4>
														<div class="op-status">
															<span data-toggle="tooltip" data-placement="left"><?=$deposit["deposit_amount"]?></span>
														</div>
													</div>
												</div>
											</div>
										</div>
										<?php endforeach; ?>
                                    </div>

                        </div>
                    </div>
                </div>
                
            </div>
		
        </div>
    </div>
</main>


<?php require view('theme/footer'); ?>




<!------------------------------------------------------------------------------------------------------>
