<?php
require_once '../../../config.php';
$check_data = $db->query("SELECT * FROM provider ORDER BY id DESC");
$check_category = $db->query("SELECT * FROM kategori_layanan ORDER BY id DESC");
$check_img = $db->query("SELECT * FRoM gambar_produk ORDER BY id DESC");
if (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { ?>
<form method="POST">
<div class="form-group mb-3">
        <label>Provider</label>
        <select class="form-control" name="provider">
				<option value="0">- Select One -</option>
				
	<?php while ($data_provider = $check_data->fetch_assoc()) { ?>
	<?php if($data_provider['code'] !== "Tripay"):?>
	<option value="<?= $data_provider['code']; ?>"><?= $data_provider['code']; ?></option>
	<?endif?>
	<?php } ?>
			</select>
    </div>
    <div class="form-group mb-3">
        <label>Category</label>
        <input class="form-control" name="kategori">
    </div>
<div class="form-group mb-3">
        <label>Code</label>
        <input type="text" class="form-control" placeholder="FF250DM" name="code">
    </div>
<div class="form-group mb-3">
        <label>Layanan</label>
        <input type="text" class="form-control" name="layanan">
    </div>
    <div class="form-group mb-3">
        <label>Gambar Produk</label>
        <select class="form-control" name="gambar">
				<option value="0">- Pilih Gambar Produk -</option>
				<?php while($fetch = $check_img->fetch_assoc()){?>
					<option value="<?= $fetch['img'];?>"><?= $fetch['nama_gambar'];?></option>
				<?php };?>
			</select>
    </div>
    <div class="form-group mb-3">
        <label>Note</label>
        <textarea class="form-control" name="note" rows="5"></textarea>
    </div>
    <div class="form-group mb-3">
        <label>Harga Web</label>
        <input type="number" class="form-control" name="harga_web" placeholder="contoh: 10115">
    </div>
    <div class="form-group mb-3">
        <label>Harga Reseller</label>
        <input type="number" class="form-control" placeholder="contoh: 10115" name="harga_web_ress">
    </div>
    <div class="form-group mb-3">
        <label>Harga Reseller Premium</label>
        <input type="number" class="form-control" placeholder="contoh: 10115" name="harga_web_prem">
    </div>
    <div class="form-group mb-3">
        <label>Type</label>
        <select class="form-control" name="tipe">
				<option value="0">- Select One -</option>
				
					<option value="VGAME">Voucher Game</option>
			</select>
    </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="addlayanan" class="btn btn-block text-white bg-primary fw-bold">ADD</button>
            </div>
</form>
<?php } ?>