<div class="content-header">
<div>
  <h4 class="content-title"><?php echo $title; ?></h4>
</div>
</div><!-- content-header -->
<div class="content-body">
	<?php if($this->session->flashdata('error')): ?>
	<div class="alert alert-danger"><?php echo $this->session->flashdata('error'); ?></div>
	<?php endif; ?>
	<form action="" method="post" enctype="multipart/form-data">
		<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>">
	<div class="row">
     <div class="form-group col-md-8">
        <label>Judul</label>
        <input type="text" class="form-control" name="judul" value="<?php echo set_value('judul'); ?>" autofocus>
        <small class="text-danger"><?php echo form_error('judul'); ?></small>
    </div>
    <div class="form-group col-md-4">
        <label>Kategori</label>
        <select class="form-control" name="kategori">
            <option value="">-Pilih-</option>
            <?php foreach($kategori as $kat): ?>
                <option value="<?php echo $kat['kacam_id']; ?>" <?php echo set_select('kategori', $kat['kacam_id']); ?>><?php echo $$kat['kacam_nama']; ?></option>
            <?php endforeach; ?>
        </select>
        <small class="text-danger"><?php echo form_error('kategori'); ?></small>
    </div>
    </div>
    <div class="form-group">
        <label>Deskripsi</label>
        <textarea name="isi" class="form-control" cols="30" rows="10" id="summernote"><?php echo set_value('isi'); ?></textarea>
        <small class="text-danger"><?php echo form_error('isi'); ?></small>
    </div>
    <div class="row">
        <div class="col-md-4 form-group">
            <label>Dana yang dibutuhkan</label>
            <input type="number" class="form-control" min="1" name="jml" value="<?php echo set_value('jml'); ?>">
            <small class="text-danger"><?php echo form_error('jml'); ?></small>
        </div>
        <div class="col-md-4 form-group">
            <label>Batas waktu</label>
            <input type="date" class="form-control" min="<?php echo date('Y-m-d'); ?>" name="tgl" value="<?php echo set_value('tgl'); ?>">
            <small class="text-danger"><?php echo form_error('tgl'); ?></small>
        </div>
        <div class="col-md-4 form-group">
            <label>Foto</label>
            <input type="file" class="form-control" name="gambar" required>
        </div>
    </div>
		<div class="form-group">
			<button type="button" onclick="goBack();" class="btn btn-warning">Batal</button>
			<button type="submit" class="btn btn-success">Simpan</button>
		</div>
	</form>
</div><!-- content-body -->