141 lines
3.9 KiB
PHP
141 lines
3.9 KiB
PHP
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
/** @var \App\Models\Product $product */
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<title>Mapping Produk Marketplace</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
padding: 20px;
|
|
background: #f9fafb;
|
|
}
|
|
|
|
.card {
|
|
background: white;
|
|
border: 1px solid #e5e7eb;
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
max-width: 800px;
|
|
}
|
|
|
|
label {
|
|
display: block;
|
|
margin-top: 12px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
input,
|
|
select {
|
|
width: 100%;
|
|
padding: 8px;
|
|
margin-top: 6px;
|
|
border: 1px solid #d1d5db;
|
|
border-radius: 6px;
|
|
}
|
|
|
|
.checkbox {
|
|
width: auto;
|
|
margin-right: 6px;
|
|
}
|
|
|
|
.btn {
|
|
display: inline-block;
|
|
padding: 9px 14px;
|
|
border-radius: 6px;
|
|
text-decoration: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: #2563eb;
|
|
color: white;
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: #e5e7eb;
|
|
color: #111827;
|
|
}
|
|
|
|
.info {
|
|
background: #f3f4f6;
|
|
padding: 12px;
|
|
border-radius: 6px;
|
|
margin-bottom: 16px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h2>Mapping Produk Marketplace</h2>
|
|
|
|
<div class="card">
|
|
|
|
<div class="info">
|
|
|
|
<strong>Produk Marketplace:</strong><br>
|
|
Marketplace: <?= html_escape($product->marketplace) ?><br>
|
|
SKU: <?= html_escape($product->sku) ?><br>
|
|
Nama Produk: <?= html_escape($product->product_name) ?><br>
|
|
Variant: <?= html_escape($product->variant_name) ?><br>
|
|
Stock MP: <?= html_escape($product->stock) ?>
|
|
</div>
|
|
|
|
<form method="post" action="<?= site_url('marketplace/save_mapping') ?>">
|
|
<input type="hidden" name="marketplace_product_id" value="<?= html_escape($product->id) ?>">
|
|
|
|
<label>Barang Lokal</label>
|
|
<select name="kode_barang" required>
|
|
<option value="">-- Pilih Barang Lokal --</option>
|
|
|
|
<?php foreach ((array)($barang ?? []) as $b): ?>
|
|
<option value="<?= html_escape($b->KODE_BARANG) ?>"
|
|
<?= !empty($mapping) && $mapping->kode_barang == $b->KODE_BARANG ? 'selected' : '' ?>>
|
|
<?= html_escape($b->KODE_BARANG) ?> - <?= html_escape($b->NAMA_BARANG) ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
|
|
<label>Qty Multiplier</label>
|
|
<input
|
|
type="number"
|
|
step="0.01"
|
|
name="qty_multiplier"
|
|
value="<?= !empty($mapping) ? html_escape($mapping->qty_multiplier) : '1.00' ?>"
|
|
required>
|
|
|
|
<label>
|
|
<input
|
|
class="checkbox"
|
|
type="checkbox"
|
|
name="sync_stock"
|
|
value="1"
|
|
<?= empty($mapping) || !empty($mapping->sync_stock) ? 'checked' : '' ?>>
|
|
Sinkron stok
|
|
</label>
|
|
|
|
<label>
|
|
<input
|
|
class="checkbox"
|
|
type="checkbox"
|
|
name="sync_price"
|
|
value="1"
|
|
<?= !empty($mapping) && !empty($mapping->sync_price) ? 'checked' : '' ?>>
|
|
Sinkron harga
|
|
</label>
|
|
|
|
<button type="submit" class="btn btn-primary">Simpan Mapping</button>
|
|
<a href="<?= site_url('marketplace/products') ?>" class="btn btn-secondary">Kembali</a>
|
|
</form>
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|