<?php $__env->startSection('title', 'Brand'); ?>
<?php $__env->startSection('active11', 'active'); ?>
<?php $__env->startSection('menu1', 'open'); ?>
<?php $__env->startSection('content'); ?>

    <div class="content-wrapper">
        <div class="container-xxl flex-grow-1 container-p-y">
            <!-- Invoice List Widget -->
            

            <!-- Invoice List Table -->
            <div class="card">
                <div class="header-menu d-flex justify-content-between align-items-center">
                    <h3 class="card-header">Data Brand</h3>
                    <?php if(Auth::user()->role == 'superadmin'): ?>
                        <button type="button" class="btn btn-primary me-2" data-bs-toggle="modal"
                            data-bs-target="#staticBackdrop"><i class="bx bx-plus bx-sm"></i> Add</button>
                    <?php endif; ?>
                </div>


                <div class="table-responsive">
                    <table class="table" id="Mytable">
                        <thead>
                            <tr>
                                <th scope="col">Id</th>
                                <th scope="col">Brand</th>
                                <th scope="col">Logo</th>
                                <th scope="col">Alamat</th>
                                <th scope="col">Email</th>
                                <th scope="col">Moto</th>
                                <th scope="col">Status</th>
                                <th scope="col">Didaftarkan Oleh</th>
                                <th scope="col">Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <th scope="row"><?php echo e($data->id); ?></th>
                                    <td><?php echo e($data->nama_brand); ?></td>
                                    <td><img src="<?php echo e(asset('storage/img/' . $data->logo_brand)); ?>" alt=""
                                            class="w-px-100 h-auto rounded-circle" /></td>
                                    <td><?php echo e($data->email); ?></td>
                                    <td><?php echo e($data->alamat); ?></td>
                                    <td><?php echo e($data->moto); ?></td>
                                    <td>
                                        <?php if($data->status == 'aktif'): ?>
                                            <span class="badge bg-label-success me-1">Aktif</span>
                                        <?php elseif($data->status == 'tidak aktif'): ?>
                                            <span class="badge bg-label-danger me-1">Tidak Aktif</span>
                                        <?php endif; ?>
                                    </td>
                                    <td>
                                        
                                        <?php echo e($data->user->username); ?>

                                    </td>
                                    <td><a href="<?php echo e(route('brand.edit', $data->id)); ?>"
                                            class="btn btn-sm btn-label-secondary"> <i class="bx bx-edit-alt"></i></a>
                                        <form action="<?php echo e(route('brand.aktifasi', $data->id)); ?>" method="POST">
                                            <?php echo csrf_field(); ?>
                                            <?php if($data->status == 'tidak aktif'): ?>
                                                <button type="submit" class="btn btn-sm btn-label-success"> <i
                                                        class="bx bx-check"></i></button>
                                            <?php elseif($data->status == 'aktif'): ?>
                                                <button type="submit" class="btn btn-sm btn-label-danger"> <i
                                                        class="bx bx-x"></i></button>
                                            <?php endif; ?>

                                        </form>

                                    </td>

                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>

            </div>
            <!-- Modal -->
            <div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
                aria-labelledby="staticBackdropLabel" aria-hidden="true">
                <div class="modal-dialog modal-lg">
                    <div class="modal-content ">
                        <div class="modal-header">
                            <h4 class="modal-title" id="staticBackdropLabel">Tambah Data</h4>
                            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                        </div>
                        <div class="modal-body">
                            <form action="<?php echo e(route('brand.store')); ?>" method="POST" enctype="multipart/form-data">
                                <?php echo csrf_field(); ?>
                                <div class="row">
                                    <!-- Kolom Kiri -->
                                    <div class="col-md-6">
                                        <!-- Users ID -->
                                        <h5>Data Admin Pengelola</h5>
                                        <div class="row">
                                            <!-- Kolom Kiri -->
                                            <div class="col-md-12">
                                                <!-- Username -->
                                                <div class="mb-3">
                                                    <label for="username" class="form-label">Username</label>
                                                    <input type="text" class="form-control" id="username"
                                                        name="username" placeholder="Masukkan Username" required>
                                                </div>

                                                <!-- Email -->
                                                <div class="mb-3">
                                                    <label for="email" class="form-label">Email</label>
                                                    <input type="email" class="form-control" id="email" name="email"
                                                        placeholder="Masukkan Email" required>
                                                </div>

                                                <!-- Password -->
                                                <div class="mb-3">
                                                    <label for="password" class="form-label">Password</label>
                                                    <input type="password" class="form-control" id="password"
                                                        name="password" placeholder="Masukkan Password" required>
                                                </div>

                                                <!-- Phone -->
                                                <div class="mb-3">
                                                    <label for="phone" class="form-label">No. Telp</label>
                                                    <input type="text" class="form-control" id="phone" name="phone"
                                                        placeholder="Masukkan No. Telp" required>
                                                </div>
                                                <!-- Nama -->
                                                <div class="mb-3">
                                                    <label for="nama" class="form-label">Nama</label>
                                                    <input type="text" class="form-control" id="nama"
                                                        name="nama" placeholder="Masukkan Nama" required>
                                                </div>

                                                <!-- Alamat -->
                                                <div class="mb-3">
                                                    <label for="alamat" class="form-label">Alamat</label>
                                                    <textarea class="form-control" id="alamat" name="alamat" placeholder="Masukkan Alamat" rows="3" required></textarea>
                                                </div>

                                                <!-- Foto -->
                                                <div class="mb-3">
                                                    <label for="foto" class="form-label">Foto</label>
                                                    <input type="file" class="form-control" id="foto"
                                                        name="foto">
                                                </div>
                                            </div>


                                        </div>



                                    </div>
                                    <!-- Kolom Kanan -->
                                    <div class="col-md-6">
                                        <h5>Data Brand</h5>
                                        <!-- Nama Brand -->
                                        <div class="mb-3">
                                            <label for="nama_brand" class="form-label">Nama Brand</label>
                                            <input type="text" class="form-control" id="nama_brand" name="nama_brand"
                                                placeholder="Masukkan Nama Brand" required>
                                        </div>

                                        <!-- Logo Brand -->
                                        <div class="mb-3">
                                            <label for="logo_brand" class="form-label">Logo Brand</label>
                                            <input type="file" class="form-control" id="logo_brand" name="logo_brand"
                                                required>
                                        </div>

                                        <!-- Alamat -->
                                        <div class="mb-3">
                                            <label for="alamat" class="form-label">Alamat</label>
                                            <textarea class="form-control" id="alamat" name="alamat" placeholder="Masukkan Alamat" rows="3" required></textarea>
                                        </div>

                                        <!-- Email -->
                                        <div class="mb-3">
                                            <label for="email" class="form-label">Email</label>
                                            <input type="email" class="form-control" id="email" name="email"
                                                placeholder="Masukkan Email" required>
                                        </div>
                                        <!-- No Telp -->
                                        <div class="mb-3">
                                            <label for="no_telp" class="form-label">No. Telp</label>
                                            <input type="text" class="form-control" id="no_telp" name="no_telp"
                                                placeholder="Masukkan No. Telp" required>
                                        </div>

                                        <!-- Moto -->
                                        <div class="mb-3">
                                            <label for="moto" class="form-label">Moto</label>
                                            <input type="text" class="form-control" id="moto" name="moto"
                                                placeholder="Masukkan Moto" required>
                                        </div>
                                    </div>


                                </div>

                        </div>

                        <div class="modal-footer">
                            
                            <button type="submit" class="btn btn-primary">Simpan</button>
                        </div>
                        </form>
                    </div>
                </div>
            </div>
        <?php $__env->stopSection(); ?>

<?php echo $__env->make('component.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp_2\htdocs\Laundry\resources\views/brand/index.blade.php ENDPATH**/ ?>