TIF_E41201448/application/views/dist/v_kriteria.php

116 lines
4.3 KiB
PHP

<?php
defined('BASEPATH') or exit('No direct script access allowed');
$this->load->view('dist/_partials/header');
?>
<!-- Main Content -->
<div class="main-content">
<section class="section">
<div class="section-header">
<h1>Data Kriteria</h1>
<div class="section-header-breadcrumb">
<div class="breadcrumb-item active"><a href="#">Dashboard</a></div>
<div class="breadcrumb-item">Data Kriteria</div>
</div>
</div>
<div class="section-body">
<h3 class="section-tambah">
<a href="<?php echo base_url(); ?>dist/tambah_kriteria" class="btn btn-sm btn-warning"><i
class="fa fa-plus"></i> Tambah Data Kriteria</a>
</h3>
<?php if (!empty($this->session->flashdata('status'))) { ?>
<div class="alert alert-info" role="alert"><?= $this->session->flashdata('status'); ?></div>
<?php } ?>
<?php if (isset($_GET['notif'])):
_notif($this->session->flashdata($_GET['notif']));
endif; ?>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h4>Data Kriteria </h4>
<?php echo form_open('dist/kriteria'); ?>
<button class="btn btn-danger" name="sub">Hapus Data</button>
<select
style="width:100px;margin:10px 0;border-radius:5px;font-size:14px;height:100%;padding:6px;color:#6c757d;"
name="n_tahun">
<!-- <option value="1">Semua</option> -->
<?php
foreach ($data_tahun->result_array() as $s) { ?>
<option value="<?php echo $s['tahun']; ?>"><?php echo $s['tahun']; ?></option>
<?php } ?>
</select>
<?php echo form_close(); ?>
<form class="inkk" action="<?= base_url('dist/import_excel'); ?>" method="post"
enctype="multipart/form-data">
<div>
<input style="margin-right:-100px;" type="file" name="fileExcel" required>
<button class='btn btn-success' type="submit">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
Import
</button>
</div>
</form>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped" id="table-1">
<thead>
<tr align="center">
<th class="text-center">
#
</th>
<th>Alternatif ID</th>
<?php foreach ($tes->result() as $t_krit) { ?>
<th><?php echo $t_krit->nama; ?></th>
<?php } ?>
<th>Tahun</th>
<th width="150px" align="center">Action</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
foreach ($kriteria->result() as $a) {
?>
<tr align="center">
<td class="text-center">
<?php echo $no++; ?>
</td>
<td><?php echo $a->alternatif_id; ?></td>
<?php foreach ($tes->result() as $t_krit) {
$nama_t = $t_krit->isi; ?>
<td><?php echo $a->$nama_t; ?></td>
<?php } ?>
<td><?php echo $a->tahun; ?></td>
<td>
<a href="<?php echo base_url() . 'dist/edit_kriteria/' . $a->kriteria_id ?>"
class="btn btn-primary">Edit</a>
<a href="<?php echo base_url() . 'dist/delete_kriteria/' . $a->kriteria_id ?>"
class="btn btn-danger">Hapus</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<?php $this->load->view('dist/_partials/footer'); ?>