<section class="content-header">
  <div class="container-fluid">
    <div class="row mb-2">
      <div class="col-sm-6">
        <h1><?php echo $page_title; ?></h1>
        <p class="text-muted mb-0"><?php echo $page_subtitle; ?></p>
      </div>
      <div class="col-sm-6 text-right">
        <ol class="breadcrumb float-sm-right">
          <li class="breadcrumb-item"><a href="<?php echo site_url('dashboard'); ?>">Dashboard</a></li>
          <li class="breadcrumb-item"><a href="<?php echo site_url('transaksi/payroll'); ?>">Sistem Payroll</a></li>
          <li class="breadcrumb-item active">Buat Periode</li>
        </ol>
      </div>
    </div>
  </div>
</section>

<section class="content">
  <div class="container-fluid">
    <div class="card card-danger card-outline" style="max-width:560px;">
      <div class="card-header">
        <h3 class="card-title"><i class="fa fa-calendar mr-1"></i> Form Periode Payroll</h3>
      </div>
      <div class="card-body">
        <?php echo form_open('transaksi/payroll/simpan'); ?>
        <div class="row">
          <div class="col-sm-4">
            <div class="form-group">
              <label>Bulan <span class="text-danger">*</span></label>
              <select name="bulan" class="form-control" required>
                <?php for ($b = 1; $b <= 12; $b++): ?>
                <option value="<?php echo $b; ?>" <?php echo (date('n') == $b) ? 'selected' : ''; ?>>
                  <?php echo str_pad($b, 2, '0', STR_PAD_LEFT); ?>
                </option>
                <?php endfor; ?>
              </select>
            </div>
          </div>
          <div class="col-sm-4">
            <div class="form-group">
              <label>Tahun <span class="text-danger">*</span></label>
              <input type="number" name="tahun" class="form-control" min="2020" max="2100" value="<?php echo date('Y'); ?>" required>
            </div>
          </div>
          <div class="col-sm-4">
            <div class="form-group">
              <label>Jenis Periode <span class="text-danger">*</span></label>
              <select name="tipe_periode" class="form-control" required>
                <option value="REGULER" selected>Reguler (Bulanan)</option>
                <option value="THR">THR</option>
              </select>
            </div>
          </div>
        </div>

        <div class="form-group">
          <label>Catatan</label>
          <textarea name="catatan" rows="3" class="form-control" placeholder="Catatan periode payroll (opsional)"></textarea>
        </div>

        <div class="d-flex justify-content-between">
          <a href="<?php echo site_url('transaksi/payroll'); ?>" class="btn btn-secondary"><i class="fa fa-arrow-left mr-1"></i> Kembali</a>
          <button type="submit" class="btn btn-danger"><i class="fa fa-save mr-1"></i> Simpan Periode</button>
        </div>
        <?php echo form_close(); ?>
      </div>
    </div>
  </div>
</section>
