function index() { $data['_title'] = 'Laporan Penerimaan'; $data['judul'] = 'Laporan Penerimaan'; $data['tgl_dari'] = $this->input->get('tgl_dari'); $data['tgl_sampai'] = $this->input->get('tgl_sampai'); $data['cabang'] = $this->input->get('cabang'); $data['print'] = $this->input->get('print'); if ($this->session->userdata('cabang') != NULL) { $this->db->where('kd_cabang', $this->session->userdata('cabang')); } $data['dd_cabang'] = $this->dbm->dropdown('cabang', '- pilih cabang', 'kd_cabang', 'nm_cabang'); $this->db->order_by('pengiriman.tgl_terima', "DESC"); if ($this->session->userdata('cabang') != NULL) { $this->db->where('kd_cabang_tujuan', $this->session->userdata('cabang')); } if ($data['tgl_dari'] != '' && $data['tgl_sampai'] != '') { $this->db->where('tgl_terima >=', tgl_sql($data['tgl_dari'])); $this->db->where('tgl_terima <=', tgl_sql($data['tgl_sampai'])); } elseif ($data['tgl_dari'] == '' && $data['tgl_sampai'] == '') { $this->db->where('tgl_terima >=', date('Y-m-d')); $this->db->where('tgl_terima <=', date('Y-m-d')); } if ($data['cabang'] != '') { $this->db->where('kd_cabang_tujuan', $data['cabang']); } $this->db->where('status', 'DITERIMA'); $data['list'] = $this->dbm->get_all_data('pengiriman')->result(); if ($data['print'] != 'ok') { $this->template->display($this->view . 'index', $data); } elseif ($data['print'] == 'ok') { $content = $this->load->view($this->view . 'cetak', $data, true); $this->pdf->create($content, 'laporan_penerimaan'); } }
function ubah_status($no_resi, $status, $tgl_terima) { $up = $this->dbm->update('pengiriman', array('no_resi' => $no_resi), array('status' => $status, 'tgl_terima' => tgl_sql($tgl_terima), 'jam_terima' => date('H:i:s'))); if ($up) { echo 'ok'; } }
function search_data($from, $to, $filter, $keyword) { if (!empty($from)) { $this->db->where('date_sms >=', tgl_sql($from) . ' 00:00:00'); } if (!empty($to)) { $this->db->where('date_sms <=', tgl_sql($to) . ' 23:59:00'); } if (!empty($keyword)) { if ($filter == 'msisdn') { $this->db->like('history_pointbanking_report.msisdn', $keyword); } if ($filter == 'memberid') { $this->db->like('history_pointbanking_report.memberid', $keyword); } if ($filter == 'trxid_links') { $this->db->like('history_pointbanking_report.trxid_links', $keyword); } } return $this->db->get($this->table); }
<?php session_start(); if (empty($_SESSION['username']) and empty($_SESSION['password'])) { ?> <script>alert('Untuk mengakses halaman admin, Anda harus login terlebih dahulu.'); window.location = './index.php'</script> <?php } else { if ($_SESSION[status] == 'admin') { if (isset($_POST['tampil'])) { $tgl_awal = tgl_sql($_POST['tgl_awal']); $tgl_akhir = tgl_sql($_POST['tgl_akhir']); } ?> <div class="judul"><h2>Laporan Data Penjualan Barang</h2></div> <div class="tambah"><input type="button" id="cetak" class="button" value="Cetak Data" ></div> <div class="area_main"><!-- class area_main --> <form name="lap_jual" action="?mod=lap_pj" method="POST"> <table class="tanggal"> <tr> <td>Tanggal Awal</td> <td>:</td> <td><input type="text" name="tgl_awal" class="tgl" size="10" /></td> <td> </td> <td>Tanggal Akhir</td> <td>:</td> <td><input type="text" name="tgl_akhir" class="tgl" size="10" /></td> <td> </td> <td><input type="submit" name="tampil" class="button" value="Tampil" /></td> </tr> </table>
function simpan_pengiriman() { $this->form_validation->set_rules('kode_pengirim', 'Kode Pengirim', 'required'); $this->form_validation->set_rules('nama_pengirim', 'Nama Pengirim', 'required'); $this->form_validation->set_rules('alamat_pengirim', 'Alamat Pengirim', 'required'); $this->form_validation->set_rules('telp_pengirim', 'Telp Pengirim', 'required'); $this->form_validation->set_rules('kode_penerima', 'Kode Penerima', 'required'); $this->form_validation->set_rules('nama_penerima', 'Nama Penerima', 'required'); $this->form_validation->set_rules('alamat_penerima', 'Alamat Penerima', 'required'); $this->form_validation->set_rules('telp_penerima', 'Telp Penerima', 'required'); $this->form_validation->set_rules('dari', 'Asal / Dari', 'required'); $this->form_validation->set_rules('sampai', 'Tujuan', 'required'); $this->form_validation->set_rules('layanan', 'Layanan', 'required'); $this->form_validation->set_rules('tgl_kirim', 'Tgl. Kirim', 'required'); $this->form_validation->set_rules('tarif_kg', 'Tarif / Kg', 'required'); if ($this->form_validation->run()) { $mode = $this->input->post('mode'); $no_resi_hidden = $this->input->post('no_resi_hidden'); $no_resi = $mode == 'edit' ? $no_resi_hidden : $this->no_resi(); $cabang = $this->input->post('cabang'); $cabang_tujuan = $this->input->post('cabang_tujuan'); $kode_pengirim = $this->input->post('kode_pengirim'); $nama_pengirim = $this->input->post('nama_pengirim'); $alamat_pengirim = $this->input->post('alamat_pengirim'); $telp_pengirim = $this->input->post('telp_pengirim'); $kode_penerima = $this->input->post('kode_penerima'); $nama_penerima = $this->input->post('nama_penerima'); $alamat_penerima = $this->input->post('alamat_penerima'); $telp_penerima = $this->input->post('telp_penerima'); $dari = $this->input->post('dari'); $sampai = $this->input->post('sampai'); $layanan = $this->input->post('layanan'); $tarif_kg = $this->input->post('tarif_kg'); $tgl_kirim = $this->input->post('tgl_kirim'); $keterangan = $this->input->post('keterangan'); $ind = array('no_resi' => $no_resi); $arr = array('no_resi' => $no_resi, 'kd_cabang' => $cabang, 'kd_pengirim' => $kode_pengirim, 'nama_pengirim' => $nama_pengirim, 'alamat_pengirim' => $alamat_pengirim, 'telp_pengirim' => $telp_pengirim, 'kd_penerima' => $kode_penerima, 'nama_penerima' => $nama_penerima, 'alamat_penerima' => $alamat_penerima, 'telp_penerima' => $telp_penerima, 'tgl_kirim' => tgl_sql($tgl_kirim), 'jam_kirim' => date('H:i:s'), 'status' => 'proses pengiriman', 'keterangan' => $keterangan, 'layanan' => $layanan, 'harga_kg' => $tarif_kg, 'kd_cabang_tujuan' => $cabang_tujuan, 'dari' => $dari, 'sampai' => $sampai); if ($mode == 'edit') { $in = $this->dbm->update('pengiriman', $ind, $arr); $msg = 'Data Terupdate'; } elseif ($mode == 'tambah') { $in = $this->dbm->insert('pengiriman', $arr); $msg = 'Data Tersimpan'; } if ($in) { echo $msg; } } else { echo strip_tags(validation_errors()); } }
function get_search_data($page = '1') { $page = $page - 1; $jml = '100'; $dari = $page * $jml; $data['page'] = $page + 1; $from = $this->input->get('from'); $to = $this->input->get('to'); $filter = $this->input->get('filter'); $keyword = $this->input->get('keyword'); $excel = $this->input->get('excel'); $csv = $this->input->get('csv'); // $data['list'] = $this->model_report->search_data($from, $to, $filter, $keyword)->result(); if (!empty($from)) { $this->db->where('date_sms >=', tgl_sql($from) . ' 00:00:00'); } if (!empty($to)) { $this->db->where('date_sms <=', tgl_sql($to) . ' 23:59:00'); } if (!empty($keyword)) { if ($filter == 'msisdn') { $this->db->like('history_pointbanking_report.msisdn', $keyword); } if ($filter == 'memberid') { $this->db->like('history_pointbanking_report.memberid', $keyword); } if ($filter == 'trxid_links') { $this->db->like('history_pointbanking_report.trxid_links', $keyword); } } $get = $this->mypaging->config('history_pointbanking_report', $jml, $dari); $data['list'] = $get[0]; $data['count'] = $get[1]; $this->mypaging->set('history_pointbanking_report', $jml, $page, $data['count']); //baris ini untuk mencetak tanpa limit pagination if (!empty($from)) { $this->db->where('date_sms >=', tgl_sql($from) . ' 00:00:00'); } if (!empty($to)) { $this->db->where('date_sms <=', tgl_sql($to) . ' 23:59:00'); } if (!empty($keyword)) { if ($filter == 'msisdn') { $this->db->like('history_pointbanking_report.msisdn', $keyword); } if ($filter == 'memberid') { $this->db->like('history_pointbanking_report.memberid', $keyword); } if ($filter == 'trxid_links') { $this->db->like('history_pointbanking_report.trxid_links', $keyword); } } $data['no_paging'] = $this->dbm->get_all_data('history_pointbanking_report')->result(); if ($csv != 'ok' && $excel != 'ok') { $this->template->display(view . 'result_show_search', $data); // $this->load->view('report/result_show_search', $data); } if ($csv == 'ok') { $this->download_csv($data['no_paging']); } if ($excel == 'ok') { $this->download_excel($data['no_paging']); } // header("content-type:application/json"); // echo json_encode($data); }