<?= $this->extend('layouts/owner') ?>

<?= $this->section('content') ?>

<div class="container-fluid">

<div class="card">

<div class="card-header bg-info">

<div class="d-flex justify-content-between">

<h4>

<?= $product['nama_product']; ?>

</h4>

<a

href="<?= base_url('owner/product') ?>"

class="btn btn-light">

Kembali

</a>

</div>

</div>

<div class="card-body">

<form

action="<?= base_url('owner/productphoto/upload/'.$product['id_product']) ?>"

method="post"

enctype="multipart/form-data">

<div class="row">

<div class="col-md-9">

<input

type="file"

name="photo"

class="form-control"

required>

</div>

<div class="col-md-3">

<button

class="btn btn-primary btn-block">

Upload Foto

</button>

</div>

</div>

</form>

<hr>

<div class="row">

<?php foreach($images as $img): ?>

<div class="col-md-3">

<div class="card">

<img

src="<?= base_url('uploads/products/'.$img['image_url']) ?>"

class="card-img-top"

style="height:220px;object-fit:cover;">

<div class="card-footer text-center">

<a

href="<?= base_url('owner/productphoto/delete/'.$img['id_image']) ?>"

class="btn btn-danger btn-sm"

onclick="return confirm('Hapus foto?')">

Hapus

</a>

</div>

</div>

</div>

<?php endforeach; ?>

</div>

</div>

</div>

</div>

<?= $this->endSection() ?>