Assalamualaikum,.. apa menggunakan view & controller ini bisa?
View :
<form method="post" action="<?php echo base_url('admin/cetakbulan') ?>">
<div class="form-group col-md-3"><b>
Bulan</b>
<select class="form-control" id="bulan" name="bulan">
<option value="01">Januari</option>
<option value="02">Februari</option>
<option value="03">Maret</option>
<option value="04">April</option>
<option value="05">Mei</option>
<option value="06">Juni</option>
<option value="07">Juli</option>
<option value="08">Agustus</option>
<option value="09">September</option>
<option value="10">Oktober</option>
<option value="11">November</option>
<option value="12">Desember</option>
</select>
</div>
<div class="form-group col-md-3"><b>
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd">
<label class="control-label" for="tgl_mulai">Tgl_Mulai</label><br>
<input type="text" class="form-control" name="tgl_mulai" id="tgl_mulai" required>
<div class="input-group-addon">
<span class="glyphicon glyphicon-th"></span>
</div>
</div>
</div></b>
<div class="form-group col-md-3"><b>
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd">
<label class="control-label" for="tgl_kembali">Tgl_Akhir</label><br>
<input type="text" class="form-control" name="tgl_akhir" id="tgl_akhir" required>
<div class="input-group-addon">
<span class="glyphicon glyphicon-th"></span>
</div>
</div>
</div></b>
<div class="form-group col-md-3"><b>Tahun</b>
<select class="form-control" id="tahun" name="tahun">
<?php
for($i = $mulai;$i<$mulai + 100;$i++)
{
$sel = $i == date('Y') ?
' selected="selected"' : ''; echo '<option value="'.$i.'"'.$sel.'>'.$i.'</option>';
}
?>
</select>
</div>
<div class="form-group col-md-12"><b>TRIWULAN</b>
<select class="form-control" name="triwulan">
<option value="">-- Silahkan Pilih --</option>
<option>Triwulan 1</option>
<option>Triwulan 2</option>
<option>Triwulan 3</option>
<option>Triwulan 4</option>
</select>
</div>
<input type="submit" name="btnKirim" class="btn btn-primary" style="float:left; margin-left:15px; margin-bottom:15px;" value="Preview"/>
<hr>
</form>
Controller :
public function cetakBulan()
{
$this->_is_admin();
if($this->input->post('btnKirim'))
{
$bulan = $this->input->post('bulan');
$tahun = $this->input->post('tahun');
$triwulan = $this->input->post('triwulan');
$v_array = $this->input->post();
$data['tb_laporan1'] = $this->db->query("SELECT * FROM tb_lapreport
WHERE MONTH(a.tanggal)='$bulan' AND YEAR(a.tanggal)='$tahun' AND a.id_organisasi
GROUP BY suburusan2 ASC");
$data['tb_laporanGroup'] = $this->db->query("SELECT * FROM tb_lapreport
WHERE MONTH(a.tanggal)='$bulan' AND YEAR(a.tanggal)='$tahun' AND a.id_organisasi
GROUP BY d.id_program ASC");
$data['tb_laporan'] = $this->db->query("SELECT * FROM tb_lapreport
WHERE MONTH(a.tanggal)='$bulan' AND YEAR(a.tanggal)='$tahun' AND a.id_organisasi");
}
$data['nama_bulan'] = $v_array['bulan'];
$data['nama_tahun'] = $v_array['tahun'];
$data['nama_triwulan'] = $v_array['triwulan'];
$this->load->view('template/header-report',$data);
$this->load->view('admin/cetak',$data);
$this->load->view('template/footer-report',$data);
}
perlu penyesuaian dimana aja ?agar dapat berjalan
terimakasihh