<?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.');
}
					  $gpp_CON = mysqli_query($conn, "Select * From config_codetoday");
					  
					  if(mysqli_num_rows($gpp_CON)){
						  $i=0;
						  while($row = mysqli_fetch_array($gpp_CON, MYSQLI_ASSOC)){
							  $i++;
							  echo '<tr id="giftcodeid-'.$row['ID'].'">
                          <td>
                            '.$i.'
                          </td>
                          <td>
                           '.$row['Item'].'
                          </td>
                          <td>
                          '.number_format($row['Count']).'
                          </td>		
                          <td>
                          <a href="javascript:xoaCodetoday(\''.$row['ID'].'\');"><label class="badge badge-danger">Xóa</label></a>
                          </td>						  
                        </tr>';
						  }
					  }
					  ?>