input->post('tgl'); $supplier = $this->input->post('id'); $pecah = explode(" - ",$tgl); $tglawal = date_format(date_create($pecah[0]),"Y-m-d"); $tglakhir = date_format(date_create($pecah[1]),"Y-m-d"); $data = $this->M_pempers->kartupiutang($supplier,$tglawal,$tglakhir)->result(); $array_hasil = []; foreach ($data as $a) { $rowspan_key = "{$a->invoice_date}-{$a->invoice_no}-{$a->invoice_value}"; if ( !isset( $array_hasil[$rowspan_key] ) ) { $array_hasil[$rowspan_key] = []; } $array_hasil[$rowspan_key][] = $a; } $this->load->view('tabel', ['array_hasil' => $array_hasil]); }
| INVOICE | BUKTI | ||||
|---|---|---|---|---|---|
| TGL | NO | TGL | NO | PIUTANG | BAYAR |
| = $data_baris_pertama->invoice_date ?> | = $data_baris_pertama->invoice_no ?> | = $data_baris_pertama->payment_date ?> | = $data_baris_pertama->reference_no ?> | Rp. = number_format($piutang) ?> | Rp. = number_format($data_baris_pertama->payment_invoice) ?> |
| = $baris->payment_date ?> | = $baris->reference_no ?> | Rp. = number_format($baris->payment_invoice) ?> | |||