<?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_VongQuay 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 Vòng Quay</h4>
          </div>
		  <div class="col-12 stretch-card">
                    <div class="card-body">
                        <div class="form-group row">
                          <label for="exampleInputPassword2" class="col-sm-3 col-form-label">[GIÁ MUA] 1 Lượt [Xu Web]</label>
                          <div class="col-sm-9">
                            <textarea class="form-control" id="sett_gia_xuweb"><?=$row['XuWeb']?></textarea>
                          </div>
                        </div>
                        <div class="form-group row">
                          <label for="exampleInputPassword2" class="col-sm-3 col-form-label">[GIÁ MUA] 1 Lượt [Số Dư]</label>
                          <div class="col-sm-9">
                            <textarea class="form-control" id="sett_gia_sodu"><?=$row['SoDu']?></textarea>
                          </div>
                        </div>						
                        <button type="submit" class="btn btn-success mr-2" onClick="luucobanVQ();">Lưu lại</button>
                    </div>					
                </div>
<div class="col-lg-12 grid-margin stretch-card">
              <div class="card">
                <div class="card-body">
                  <h4 class="card-title">Điều chỉnh danh sách vật phẩm </h4>
				  <center><font color="red">Tỉ lệ 1000 ==>[Tương Ứng]<== Tỉ lệ 100% Trúng</font></center>
                  <div class="table-responsive">
                    <table class="table table-striped">
                      <thead>
                        <tr>
                          <th>
                            STT
                          </th>
                          <th>
                           Vật phẩm
                          </th>
                          <th>
                           Số lượng
                          </th>
                          <th>
                            Tỉ lệ
                          </th><th>
                            Điều chỉnh
                          </th>
                        </tr>
                      </thead>
                      <tbody>
					  					  <?php
					  $get_AA = mysqli_query($conn, "Select * From vongquay_item");										  
					  if(mysqli_num_rows($get_AA)){
						  $i=0;
						  while($row = mysqli_fetch_array($get_AA, MYSQLI_ASSOC)){
							  $i++;
							  echo '<!--- ============================================= --->
                        <tr>
                          <td> '.$i.'</td>
                          <td><input type="text" class="form-control" id="set__vq_a_'.$row['IDLucky'].'" value="'.$row['Item'].'"></td>
                          <td><input type="text" class="form-control" id="set__vq_b_'.$row['IDLucky'].'" value="'.$row['Count'].'"></td>
                          <td><input type="text" class="form-control" id="set__vq_c_'.$row['IDLucky'].'"value="'.$row['Random'].'"></td>
                          <td>
                          <div class="col-sm-4">
                            <div class="form-radio">
                            <button class="file-upload-browse btn btn-info" type="button" onClick="set__vq_save(\''.$row['IDLucky'].'\');">Lưu</button>
                            </div>
                          </div>
						  </td>
                        </tr>';
						  }
					  }
					  
					  ?>	
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>	
		   			