<?php
require_once '../../../config.php';
$id = $_GET['id'];
if(!isset($id))
    die('No direct script access allowed!');
$query = mysqli_query($db, "SELECT * FROM gift_skin WHERE id = '$id'");
$q = mysqli_fetch_assoc($query); 
?>
                <form method="POST">
                    <input type="hidden" name="id" value="<?=$q['id'];?>">
                    <div class="row">
                        <div class="col-6">
                            <div class="form-group mb-3">
                                <label class="mb-1">Date Create</label>
                                <input type="text" class="form-control" name="date_create" readonly value="<?=$q['date_create'];?>">
                            </div>
                        </div>
                        <div class="col-6">
                            <div class="form-group mb-3">
                                <label class="mb-1">Gift Date</label>
                                <input type="text" class="form-control" name="date_gift" readonly value="<?=$q['date_gift'];?>">
                            </div>
                        </div>
                        <div class="col-6">
                            <div class="form-group mb-3">
                                <label class="mb-1">User ID</label>
                                <input type="number" class="form-control" name="userid" id="userid" placeholder="123456789" value="<?=$q['userid'];?>">
                            </div>
                        </div>
                        <div class="col-6">
                            <div class="form-group mb-3">
                                <label class="mb-1">Nickname</label>
                                <input type="text" class="form-control" name="nick" id="nick" placeholder="wcode.id" value="<?=$q['nickname'];?>">
                            </div>
                        </div>
                        <div class="col-12">
                            <div class="form-group mb-3">
                                <label class="mb-1">Name Skin</label>
                                <input type="text" class="form-control" name="name_skin" id="name_skin" placeholder="wcode.id" value="<?=$q['name_skin'];?>">
                            </div>
                        </div>
                        <div class="col-12">
                            <div class="form-group mb-3">
                                <label class="mb-1">Status</label>
                                <select name="status" class="form-control">
                                    <option value="Pending" <?= $q['status'] == "Pending" ? "selected" : "";?>>Pending</option>
                                    <option value="Waiting" <?= $q['status'] == "Waiting" ? "selected" : "";?>>Waiting</option>
                                    <option value="Processing" <?= $q['status'] == "Processing" ? "selected" : "";?>>Proccesing</option>
                                    <option value="Success" <?= $q['status'] == "Success" ? "selected" : "";?>>Success</option>
                                    <option value="Canceled" <?= $q['status'] == "Canceled" ? "selected" : "";?>>Canceled</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <hr>
                    <div class="float-right">
                        <button type="button" data-bs-dismiss="modal" aria-label="Close" class="btn btn-block bg-light fw-bold">BACK</button>
                        <button type="submit" name="edit" class="btn btn-block text-white bg-primary fw-bold">CHANGE</button>
                    </div>
                </form>
