<?php
session_start();
include_once('../../config/#Config.php');
if(!$_SESSION['UserName']){
die('<script>window.location.href=\''.$config['site']['url'].'index.php\';</script>');
}
$get_AD = mysqli_query($conn, "Select * From config_admin WHERE Account = '".$_SESSION['UserName']."'");
if(!mysqli_num_rows($get_AD)){
	die('Không đủ quyền.');
}
					  $get_AA = mysqli_query($conn, "Select * From config_card WHERE ID = 1");
					  if(mysqli_num_rows($get_AA)){
						  $row = mysqli_fetch_array($get_AA, MYSQLI_ASSOC);
					  }
?>
<?php include 'menu.php'; ?>
<div class="row">
                <div class="card-body">
                  <h4 class="card-title">Tùy chỉnh nạp thẻ</h4>
          </div>
		  <div class="col-12 stretch-card">
                  <div class="card">
                    <div class="card-body">
                      <h4 class="card-title">Điều chỉnh nội dung [Chỗ Nạp Thẻ]</h4>
                        <div class="form-group row">
                          <label for="exampleInputPassword2" class="col-sm-3 col-form-label">Bắt đầu</label>
                          <div class="col-sm-9">
                            <textarea class="form-control" id="sett__nap_start"><? if($row['batdau']){ echo date('d/m/Y',$row['batdau']); } else { echo date('d/m/Y'); } ?></textarea>
                          </div>
                        </div>
                        <div class="form-group row">
                          <label for="exampleInputPassword2" class="col-sm-3 col-form-label">Kết Thúc</label>
                          <div class="col-sm-9">
                            <textarea class="form-control" id="sett__nap_end"><? if($row['ketthuc']){ echo date('d/m/Y',$row['ketthuc']); } else { echo date('d/m/Y'); } ?></textarea>
                          </div>
                        </div>						
                        <div class="form-group row">
                          <label class="col-sm-3 col-form-label">Khuyến mãi</label>
                          <div class="col-sm-9">
                            <select class="form-control" id="sett__nap_km">
                              <option value="1" <? if($row['khuyenmai'] == '1'){ echo 'selected="selected"'; }?>>Không khuyến mãi</option>
                              <option value="1.2" <? if($row['khuyenmai'] == '1.1'){ echo 'selected="selected"'; }?>>10%</option>
                              <option value="1.3" <? if($row['khuyenmai'] == '1.2'){ echo 'selected="selected"'; }?>>20%</option>
                              <option value="1.4" <? if($row['khuyenmai'] == '1.3'){ echo 'selected="selected"'; }?>>30%</option>
                              <option value="1.5" <? if($row['khuyenmai'] == '1.4'){ echo 'selected="selected"'; }?>>40%</option>
                              <option value="1.6" <? if($row['khuyenmai'] == '1.5'){ echo 'selected="selected"'; }?>>50%</option>
                              <option value="1.6" <? if($row['khuyenmai'] == '1.6'){ echo 'selected="selected"'; }?>>60%</option>
                              <option value="1.7" <? if($row['khuyenmai'] == '1.7'){ echo 'selected="selected"'; }?>>70%</option>
                              <option value="1.8" <? if($row['khuyenmai'] == '1.8'){ echo 'selected="selected"'; }?>>80%</option>
                              <option value="1.9" <? if($row['khuyenmai'] == '1.9'){ echo 'selected="selected"'; }?>>90%</option>
                              <option value="2" <? if($row['khuyenmai'] == '2'){ echo 'selected="selected"'; }?>>100%</option>
                              <option value="2.5" <? if($row['khuyenmai'] == '2.5'){ echo 'selected="selected"'; }?>>150%</option>
                              <option value="3.0" <? if($row['khuyenmai'] == '3.0'){ echo 'selected="selected"'; }?>>200%</option>

                            </select>
                                        </div>
                        </div>						
                        <button type="submit" class="btn btn-success mr-2" onClick="luucoban();">Lưu lại</button>
                    </div>					
                  </div>			  
                </div>	  
						   