function update() { $date_from = $this->input->get("date_from"); $date_to = $this->input->get("date_to"); if ($date_from != '' && $date_to != '') { $result = moderator(); foreach ($result as $r) { $from = date_create(format_tanggal_barat($date_from)); $to = date_create(format_tanggal_barat($date_to)); while ($from <= $to) { $value = $this->input->post($r[0] . '_' . date_format($from, 'dmy')); if ($value != '') { $data[] = array('user_code' => $r[0], 'absen_date' => date_format($from, 'Y-m-d'), 'absen_type' => $value); } date_add($from, date_interval_create_from_date_string('1 days')); } } $this->mdl_mod_absent->set($data); $this->session->set_flashdata('alert', '<div class="alert alert-success">Complete!!!</div>'); } else { $this->session->set_flashdata('alert', '<div class="alert alert-danger">Date Empty!!!</div>'); } redirect('mod_absent' . $this->_filter()); }
<?php /* **************************************************************** #mode.php File #Version 1.4 **************************************************************** #Copy Righted 2006-2007(http://nevuxbulletin.com) #Created By NevuxAB Developement Team **************************************************************** */ define("NABPROOF", true); /*==================================================== @Include all main functions to run NAB =====================================================*/ include "./config.php"; include "./functions/globals.php"; /* ||Show HEADER|| */ include_once "./sources/header.php"; include "./navigation.php"; include "./modes.php"; moderator(); include "footer.php";
function fee_senior() { $date_from = $this->input->get("date_from"); $date_to = $this->input->get("date_to"); if ($date_from != '' && $date_to != '') { require_once "../assets/fpdf/fpdf.php"; $pdf = new FPDF(); $pdf->AliasNbPages(); $pdf->AddPage('L', 'A4'); //title $pdf->SetFont('Arial', 'B', 16); $pdf->Cell(0, 10, 'Report Absensi Moderasi HM Sampoerna', 0, 0, 'C'); $pdf->Ln(10); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, 5, 'Periode Tanggal : ' . $this->input->get('date_from') . ' s/d ' . $this->input->get('date_to'), 0, 0, 'C'); $pdf->Ln(10); //header $pdf->SetFont('Arial', 'B', 10); $pdf->SetDrawColor(0, 0, 0); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(10, 14, 'No', 1, 0, 'C'); $pdf->Cell(40, 14, 'Moderator', 1, 0, 'C'); $from = date_create(format_tanggal_barat($date_from)); $to = date_create(format_tanggal_barat($date_to)); $j = 0; while ($from <= $to) { $pdf->SetXY(60 + $j, 30); $pdf->Cell(6, 7, date_format($from, "d"), 1, 0, 'C'); $pdf->SetXY(60 + $j, 37); $pdf->Cell(6, 7, date_format($from, "m"), 1, 0, 'C'); date_add($from, date_interval_create_from_date_string('1 days')); $j += 6; } $pdf->SetXY($j + 60, 30); $pdf->Cell(0, 14, 'Jumlah', 1, 0, 'C'); $pdf->Ln(14); //rows $pdf->SetFont('Arial', '', 10); $pdf->SetDrawColor(0, 0, 0); $pdf->SetTextColor(0, 0, 0); $result = moderator(); $total = 0; $i = 1; foreach ($result as $r) { if ($r[2] == 2) { $pdf->Cell(10, 7, $i++, 1, 0, 'C'); $pdf->Cell(40, 7, $r[1], 1, 0, 'L'); $from = date_create(format_tanggal_barat($date_from)); $to = date_create(format_tanggal_barat($date_to)); $j = 0; $jum = 0; while ($from <= $to) { $jumlah = $this->mdl_mod_absent->fee_senior(date_format($from, 'Y-m-d'), $r[0]); $pdf->Cell(6, 7, number_format($jumlah), 1, 0, 'C'); $jum += $jumlah; date_add($from, date_interval_create_from_date_string('1 days')); $j++; } $pdf->Cell(0, 7, number_format($jum), 1, 0, 'C'); $total += $jum; $pdf->Ln(7); } } $pdf->SetFillColor(240, 240, 240); $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(50 + 6 * $j, 7, 'Total : ', 1, 0, 'R', true); $pdf->Cell(0, 7, number_format($total), 1, 0, 'C', true); $pdf->SetFont('Arial', '', 10); $this->_footer($pdf); $pdf->Output("Fee Moderasi HM Sampoerna", "I"); } else { $this->session->set_flashdata('alert', '<div class="alert alert-danger">Date Empty!!!</div>'); redirect('absent'); } }
function get_moderator($id) { $data = moderator(); return $data[$id]; }