

<div class="form-group">
    <label for="product_name">Nom de produit</label>
    <input type="text" class="form-control" id="product_name" name="product_name" placeholder="Nom de produit" value="<?php echo $product_data['name']; ?>" autocomplete="off" />
</div>

<div class="form-group">
    <label for="sku">Numéro de série</label>
    <input type="text" class="form-control" id="sku" name="sku" placeholder="Unité de Gestion de Stock" value="<?php echo $product_data['sku']; ?>" autocomplete="off" />
</div>

<div class="form-group">
    <label for="sku">Numéro de moteur</label>
    <input type="text" class="form-control" id="sku" name="sku" placeholder="Unité de Gestion de Stock" value="<?php echo $product_data['numero_de_moteur']; ?>" autocomplete="off" />
</div>

<div class="form-group">
    <label for="price">Prix d'Achat</label>
    <input type="text" class="form-control" id="price" name="price" placeholder="Prix" value="<?php echo $product_data['price']; ?>" autocomplete="off" />
</div>

<div class="form-group">
    <label for="qty">Quantiter</label>
    <input type="text" class="form-control" id="qty" name="qty" placeholder="Quantiter" value="<?php echo $product_data['qty']; ?>" autocomplete="off" />
</div>

<div class="form-group">
    <label for="description">Description</label>
    <textarea type="text" class="form-control" id="description" name="description" placeholder="Description" autocomplete="off">
                                <?php echo $product_data['description']; ?>
                                </textarea>
</div>

<?php $attribute_id = json_decode($product_data['attribute_value_id']); ?>
<?php if ($attributes): ?>
    <?php foreach ($attributes as $k => $v): ?>
        <div class="form-group">
            <label for="groups"><?php echo $v['attribute_data']['name'] ?></label>
            <select class="form-control select_group" id="attributes_value_id" name="attributes_value_id[]" multiple="multiple">
                <?php foreach ($v['attribute_value'] as $k2 => $v2): ?>
                    <option value="<?php echo $v2['id'] ?>" <?php if (in_array($v2['id'], $attribute_id)) {
                                                                echo "selected";
                                                            } ?>><?php echo $v2['value'] ?></option>
                <?php endforeach ?>
            </select>
        </div>
    <?php endforeach ?>
<?php endif; ?>

<div class="form-group">
    <label for="brands">Marques</label>
    <?php $brand_data = json_decode($product_data['brand_id']); ?>
    <select class="form-control select_group" id="brands" name="brands[]" multiple="multiple">
        <?php foreach ($brands as $k => $v): ?>
            <option value="<?php echo $v['id'] ?>" <?php if (in_array($v['id'], $brand_data)) {
                                                        echo 'selected="selected"';
                                                    } ?>><?php echo $v['name'] ?></option>
        <?php endforeach ?>
    </select>
</div>

<div class="form-group">
    <label for="category">Categories</label>
    <?php $category_data = json_decode($product_data['category_id']); ?>
    <select class="form-control select_group" id="category" name="category[]" multiple="multiple">
        <?php foreach ($category as $k => $v): ?>
            <option value="<?php echo $v['id'] ?>" <?php if (in_array($v['id'], $category_data)) {
                                                        echo 'selected="selected"';
                                                    } ?>><?php echo $v['name'] ?></option>
        <?php endforeach ?>
    </select>
</div>

<div class="form-group">
    <label for="store">Magasin</label>
    <select class="form-control select_group" id="store" name="store">
        <?php foreach ($stores as $k => $v): ?>
            <option value="<?php echo $v['id'] ?>" <?php if ($product_data['store_id'] == $v['id']) {
                                                        echo "selected='selected'";
                                                    } ?>><?php echo $v['name'] ?></option>
        <?php endforeach ?>
    </select>
</div>

<div class="form-group">
    <label for="store">Disponibilité</label>
    <select class="form-control" id="availability" name="availability">
        <option value="1" <?php if ($product_data['availability'] == 1) {
                                echo "selected='selected'";
                            } ?>>Oui</option>
        <option value="2" <?php if ($product_data['availability'] != 1) {
                                echo "selected='selected'";
                            } ?>>Non</option>
    </select>
</div>