public function index() { $offset = $this->general_lib->get_offset(); $limit = $this->general_lib->get_limit(); $total = $this->servis_mdl->count_all(); $xdata['action'] = 'servis/search' . $this->_filter(); $xdata['action_delete'] = 'servis/delete' . $this->_filter(); $xdata['add_btn'] = anchor('servis/add', '<span class="glyphicon glyphicon-plus"></span> Tambah', array('class' => 'btn btn-success btn-sm')); $xdata['delete_btn'] = '<button id="delete-btn" class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash"></span> Delete Checked</button>'; $this->table->set_template(tbl_tmp()); $head_data = array('nomor' => 'Nomor', 'nopol' => 'Kendaraan', 'tanggal' => 'Tanggal', 'tipe_nama' => 'Tipe', 'kilometer' => 'Kilometer', 'jumlah_satuan' => 'Jumlah Satuan', 'total_harga' => 'Total Harga'); $heading[] = form_checkbox(array('id' => 'selectAll', 'value' => 1)); $heading[] = '#'; foreach ($head_data as $r => $value) { $heading[] = anchor('servis' . $this->_filter(array('order_column' => "{$r}", 'order_type' => $this->general_lib->order_type($r))), "{$value} " . $this->general_lib->order_icon("{$r}")); } $heading[] = 'Action'; $this->table->set_heading($heading); $result = $this->servis_mdl->get()->result(); $i = 1 + $offset; foreach ($result as $r) { $this->table->add_row(array('data' => form_checkbox(array('name' => 'check[]', 'value' => $r->id)), 'width' => '10px'), $i++, $r->nomor, $r->nopol, format_dmy($r->tanggal), $r->tipe_nama, $r->kilometer, array('data' => number_format($r->jumlah_satuan), 'align' => 'right'), array('data' => number_format($r->total_harga), 'align' => 'right'), anchor('servis/edit/' . $r->id . $this->_filter(), 'Edit') . " | " . anchor('servis/delete/' . $r->id . $this->_filter(), 'Delete', array('onclick' => "return confirm('you sure')")) . " | " . anchor('servis/print_detail/' . $r->id, 'Print', array('target' => '_blank'))); } $xdata['table'] = $this->table->generate(); $xdata['total'] = page_total($offset, $limit, $total); $config = pag_tmp(); $config['base_url'] = site_url("servis" . $this->_filter()); $config['total_rows'] = $total; $config['per_page'] = $limit; $this->pagination->initialize($config); $xdata['pagination'] = $this->pagination->create_links(); $data['content'] = $this->load->view('servis_list', $xdata, true); $this->load->view('template', $data); }
echo form_label('No Rekening', 'norek', array('class' => 'control-label')); ?> <?php echo form_input(array('name' => 'norek', 'class' => 'form-control input-sm', 'maxlength' => '60', 'size' => '50', 'autocomplete' => 'off', 'autofocus' => 'autofocus', 'value' => set_value('norek', isset($row->norek) ? $row->norek : ''), 'required' => 'required')); ?> <small><?php echo form_error('norek'); ?> </small> </div> <div class="form-group form-inline"> <?php echo form_label('Tanggal', 'tanggal', array('class' => 'control-label')); ?> <?php echo form_input(array('name' => 'tanggal', 'class' => 'form-control input-sm input-tanggal', 'maxlength' => '50', 'autocomplete' => 'off', 'value' => set_value('tanggal', isset($row->tanggal) ? format_dmy($row->tanggal) : ''), 'required' => 'required')); ?> <small><?php echo form_error('tanggal'); ?> </small> </div> <div class="form-group form-inline"> <?php echo form_label('Tipe', 'tipe', array('class' => 'control-label')); ?> <?php echo form_dropdown('tipe', $this->anggaran_mdl->dropdown_tipe(), set_value('tipe', isset($row->tipe) ? $row->tipe : ''), 'required=required class="form-control input-sm"'); ?> <small><?php echo form_error('tipe');
public function detail($id) { $xdata['breadcrumb'] = 'kendaraan' . $this->_filter(); $xdata['kendaraan'] = $this->kendaraan_mdl->get_from_field('kendaraan.id', $id, 1)->row(); //servis detail $this->table->set_template(tbl_tmp_servis()); $this->table->set_heading('No', 'Tanggal', 'Lama', 'Komponen Mesin', 'Jenis Perlakuan'); $servis_history = $this->general_mdl->get_servis_history($xdata['kendaraan']->kode)->result(); $i = 1; foreach ($servis_history as $r) { $this->table->add_row($i++, format_dmy($r->tanggal), timeago(strtotime($r->tanggal)), $r->komponen_lain != '' ? $r->komponen_lain : $r->komponen_nama, $r->servis_aksi_nama); } $xdata['servis_history'] = $this->table->generate(); $data['content'] = $this->load->view('kendaraan_detail', $xdata, true); $this->load->view('template', $data); }
public function pdf() { require_once "./assets/lib/fpdf/fpdf.php"; $pdf = new FPDF(); $pdf->AliasNbPages(); $pdf->AddPage('L', 'A4'); $pdf->Image('./assets/img/logo.jpg', 10, 10, 15, 0); $pdf->SetFont('Arial', 'B', 10); $pdf->setX(30); $pdf->Cell(0, 5, 'PEMERINTAH DAERAH KABUPATEN CIANJUR', 0, 0, 'L'); $pdf->Ln(5); $pdf->setX(30); $pdf->Cell(0, 5, 'DINAS KEBERSIHAN DAN PERTAMANAN', 0, 0, 'L'); $pdf->SetFont('Arial', '', 8); if ($this->input->get('date_from') != '' && $this->input->get('date_to') != '') { $pdf->Ln(5); $pdf->setX(30); $pdf->Cell(0, 5, 'Periode : ' . $this->input->get('date_from') . ' s/d ' . $this->input->get('date_to'), 0, 0, 'L'); } if ($this->input->get('kendaraan') != '') { $pdf->Ln(5); $pdf->setX(30); $pdf->Cell(0, 5, 'Nomor Polisi : ' . $this->general_mdl->get_from_field('kendaraan', 'id', $this->input->get('kendaraan'))->row()->nopol, 0, 0, 'L'); } $pdf->Ln(15); $pdf->Cell(0, 1, '', 'T', 0, 'C'); $pdf->Ln(5); $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(0, 5, 'REKAPITULASI SERVIS', 0, 0, 'C'); $pdf->Ln(10); $pdf->SetFont('Arial', 'B', 8); $pdf->Cell(10, 5, 'NO', 1, 0, 'C'); $pdf->Cell(20, 5, 'TANGGAL', 1, 0, 'C'); $pdf->Cell(20, 5, 'KENDARAAN', 1, 0, 'C'); $pdf->Cell(40, 5, 'TIPE', 1, 0, 'C'); $pdf->Cell(30, 5, 'KILOMETER', 1, 0, 'C'); $pdf->Cell(60, 5, 'KOMPONEN', 1, 0, 'C'); $pdf->Cell(20, 5, 'PERLAKUAN', 1, 0, 'C'); $pdf->Cell(20, 5, 'SATUAN', 1, 0, 'C'); $pdf->Cell(30, 5, 'HARGA SATUAN', 1, 0, 'C'); $pdf->Cell(0, 5, 'TOTAL HARGA', 1, 0, 'C'); $pdf->Ln(5); $pdf->SetFont('Arial', '', 8); $result = $this->servis_rekap_mdl->pdf()->result(); $i = 1; $total = 0; foreach ($result as $r) { $pdf->Cell(10, 5, $i++, 1, 0, 'C'); $pdf->Cell(20, 5, format_dmy($r->tanggal), 1, 0, 'C'); $pdf->Cell(20, 5, $r->nopol, 1, 0, 'C'); $pdf->Cell(40, 5, $r->tipe, 1, 0, 'L'); $pdf->Cell(30, 5, $r->kilometer, 1, 0, 'C'); $pdf->Cell(60, 5, $r->komponen_lain != '' ? $r->komponen_lain : $r->komponen_nama, 1, 0, 'L'); $pdf->Cell(20, 5, $r->servis_aksi_nama, 1, 0, 'C'); $pdf->Cell(20, 5, number_format($r->satuan) . ' ' . $r->komponen_satuan_nama, 1, 0, 'R'); $pdf->Cell(30, 5, number_format($r->harga), 1, 0, 'R'); $pdf->Cell(0, 5, number_format($r->total), 1, 0, 'R'); $pdf->Ln(5); $total += $r->satuan * $r->harga; } $pdf->SetFont('Arial', 'B', 8); $pdf->Cell(250, 5, 'Total', 1, 0, 'L'); $pdf->Cell(0, 5, number_format($total), 1, 0, 'R'); $pdf->Ln(10); $pdf->Cell(140, 5, '', 0, 0, 'C'); $pdf->Cell(0, 5, 'Mengetahui,', 0, 0, 'C'); $pdf->Ln(5); $pdf->Cell(140, 5, 'Penanggung Jawab Bengkel', 0, 0, 'C'); $pdf->Cell(0, 5, 'Mandor Armada', 0, 0, 'C'); $pdf->Ln(5); $pdf->Cell(140, 5, 'Dinas Kebersihan dan Pertamanan', 0, 0, 'C'); $pdf->Cell(0, 5, 'Dinas Kebersihan dan Pertamanan', 0, 0, 'C'); $pdf->Ln(5); $pdf->Cell(140, 5, 'Kabupaten Cianjur', 0, 0, 'C'); $pdf->Cell(0, 5, 'Kabupaten Cianjur', 0, 0, 'C'); $pdf->Ln(20); $pdf->SetFont('Arial', 'BU', 8); $pdf->Cell(140, 5, 'Rusdi Hermawan', 0, 0, 'C'); $pdf->Cell(0, 5, 'Deden Suparman, SIP', 0, 0, 'C'); $pdf->Ln(5); $pdf->SetFont('Arial', 'B', 8); $pdf->Cell(140, 5, 'NIP. 19610912 200701 1 002', 0, 0, 'C'); $pdf->Cell(0, 5, 'NIP. 19710316 200901 1 003', 0, 0, 'C'); $pdf->Output(); }
<tr> <?php $r = $this->db->get_where('matrix', array('no_diagnosa' => $row->no_diagnosa, 'skor' => $this->laporan_model->get_skor($row->no_diagnosa)))->row_array(); $k = $this->db->get_where('penyakit', array('id' => $r['id_penyakit']))->row_array(); ?> <td><?php echo $row->no_diagnosa; ?> </td> <td><?php echo $row->nama; ?> </td> <td><?php echo $row->kelompok; ?> </td> <td><?php echo $k['penyakit']; ?> </td> <td><?php echo format_dmy($row->tanggal); ?> </td> </tr> <?php } ?> </table>
</div> </div> <div class="form-group"> <label class="col-lg-4">Kelompok</label> <div class="col-md-8"> <p class="form-control-static"><?php echo $kelompok; ?> </p> </div> </div> <div class="form-group"> <label class="col-lg-4">Tanggal</label> <div class="col-md-8"> <p class="form-control-static"><?php echo format_dmy($tanggal); ?> </p> </div> </div> <div class="form-group"> <label class="col-lg-4">Hasil</label> <div class="col-md-8"> <?php $r = $this->db->get_where('matrix', array('no_diagnosa' => $no_diagnosa, 'skor' => $this->diagnosa_model->get_skor($no_diagnosa)))->row_array(); $k = $this->db->get_where('penyakit', array('id' => $r['id_penyakit']))->row_array(); $l = $this->db->get_where('mt_aturan', array('penyakit' => $k['penyakit']))->row_array(); ?> <p class="form-control-static">Kemungkinan mengalami <label class="label label-info"><?php echo $k['penyakit']; ?>