<?php $section = $sections['hero_section'] ?? []; ?>

<form method="post" action="<?php echo site_url('admin/product/save_section'); ?>" enctype="multipart/form-data">
  <input type="hidden" name="prd_id" value="<?php echo $product['prd_id']; ?>">
  <input type="hidden" name="section_key" value="hero_section">


  <div class="form-group"><label>Title</label><input name="title" class="form-control" value="<?php echo $section['title'] ?? ''; ?>"></div>
  <div class="form-group"><label>Subtitle</label><input name="subtitle" class="form-control" value="<?php echo $section['subtitle'] ?? ''; ?>"></div>
  <div class="form-group"><label>Description</label><textarea name="description" rows="4" class="form-control"><?php echo $section['description'] ?? ''; ?></textarea></div>
  <div class="form-group d-none"><label>Button Text</label><input name="button_text" class="form-control" value="<?php echo $section['button_text'] ?? ''; ?>"></div>
  <div class="form-group"><label>Youtube Link</label><input name="button_url" class="form-control" value="<?php echo $section['button_url'] ?? ''; ?>"></div>
  <div class="form-group d-none"><label>Hero Image</label><input type="file" name="image" class="form-control"><?php if (!empty($section['image'])): ?><img src="<?php echo base_url($section['image']); ?>" style="width:200px; margin-top:10px;"><?php endif; ?></div>
  <button class="btn btn-success">Save</button>
</form>