<?php
/**
 * users.php -- Users
 */

include '../inc/config.inc.php'; // Configuration

ob_start();
session_start();

//date_default_timezone_set('Africa/Lagos');

error_reporting(E_ALL);
ini_set('display_errors', 1);

if ( !isset($_SESSION['admin']) || $_SESSION["loggedin"] !== true || trim($_SESSION['admin']) == '' ){
//header('Location: ' . $BASE_URL . 'wp-admin/');
header('Location: ' . $BASE_URL . 'signin');
exit;
}

?>

<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Users - Alert Signals Nation</title>
<!-- Favicon -->
<link rel="shortcut icon" href="../img/Signals-Alert-3.png" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Typography CSS -->
<link rel="stylesheet" href="css/typography.css">
<!-- Style CSS -->
<link rel="stylesheet" href="css/style.css">
<!-- Responsive CSS -->
<link rel="stylesheet" href="css/responsive.css">

<script src="../plugins/sweetalerts/promise-polyfill.js"></script>
<link href="../plugins/sweetalerts/sweetalert.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" rel="stylesheet" />
<style>
/*------ Google Font Style ------ */
body {font-family:'Roboto'!important;}
</style>

</head>
<body>
<!-- loader Start -->
<!--<div id="loading">
<div id="loading-center">
</div>
</div>-->
<!-- loader END -->
<!-- Wrapper Start -->
<div class="wrapper">
<!-- Sidebar  -->
<?php include 'navbar.php' ?>
<!-- TOP Nav Bar END -->
<!-- Page Content  -->
<div id="content-page" class="content-page">
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="iq-card">
<div class="iq-card-header d-flex justify-content-between">
<div class="iq-header-title">
<h4 class="card-title" style="font-family: 'Roboto'!important;">User List</h4>
</div>
</div>
<div class="iq-card-body">
<div class="table-responsive">
<div class="row justify-content-between">
<div class="col-sm-12 col-md-6">
<div id="user_list_datatable_info" class="dataTables_filter">
<form class="mr-3 position-relative">
<div class="form-group mb-0">
<input type="search" class="form-control" id="exampleInputSearch" placeholder="Search" aria-controls="user-list-table">
</div>
</form>
</div>
</div>
<div class="col-sm-12 col-md-6">
<div class="user-list-files d-flex float-right">
<a class="iq-bg-primary" href="javascript:void();">
Print
</a>
<a class="iq-bg-primary" href="javascript:void();">
Excel
</a>
<a class="iq-bg-primary" href="javascript:void();">
Pdf
</a>
</div>
</div>
</div>
<table id="user-list-table" class="table table-striped table-bordered mt-4" role="grid" aria-describedby="user-list-page-info">
<thead>
<tr>
<th>Image</th>
<th>Username</th>
<th>Contact</th>
<th>Confirmed?</th>
<th>Status</th>
<th>Password</th>
<th>Join Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
// Users
$users = $db_con->prepare("SELECT * FROM backup WHERE id  !='' ORDER BY created DESC");

if ( $users->execute() ){
$i = 0;
while ( $user = $users->fetch(PDO::FETCH_ASSOC) ){
$i++;
?>
<tr>
<td class="text-center">
<?php
if ( empty($user['picture']) ){
echo '<img class="rounded img-fluid avatar-40" src="../wp-user/images/user/11.png" alt="profile">';
} else {
echo '<img class="rounded img-fluid avatar-40" src="../wp-user/uploads/'.$user['picture'].'" alt="profile">';
}
?>
</td>
<!--<td><?= $user['fullname']; ?></td>-->
<td><?= $user['username']; ?></td>
<td><?= $user['phone']; ?></td>
<td><?= $user['country']; ?></td>

<td>
<?= $user['status']; ?>
<? if ( $user['status'] == 'Not Verified' ){ ?>
<button class="btn btn-sm btn-primary" type="button" onclick="AdminValidateUser('verify', <?= $user['id']; ?>)">YES!</button>
<? } ?>
<!--<select id="user-status" name="status">
<option value="Not Verified" <? if ($user['status']=='Not Verified') echo 'selected'; ?>>Not Verified</option>
<option value="Active" <? if ($user['status']=='Active') echo 'selected'; ?>>Active</option>
<option value="Suspended" <? if ($user['status']=='Suspended') echo 'selected'; ?>>Suspended</option>
<option value="Disabled" <? if ($user['status']=='Disabled') echo 'selected'; ?>>Disabled</option>
</select>-->
</td>
<td><code><?= $user['password_plain']; ?></code></td>
<td>
<?= date('Y/m/d', strtotime($user['created'])); ?><br>
<input type="date" class="form-control" id="udate-<?= $user['id']; ?>" value="<?= $user['created']; ?>"><br>
<button class="btn btn-sm btn-primary" type="button" onclick="ChangeJoinDate(<?= $user['id']; ?>)">Change</button>
</td>
<td>
<div class="d-flex align-items-center list-user-action">

<a class="iq-bg-primary" data-toggle="tooltip" data-placement="top" title="" data-original-title="activate" href="activate?activate&id=<?= $user['id']; ?>"><i class="ri-arrow-go-back-line"></i></a>


<?php
if ( isset($_GET['activate'], $_GET['id']) ){
    $user_id = intval($_GET['id']);
 
  
        $delete = $db_con->prepare("DELETE FROM backup WHERE id='$user_id'");
        if ( $delete->execute() ){
        ?>
        <script>
                        Swal.fire({
  position: 'center',
  icon: 'success',
   html: 'Account Has Been recovered.',
  showConfirmButton: false,
  timer: 15000
})
   
        </script>
        <?php
        } else {
        ?>
        <script>
        setTimeout(function(){
        noticePop('Something Went Wrong.', 'error');
        }, 2000);
        </script>
        <?php
        }
      
    }

    
?>
</div>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Wrapper END -->
<!-- Footer -->
<?php include 'footer.php' ?>
<!-- color-customizer END -->
<!-- Optional JavaScript -->
<script src="../plugins/jquery-3.1.1.min.js"></script>
<script src="../plugins/sweetalerts/sweetalert2.min.js"></script>
<script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.js"></script>

<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<!--<script src="js/jquery.min.js"></script>
<script src="js/popper.min.js"></script>-->
<script src="js/bootstrap.min.js"></script>
<!-- Appear JavaScript -->
<script src="js/jquery.appear.js"></script>
<!-- Countdown JavaScript -->
<script src="js/countdown.min.js"></script>
<!-- Counterup JavaScript -->
<script src="js/waypoints.min.js"></script>
<script src="js/jquery.counterup.min.js"></script>
<!-- Wow JavaScript -->
<script src="js/wow.min.js"></script>
<!-- Apexcharts JavaScript -->
<script src="js/apexcharts.js"></script>
<!-- Slick JavaScript -->
<script src="js/slick.min.js"></script>
<!-- Select2 JavaScript -->
<script src="js/select2.min.js"></script>
<!-- Owl Carousel JavaScript -->
<script src="js/owl.carousel.min.js"></script>
<!-- Magnific Popup JavaScript -->
<script src="js/jquery.magnific-popup.min.js"></script>
<!-- Smooth Scrollbar JavaScript -->
<script src="js/smooth-scrollbar.js"></script>
<!-- lottie JavaScript -->
<script src="js/lottie.js"></script>
<!-- am core JavaScript -->
<script src="js/core.js"></script>
<!-- am charts JavaScript -->
<script src="js/charts.js"></script>
<!-- am animated JavaScript -->
<script src="js/animated.js"></script>
<!-- am kelly JavaScript -->
<script src="js/kelly.js"></script>
<!-- am maps JavaScript -->
<script src="js/maps.js"></script>
<!-- am worldLow JavaScript -->
<script src="js/worldLow.js"></script>
<!-- Style Customizer -->
<script src="js/style-customizer.js"></script>
<!-- Chart Custom JavaScript -->
<script src="js/chart-custom.js"></script>
<!-- Custom JavaScript -->
<script src="js/custom.js"></script>

<script>
// BASE URL and API Inclusion
const BASE_URL = '<?= $BASE_URL; ?>';
const API = `${BASE_URL}api/admin.php`;

function noticePop(value, type) {
swal({
html: '<span style="font-size:18px!important;">' + `${value}` + '</span>',
type: `${type}`,
timer: 4000,
showConfirmButton: false,
allowOutsideClick: false,
allowEscapeKey: false,
}).then(function() {
window.location.href = 'users';
});
}

function SelectCountryCurrency( uid ){
var country = $('#country-'+uid).val();

if ( country == "Afghanistan" ){ $('#currency-'+uid).val('؋'); }
else if ( country == "Albania" ){ $('#currency-'+uid).val('Lek'); }
else if ( country == "Algeria" ){ $('#currency-'+uid).val('دج'); }
else if ( country == "American Samoa" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Andorra" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Angola" ){ $('#currency-'+uid).val('Kz'); }
else if ( country == "Anguilla" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Antarctica" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Antigua and Barbuda" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Argentina" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Armenia" ){ $('#currency-'+uid).val('֏'); }
else if ( country == "Aruba" ){ $('#currency-'+uid).val('ƒ'); }
else if ( country == "Australia" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Austria" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Azerbaijan" ){ $('#currency-'+uid).val('AZN'); }
else if ( country == "Bahamas" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Bahrain" ){ $('#currency-'+uid).val('د.'); }
else if ( country == "Bangladesh" ){ $('#currency-'+uid).val('ó'); }
else if ( country == "Barbados" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Belarus" ){ $('#currency-'+uid).val('Br'); }
else if ( country == "Belgium" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Belize" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Benin" ){ $('#currency-'+uid).val('CFA'); }
else if ( country == "Bermuda" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Bhutan" ){ $('#currency-'+uid).val('Nu'); }
else if ( country == "Bolivia" ){ $('#currency-'+uid).val('Bs'); }
else if ( country == "Bosnia and Herzegovina" ){ $('#currency-'+uid).val('KM'); }
else if ( country == "Botswana" ){ $('#currency-'+uid).val('P'); }
else if ( country == "Bouvet Island" ){ $('#currency-'+uid).val('kr'); }
else if ( country == "Brazil" ){ $('#currency-'+uid).val('R$'); }
else if ( country == "British Indian Ocean Territory" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Brunei Darussalam" ){ $('#currency-'+uid).val('B$'); }
else if ( country == "Bulgaria" ){ $('#currency-'+uid).val('Лв.'); }
else if ( country == "Burkina Faso" ){ $('#currency-'+uid).val('CFA'); }
else if ( country == "Burundi" ){ $('#currency-'+uid).val('FBu'); }
else if ( country == "Cambodia" ){ $('#currency-'+uid).val('៛'); }
else if ( country == "Cameroon" ){ $('#currency-'+uid).val('FCFA'); }
else if ( country == "Canada" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Cape Verde" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Cayman Islands" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Central African Republic" ){ $('#currency-'+uid).val('FCFA'); }
else if ( country == "Chad" ){ $('#currency-'+uid).val('FCFA'); }
else if ( country == "Chile" ){ $('#currency-'+uid).val('$'); }
else if ( country == "China" ){ $('#currency-'+uid).val('¥'); }
else if ( country == "Christmas Island" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Cocos (Keeling) Islands" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Colombia" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Comoros" ){ $('#currency-'+uid).val('CF'); }
else if ( country == "Congo" ){ $('#currency-'+uid).val('FC'); }
else if ( country == "Democratic Republic of the Congo" ){ $('#currency-'+uid).val('FC'); }
else if ( country == "Cook Islands" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Costa Rica" ){ $('#currency-'+uid).val('₡'); }
else if ( country == "Cote D'Ivoire" ){ $('#currency-'+uid).val('CFA'); }
else if ( country == "Croatia" ){ $('#currency-'+uid).val('Kn'); }
else if ( country == "Cuba" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Cyprus" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Czech Republic" ){ $('#currency-'+uid).val('Kč'); }
else if ( country == "Denmark" ){ $('#currency-'+uid).val('kr'); }
else if ( country == "Djibouti" ){ $('#currency-'+uid).val('Fdj'); }
else if ( country == "Dominica" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Dominican Republic" ){ $('#currency-'+uid).val('RD$'); }
else if ( country == "Ecuador" ){ $('#currency-'+uid).val('S/.'); }
else if ( country == "Egypt" ){ $('#currency-'+uid).val('E£'); }
else if ( country == "El Salvador" ){ $('#currency-'+uid).val('₡'); }
else if ( country == "Equatorial Guinea" ){ $('#currency-'+uid).val('FCFA'); }
else if ( country == "Eritrea" ){ $('#currency-'+uid).val('Nkf'); }
else if ( country == "Estonia" ){ $('#currency-'+uid).val('kr'); }
else if ( country == "Ethiopia" ){ $('#currency-'+uid).val('Br'); }
else if ( country == "Falkland Islands (Malvinas)" ){ $('#currency-'+uid).val('£'); }
else if ( country == "Faroe Islands" ){ $('#currency-'+uid).val('kr'); }
else if ( country == "Fiji" ){ $('#currency-'+uid).val('FJ$'); }
else if ( country == "Finland" ){ $('#currency-'+uid).val('mk'); }
else if ( country == "France" ){ $('#currency-'+uid).val('€'); }
else if ( country == "French Guiana" ){ $('#currency-'+uid).val('€'); }
else if ( country == "French Polynesia" ){ $('#currency-'+uid).val('₣'); }
else if ( country == "French Southern Territories" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Gabon" ){ $('#currency-'+uid).val('FCFA'); }
else if ( country == "Gambia" ){ $('#currency-'+uid).val('D'); }
else if ( country == "Georgia" ){ $('#currency-'+uid).val('GEL'); }
else if ( country == "Germany" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Ghana" ){ $('#currency-'+uid).val('GH₵'); }
else if ( country == "Gibraltar" ){ $('#currency-'+uid).val('£'); }
else if ( country == "Greece" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Greenland" ){ $('#currency-'+uid).val('Kr.'); }
else if ( country == "Grenada" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Guadeloupe" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Guam" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Guatemala" ){ $('#currency-'+uid).val('Q'); }
else if ( country == "Guernsey" ){ $('#currency-'+uid).val('£'); }
else if ( country == "Guinea" ){ $('#currency-'+uid).val('FG'); }
else if ( country == "Guinea-Bissau" ){ $('#currency-'+uid).val('CFA'); }
else if ( country == "Guyana" ){ $('#currency-'+uid).val('G$'); }
else if ( country == "Haiti" ){ $('#currency-'+uid).val('G'); }
else if ( country == "Heard Island and McDonald Islands" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Holy See (Vatican City State)" ){ $('#currency-'+uid).val('₤'); }
else if ( country == "Honduras" ){ $('#currency-'+uid).val('HNL'); }
else if ( country == "Hong Kong" ){ $('#currency-'+uid).val('HK$'); }
else if ( country == "Hungary" ){ $('#currency-'+uid).val('Ft'); }
else if ( country == "Iceland" ){ $('#currency-'+uid).val('kr'); }
else if ( country == "India" ){ $('#currency-'+uid).val('₹'); }
else if ( country == "Indonesia" ){ $('#currency-'+uid).val('Rp'); }
else if ( country == "Islamic Republic of Iran" ){ $('#currency-'+uid).val('IRR'); }
else if ( country == "Iraq" ){ $('#currency-'+uid).val('د.ع'); }
else if ( country == "Ireland" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Isle of Man" ){ $('#currency-'+uid).val('£'); }
else if ( country == "Israel" ){ $('#currency-'+uid).val('₪'); }
else if ( country == "Italy" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Jamaica" ){ $('#currency-'+uid).val('J$'); }
else if ( country == "Japan" ){ $('#currency-'+uid).val('¥'); }
else if ( country == "Jersey" ){ $('#currency-'+uid).val('£'); }
else if ( country == "Jordan" ){ $('#currency-'+uid).val('د.ا'); }
else if ( country == "Kazakhstan" ){ $('#currency-'+uid).val('₸'); }
else if ( country == "Kenya" ){ $('#currency-'+uid).val('KSh'); }
else if ( country == "Kiribati" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Democratic People's Republic of Korea" ){ $('#currency-'+uid).val('₩'); }
else if ( country == "Republic of Korea" ){ $('#currency-'+uid).val('₩'); }
else if ( country == "Kuwait" ){ $('#currency-'+uid).val('د.ك'); }
else if ( country == "Kyrgyzstan" ){ $('#currency-'+uid).val('лв'); }
else if ( country == "Lao People's Democratic Republic" ){ $('#currency-'+uid).val('₭'); }
else if ( country == "Latvia" ){ $('#currency-'+uid).val('LVL'); }
else if ( country == "Lebanon" ){ $('#currency-'+uid).val('ل.ل'); }
else if ( country == "Lesotho" ){ $('#currency-'+uid).val('L'); }
else if ( country == "Liberia" ){ $('#currency-'+uid).val('L$'); }
else if ( country == "Libyan Arab Jamahiriya" ){ $('#currency-'+uid).val('LD'); }
else if ( country == "Liechtenstein" ){ $('#currency-'+uid).val('CHF'); }
else if ( country == "Lithuania" ){ $('#currency-'+uid).val('Lt'); }
else if ( country == "Luxembourg" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Macao" ){ $('#currency-'+uid).val('MOP$'); }
else if ( country == "The Former Yugoslav Republic of Macedonia" ){ $('#currency-'+uid).val('den'); }
else if ( country == "Madagascar" ){ $('#currency-'+uid).val('Ar'); }
else if ( country == "Malawi" ){ $('#currency-'+uid).val('K'); }
else if ( country == "Malaysia" ){ $('#currency-'+uid).val('RM'); }
else if ( country == "Maldives" ){ $('#currency-'+uid).val('Rf'); }
else if ( country == "Mali" ){ $('#currency-'+uid).val('MAF'); }
else if ( country == "Malta" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Marshall Islands" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Martinique" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Mauritania" ){ $('#currency-'+uid).val('MRU'); }
else if ( country == "Mauritius" ){ $('#currency-'+uid).val('₨'); }
else if ( country == "Mayotte" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Mexico" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Federated States of Micronesia" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Republic of Moldova" ){ $('#currency-'+uid).val('L'); }
else if ( country == "Monaco" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Mongolia" ){ $('#currency-'+uid).val('₮'); }
else if ( country == "Montenegro" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Montserrat" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Morocco" ){ $('#currency-'+uid).val('MAD'); }
else if ( country == "Mozambique" ){ $('#currency-'+uid).val('MT'); }
else if ( country == "Myanmar" ){ $('#currency-'+uid).val('K'); }
else if ( country == "Namibia" ){ $('#currency-'+uid).val('N$'); }
else if ( country == "Nauru" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Nepal" ){ $('#currency-'+uid).val('Rs'); }
else if ( country == "Netherlands" ){ $('#currency-'+uid).val('ANG'); }
else if ( country == "Netherlands Antilles" ){ $('#currency-'+uid).val('NAf'); }
else if ( country == "New Caledonia" ){ $('#currency-'+uid).val('₣'); }
else if ( country == "New Zealand" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Nicaragua" ){ $('#currency-'+uid).val('C$'); }
else if ( country == "Niger" ){ $('#currency-'+uid).val('XOF'); }
else if ( country == "Nigeria" ){ $('#currency-'+uid).val('₦'); }
else if ( country == "Niue" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Norfolk Island" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Northern Mariana Islands" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Norway" ){ $('#currency-'+uid).val('kr'); }
else if ( country == "Oman" ){ $('#currency-'+uid).val('ر.ع.'); }
else if ( country == "Pakistan" ){ $('#currency-'+uid).val('₨'); }
else if ( country == "Palau" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Occupied Palestinian Territory" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Panama" ){ $('#currency-'+uid).val('B/'); }
else if ( country == "Papua New Guinea" ){ $('#currency-'+uid).val('K'); }
else if ( country == "Paraguay" ){ $('#currency-'+uid).val('₲'); }
else if ( country == "Peru" ){ $('#currency-'+uid).val('S/'); }
else if ( country == "Philippines" ){ $('#currency-'+uid).val('₱'); }
else if ( country == "Pitcairn" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Poland" ){ $('#currency-'+uid).val('zł'); }
else if ( country == "Portugal" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Puerto Rico" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Qatar" ){ $('#currency-'+uid).val('QR'); }
else if ( country == "Reunion" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Romania" ){ $('#currency-'+uid).val('lei'); }
else if ( country == "Russian Federation" ){ $('#currency-'+uid).val('₽'); }
else if ( country == "Rwanda" ){ $('#currency-'+uid).val('FRw'); }
else if ( country == "Saint Barthélemy" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Saint Helena" ){ $('#currency-'+uid).val('£'); }
else if ( country == "Saint Kitts and Nevis" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Saint Lucia" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Saint Martin" ){ $('#currency-'+uid).val('ƒ'); }
else if ( country == "Saint Pierre and Miquelon" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Saint Vincent and the Grenadines" ){ $('#currency-'+uid).val('X$'); }
else if ( country == "Samoa" ){ $('#currency-'+uid).val('$'); }
else if ( country == "San Marino" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Sao Tome and Principe" ){ $('#currency-'+uid).val('Db'); }
else if ( country == "Saudi Arabia" ){ $('#currency-'+uid).val('﷼'); }
else if ( country == "Senegal" ){ $('#currency-'+uid).val('CFA'); }
else if ( country == "Serbia" ){ $('#currency-'+uid).val('din'); }
else if ( country == "Seychelles" ){ $('#currency-'+uid).val('SCR'); }
else if ( country == "Sierra Leone" ){ $('#currency-'+uid).val('Le'); }
else if ( country == "Singapore" ){ $('#currency-'+uid).val('S$'); }
else if ( country == "Slovakia" ){ $('#currency-'+uid).val('SKK'); }
else if ( country == "Slovenia" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Solomon Islands" ){ $('#currency-'+uid).val('Si$'); }
else if ( country == "Somalia" ){ $('#currency-'+uid).val('Sh.so.'); }
else if ( country == "South Africa" ){ $('#currency-'+uid).val('R'); }
else if ( country == "South Georgia and the South Sandwich Islands" ){ $('#currency-'+uid).val('£'); }
else if ( country == "Spain" ){ $('#currency-'+uid).val('€'); }
else if ( country == "Sri Lanka" ){ $('#currency-'+uid).val('Rs'); }
else if ( country == "Sudan" ){ $('#currency-'+uid).val('£SD'); }
else if ( country == "Suriname" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Svalbard and Jan Mayen" ){ $('#currency-'+uid).val('kr'); }
else if ( country == "Swaziland" ){ $('#currency-'+uid).val('L'); }
else if ( country == "Sweden" ){ $('#currency-'+uid).val('kr'); }
else if ( country == "Switzerland" ){ $('#currency-'+uid).val('CHf'); }
else if ( country == "Syrian Arab Republic" ){ $('#currency-'+uid).val('LS'); }
else if ( country == "Taiwan, Province Of China" ){ $('#currency-'+uid).val('NT$'); }
else if ( country == "Tajikistan" ){ $('#currency-'+uid).val('SM'); }
else if ( country == "United Republic of Tanzania" ){ $('#currency-'+uid).val('TSh'); }
else if ( country == "Thailand" ){ $('#currency-'+uid).val('฿)'); }
else if ( country == "Timor-Leste" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Togo" ){ $('#currency-'+uid).val('CFA'); }
else if ( country == "Tokelau" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Tonga" ){ $('#currency-'+uid).val('T$'); }
else if ( country == "Trinidad and Tobago" ){ $('#currency-'+uid).val('TT$'); }
else if ( country == "Tunisia" ){ $('#currency-'+uid).val('د.ت'); }
else if ( country == "Turkey" ){ $('#currency-'+uid).val('₺'); }
else if ( country == "Turkmenistan" ){ $('#currency-'+uid).val('T'); }
else if ( country == "Turks and Caicos Islands" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Tuvalu" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Uganda" ){ $('#currency-'+uid).val('USh'); }
else if ( country == "Ukraine" ){ $('#currency-'+uid).val('₴'); }
else if ( country == "United Arab Emirates" ){ $('#currency-'+uid).val('د.إ'); }
else if ( country == "United Kingdom" ){ $('#currency-'+uid).val('£'); }
else if ( country == "United States" ){ $('#currency-'+uid).val('$'); }
else if ( country == "United States Minor Outlying Islands" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Uruguay" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Uzbekistan" ){ $('#currency-'+uid).val('лв'); }
else if ( country == "Vanuatu" ){ $('#currency-'+uid).val('VT'); }
else if ( country == "Venezuela" ){ $('#currency-'+uid).val('Bs.'); }
else if ( country == "Vietnam" ){ $('#currency-'+uid).val('₫'); }
else if ( country == "British, Virgin Islands" ){ $('#currency-'+uid).val('$'); }
else if ( country == "U.S., Virgin Islands" ){ $('#currency-'+uid).val('$'); }
else if ( country == "Wallis And Futuna" ){ $('#currency-'+uid).val('Fr'); }
else if ( country == "Western Sahara" ){ $('#currency-'+uid).val('د.م.'); }
else if ( country == "Yemen" ){ $('#currency-'+uid).val('﷼'); }
else if ( country == "Zambia" ){ $('#currency-'+uid).val('ZK'); }
else if ( country == "Zimbabwe" ){ $('#currency-'+uid).val('Z$'); }
}

function ChangeCurrency( uid ){
var currency = $('#currency-'+uid).val();

$.ajax({
url: API,
type: 'POST',
//dataType: 'JSON',
data: {
change_currency: 'change_currency',
user_id: uid,
currency: currency
},
cache: false
}).done( function( result ){
if ( result.error == false && result.notice == 'changed' ){
noticePop( result.message, 'success' );
}
else if ( result.error == true && result.notice == 'failed' ){
noticePop( result.message, 'error' );
}
});
}

function AllowWithdraw( action_type, uid ){
$.ajax({
url: API,
type: 'POST',
//dataType: 'JSON',
data: {
allow_withdraw: 'allow_withdraw',
action_type: action_type,
user_id: uid
},
cache: false
}).done( function( result ){
if ( result.error == false && result.notice == 'changed' ){
noticePop( result.message, 'success' );
}
else if ( result.error == true && result.notice == 'failed' ){
noticePop( result.message, 'error' );
}
});
}

function ChangeFees( uid ){
var fees = $('#change-fees-'+uid).val();

$.ajax({
url: API,
type: 'POST',
//dataType: 'JSON',
data: {
change_fees: 'change_fees',
user_id: uid,
fees: fees
},
cache: false
}).done( function( result ){
if ( result.error == false && result.notice == 'changed' ){
noticePop( result.message, 'success' );
}
else if ( result.error == true && result.notice == 'failed' ){
noticePop( result.message, 'error' );
}
});
}

function ChangePlan( uid ){
var plan = $('#change-plan-'+uid).val();

$.ajax({
url: API,
type: 'POST',
//dataType: 'JSON',
data: {
change_plan: 'change_plan',
user_id: uid,
plan: plan
},
cache: false
}).done( function( result ){
if ( result.error == false && result.notice == 'changed' ){
noticePop( result.message, 'success' );
}
else if ( result.error == true && result.notice == 'failed' ){
noticePop( result.message, 'error' );
}
});
}

function ChangeJoinDate( uid ){
var join_date = $('#udate-'+uid).val();

$.ajax({
url: API,
type: 'POST',
//dataType: 'JSON',
data: {
change_join_date: 'change_join_date',
user_id: uid,
join_date: join_date
},
cache: false
}).done( function( result ){
if ( result.error == false && result.notice == 'changed' ){
noticePop( result.message, 'success' );
}
else if ( result.error == true && result.notice == 'failed' ){
noticePop( result.message, 'error' );
}
});
}


function AdminValidateUser( action_type, uid ){
$.ajax({
url: API,
type: 'POST',
//dataType: 'JSON',
data: {
admin_validate_user: 'admin_validate_user',
action_type: action_type,
user_id: uid
},
cache: false
}).done( function( result ){
if ( result.error == false && result.notice == 'changed' ){
noticePop( result.message, 'success' );
}
else if ( result.error == true && result.notice == 'failed' ){
noticePop( result.message, 'error' );
}
});
}
</script>

</body>
</html>